@openremote/or-dashboard-builder 1.7.0-snapshot.20250522152736 → 1.7.0-snapshot.20250527153909
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
|
@@ -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.
|
|
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
|
|