@openremote/or-dashboard-builder 1.6.0-snapshot.20250519123755 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/umd/index.js CHANGED
@@ -591,10 +591,10 @@
591
591
  /*margin-bottom: 20px;*/
592
592
  flex: 0 0 auto;
593
593
  }
594
- `;var Cr=p(5744),Ar=p(1512),Dr=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};const Ir=p(48);class Rr extends CustomEvent{constructor(t){super(Rr.NAME,{detail:t,bubbles:!0,composed:!0})}}Rr.NAME="or-mwc-menu-changed";class Or extends CustomEvent{constructor(){super(Or.NAME,{bubbles:!0,composed:!0})}}function Pr(t,e,i,n,r,a=!1,o=!0,s=!1,l=!1){return F`
594
+ `;var Cr=p(5744),Ar=p(1512),Dr=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};const Ir=p(48);class Rr extends CustomEvent{constructor(t){super(Rr.NAME,{detail:t,bubbles:!0,composed:!0})}}Rr.NAME="or-mwc-menu-changed";class Or extends CustomEvent{constructor(){super(Or.NAME,{bubbles:!0,composed:!0})}}function Pr(t,e,i,n,r,a=!1,o=!0,s=!1,l=!1,d="menu",c=!1){let u=null;return F`
595
595
  <span>
596
- <span @click="${t=>{e&&t.currentTarget.parentElement.lastElementChild.open()}}">${t}</span>
597
- ${e?F`<or-mwc-menu ?multiselect="${a}" @or-mwc-menu-closed="${()=>{r&&r()}}" @or-mwc-menu-changed="${t=>{n&&n(t.detail)}}" .translateValues="${o}" .values="${i}" .menuItems="${e}" .midHeight="${s}" .fullWidth="${l}" id="menu"></or-mwc-menu>`:""}
596
+ <span @click="${t=>{if(e){if(c&&u){const e=t.currentTarget;!function(t,e){e||(e=document.body);const i=e.getBoundingClientRect();Object.assign(t.style,{position:"fixed",top:`${i.bottom}px`,left:`${i.left}px`,zIndex:"1000",display:"block"})}(u,e)}t.currentTarget.parentElement.lastElementChild.open()}}}">${t}</span>
597
+ ${e?F`<or-mwc-menu ?multiselect="${a}" @or-mwc-menu-closed="${()=>{r&&r()}}" @or-mwc-menu-changed="${t=>{n&&n(t.detail)}}" .translateValues="${o}" .values="${i}" .menuItems="${e}" .midHeight="${s}" .fullWidth="${l}" id="${d}" ${oe((t=>u=t))}></or-mwc-menu>`:""}
598
598
  </span>
599
599
  `}Or.NAME="or-mwc-menu-closed";const zr=ht`
600
600
  :host {
@@ -1327,7 +1327,7 @@
1327
1327
  .button-action:hover {
1328
1328
  --or-icon-fill: var(--or-app-color4);
1329
1329
  }
1330
- `;let vs=class extends Lt{constructor(){super(...arguments),this.attributeRefs=[],this.multi=!1,this.onlyDataAttrs=!1,this.loadedAssets=[]}static get styles(){return[bs,Sr]}willUpdate(t){super.willUpdate(t),this.attributeRefs||(this.attributeRefs=[]),t.has("attributeRefs")&&this.attributeRefs&&this.loadAssets().then((e=>{t.get("attributeRefs")&&this.dispatchEvent(new ys(e,this.attributeRefs))}))}getLoadedAsset(t){var e;return null===(e=this.loadedAssets)||void 0===e?void 0:e.find((e=>e.id===t.id))}removeWidgetAttribute(t){null!=this.attributeRefs&&(this.attributeRefs=this.attributeRefs.filter((e=>e!==t)))}loadAssets(){return gs(this,void 0,void 0,(function*(){if(this.attributeRefs.filter((t=>!this.getLoadedAsset(t))).length>0){const t=yield this.fetchAssets(this.attributeRefs);return this.loadedAssets=t,t}return this.loadedAssets}))}fetchAssets(t=[]){return gs(this,void 0,void 0,(function*(){let e=[];return yield Wn().rest.api.AssetResource.queryAssets({ids:t.map((t=>t.id)),realm:{name:Wn().displayRealm},select:{attributes:t.map((t=>t.name))}}).then((t=>{e=t.data})).catch((t=>{console.error(t),Ma(void 0,"errorOccurred")})),e}))}onAttributeActionClick(t,e,i){this.dispatchEvent(new _s(t,e,i))}openAttributeSelector(t,e,i=!0,n){let r;r=Jr(null!=t?(new ps.OrAttributePicker).setMultiSelect(e).setSelectedAttributes(t).setShowOnlyDatapointAttrs(i).setAttributeFilter(n):(new ps.OrAttributePicker).setMultiSelect(e).setShowOnlyDatapointAttrs(i)),r.addEventListener(ps.OrAttributePickerPickedEvent.NAME,(t=>{this.attributeRefs=t.detail}))}render(){return F`
1330
+ `;let vs=class extends Lt{constructor(){super(...arguments),this.attributeRefs=[],this.multi=!1,this.onlyDataAttrs=!1,this.loadedAssets=[]}static get styles(){return[bs,Sr]}willUpdate(t){super.willUpdate(t),this.attributeRefs||(this.attributeRefs=[]),t.has("attributeRefs")&&this.attributeRefs&&this.loadAssets().then((e=>{t.get("attributeRefs")&&this.dispatchEvent(new ys(e,this.attributeRefs))}))}getLoadedAsset(t){var e;return null===(e=this.loadedAssets)||void 0===e?void 0:e.find((e=>e.id===t.id))}removeWidgetAttribute(t){null!=this.attributeRefs&&(this.attributeRefs=this.attributeRefs.filter((e=>e!==t)))}loadAssets(){return gs(this,void 0,void 0,(function*(){if(this.attributeRefs.filter((t=>!this.getLoadedAsset(t))).length>0){const t=yield this.fetchAssets(this.attributeRefs);return this.loadedAssets=t,t}return this.loadedAssets}))}fetchAssets(t=[]){return gs(this,void 0,void 0,(function*(){let e=[];return yield Wn().rest.api.AssetResource.queryAssets({ids:t.map((t=>t.id)),realm:{name:Wn().displayRealm},select:{attributes:t.map((t=>t.name))}}).then((t=>{e=t.data})).catch((t=>{console.error(t),Ma(void 0,"errorOccurred")})),e}))}onAttributeActionClick(t,e,i){this.dispatchEvent(new _s(t,e,i))}openAttributeSelector(t,e,i=!0,n){let r;r=Jr(null!=t?(new ps.OrAssetAttributePicker).setMultiSelect(e).setSelectedAttributes(t).setShowOnlyDatapointAttrs(i).setAttributeFilter(n):(new ps.OrAssetAttributePicker).setMultiSelect(e).setShowOnlyDatapointAttrs(i)),r.addEventListener(ps.OrAssetAttributePickerPickedEvent.NAME,(t=>{this.attributeRefs=t.detail}))}render(){return F`
1331
1331
  <div>
1332
1332
  ${zt(this.attributeRefs.length>0,(()=>F`
1333
1333