100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
New Vaadin UI integration (#2377)
Martin Peetersbc5b80d4c16b
diff --git a/ui/app/manager/index.html b/ui/app/manager/index.htmlindex 6108ad377..26d4dfb3e 100644--- a/ui/app/manager/index.html+++ b/ui/app/manager/index.html@@ -55,8 +55,6 @@}body {margin: 0;- font-family: "Segoe UI", Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";- line-height: 1.5;height: 100%;-webkit-font-smoothing: antialiased;overflow: hidden;diff --git a/ui/app/manager/package.json b/ui/app/manager/package.jsonindex 8dc53d3f1..d5f7bf7de 100644--- a/ui/app/manager/package.json+++ b/ui/app/manager/package.json@@ -22,8 +22,11 @@"modelWatch": "npx orutil watch","doctor": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 RSDOCTOR=true rspack --mode production","build": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 rspack --mode production",+ "build:experimental": "npx cross-env NODE_OPTIONS=--max_old_space_size=4096 rsbuild build","serve": "npx tsc -b --clean && npx shx rm -rf dist lib && npx orutil build && npx cross-env NODE_OPTIONS=--max_old_space_size=4096 rspack serve --mode development",+ "serve:experimental": "npx tsc -b --clean && npx shx rm -rf dist lib && npx orutil build && npx cross-env NODE_OPTIONS=--max_old_space_size=4096 rsbuild dev","serveNoModelBuild": "npx tsc -b --clean && npx cross-env NODE_OPTIONS=--max_old_space_size=4096 rspack serve --mode development",+ "serveNoModelBuild:experimental": "npx tsc -b --clean && npx cross-env NODE_OPTIONS=--max_old_space_size=4096 rsbuild dev","test": "npx playwright test","prepack": "npx tsc -b"},@@ -46,9 +49,10 @@"@openremote/or-rules": "workspace:*","@openremote/or-services": "workspace:*","@openremote/or-translate": "workspace:*",+ "@openremote/or-vaadin-components": "workspace:*","@openremote/rest": "workspace:*",+ "@openremote/theme": "workspace:*","@reduxjs/toolkit": "^1.8.1",- "iso-639-1": "^3.1.3","lit": "^3.3.1","maplibre-gl": "^5.12.0","moment": "^2.29.4",@@ -56,6 +60,7 @@},"devDependencies": {"@openremote/util": "workspace:*",+ "@rsbuild/core": "~1.7.5","@rsdoctor/rspack-plugin": "~1.4.0","@rspack/core": "~1.7.10"},diff --git a/ui/app/manager/rsbuild.config.ts b/ui/app/manager/rsbuild.config.tsnew file mode 100644index 000000000..0a01b8e99--- /dev/null+++ b/ui/app/manager/rsbuild.config.ts@@ -0,0 +1,60 @@+import { defineConfig } from "@rsbuild/core";++export default defineConfig({+ dev: {+ hmr: false, // HMR does not work for our Web Components atm+ liveReload: true+ },+ server: {+ port: 9000 // TODO: Leave default in production+ },+ source: {+ decorators: {+ version: "legacy"+ }+ },+ resolve: {+ alias: {+ // Webpack fallbacks for Node.js modules+ vm: false,+ // Workspace aliases for proper resolution+ "@openremote/core": "../../component/core/src",+ "@openremote/model": "../../component/model/src",+ "@openremote/rest": "../../component/rest/src",+ "@openremote/or-app": "../../component/or-app/src",+ "@openremote/or-asset-tree": "../../component/or-asset-tree/src",+ "@openremote/or-asset-viewer": "../../component/or-asset-viewer/src",+ "@openremote/or-attribute-barchart": "../../component/or-attribute-barchart/src",+ "@openremote/or-attribute-card": "../../component/or-attribute-card/src",+ "@openremote/or-attribute-history": "../../component/or-attribute-history/src",+ "@openremote/or-attribute-input": "../../component/or-attribute-input/src",+ "@openremote/or-attribute-picker": "../../component/or-attribute-picker/src",+ "@openremote/or-components": "../../component/or-components/src",+ "@openremote/or-chart": "../../component/or-chart/src",+ "@openremote/or-dashboard-builder": "../../component/or-dashboard-builder/src",+ "@openremote/or-gauge": "../../component/or-gauge/src",+ "@openremote/or-icon": "../../component/or-icon/src",+ "@openremote/or-json-forms": "../../component/or-json-forms/src",+ "@openremote/or-log-viewer": "../../component/or-log-viewer/src",+ "@openremote/or-map": "../../component/or-map/src",+ "@openremote/or-mwc-components": "../../component/or-mwc-components/src",+ "@openremote/or-rules": "../../component/or-rules/src",+ "@openremote/or-services": "../../component/or-services/src",+ "@openremote/or-translate": "../../component/or-translate/src",+ "@openremote/or-tree-menu": "../../component/or-tree-menu/src",+ "@openremote/or-vaadin-components": "../../component/or-vaadin-components/src",+ "@openremote/theme": "../../component/theme",+ "@openremote/util": "../../util"+ }+ },+ plugins: [],+ tools: {+ bundlerChain: (chain, { CHAIN_ID }) => {+ chain.module.rule(CHAIN_ID.RULE.CSS).exclude.add(/(@material|@mdi).*\.css$/); // Exclude the external CSS imports from default bundling.+ },+ rspack: (config, { addRules }) => {+ addRules([{test: /(@material|@mdi).*\.css$/, type: "asset/source"}]); // Add rule to treat external CSS imports as raw strings.+ return config;+ }+ }+});diff --git a/ui/app/manager/src/components/configuration/or-conf-json.ts b/ui/app/manager/src/components/configuration/or-conf-json.tsindex ce2de1716..d77bb417d 100644--- a/ui/app/manager/src/components/configuration/or-conf-json.ts+++ b/ui/app/manager/src/components/configuration/or-conf-json.ts@@ -25,7 +25,6 @@ import { OrMwcDialog, showDialog } from "@openremote/or-mwc-components/or-mwc-diimport { createRef, Ref, ref } from "lit/directives/ref.js";import { OrAceEditor, OrAceEditorChangedEvent } from "@openremote/or-components/or-ace-editor";import { ManagerAppConfig, MapConfig } from "@openremote/model";-import { InputType } from "@openremote/or-mwc-components/or-mwc-input";@customElement("or-conf-json")export class OrConfJson extends LitElement {@@ -118,7 +117,10 @@ export class OrConfJson extends LitElement {render() {return html`- <or-mwc-input type="${InputType.BUTTON}" label="JSON" outlined icon="pencil" @or-mwc-input-changed="${() => {this._showConfigDialog()}}"></or-mwc-input>+ <or-vaadin-button @click=${() => this._showConfigDialog()}>+ <or-icon slot="prefix" icon="pencil"></or-icon>+ <or-translate value="JSON"></or-translate>+ </or-vaadin-button>`}}diff --git a/ui/app/manager/src/components/configuration/or-conf-map/or-conf-map-card.ts b/ui/app/manager/src/components/configuration/or-conf-map/or-conf-map-card.tsindex 2e147df48..34e6a9d25 100644--- a/ui/app/manager/src/components/configuration/or-conf-map/or-conf-map-card.ts+++ b/ui/app/manager/src/components/configuration/or-conf-map/or-conf-map-card.ts@@ -164,7 +164,7 @@ export class OrConfMapCard extends LitElement {padding: 10px 0;}- .input or-mwc-input:not([icon]) {+ .input or-vaadin-number-field {width: 80%;}@@ -212,29 +212,29 @@ export class OrConfMapCard extends LitElement {<div class="boundary-container"><div class="subheader">${i18next.t("configuration.mapBounds")}</div><span>${i18next.t("configuration.mapBoundsDescription")}</span>- <or-mwc-input .value="${map?.bounds[3]}" .type="${InputType.NUMBER}" .label="${i18next.t("north")}"- class="boundary-item"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.setBoundary(3, e.detail.value)}"- .step="${.01}"></or-mwc-input>- <or-mwc-input .value="${map?.bounds[2]}" .type="${InputType.NUMBER}" .label="${i18next.t("east")}"- class="boundary-item"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.setBoundary(2, e.detail.value)}"- .step="${.01}"></or-mwc-input>- <or-mwc-input .value="${map?.bounds[1]}" .type="${InputType.NUMBER}" .label="${i18next.t("south")}"- class="boundary-item"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.setBoundary(1, e.detail.value)}"- .step="${.01}"></or-mwc-input>- <or-mwc-input .value="${map?.bounds[0]}" .type="${InputType.NUMBER}" .label="${i18next.t("west")}"- class="boundary-item"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.setBoundary(0, e.detail.value)}"- .step="${.01}"></or-mwc-input>+ <or-vaadin-number-field class="boundary-item" value=${map?.bounds[3]} step="0.01"+ @change=${(ev: Event) => this.setBoundary(3, (ev.currentTarget as HTMLInputElement).value)}>+ <or-translate slot="label" value="north"></or-translate>+ </or-vaadin-number-field>+ <or-vaadin-number-field class="boundary-item" value=${map?.bounds[2]} step="0.01"+ @change=${(ev: Event) => this.setBoundary(2, (ev.currentTarget as HTMLInputElement).value)}>+ <or-translate slot="label" value="east"></or-translate>+ </or-vaadin-number-field>+ <or-vaadin-number-field class="boundary-item" value=${map?.bounds[1]} step="0.01"+ @change=${(ev: Event) => this.setBoundary(1, (ev.currentTarget as HTMLInputElement).value)}>+ <or-translate slot="label" value="south"></or-translate>+ </or-vaadin-number-field>+ <or-vaadin-number-field class="boundary-item" value=${map?.bounds[0]} step="0.01"+ @change=${(ev: Event) => this.setBoundary(0, (ev.currentTarget as HTMLInputElement).value)}>+ <or-translate slot="label" value="west"></or-translate>+ </or-vaadin-number-field>+<div class="subheader">${i18next.t("configuration.center")}</div><span>${i18next.t("configuration.centerDescription")}</span>- <or-mwc-input .value="${Array.isArray(map.center) ? map.center.join() : undefined}"- .type="${InputType.TEXT}" label="${i18next.t("configuration.center")}"- class="boundary-item"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.setCenter(e.detail.value)}"- .step="${.01}"></or-mwc-input>+ <or-vaadin-text-field class="boundary-item"+ value=${Array.isArray(map.center) ? map.center.join() : undefined}+ @change=${(ev: Event) => this.setCenter((ev.currentTarget as HTMLInputElement).value)}>+ </or-vaadin-text-field><div class="subheader">${i18next.t("configuration.geoJson")}</div><span>${i18next.t("configuration.geoJsonDescription")}</span><div class="input" style="height: 56px; display: flex; align-items: center;">@@ -250,43 +250,42 @@ export class OrConfMapCard extends LitElement {<div class="subheader">${i18next.t("configuration.mapZoom")}</div><span>${i18next.t("configuration.mapZoomDescription")}</span><div class="input">- <or-mwc-input .value="${map.zoom}" .type="${InputType.NUMBER}" .label="${i18next.t('default')}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- map.zoom = e.detail.value;- this.notifyConfigChange(map);- }}"- .step="${1}"></or-mwc-input>- <or-mwc-input .type="${InputType.BUTTON}" icon="eye"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.setZoom(map.zoom)}"- .step="${1}"></or-mwc-input>+ <or-vaadin-number-field value=${map.zoom} step="1" min="1" max="100" step-buttons-visible+ @change=${(ev: Event) => {+ map.zoom = Number((ev.currentTarget as HTMLInputElement).value);+ this.notifyConfigChange(map);+ }}>+ <or-translate slot="label" value="default"></or-translate>+ </or-vaadin-number-field>+ <or-vaadin-button theme="icon" @click=${() => this.setZoom(map.zoom)}>+ <or-icon icon="eye" style="margin: 0;"></or-icon>+ </or-vaadin-button></div><div class="input">- <or-mwc-input .value="${map.minZoom}" .type="${InputType.NUMBER}"- .label="${i18next.t("configuration.minZoom")}"- max="${map.maxZoom}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- map.minZoom = e.detail.value;- this.requestUpdate();- this.notifyConfigChange(map);- }}"- .step="${1}"></or-mwc-input>- <or-mwc-input .type="${InputType.BUTTON}" icon="eye"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.setZoom(map.minZoom)}"- .step="${1}"></or-mwc-input>+ <or-vaadin-number-field value=${map.minZoom} min="0" max=${map.maxZoom} step="1" step-buttons-visible+ @change=${(ev: Event) => {+ map.minZoom = Number((ev.currentTarget as HTMLInputElement).value);+ this.requestUpdate();+ this.notifyConfigChange(map);+ }}>+ <or-translate slot="label" value="configuration.minZoom"></or-translate>+ </or-vaadin-number-field>+ <or-vaadin-button theme="icon" @click=${() => this.setZoom(map.minZoom)}>+ <or-icon icon="eye" style="margin: 0;"></or-icon>+ </or-vaadin-button></div><div class="input">- <or-mwc-input .value="${map.maxZoom}" .type="${InputType.NUMBER}"- .label="${i18next.t("configuration.maxZoom")}"- min="${map.minZoom}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- map.maxZoom = e.detail.value;- this.requestUpdate("map");- this.notifyConfigChange(map);- }}"- .step="${1}"></or-mwc-input>- <or-mwc-input .type="${InputType.BUTTON}" icon="eye"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.setZoom(map.maxZoom)}"- .step="${1}"></or-mwc-input>+ <or-vaadin-number-field value=${map.maxZoom} min=${map.minZoom} max="100" step="1" step-buttons-visible+ @change=${(ev: Event) => {+ map.maxZoom = Number((ev.currentTarget as HTMLInputElement).value);+ this.requestUpdate("map");+ this.notifyConfigChange(map);+ }}>+ <or-translate slot="label" value="configuration.maxZoom"></or-translate>+ </or-vaadin-number-field>+ <or-vaadin-button theme="icon" @click=${() => this.setZoom(map.maxZoom)}>+ <or-icon icon="eye" style="margin: 0;"></or-icon>+ </or-vaadin-button></div><div class="input" style="height: 56px;">@@ -301,10 +300,9 @@ export class OrConfMapCard extends LitElement {</div>${when(this.canRemove, () => html`- <or-mwc-input outlined .type="${InputType.BUTTON}" id="remove-map"- label="configuration.deleteMapCustomization"- @or-mwc-input-changed="${() => { this._showRemoveMapDialog(); }}"- ></or-mwc-input>+ <or-vaadin-button id="remove-map" @click=${() => this._showRemoveMapDialog()}>+ <or-translate value="configuration.deleteMapCustomization"></or-translate>+ </or-vaadin-button>`)}</div>`}diff --git a/ui/app/manager/src/components/configuration/or-conf-map/or-conf-map-geojson.ts b/ui/app/manager/src/components/configuration/or-conf-map/or-conf-map-geojson.tsindex d733c60a2..89815516e 100644--- a/ui/app/manager/src/components/configuration/or-conf-map/or-conf-map-geojson.ts+++ b/ui/app/manager/src/components/configuration/or-conf-map/or-conf-map-geojson.ts@@ -4,7 +4,6 @@ import { html, LitElement } from "lit";import { customElement, property, state } from "lit/decorators.js";import "@openremote/or-components/or-ace-editor";import { OrAceEditorChangedEvent } from "@openremote/or-components/or-ace-editor";-import { InputType } from "@openremote/or-mwc-components/or-mwc-input";@customElement("or-conf-map-geojson")export class OrConfMapGeoJson extends LitElement {@@ -22,7 +21,12 @@ export class OrConfMapGeoJson extends LitElement {/* -------------- */protected render() {- return html`<or-mwc-input type="${InputType.BUTTON}" label="geoJson" outlined icon="pencil" @or-mwc-input-changed="${this.showDialog}"></or-mwc-input>`+ return html`+ <or-vaadin-button @click=${() => this.showDialog()}>+ <or-icon slot="prefix" icon="pencil"></or-icon>+ <or-translate value="configuration.geoJson"></or-translate>+ </or-vaadin-button>+ `;}protected showDialog() {diff --git a/ui/app/manager/src/components/configuration/or-conf-map/or-conf-map-global.ts b/ui/app/manager/src/components/configuration/or-conf-map/or-conf-map-global.tsindex 275034042..cf3fdb462 100644--- a/ui/app/manager/src/components/configuration/or-conf-map/or-conf-map-global.ts+++ b/ui/app/manager/src/components/configuration/or-conf-map/or-conf-map-global.ts@@ -108,17 +108,16 @@ export class OrConfMapGlobal extends LitElement {<or-translate value="configuration.global.mapTileServerDescription"></or-translate><br><or-translate class="note" value="configuration.global.mapTileServerNote"></or-translate></span>- <or-mwc-input class="input"- .value="${isCustom ? this.config.sources?.vector_tiles?.tiles?.[0] : undefined}"- .type="${InputType.URL}"- .label="${i18next.t("configuration.global.mapTileServerPlaceholder")}"- placeholder="https://api.example.com/tileset/{z}/{x}/{y}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- this.config.sources.vector_tiles.tiles = e.detail.value ? [e.detail.value] : undefined;- this.config.sources.vector_tiles.custom = !!e.detail.value;- this.notifyConfigChange(this.config);- }}"- ></or-mwc-input>+ <or-vaadin-text-field class="input" type="url" pattern="^[a-zA-Z][a-zA-Z0-9+.-]*://.*$"+ value=${isCustom ? this.config.sources?.vector_tiles?.tiles?.[0] : undefined}+ placeholder="https://api.example.com/tileset/{z}/{x}/{y}"+ @change=${(ev: Event) => {+ const newValue = (ev.currentTarget as HTMLInputElement).value;+ this.config.sources.vector_tiles.tiles = newValue ? [newValue] : undefined;+ this.config.sources.vector_tiles.custom = !!newValue;+ this.notifyConfigChange(this.config);+ }}>+ </or-vaadin-text-field></div><div class="map-tile-upload-group"><div class="subheader"><or-translate value="configuration.global.mapTiles"></or-translate></div>@@ -152,17 +151,15 @@ export class OrConfMapGlobal extends LitElement {<or-translate class="note" value="configuration.global.mapStyleJsonUrlNote"></or-translate></span><div style="display: flex; height: 56px; align-items: center">- <or-mwc-input class="input"- .value="${this.config.override}"- .type="${InputType.URL}"- .label="${i18next.t("configuration.global.mapStyleJsonUrlPlaceholder")}"- placeholder="https://api.example.com/tileset/style.json"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- this.config.override = e.detail.value || undefined- this.notifyConfigChange(this.config)- this.requestUpdate();- }}"- ></or-mwc-input>+ <or-vaadin-text-field class="input" type="url" pattern="^[a-zA-Z][a-zA-Z0-9+.-]*://.*$"+ value=${this.config.override}+ placeholder="https://api.example.com/tileset/style.json"+ @change=${(ev: Event) => {+ this.config.override = (ev.currentTarget as HTMLInputElement).value || undefined+ this.notifyConfigChange(this.config)+ this.requestUpdate();+ }}>+ </or-vaadin-text-field></div></div><div class="map-style-layers-group">@@ -172,10 +169,11 @@ export class OrConfMapGlobal extends LitElement {<or-translate class="note" value="configuration.global.mapImportStyleNote"></or-translate></span><div style="display: flex; gap: 12px; align-items: center">- <or-mwc-input class="input fit-content" type="button" outlined icon="import"- .label="${i18next.t("configuration.global.import")}"- .disabled="${!this.config.override}" @or-mwc-input-changed="${this.importMapSettings}"- ></or-mwc-input>+ <or-vaadin-button class="fit-content" ?disabled=${!this.config.override}+ @click=${() => this.importMapSettings()}>+ <or-icon slot="prefix" icon="import"></or-icon>+ <or-translate value="configuration.global.import"></or-translate>+ </or-vaadin-button><or-conf-json class="input fit-content hide-mobile" .heading="${i18next.t("configuration.global.mapLayers")}".config="${hasExternalSource ? this.config.layers.filter(({ id }) => !id.startsWith("or:")) : this.config.layers}"@saveLocalConfig="${(ev: CustomEvent) => {@@ -194,10 +192,10 @@ export class OrConfMapGlobal extends LitElement {}}"></or-conf-json>${when(hasExternalSource, () => html`- <or-mwc-input class="input fit-content" outlined type="button" icon="undo"- .label="${i18next.t("configuration.global.reset")}"- @or-mwc-input-changed="${this.resetMapSettings}"- ></or-mwc-input>+ <or-vaadin-button class="fit-content" @click=${() => this.resetMapSettings()}>+ <or-icon slot="prefix" icon="undo"></or-icon>+ <or-translate value="configuration.global.reset"></or-translate>+ </or-vaadin-button>`)}</div></div>diff --git a/ui/app/manager/src/components/configuration/or-conf-panel.ts b/ui/app/manager/src/components/configuration/or-conf-panel.tsindex 12e7a948f..099abafc0 100644--- a/ui/app/manager/src/components/configuration/or-conf-panel.ts+++ b/ui/app/manager/src/components/configuration/or-conf-panel.ts@@ -10,6 +10,7 @@ import "./or-conf-map/or-conf-map-card";import "./or-conf-realm/or-conf-realm-card";import {OrConfRealmCard} from "./or-conf-realm/or-conf-realm-card";import {OrConfMapCard} from "./or-conf-map/or-conf-map-card";+import {OrVaadinSelect} from "@openremote/or-vaadin-components/or-vaadin-select";@customElement("or-conf-panel")export class OrConfPanel extends LitElement {@@ -97,9 +98,10 @@ export class OrConfPanel extends LitElement {<!-- Show an "ADD REALM" button if there are realms available to be added --><div style="display: flex; justify-content: space-between;">${when(availableRealms.length > 0, () => html`- <or-mwc-input id="btn-add-realm" .type="${InputType.BUTTON}" label="${type === 'mapconfig' ? 'configuration.addMapCustomization' : 'configuration.addRealmCustomization'}" icon="plus"- @or-mwc-input-changed="${() => this._showAddingRealmDialog()}"- ></or-mwc-input>+ <or-vaadin-button id="btn-add-realm" @click=${() => this._showAddingRealmDialog()}>+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value=${type === 'mapconfig' ? 'configuration.addMapCustomization' : 'configuration.addRealmCustomization'}></or-translate>+ </or-vaadin-button>`)}</div>`@@ -174,15 +176,17 @@ export class OrConfPanel extends LitElement {},];const headingKey = this.isMapConfig(this.config) ? 'configuration.addMapCustomization' : 'configuration.addRealmCustomization';+ const realmItems = this.getAvailableRealms(this.config, this.realmOptions).map(item => ({value: item.name, label: item.displayName}));showDialog(new OrMwcDialog().setHeading(i18next.t(headingKey)).setActions(dialogActions).setContent(html`- <or-mwc-input class="selector" label="${i18next.t('realm')}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._addedRealm = e.detail.value}" .type="${InputType.SELECT}"- .options="${Object.entries(this.getAvailableRealms(this.config, this.realmOptions)).map(([, value]) => {- return [value.name, value.displayName]- })}"- ></or-mwc-input>+ <div style="width: 280px; padding: 10px 20px;">+ <or-vaadin-select class="selector" .items=${realmItems}+ @change=${(ev: Event) => this._addedRealm = (ev.currentTarget as OrVaadinSelect).value}>+ <or-translate slot="label" value="realm"></or-translate>+ </or-vaadin-select>+ </div>`).setStyles(html`<style>diff --git a/ui/app/manager/src/components/configuration/or-conf-realm/or-conf-realm-card.ts b/ui/app/manager/src/components/configuration/or-conf-realm/or-conf-realm-card.tsindex 223a79cf5..f40ee0516 100644--- a/ui/app/manager/src/components/configuration/or-conf-realm/or-conf-realm-card.ts+++ b/ui/app/manager/src/components/configuration/or-conf-realm/or-conf-realm-card.ts@@ -37,8 +37,8 @@ import { i18next, translate } from "@openremote/or-translate";import { FileInfo, ManagerAppRealmConfig } from "@openremote/model";import { DialogAction, OrMwcDialog, showDialog } from "@openremote/or-mwc-components/or-mwc-dialog";import {when} from 'lit/directives/when.js';-import ISO6391 from 'iso-639-1';import {DefaultHeaderMainMenu, DefaultHeaderSecondaryMenu} from "../../../index";+import {OrVaadinMultiSelectComboBox} from "@openremote/or-vaadin-components/or-vaadin-multi-select-combo-box";@customElement("or-conf-realm-card")export class OrConfRealmCard extends translate(i18next)(LitElement) {@@ -131,14 +131,12 @@ export class OrConfRealmCard extends translate(i18next)(LitElement) {protected logo:string = this.realm.logo;protected logoMobile:string = this.realm.logoMobile;protected favicon:string = this.realm.favicon;- protected headerListPrimary: string[] = Object.keys(DefaultHeaderMainMenu);- protected headerListSecondary: string[] = Object.keys(DefaultHeaderSecondaryMenu);+ protected headerListPrimary: {value: any, label: string}[] = Object.keys(DefaultHeaderMainMenu).map(k => ({value: k, label: Util.camelCaseToSentenceCase(k)}));+ protected headerListSecondary: {value: any, label: string}[] = Object.keys(DefaultHeaderSecondaryMenu).map(k => ({value: k, label: Util.camelCaseToSentenceCase(k)}));- protected get _languages(): string[][] {- return Object.entries(DEFAULT_LANGUAGES)- .map(([code, key]) => [code, i18next.t(key)])- .sort((a, b) => a[1].localeCompare(b[1]));- }+ protected _languages = Object.entries(DEFAULT_LANGUAGES)+ .map(([code, key]) => ({value: code, label: i18next.t(key) }))+ .sort((a, b) => a.label.localeCompare(b.label));protected get commonLanguages(): string[] {return this._languages.map(entry => entry[1]);@@ -180,8 +178,9 @@ export class OrConfRealmCard extends translate(i18next)(LitElement) {}protected _setHeader(keys: string[], list: string[]) {+ console.debug(keys, list);if (!this.realm.headers) {- this.realm.headers = this.headerListSecondary.concat(this.headerListPrimary);+ this.realm.headers = this.headerListSecondary.map(x => x.value).concat(this.headerListPrimary.map(x => x.value));}this.realm.headers = this.realm.headers?.filter(function(ele) {return !list.includes(ele);@@ -268,13 +267,6 @@ export class OrConfRealmCard extends translate(i18next)(LitElement) {const app = this;const managerUrl = (manager.managerUrl ?? "");- // On an empty search; return the common language as set in DEFAULT_LANGUAGES- // If searching, compare strings using lowercase. (with no maximum)- const searchProvider = (search: string) => this._languages.filter(entry =>- (!search && this.commonLanguages.includes(entry[1])) ||- (!search && app.realm.notifications?.languages.includes(entry[0])) ||- entry[1].toLowerCase().includes(search?.toLowerCase()))-return html`<or-collapsible-panel .expanded="${app.expanded}"><div slot="header" class="header-container">@@ -282,19 +274,21 @@ export class OrConfRealmCard extends translate(i18next)(LitElement) {</div><div slot="content" class="panel-content"><div class="subheader"><or-translate value="configuration.main"></or-translate></div>- <or-mwc-input class="appTitle" .type="${InputType.TEXT}" label="${i18next.t("configuration.realmTitle")}" value="${app.realm?.appTitle}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- app.realm.appTitle = e.detail.value;- app.notifyConfigChange(app.realm);- }}"- ></or-mwc-input>- <or-mwc-input class="language" .type="${InputType.SELECT}" label="${i18next.t("configuration.defaultLanguage")}" value="${app.realm?.language}"- .options="${Object.entries(DEFAULT_LANGUAGES).map(([key, value]) => [key, i18next.t(value)])}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- app.realm.language = e.detail.value;- app.notifyConfigChange(app.realm);- }}"- ></or-mwc-input>+ <or-vaadin-text-field class="appTitle" value=${app.realm?.appTitle}+ @change=${(ev: Event) => {+ app.realm.appTitle = (ev.currentTarget as HTMLInputElement).value;+ app.notifyConfigChange(app.realm);+ }}>+ <or-translate slot="label" value="configuration.realmTitle"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-select class="language" value=${app.realm?.language}+ .items=${Object.entries(DEFAULT_LANGUAGES).map(([key, value]) => ({value: key, label: i18next.t(value)}))}+ @change=${(ev: Event) => {+ app.realm.language = (ev.currentTarget as HTMLInputElement).value;+ app.notifyConfigChange(app.realm);+ }}>+ <or-translate slot="label" value="configuration.defaultLanguage"></or-translate>+ </or-vaadin-select><div class="logo-group"><div class="subheader"><or-translate value="configuration.images"></or-translate></div><div class="d-inline-flex">@@ -338,80 +332,70 @@ export class OrConfRealmCard extends translate(i18next)(LitElement) {<div class="header-group"><div class="subheader"><or-translate value="configuration.navigation"></or-translate></div><span><or-translate value="configuration.navigationDescription"></or-translate></span>+ <span>${app.realm.headers ?? "none"}</span><div>- <or-mwc-input- .type="${InputType.SELECT}" multiple- class="header-item"- label="${i18next.t("configuration.primaryNavigation")}"- .value="${!!app.realm.headers ? app.realm.headers?.filter(function(ele: string) {- return app.headerListPrimary.includes(ele);- }) : app.headerListPrimary}"- .options="${app.headerListPrimary}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => app._setHeader(e.detail.value, app.headerListPrimary)}"- ></or-mwc-input>- <or-mwc-input- .type="${InputType.SELECT}" multiple- class="header-item"- label="${i18next.t("configuration.secondaryNavigation")}"- .value="${!!app.realm.headers ? app.realm.headers?.filter(function(ele: string) {- return app.headerListSecondary.includes(ele);- }) : app.headerListSecondary}"- .options="${app.headerListSecondary}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => app._setHeader(e.detail.value, app.headerListSecondary)}"- ></or-mwc-input>+ <or-vaadin-multi-select-combo-box class="header-item"+ .items=${app.headerListPrimary}+ .selectedItems=${app.realm.headers ? app.headerListPrimary.filter(h => app.realm.headers?.includes(h.value)) : app.headerListPrimary}+ @change=${(ev: Event) => {+ app._setHeader(+ (ev.currentTarget as OrVaadinMultiSelectComboBox).selectedItems.map(i => i.value),+ app.headerListPrimary.map(i => i.value),+ );+ }}>+ <or-translate slot="label" value="configuration.primaryNavigation"></or-translate>+ </or-vaadin-multi-select-combo-box>+ <or-vaadin-multi-select-combo-box class="header-item"+ .items=${app.headerListSecondary}+ .selectedItems=${app.realm.headers ? app.headerListSecondary.filter(h => app.realm.headers?.includes(h.value)) : app.headerListSecondary}+ @change=${(ev: Event) => {+ app._setHeader(+ (ev.currentTarget as OrVaadinMultiSelectComboBox).selectedItems.map(i => i.value),+ app.headerListSecondary.map(i => i.value),+ );+ }}>+ <or-translate slot="label" value="configuration.secondaryNavigation"></or-translate>+ </or-vaadin-multi-select-combo-box></div></div><div class="header-group"><div class="subheader"><or-translate value="configuration.notificationLanguages"></or-translate></div><span><or-translate value="configuration.notificationLanguagesDesc"></or-translate></span><div>- <or-mwc-input- .type="${InputType.SELECT}" multiple- class="header-item"- searchLabel="configuration.notificationLanguagesLabel"- label="${i18next.t("configuration.notificationLanguages")}"- .value="${app.realm.notifications?.languages || []}"- .options="${this._languages}"- .searchProvider="${searchProvider}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- const newLanguages: string[] | undefined = e.detail.value;- const currentDefault: string | undefined = app.realm.notifications?.defaultLanguage;- app.realm.notifications = {- languages: newLanguages,- defaultLanguage: newLanguages?.includes(currentDefault) ? currentDefault : newLanguages?.[0]- }- app.notifyConfigChange(app.realm);- this.requestUpdate(); // force render- }}"- ></or-mwc-input>- ${when(app.realm.notifications?.languages?.length > 0, () => html`- <or-mwc-input- .type="${InputType.SELECT}"- class="header-item"- label="${i18next.t("configuration.defaultLanguage")}"- .value="${app.realm.notifications?.defaultLanguage || []}"- .options="${this._languages.filter(entry => app.realm.notifications?.languages.includes(entry[0]))}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- app.realm.notifications.defaultLanguage = e.detail.value;- app.notifyConfigChange(app.realm);- this.requestUpdate(); // force render- }}"- ></or-mwc-input>- `, () => html`- <or-mwc-input- .type="${InputType.SELECT}" disabled- class="header-item"- label="${i18next.t("configuration.defaultLanguage")}"- ></or-mwc-input>- `)}+ <or-vaadin-multi-select-combo-box class="header-item"+ .items=${this._languages}+ .selectedItems=${this._languages.filter(l => app.realm.notifications?.languages.includes(l.value))}+ @change=${(ev: Event) => {+ const newLanguages: string[] | undefined = (ev.currentTarget as OrVaadinMultiSelectComboBox).selectedItems.map(i => i.value);+ const currentDefault: string | undefined = app.realm.notifications?.defaultLanguage;+ app.realm.notifications = {+ languages: newLanguages,+ defaultLanguage: newLanguages?.includes(currentDefault) ? currentDefault : newLanguages?.[0]+ }+ app.notifyConfigChange(app.realm);+ this.requestUpdate(); // force render+ }}>+ <or-translate slot="label" value="configuration.notificationLanguages"></or-translate>+ </or-vaadin-multi-select-combo-box>++ <or-vaadin-select class="header-item"+ ?disabled=${!app.realm.notifications?.languages?.length}+ .items=${this._languages.filter(l => app.realm.notifications?.languages.includes(l.value))}+ value=${app.realm.notifications?.defaultLanguage}+ @change=${(ev: Event) => {+ app.realm.notifications.defaultLanguage = (ev.currentTarget as HTMLInputElement).value;+ app.notifyConfigChange(app.realm);+ this.requestUpdate(); // force render+ }}>+ <or-translate slot="label" value="configuration.defaultLanguage"></or-translate>+ </or-vaadin-select></div></div>${when(app.canRemove, () => html`- <or-mwc-input outlined id="remove-realm" .type="${InputType.BUTTON}"- label="configuration.deleteRealmCustomization"- @or-mwc-input-changed="${() => { app._showRemoveRealmDialog(); }}"- ></or-mwc-input>+ <or-vaadin-button id="remove-realm" @click=${() => app._showRemoveRealmDialog()}>+ <or-translate value="configuration.deleteRealmCustomization"></or-translate>+ </or-vaadin-button>`)}</div></or-collapsible-panel>diff --git a/ui/app/manager/src/headers.ts b/ui/app/manager/src/headers.tsindex a4a8b3bdf..ea42e0a2f 100644--- a/ui/app/manager/src/headers.ts+++ b/ui/app/manager/src/headers.ts@@ -6,6 +6,7 @@ import { getMapRoute } from "./routes";export function headerItemMap<S extends AppStateKeyed, A extends AnyAction>(orApp: OrApp<S>): HeaderItem {return {icon: "map",+ value: "map",href: getMapRoute(),text: "map"};@@ -14,6 +15,7 @@ export function headerItemMap<S extends AppStateKeyed, A extends AnyAction>(orApexport function headerItemAssets<S extends AppStateKeyed, A extends AnyAction>(orApp: OrApp<S>): HeaderItem {return {icon: "rhombus-split",+ value: "assets",href: "assets",text: "asset_plural",};@@ -22,6 +24,7 @@ export function headerItemAssets<S extends AppStateKeyed, A extends AnyAction>(oexport function headerItemServices<S extends AppStateKeyed, A extends AnyAction>(orApp: OrApp<S>): HeaderItem {return {icon: "puzzle",+ value: "services",href: "services",text: "services",roles: ["read:services"]@@ -31,6 +34,7 @@ export function headerItemServices<S extends AppStateKeyed, A extends AnyAction>export function headerItemRules<S extends AppStateKeyed, A extends AnyAction>(orApp: OrApp<S>): HeaderItem {return {icon: "state-machine",+ value: "rules",href: "rules",text: "rule_plural",hideMobile: true,@@ -41,6 +45,7 @@ export function headerItemRules<S extends AppStateKeyed, A extends AnyAction>(orexport function headerItemInsights<S extends AppStateKeyed, A extends AnyAction>(orApp: OrApp<S>): HeaderItem {return {icon: "chart-areaspline",+ value: "insights",href: "insights",text: "insights"};@@ -140,7 +145,8 @@ export function headerItemExport<S extends AppStateKeyed, A extends AnyAction>(oicon: "database-export",value: "export",href: "data-export",- text: "dataExport"+ text: "dataExport",+ roles: ["read:assets"]};}diff --git a/ui/app/manager/src/pages/page-account.ts b/ui/app/manager/src/pages/page-account.tsindex 00e4f8cc0..ad5aeee2f 100644--- a/ui/app/manager/src/pages/page-account.ts+++ b/ui/app/manager/src/pages/page-account.ts@@ -10,9 +10,9 @@ import {until} from "lit/directives/until.js";import {map} from 'lit/directives/map.js';import {guard} from "lit/directives/guard.js";import {i18next} from "@openremote/or-translate";-import {InputType, OrInputChangedEvent, OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";import {ClientRole, Credential, Role, User, UserAssetLink, UserQuery} from "@openremote/model";import {showSnackbar} from "@openremote/or-mwc-components/or-mwc-snackbar";+import {OrVaadinPasswordField} from "@openremote/or-vaadin-components/or-vaadin-password-field";export function pageAccountProvider(store: Store<AppStateKeyed>): PageProvider<AppStateKeyed> {return {@@ -155,10 +155,10 @@ export class PageAccount extends Page<AppStateKeyed> {protected _passwordPolicy: string[] = [];@query("#new-password")- protected _passwordElem?: OrMwcInput;+ protected _passwordElem?: OrVaadinPasswordField;@query("#new-repeatPassword")- protected _repeatPasswordElem?: OrMwcInput;+ protected _repeatPasswordElem?: OrVaadinPasswordField;static get styles() {return this._getStyle();@@ -222,10 +222,9 @@ export class PageAccount extends Page<AppStateKeyed> {</p><div class="row"><div class="column">- <or-mwc-input .type="${InputType.BUTTON}" label="${i18next.t('twoFactorConfigure')}"- outlined- @or-mwc-input-changed="${() => manager.login({action: "CONFIGURE_TOTP"})}"- ></or-mwc-input>+ <or-vaadin-button style="width: fit-content;" @click=${() => manager.login({action: "CONFIGURE_TOTP"})}>+ <or-translate value="twoFactorConfigure"></or-translate>+ </or-vaadin-button></div></div></div>@@ -249,94 +248,80 @@ export class PageAccount extends Page<AppStateKeyed> {<div class="column"><!-- user details --><h5><or-translate value="details"></or-translate></h5>- <or-mwc-input id="new-username" class="validate"- label="${i18next.t("username")}"- .type="${InputType.TEXT}"- ?required="${!registrationEmailAsUsername}"- .disabled="${true}"- minLength="3" maxLength="255" pattern="[A-Za-z0-9\\-_+@\\.ßçʊÇʊ]+"- .validationMessage="${i18next.t("invalidUsername")}"- .value="${user?.username}" autocomplete="false"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- user.username = e.detail.value;- onchange?.(user, true, this._isInvalid());- }}"- ></or-mwc-input>+ <or-vaadin-text-field id="new-username" class="validate" disabled+ ?required=${!registrationEmailAsUsername}+ minlength="3" maxlength="255" pattern="[A-Za-z0-9\\-_+@\\.ßçʊÇʊ]+"+ errorMessage=${i18next.t("invalidUsername")}+ value=${user?.username} autocomplete="false"+ @change=${(ev: Event) => {+ user.username = (ev.currentTarget as HTMLInputElement).value;+ onchange?.(user, true, this._isInvalid());+ }}>+ <or-translate slot="label" value="username"></or-translate>+ </or-vaadin-text-field><!-- if identity provider is set to use email as username, make it required -->- <or-mwc-input id="new-email" class="validate"- label="${i18next.t("email")}"- .type="${InputType.EMAIL}"- ?required="${registrationEmailAsUsername}"- ?readonly="${(!!user?.id && registrationEmailAsUsername) || readonly}"- .disabled="${!user || (!!user?.id && registrationEmailAsUsername)}"- pattern="^[\\w\\.\\-]+@([\\w\\-]+\\.)+[\\w]{2,4}$"- .validationMessage="${i18next.t("invalidEmail")}"- .value="${user?.email}" autocomplete="false"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- user.email = e.detail.value;- onchange?.(user, true, this._isInvalid());- }}"- ></or-mwc-input>- <or-mwc-input id="new-firstName" class="validate"- label="${i18next.t("firstName")}"- .type="${InputType.TEXT}"- ?readonly="${readonly}"- .disabled="${!user}"- minLength="5" autocomplete="false"- .value="${user?.firstName}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- user.firstName = e.detail.value;- onchange?.(user, true, this._isInvalid());- }}"- ></or-mwc-input>- <or-mwc-input id="new-surname" class="validate"- label="${i18next.t("surname")}"- .type="${InputType.TEXT}"- ?readonly="${readonly}"- .disabled="${!user}"- minLength="1" autocomplete="false"- .value="${user?.lastName}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- user.lastName = e.detail.value;- onchange?.(user, true, this._isInvalid());- }}">- </or-mwc-input>+ <or-vaadin-email-field id="new-email" class="validate"+ ?required=${registrationEmailAsUsername}+ ?readonly=${(!!user?.id && registrationEmailAsUsername) || readonly}+ ?disabled="${!user || (!!user?.id && registrationEmailAsUsername)}"+ pattern="^[\\w\\.\\-]+@([\\w\\-]+\\.)+[\\w]{2,4}$"+ errorMessage=${i18next.t("invalidEmail")}+ value=${user?.email} autocomplete="false"+ @change="${(ev: Event) => {+ user.email = (ev.currentTarget as HTMLInputElement).value;+ onchange?.(user, true, this._isInvalid());+ }}">+ <or-translate slot="label" value="email"></or-translate>+ </or-vaadin-email-field>+ <or-vaadin-text-field id="new-firstName" class="validate"+ ?readonly=${readonly} ?disabled=${!user}+ minlength="1" autocomplete="false"+ value=${user?.firstName}+ @change=${(ev: Event) => {+ user.firstName = (ev.currentTarget as HTMLInputElement).value;+ onchange?.(user, true, this._isInvalid());+ }}>+ <or-translate slot="label" value="firstName"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-text-field id="new-surname" class="validate"+ ?readonly=${readonly} ?disabled=${!user}+ minlength="1" autocomplete="false"+ value=${user?.lastName}+ @change="${(ev: Event) => {+ user.lastName = (ev.currentTarget as HTMLInputElement).value;+ onchange?.(user, true, this._isInvalid());+ }}">+ <or-translate slot="label" value="surname"></or-translate>+ </or-vaadin-text-field></div><div class="column"><h5><or-translate value="password"></or-translate></h5>- ${registrationEmailAsUsername ? html`+ ${!registrationEmailAsUsername ? html`<!-- Reset password button when email as username is configured -->- <or-mwc-input id="reset-password" raised- label="${i18next.t("resetPassword")}"- .type="${InputType.BUTTON}"- .disabled="${!user.email}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._onResetPasswordBtnClick(e)}"- ></or-mwc-input>+ <or-vaadin-button id="reset-password" theme="primary" ?disabled=${!user.email} style="width: fit-content;"+ @click=${() => this._onResetPasswordBtnClick()}>+ <or-translate value="resetPassword"></or-translate>+ </or-vaadin-button>` : html`<!-- Direct password input fields when email as username not configured -->- <or-mwc-input id="new-password" class="validate"- label="${i18next.t("password")}"- .type="${InputType.PASSWORD}"- ?readonly="${readonly}"- .disabled="${!user}"- min="1" autocomplete="false"- @or-mwc-input-changed="${(_e: OrInputChangedEvent) => {- const changed = this._onPasswordChanged(user);- onchange?.(user, changed, this._isInvalid());- }}"- ></or-mwc-input>- <or-mwc-input id="new-repeatPassword"- label="${i18next.t("repeatPassword")}"- .type="${InputType.PASSWORD}"- helperPersistent- ?readonly="${readonly}"- .disabled="${!user}"- min="1" autocomplete="false"- @or-mwc-input-changed="${(_e: OrInputChangedEvent) => {- const changed = this._onPasswordChanged(user);- onchange?.(user, changed, this._isInvalid());- }}"- ></or-mwc-input>+ <or-vaadin-password-field id="new-password" class="validate"+ ?readonly=${readonly} ?disabled=${!user}+ minlength="1" autocomplete="false"+ @change=${() => {+ const changed = this._onPasswordChanged(user);+ onchange?.(user, changed, this._isInvalid());+ }}>+ <or-translate slot="label" value="password"></or-translate>+ </or-vaadin-password-field>+ <or-vaadin-password-field id="new-repeatPassword"+ ?readonly=${readonly} ?disabled=${!user}+ minlength="1" autocomplete="false"+ @change=${() => {+ const changed = this._onPasswordChanged(user);+ onchange?.(user, changed, this._isInvalid());+ }}>+ <or-translate slot="label" value="repeatPassword"></or-translate>+ </or-vaadin-password-field>${when(this._passwordPolicy, () => until(this._getPasswordPolicyTemplate(user, this._passwordPolicy)))}`}</div>@@ -353,12 +338,10 @@ export class PageAccount extends Page<AppStateKeyed> {const dirty = this._isDirty();return html`<div class="row" style="justify-content: end; margin-top: 20px;">- <or-mwc-input id="savebtn" style="margin: 0;" raised- label="${i18next.t(user.id ? "save" : "create")}"- .type="${InputType.BUTTON}"- .disabled="${invalid || !dirty}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._onSaveBtnClick(e)}"- ></or-mwc-input>+ <or-vaadin-button id="savebtn" theme="primary" ?disabled=${invalid || !dirty}+ @click=${() => this._onSaveBtnClick()}>+ <or-translate value=${user.id ? "save" : "create"}></or-translate>+ </or-vaadin-button></div>`;}@@ -369,22 +352,30 @@ export class PageAccount extends Page<AppStateKeyed> {* and updates the {@link user} object with the new password.*/protected _onPasswordChanged(user: UserModel): boolean {- const password = this._passwordElem?.nativeValue;- const repeatPassword = this._repeatPasswordElem?.nativeValue;+ const password = this._passwordElem?.value;+ const repeatPassword = this._repeatPasswordElem?.value;if(password && repeatPassword) {if(password !== repeatPassword) {- const error = i18next.t("passwordMismatch");- this._repeatPasswordElem?.setCustomValidity(error);+ console.warn("Could not update password: the passwords do not match.");user.password = "";+ setTimeout(() => {+ this._passwordElem.errorMessage = i18next.t("passwordMismatch");+ this._passwordElem.invalid = true;+ this._repeatPasswordElem.errorMessage = i18next.t("passwordMismatch");+ this._repeatPasswordElem.invalid = true;+ });} else {- this._repeatPasswordElem?.setCustomValidity(undefined);user.password = password;+ setTimeout(() => {+ this._passwordElem.invalid = false;+ this._repeatPasswordElem.invalid = false;+ })return true;}} else {- console.warn("Could not update password; some fields are empty;", password, repeatPassword);+ console.warn("Could not update password; some fields are empty.");}return false;}@@ -393,7 +384,7 @@ export class PageAccount extends Page<AppStateKeyed> {* HTML callback function for when the 'Save' button is clicked.* Checks if the input fields are valid, and calls the {@link _updateUser} function.*/- protected _onSaveBtnClick(_e: OrInputChangedEvent) {+ protected _onSaveBtnClick() {if (this._user && !this._isInvalid()) {this._updateUser(this._user);} else {@@ -405,7 +396,7 @@ export class PageAccount extends Page<AppStateKeyed> {/*** HTML callback function for when the 'Reset Password' button is clicked.*/- protected _onResetPasswordBtnClick(_e: OrInputChangedEvent) {+ protected _onResetPasswordBtnClick() {if (this._user && !this._isInvalid()) {manager.rest.api.UserResource.requestPasswordResetCurrent()@@ -423,7 +414,9 @@ export class PageAccount extends Page<AppStateKeyed> {if (validateArray.length === 0) {return true;}- return Array.from(validateArray).filter(e => e instanceof OrMwcInput).some(input => !(input as OrMwcInput).valid);+ return Array.from(validateArray)+ .filter(e => e instanceof HTMLInputElement)+ .some(input => !(input as HTMLInputElement).checkValidity());}/**diff --git a/ui/app/manager/src/pages/page-alarms.ts b/ui/app/manager/src/pages/page-alarms.tsindex 804ac3c43..ff0ea19b7 100644--- a/ui/app/manager/src/pages/page-alarms.ts+++ b/ui/app/manager/src/pages/page-alarms.ts@@ -20,7 +20,6 @@ import {getAlarmsRoute} from "../routes";import {when} from "lit/directives/when.js";import {until} from "lit/directives/until.js";import {guard} from "lit/directives/guard.js";-import {InputType, OrInputChangedEvent, OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";import {OrMwcDialog, showDialog, showOkCancelDialog} from "@openremote/or-mwc-components/or-mwc-dialog";import {OrAssetTreeRequestSelectionEvent, OrAssetTreeSelectionEvent} from "@openremote/or-asset-tree";import {@@ -29,6 +28,9 @@ import {OrMwcTableRowSelectEvent} from "@openremote/or-mwc-components/or-mwc-table";import "../components/alarms/or-alarms-table";+import {OrVaadinSelect} from "@openremote/or-vaadin-components/or-vaadin-select";+import moment from "moment";+import {OrVaadinButton} from "@openremote/or-vaadin-components/or-vaadin-button";export interface PageAlarmsConfig {initialFilter?: string;@@ -75,7 +77,6 @@ export class PageAlarms extends Page<AppStateKeyed> {#title {padding: 0 20px;font-size: 18px;- font-weight: bold;margin: 10px 0;display: flex;align-items: center;@@ -151,12 +152,12 @@ export class PageAlarms extends Page<AppStateKeyed> {display: flex;flex-direction: row;justify-content: space-between;- align-items: center;+ align-items: baseline;}.controls-left {display: flex;- align-items: center;+ align-items: baseline;width: 100%;}@@ -274,22 +275,12 @@ export class PageAlarms extends Page<AppStateKeyed> {protected _selectedIds?: number[];get statusValue() {- const statusOptions = this._getStatusOptions();- const matchingOption = statusOptions.find(option =>+ const matchingOption = this._getStatusOptions().find(option =>option.value === this.status ||- (this.allActive && option.value === 'All-active') ||- (!this.status && option.value === 'All')- );- return matchingOption ? matchingOption.label : '';- }-- get severityValue() {- const severityOptions = this._getSeverityOptions();- const matchingOption = severityOptions.find(option =>- option.value === this.severity ||- (!this.severity && option.value === 'All')+ (this.allActive && option.value === 'allActive') ||+ (!this.status && option.value === 'all'));- return matchingOption ? matchingOption.label : '';+ return matchingOption?.value;}get name(): string {@@ -412,49 +403,44 @@ export class PageAlarms extends Page<AppStateKeyed> {<div class="${this.creationState || this.alarm ? "hidden" : ""}"style="display: flex; align-items: center;"><or-icon icon="bell-outline" style="padding: 0 10px 0 4px;"></or-icon>- <span>${this.alarm != undefined ? this.alarm.title : html`+ <span style="font-weight: bold;">${this.alarm != undefined ? this.alarm.title : html`<or-translate value="alarm.alarm_plural"/>`}</span></div><div><div id="controls">+ <!-- Actions when alarm is selected --><div class="${this.creationState || this.alarm || assignOnly || readonly ? "hidden" : "panel-title"}"- style="justify-content: flex-end;">- <or-mwc-input- outlined- class="${this._selectedIds?.length > 0 ? "" : "hidden"}"- style="margin: 0;"- type="${InputType.BUTTON}"- icon="delete"- @or-mwc-input-changed="${() => (this._deleteAlarms())}"- ></or-mwc-input>+ style="justify-content: flex-end; margin-right: 12px;">+ <or-vaadin-button theme="icon" class="${this._selectedIds?.length > 0 ? "" : "hidden"}"+ @click=${() => this._deleteAlarms()}>+ <or-icon icon="delete"></or-icon>+ </or-vaadin-button></div>- <div class="${this._selectedIds?.length > 0 ? "" : "hidden"}"- style="height:40px; border-right: 1px solid #e0e0e0; margin-right: 4px;"></div>++ <!-- Filters --><div class="${this.creationState || this.alarm ? "hidden" : "controls-left"}">- <or-mwc-input .type="${InputType.CHECKBOX}" id="assign-check"- ?disabled="${disabled}" .label="${i18next.t("alarm.assignedToMe")}"- @or-mwc-input-changed="${(evt: OrInputChangedEvent) => this._onAssignCheckChanged(evt.detail.value)}"- .value="${this.assign}"></or-mwc-input>- <or-mwc-input .type="${InputType.SELECT}" id="severity-select" comfortable- ?disabled="${disabled}" .label="${i18next.t("alarm.severity")}"- @or-mwc-input-changed="${(evt: OrInputChangedEvent) => this._onSeverityChanged(evt.detail.value)}"- .value="${this.severityValue}"- .options="${this._getSeverityOptions().map(s => s.label)}"></or-mwc-input>- <or-mwc-input .type="${InputType.SELECT}" id="status-select" comfortable- ?disabled="${disabled}" .label="${i18next.t("alarm.status")}"- @or-mwc-input-changed="${(evt: OrInputChangedEvent) => this._onStatusChanged(evt.detail.value)}"- .value="${this.statusValue}"- .options="${this._getStatusOptions().map(s => s.label)}"></or-mwc-input>+ <or-vaadin-checkbox id="assign-check" ?disabled=${disabled} ?checked=${this.assign}+ @change=${(ev: Event) => this._onAssignCheckChanged((ev.currentTarget as HTMLInputElement).checked)}>+ <label slot="label"><or-translate value="alarm.assignedToMe"></or-translate></label>+ </or-vaadin-checkbox>+ <or-vaadin-select id="severity-select" ?disabled=${disabled}+ .items=${this._getSeverityOptions()} value=${this.severity ?? 'all'}+ @change=${(ev: Event) => this._onSeverityChanged((ev.currentTarget as OrVaadinSelect).value as AlarmSeverity | 'all')}>+ <or-translate slot="label" value="alarm.severity"></or-translate>+ </or-vaadin-select>+ <or-vaadin-select id="status-select" ?disabled=${disabled}+ .items=${this._getStatusOptions()} value=${this.statusValue}+ @change=${(ev: Event) => this._onStatusChanged((ev.currentTarget as OrVaadinSelect).value as AlarmStatus | 'all' | 'allActive')}>+ <or-translate slot="label" value="alarm.status"></or-translate>+ </or-vaadin-select></div><div class="${this.creationState || this.alarm || assignOnly || readonly ? "hidden" : "panel-title"}"style="justify-content: flex-end;">- <or-mwc-input- type="${InputType.BUTTON}"- icon="plus"- label="${i18next.t("alarm.add")}"- @or-mwc-input-changed="${() => (this.creationState = {alarmModel: this.getNewAlarmModel()})}"- ></or-mwc-input>+ <or-vaadin-button @click=${() => (this.creationState = {alarmModel: this.getNewAlarmModel()})}>+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value="alarm.add"></or-translate>+ </or-vaadin-button></div></div></div>@@ -660,88 +646,63 @@ export class PageAlarms extends Page<AppStateKeyed> {<or-translate value="details"/></h5><!-- alarm details -->- <or-mwc-input class="alarm-input" ?disabled="${!write}"- .label="${i18next.t("alarm.title")}" required- .type="${InputType.TEXT}"- .value="${alarm.title}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- alarm.title = e.detail.value;- this.onAlarmChanged(e);- }}"- ></or-mwc-input>- <or-mwc-input class="alarm-input" ?disabled="${!write}"- .label="${i18next.t("alarm.content")}"- .type="${InputType.TEXTAREA}"- .value="${alarm.content}"- rows="12"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- alarm.content = e.detail.value;- this.onAlarmChanged(e);- }}"- ></or-mwc-input>+ <or-vaadin-text-field class="alarm-input" ?readonly=${!write} required value=${alarm.title}+ @change=${(ev: Event) => {+ alarm.title = (ev.currentTarget as HTMLInputElement).value;+ this.onAlarmChanged(ev);+ }}>+ <or-translate slot="label" value="alarm.title"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-text-area class="alarm-input" ?readonly=${!write} value=${alarm.content} min-rows="12"+ @change=${(ev: Event) => {+ alarm.content = (ev.currentTarget as HTMLInputElement).value;+ this.onAlarmChanged(ev);+ }}>+ <or-translate slot="label" value="alarm.content"></or-translate>+ </or-vaadin-text-area></div><div class="column" id="prop-panel"><h5><or-translate value="properties"/></h5>- <or-mwc-input class="alarm-input hidden" ?disabled="${true}"- ?comfortable=${!this.creationState}- .label="${i18next.t("createdOn")}"- .type="${InputType.DATETIME}"- .value="${new Date(alarm.createdOn)}"- ></or-mwc-input>- <or-mwc-input class="${this.creationState ? "hidden" : "alarm-input"}" ?disabled="${true}"- .label="${i18next.t("alarm.lastModified")}"- .type="${InputType.DATETIME}"- .value="${new Date(alarm.lastModified)}"- ></or-mwc-input>- <or-mwc-input class="alarm-input" ?disabled="${!write || this.creationState || this.alarm}"- .label="${i18next.t("alarm.source")}"- .type="${InputType.TEXT}"- .value="${this._getSourceText()}"- ></or-mwc-input>- <or-mwc-input class="alarm-input" ?disabled="${!write}"- .label="${i18next.t("alarm.severity")}"- .type="${InputType.SELECT}"- .options="${this._getAddSeverityOptions().map(s => s.label)}"- .value="${this._getAddSeverityOptions().filter((obj) => obj.value === alarm.severity).map((obj) => obj.label)[0]}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- alarm.severity = this._getAddSeverityOptions().filter((obj) => obj.label === e.detail.value).map((obj) => obj.value)[0];- this.onAlarmChanged(e);- }}"- ></or-mwc-input>- <or-mwc-input class="alarm-input" ?disabled="${!write}"- .label="${i18next.t("alarm.status")}"- .type="${InputType.SELECT}"- .options="${this._getAddStatusOptions().map(s => s.label)}"- .value="${this._getAddStatusOptions().filter((obj) => obj.value === alarm.status).map((obj) => obj.label)[0]}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- alarm.status = this._getAddStatusOptions().filter((obj) => obj.label === e.detail.value).map((obj) => obj.value)[0];- this.onAlarmChanged(e);- }}"- ></or-mwc-input>- <or-mwc-input class="alarm-input"- ?disabled="${!manager.hasRole("read:users") && !manager.hasRole("read:admin")}"- .label="${i18next.t("alarm.assignee")}"- .type="${InputType.SELECT}"- .options="${this._getUsers().map((obj) => obj.label)}"- .value="${this._getUsers().filter((obj) => obj.label === alarm.assigneeUsername).map((obj) => obj.label)[0]}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- alarm.assigneeId = this._getUsers().filter((obj) => obj.label === e.detail.value).map((obj) => obj.value)[0];- this.onAlarmChanged(e);- }}"- ></or-mwc-input>+ <or-vaadin-text-field class="alarm-input hidden" disabled+ value=${moment(alarm.createdOn).format("LLL")}>+ <or-translate slot="label" value="createdOn"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-text-field class=${this.creationState ? "hidden" : "alarm-input"} disabled+ value=${moment(alarm.lastModified).format("LLL")}>+ <or-translate slot="label" value="alarm.lastModified"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-text-field class="alarm-input" ?disabled=${!write || this.creationState || this.alarm}+ value=${this._getSourceText()}>+ <or-translate slot="label" value="alarm.source"></or-translate>+ </or-vaadin-text-field>++ <or-vaadin-select class="alarm-input" ?readonly=${!write}+ .items=${this._getAddSeverityOptions()} value=${alarm.severity}+ @change=${(ev: Event) => {+ alarm.severity = (ev.currentTarget as OrVaadinSelect).value as AlarmSeverity;+ this.onAlarmChanged(ev);+ }}>+ <or-translate slot="label" value="alarm.severity"></or-translate>+ </or-vaadin-select>++ <or-vaadin-select class="alarm-input"+ ?readonly=${!manager.hasRole("read:users") && !manager.hasRole("read:admin")}+ .items=${this._getUsers()} value=${alarm.assigneeId}+ @change=${(ev: Event) => {+ console.debug(this._getUsers());+ alarm.assigneeId = (ev.currentTarget as OrVaadinSelect).value;+ this.onAlarmChanged(ev);+ }}>+ <or-translate slot="label" value="alarm.assignee"></or-translate>+ </or-vaadin-select><div>- <span style="margin: 0px auto 10px;"><or-translate value="linkedAssets"/>:</span>- <or-mwc-input outlined ?disabled="${!manager.hasRole("write:alarms")}"- style="margin-left: 4px;"- .type="${InputType.BUTTON}"- .label="${i18next.t("selectRestrictedAssets", {- number: alarm.alarmAssetLinks?.length,- })}"- @or-mwc-input-changed="${(ev: MouseEvent) =>- this._openAssetSelector(ev, alarm, readonly)}"- ></or-mwc-input>+ <span><or-translate value="linkedAssets"></or-translate>:</span>+ <or-vaadin-button ?disabled=${!manager.hasRole("write:alarms")} style="margin-left: 4px;"+ @click=${(ev: Event) => this._openAssetSelector(ev, alarm, readonly)}>+ <span>${i18next.t("selectRestrictedAssets", {number: alarm.alarmAssetLinks?.length})}</span>+ </or-vaadin-button></div></div></div>@@ -749,42 +710,35 @@ export class PageAlarms extends Page<AppStateKeyed> {${when(!(readonly && !this._saveAlarmPromise), () => html`<div class="row" style="justify-content: space-between; margin-top: 10px;">${when((manager.hasRole("write:alarms")), () => html`- <or-mwc-input class="alarm-input" style="margin: 0;" outlined- ?disabled="${!manager.hasRole("write:alarms") || !alarm.id}"- .label="${i18next.t("delete")}"- .type="${InputType.BUTTON}"- @or-mwc-input-changed="${() => this._deleteAlarm(this.alarm)}"- ></or-mwc-input>+ <or-vaadin-button class="alarm-input" ?disabled=${!manager.hasRole("write:alarms") || !alarm.id}+ @click=${() => this._deleteAlarm(this.alarm)}>+ <or-translate value="delete"></or-translate>+ </or-vaadin-button>`)}<div>- <or-mwc-input class="alarm-input" style="margin: 0;" outlined- .label="${i18next.t("cancel")}"- .type="${InputType.BUTTON}"- @or-mwc-input-changed="${() => this.reset()}"- ></or-mwc-input>- <or-mwc-input id="savebtn"- style="margin: 0;"- raised class="alarm-input" disabled- .label="${i18next.t(alarm.id ? "save" : "create")}"- .type="${InputType.BUTTON}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- let error: { status?: number; text: string };- this._saveAlarmPromise = this._createUpdateAlarm(alarm, alarm.id ? "update" : "create")- .then(() => {- showSnackbar(undefined, i18next.t("alarm.saveAlarmSucceeded"));- this.reset();- }).catch((ex) => {- if (isAxiosError(ex)) {- error = {- status: ex.response.status,- text: ex.response.status === 403 ? i18next.t("alarm.alarmAlreadyExists") : i18next.t("errorOccurred"),- };- }- }).finally(() => {- this._saveAlarmPromise = undefined;- });- }}"- ></or-mwc-input>+ <or-vaadin-button class="alarm-input" @click=${() => this.reset()}>+ <or-translate value="cancel"></or-translate>+ </or-vaadin-button>+ <or-vaadin-button id="savebtn" class="alarm-input" theme="primary" disabled+ @click=${() => {+ let error: { status?: number; text: string };+ this._saveAlarmPromise = this._createUpdateAlarm(alarm, alarm.id ? "update" : "create")+ .then(() => {+ showSnackbar(undefined, i18next.t("alarm.saveAlarmSucceeded"));+ this.reset();+ }).catch((ex) => {+ if (isAxiosError(ex)) {+ error = {+ status: ex.response.status,+ text: ex.response.status === 403 ? i18next.t("alarm.alarmAlreadyExists") : i18next.t("errorOccurred"),+ };+ }+ }).finally(() => {+ this._saveAlarmPromise = undefined;+ });+ }}>+ <or-translate value=${alarm.id ? "save" : "create"}></or-translate>+ </or-vaadin-button></div></div>`)}@@ -794,24 +748,24 @@ export class PageAlarms extends Page<AppStateKeyed> {}protected _getStatusOptions() {- return [{label: 'alarm.allActive', value: 'All-active'}, {- label: 'alarm.all',- value: 'All'- }].concat(this._getAddStatusOptions());+ return [+ {label: i18next.t('alarm.allActive'), value: 'allActive'},+ {label: i18next.t('alarm.all'), value: 'all'}+ ].concat(this._getAddStatusOptions());}protected _getSeverityOptions() {- return [{label: 'alarm.all', value: 'All'}].concat(this._getAddSeverityOptions());+ return [{label: i18next.t('alarm.all'), value: 'all'}].concat(this._getAddSeverityOptions());}protected _getAddStatusOptions() {const statuses = [AlarmStatus.OPEN, AlarmStatus.ACKNOWLEDGED, AlarmStatus.IN_PROGRESS, AlarmStatus.RESOLVED, AlarmStatus.CLOSED];- return statuses.map(status => ({label: 'alarm.status_' + status, value: status}));+ return statuses.map(status => ({label: i18next.t('alarm.status_' + status), value: status}));}protected _getAddSeverityOptions() {const severities = [AlarmSeverity.LOW, AlarmSeverity.MEDIUM, AlarmSeverity.HIGH];- return severities.map(status => ({label: 'alarm.severity_' + status, value: status}));+ return severities.map(status => ({label: i18next.t('alarm.severity_' + status), value: status}));}protected _getSourceText(): string {@@ -832,19 +786,16 @@ export class PageAlarms extends Page<AppStateKeyed> {return sourceText;}- protected _onSeverityChanged(severity: any) {- if (severity == 'alarm.all') {+ protected _onSeverityChanged(severity: AlarmSeverity | 'all') {+ console.debug(severity);+ if (severity === 'all') {this.severity = undefined;this._loadData();return;}- this.severity = this._getSeverityOptions().filter((obj) => obj.label === severity).map((obj) => obj.value)[0] as AlarmSeverity;-- if (!this.severity) {- return;- }- this._data = this._data!.filter((e) => e.severity === this.severity);+ this.severity = severity;+ this._data = this._data?.filter((e) => e.severity === this.severity);}protected async _onAssignCheckChanged(assign: boolean) {@@ -861,15 +812,14 @@ export class PageAlarms extends Page<AppStateKeyed> {}}- protected _onStatusChanged(status: any) {- if (status == 'alarm.all') {+ protected _onStatusChanged(status: AlarmStatus | 'all' | 'allActive') {+ if (status === 'all') {this.status = undefined;this.allActive = undefined;this.requestUpdate();return;}-- if (status == 'alarm.allActive') {+ if (status === 'allActive') {this.status = undefined;this.allActive = true;this.requestUpdate();@@ -923,9 +873,9 @@ export class PageAlarms extends Page<AppStateKeyed> {return options;}- protected _openAssetSelector(ev: MouseEvent, alarm: AlarmModel, readonly: boolean) {- const openBtn = ev.target as OrMwcInput;- openBtn.disabled = true;+ protected _openAssetSelector(ev: Event, alarm: AlarmModel, readonly: boolean) {+ const openBtn = ev.target as HTMLElement;+ openBtn.toggleAttribute("disabled", true);alarm.previousAssetLinks = alarm.alarmAssetLinks ? [...alarm.alarmAssetLinks] : [];const onAssetSelectionChanged = (e: OrAssetTreeSelectionEvent) => {@@ -970,15 +920,15 @@ export class PageAlarms extends Page<AppStateKeyed> {actionName: "cancel",content: i18next.t("cancel"),action: () => {- openBtn.disabled = false;+ openBtn.toggleAttribute("disabled", false);},},{actionName: "ok",content: "ok",action: () => {- openBtn.disabled = false;- this.onAlarmChanged(this.shadowRoot.querySelector('or-mwc-input') as OrMwcInput);+ openBtn.toggleAttribute("disabled", false);+ this.onAlarmChanged(this.shadowRoot.querySelector('or-vaadin-text-field') as HTMLElement);this.requestUpdate();}}@@ -986,7 +936,7 @@ export class PageAlarms extends Page<AppStateKeyed> {.setDismissAction({actionName: "cancel",action: () => {- openBtn.disabled = false;+ openBtn.toggleAttribute("disabled", false);},}));@@ -1042,14 +992,14 @@ export class PageAlarms extends Page<AppStateKeyed> {});}- protected onAlarmChanged(e: OrInputChangedEvent | OrMwcInput) {- const formElement = e instanceof OrInputChangedEvent ? (e.target as HTMLElement).parentElement : e.parentElement;- const saveBtn = this.shadowRoot.getElementById("savebtn") as OrMwcInput;+ protected onAlarmChanged(e: Event | HTMLElement) {+ const formElement = e instanceof Event ? (e.target as HTMLElement).parentElement : e.parentElement;+ const saveBtn = this.shadowRoot.getElementById("savebtn") as OrVaadinButton;if (formElement) {saveBtn.disabled = Array.from(formElement.children)- .filter((e) => e instanceof OrMwcInput)- .some((input) => !(input as OrMwcInput).valid);+ .filter((e) => e instanceof HTMLInputElement)+ .some((input) => !input.checkValidity());}if (this.alarm && !this.alarm.title) {diff --git a/ui/app/manager/src/pages/page-assets.ts b/ui/app/manager/src/pages/page-assets.tsindex 5060d0953..b83e2721a 100644--- a/ui/app/manager/src/pages/page-assets.ts+++ b/ui/app/manager/src/pages/page-assets.ts@@ -29,7 +29,6 @@ import {Asset, AssetEventCause, WellknownAssets} from "@openremote/model";import "@openremote/or-json-forms";import {getAlarmsRoute, getAssetsRoute, getUsersRoute} from "../routes";import {showSnackbar} from "@openremote/or-mwc-components/or-mwc-snackbar";-import { InputType } from "@openremote/or-mwc-components/or-mwc-input";export interface PageAssetsConfig {viewer?: ViewerConfig;@@ -208,7 +207,9 @@ export class PageAssets extends Page<AssetsStateKeyed> {<div class="multipleAssetsView hideMobile"><div><or-translate value="multiAssetSelected" .options="${ { assetNbr: this._assetIds.length } }"></or-translate>- <or-mwc-input .type="${InputType.BUTTON}" label="changeParent" @or-mwc-input-changed="${() => this._onParentChangeClick()}" outlined></or-mwc-input>+ <or-vaadin-button @click=${() => this._onParentChangeClick()}>+ <or-translate value="changeParent"></or-translate>+ </or-vaadin-button></div></div>`;diff --git a/ui/app/manager/src/pages/page-configuration.ts b/ui/app/manager/src/pages/page-configuration.tsindex 25e1f6bb5..10999856a 100644--- a/ui/app/manager/src/pages/page-configuration.ts+++ b/ui/app/manager/src/pages/page-configuration.ts@@ -33,7 +33,6 @@ import {ManagerAppConfig, MapConfig, Realm} from "@openremote/model";import "@openremote/or-components/or-loading-indicator";import {OrConfRealmCard} from "../components/configuration/or-conf-realm/or-conf-realm-card";import {OrConfPanel} from "../components/configuration/or-conf-panel";-import { InputType } from "@openremote/or-mwc-components/or-mwc-input";import {DefaultHeaderMainMenu, DefaultHeaderSecondaryMenu, DefaultRealmConfig} from "../index";import { showSnackbar } from "@openremote/or-mwc-components/or-mwc-snackbar";@@ -112,7 +111,7 @@ export class PageConfiguration extends Page<AppStateKeyed> {margin-left: 14px;}- #header-actions or-mwc-input {+ #header-actions #save-btn {margin-left: 12px;}@@ -272,9 +271,10 @@ export class PageConfiguration extends Page<AppStateKeyed> {<or-translate value="appearance"></or-translate></div><div id="header-actions">- <or-mwc-input id="save-btn" .disabled="${saveDisabled}" raised type="button" label="save"- @or-mwc-input-changed="${() => this.saveAllConfigs(this.managerConfiguration, this.mapConfig)}"- ></or-mwc-input>+ <or-vaadin-button id="save-btn" theme="primary" ?disabled=${saveDisabled}+ @click=${() => this.saveAllConfigs(this.managerConfiguration, this.mapConfig)}>+ <or-translate value="save"></or-translate>+ </or-vaadin-button></div></div><or-panel .heading="${realmHeading}">@@ -285,11 +285,11 @@ export class PageConfiguration extends Page<AppStateKeyed> {`, () => html`<div class="notFound-container"><span><or-translate value="configuration.managerConfigNotFound"></or-translate></span>- <or-mwc-input type="${InputType.BUTTON}" label="configuration.tryAgain"- @or-mwc-input-changed="${() => this.getManagerConfig().then(val => {- this.managerConfiguration = val;- }).catch(e => console.error(e))}"- ></or-mwc-input>+ <or-vaadin-button style="width: fit-content;" @click=${() => this.getManagerConfig()+ .then(val => { this.managerConfiguration = val; })+ .catch(e => console.error(e))}>+ <or-translate value="configuration.tryAgain"></or-translate>+ </or-vaadin-button></div>`)}</or-panel>@@ -315,11 +315,11 @@ export class PageConfiguration extends Page<AppStateKeyed> {`, () => html`<div class="notFound-container"><span><or-translate value="configuration.mapSettingsNotFound"></or-translate></span>- <or-mwc-input type="${InputType.BUTTON}" label="configuration.tryAgain"- @or-mwc-input-changed="${() => this.getMapConfig().then(val => {- this.mapConfig = val;- }).catch(e => console.error(e))}"- ></or-mwc-input>+ <or-vaadin-button style="width: fit-content;" @click=${() => this.getMapConfig()+ .then(val => { this.mapConfig = val; })+ .catch(e => console.error(e))}>+ <or-translate value="configuration.tryAgain"></or-translate>+ </or-vaadin-button></div>`)}</or-panel>diff --git a/ui/app/manager/src/pages/page-export.ts b/ui/app/manager/src/pages/page-export.tsindex 92e7612d3..239a61018 100644--- a/ui/app/manager/src/pages/page-export.ts+++ b/ui/app/manager/src/pages/page-export.ts@@ -2,11 +2,9 @@ import {css, html, unsafeCSS, TemplateResult} from "lit";import {customElement, property} from "lit/decorators.js";import "@openremote/or-rules";import {Store} from "@reduxjs/toolkit";-import {Page, PageProvider} from "@openremote/or-app";-import {AppStateKeyed} from "@openremote/or-app";+import {Page, PageProvider, AppStateKeyed} from "@openremote/or-app";import {i18next} from "@openremote/or-translate";import manager, { DefaultColor3, Util } from "@openremote/core";-import { InputType, OrInputChangedEvent } from "@openremote/or-mwc-components/or-mwc-input";import {OrAssetAttributePickerPickedEvent, OrAssetAttributePicker} from "@openremote/or-attribute-picker";import { AttributeRef, DatapointExportFormat } from "@openremote/model";import moment from "moment";@@ -17,6 +15,8 @@ import { showSnackbar } from "@openremote/or-mwc-components/or-mwc-snackbar";import { showDialog } from "@openremote/or-mwc-components/or-mwc-dialog";const tableStyle = require("@material/data-table/dist/mdc.data-table.css");import { when } from "lit/directives/when.js";+import {OrVaadinDateTimePicker} from "@openremote/or-vaadin-components/or-vaadin-date-time-picker";+import {OrVaadinSelect} from "@openremote/or-vaadin-components/or-vaadin-select";export function pageExportProvider(store: Store<AppStateKeyed>): PageProvider<AppStateKeyed> {return {@@ -135,7 +135,6 @@ export class PageExport extends Page<AppStateKeyed> {align-items: center;font-size: 14px;text-transform: uppercase;- color: var(--or-app-color4);}.button or-icon {--or-icon-fill: var(--or-app-color4);@@ -207,11 +206,11 @@ export class PageExport extends Page<AppStateKeyed> {@property()protected _loading: boolean = false;- protected _exportFormats: Record<DatapointExportFormat, string> = {- [DatapointExportFormat.CSV]: i18next.t('exportFormatCSV'),- [DatapointExportFormat.CSV_CROSSTAB]: i18next.t('exportFormatCSVCrosstab'),- [DatapointExportFormat.CSV_CROSSTAB_MINUTE]: i18next.t('exportFormatCSVCrosstabMinute')- };+ protected _exportFormats: {value: DatapointExportFormat, label: string}[] = [+ {value: DatapointExportFormat.CSV, label: i18next.t('exportFormatCSV')},+ {value: DatapointExportFormat.CSV_CROSSTAB, label: i18next.t('exportFormatCSVCrosstab')},+ {value: DatapointExportFormat.CSV_CROSSTAB_MINUTE, label: i18next.t('exportFormatCSVCrosstabMinute')}+ ];@property()private selectedFormat: DatapointExportFormat = DatapointExportFormat.CSV;@@ -278,7 +277,10 @@ export class PageExport extends Page<AppStateKeyed> {${this.tableRowsHtml}<tr class="mdc-data-table__row"><td colspan="100%">- <a class="button" @click="${() => this._openDialog()}"><or-icon icon="plus"></or-icon>${i18next.t("addAssetAttribute")}</a>+ <a class="button" style="color: var(--or-app-color4);" @click="${() => this._openDialog()}">+ <or-icon icon="plus"></or-icon>+ ${i18next.t("addAssetAttribute")}+ </a></td></tr></tbody>@@ -286,16 +288,29 @@ export class PageExport extends Page<AppStateKeyed> {</div><div class="options"><div class="timerange-wrapper">- <or-mwc-input .type="${InputType.DATETIME}" label="${Util.capitaliseFirstLetter(i18next.t("exportFrom"))}" .value="${moment(this.oldestTimestamp).toDate()}" @or-mwc-input-changed="${(evt: OrInputChangedEvent) => this.oldestTimestamp = evt.detail.value}"></or-mwc-input>- <or-mwc-input .type="${InputType.DATETIME}" label="${Util.capitaliseFirstLetter(i18next.t("to"))}" .value="${moment(this.latestTimestamp).toDate()}" @or-mwc-input-changed="${(evt: OrInputChangedEvent) => this.latestTimestamp = evt.detail.value}"></or-mwc-input>- </div>- <div>- <or-mwc-input .type="${InputType.SELECT}" label="${i18next.t('exportFormat')}" .value="${this.selectedFormat}" style="width: 100%;" .options="${Object.entries(this._exportFormats)}" @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.selectedFormat = ev.detail.value}"></or-mwc-input>+ <or-vaadin-date-time-picker value=${OrVaadinDateTimePicker.getLocalizedISOString(new Date(this.oldestTimestamp))} style="width: 320px;"+ @change=${(ev: Event) => { this.oldestTimestamp = new Date((ev.currentTarget as OrVaadinDateTimePicker).value).getTime(); }}>+ <or-translate slot="label" value="exportFrom"></or-translate>+ </or-vaadin-date-time-picker>+ <or-vaadin-date-time-picker value=${OrVaadinDateTimePicker.getLocalizedISOString(new Date(this.latestTimestamp))} style="width: 320px;"+ @change=${(ev: Event) => { this.latestTimestamp = new Date((ev.currentTarget as OrVaadinDateTimePicker).value).getTime(); }}>+ <or-translate slot="label" value="to"></or-translate>+ </or-vaadin-date-time-picker></div>+ <or-vaadin-select .items=${this._exportFormats} value=${this.selectedFormat}+ @change=${(ev: Event) => { this.selectedFormat = (ev.currentTarget as OrVaadinSelect).value as DatapointExportFormat; }}>+ <or-translate slot="label" value="exportFormat"></or-translate>+ </or-vaadin-select></div><div class="export-btn-wrapper">- <or-mwc-input .disabled="${this.isClearExportBtnDisabled}" class="button" .type="${InputType.BUTTON}" label="clearTable" @or-mwc-input-changed="${() => this.clearSelection()}"></or-mwc-input>- <or-mwc-input .disabled="${this.isExportBtnDisabled}" class="button" raised .type="${InputType.BUTTON}" label="export" @or-mwc-input-changed="${() => this.export()}"></or-mwc-input>+ <or-vaadin-button class="button" ?disabled=${this.isClearExportBtnDisabled}+ @click=${() => this.clearSelection()}>+ <or-translate value="clearTable"></or-translate>+ </or-vaadin-button>+ <or-vaadin-button class="button" theme="primary" ?disabled=${this.isExportBtnDisabled}+ @click=${() => this.export()}>+ <or-translate value="export"></or-translate>+ </or-vaadin-button></div></div></div>diff --git a/ui/app/manager/src/pages/page-gateway-tunnel.ts b/ui/app/manager/src/pages/page-gateway-tunnel.tsindex 0c799e4b1..a33748088 100644--- a/ui/app/manager/src/pages/page-gateway-tunnel.ts+++ b/ui/app/manager/src/pages/page-gateway-tunnel.ts@@ -7,13 +7,14 @@ import {Task} from "@lit/task";import {Store} from "@reduxjs/toolkit";import {i18next} from "@openremote/or-translate";import {DefaultColor3, manager} from "@openremote/core";-import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import {Asset, AssetQuery, GatewayTunnelInfo, GatewayTunnelInfoType} from "@openremote/model";import {TableColumn, TableRow} from "@openremote/or-mwc-components/or-mwc-table";import {getAssetsRoute} from "../routes";import {OrMwcDialog, showDialog, showOkCancelDialog} from "@openremote/or-mwc-components/or-mwc-dialog";import {showSnackbar} from "@openremote/or-mwc-components/or-mwc-snackbar";import moment from "moment";+import {OrVaadinComboBox} from "@openremote/or-vaadin-components/or-vaadin-combo-box";+import {OrVaadinSelect} from "@openremote/or-vaadin-components/or-vaadin-select";export function pageGatewayTunnelProvider(store: Store<AppStateKeyed>): PageProvider<AppStateKeyed> {return {@@ -129,10 +130,13 @@ export class PageGatewayTunnel extends Page<AppStateKeyed> {<div class="panel"><div class="panel-title" style="justify-content: space-between;"><or-translate value="tunnels"></or-translate>- <or-mwc-input style="margin: 0;" type="${InputType.BUTTON}" icon="plus"- label="${i18next.t('add')} ${i18next.t("tunnel")}"- @or-mwc-input-changed="${(ev) => this._onAddTunnelClick(ev)}"- ></or-mwc-input>+ <or-vaadin-button @click=${() => this._onAddTunnelClick()}>+ <or-icon slot="prefix" icon="plus"></or-icon>+ <span>+ <or-translate value="add"></or-translate>+ <or-translate value="tunnel"></or-translate>+ </span>+ </or-vaadin-button></div>${this._fetchTunnelsTask.render({pending: () => html`${i18next.t('loading')}`,@@ -200,11 +204,17 @@ export class PageGatewayTunnel extends Page<AppStateKeyed> {protected async _getTunnelActionsTemplate(tunnel: GatewayTunnelInfo): Promise<TemplateResult | string> {return html`<div style="display: flex; justify-content: end; align-items: center; gap: 12px;">- <or-mwc-input .type="${InputType.BUTTON}" icon="stop" @or-mwc-input-changed="${(ev) => this._onStopTunnelClick(ev, tunnel)}"></or-mwc-input>+ <or-vaadin-button theme="icon" @click=${(ev: Event) => this._onStopTunnelClick(ev, tunnel)}>+ <or-icon icon="stop"></or-icon>+ </or-vaadin-button>${when(tunnel.type === GatewayTunnelInfoType.TCP, () => html`- <or-mwc-input .type="${InputType.BUTTON}" outlined label="${i18next.t('gatewayTunnels.copyAddress')}" @or-mwc-input-changed="${(ev) => this._onCopyTunnelAddressClick(ev, tunnel)}"></or-mwc-input>+ <or-vaadin-button @click=${(ev: Event) => this._onCopyTunnelAddressClick(ev, tunnel)}>+ <or-translate value="gatewayTunnels.copyAddress"></or-translate>+ </or-vaadin-button>`, () => html`- <or-mwc-input .type="${InputType.BUTTON}" outlined label="${i18next.t('gatewayTunnels.open')}" @or-mwc-input-changed="${(ev) => this._onOpenTunnelClick(ev, tunnel)}"></or-mwc-input>+ <or-vaadin-button @click=${(ev: Event) => this._onOpenTunnelClick(ev, tunnel)}>+ <or-translate value="gatewayTunnels.open"></or-translate>+ </or-vaadin-button>`)}</div>`@@ -214,7 +224,7 @@ export class PageGatewayTunnel extends Page<AppStateKeyed> {* HTML callback event of the 'stop' button in the tunnels table,* meant to stop and delete the constructed tunnel.*/- protected _onStopTunnelClick(ev: OrInputChangedEvent, tunnel: GatewayTunnelInfo) {+ protected _onStopTunnelClick(ev: Event, tunnel: GatewayTunnelInfo) {ev.stopPropagation();showOkCancelDialog(i18next.t("areYouSure"),@@ -249,7 +259,7 @@ export class PageGatewayTunnel extends Page<AppStateKeyed> {* HTML callback event for the 'copy address' button in the tunnels table,* meant for TCP addresses to be copied to the browsers' clipboard.*/- protected _onCopyTunnelAddressClick(ev: OrInputChangedEvent, tunnel: GatewayTunnelInfo): void {+ protected _onCopyTunnelAddressClick(ev: Event, tunnel: GatewayTunnelInfo): void {const address = this._getTunnelAddress(tunnel);if(address) {navigator.clipboard.writeText(address).finally(() => {@@ -265,7 +275,7 @@ export class PageGatewayTunnel extends Page<AppStateKeyed> {* HTML callback event of the 'open' button in the tunnels table,* meant to start tunneling towards that instance*/- protected _onOpenTunnelClick(ev: OrInputChangedEvent, tunnel: GatewayTunnelInfo): void {+ protected _onOpenTunnelClick(ev: Event, tunnel: GatewayTunnelInfo): void {this._navigateToTunnel(tunnel);}@@ -273,7 +283,7 @@ export class PageGatewayTunnel extends Page<AppStateKeyed> {* HTML callback event of the 'add' button above the tunnels table,* meant to start a tunnel towards that instance.*/- protected _onAddTunnelClick(ev: OrInputChangedEvent) {+ protected _onAddTunnelClick() {const tunnel = this._getDefaultTunnelToAdd();let dialog: OrMwcDialog | undefined;@@ -288,34 +298,38 @@ export class PageGatewayTunnel extends Page<AppStateKeyed> {}const gatewayListTemplate = async (): Promise<TemplateResult> => {const gatewayAssets = await this._fetchGatewayAssets();- const items = gatewayAssets.map((g) => [g.id, g.name]);+ const items: {value: any, label: string}[] = gatewayAssets.map(g => ({value: g.id, label: g.name }));+ const types: {value: any, label: string}[] = this.GATEWAY_TUNNEL_PROTOCOL_TYPES.map(g => ({value: g, label: String(g)}))return html`<div style="display: flex; flex-direction: column; gap: 20px; width: 360px;">- <or-mwc-input .type="${InputType.SELECT}" .options="${items}" .value="${tunnel.gatewayId}" label="${i18next.t('gatewayTunnels.selectAsset')}" style="width: 100%;"- @or-mwc-input-changed="${(ev) => {- tunnel.gatewayId = ev.detail.value;- updateActions();- }}"- ></or-mwc-input>- <or-mwc-input .type="${InputType.SELECT}" label="${i18next.t('gatewayTunnels.protocol')}" .value="${tunnel.type}" .options="${this.GATEWAY_TUNNEL_PROTOCOL_TYPES}"- style="width: 100%"- @or-mwc-input-changed="${(ev) => {- tunnel.type = ev.detail.value;- updateActions();- }}"- ></or-mwc-input>- <or-mwc-input .type="${InputType.TEXT}" label="${i18next.t('host')}" .value="${tunnel.target}" style="width: 100%;"- @or-mwc-input-changed="${(ev) => {- tunnel.target = ev.detail.value;- updateActions();- }}"- ></or-mwc-input>- <or-mwc-input .type="${InputType.NUMBER}" label="${i18next.t('port')}" .value="${tunnel.targetPort}" style="width: 100%"- @or-mwc-input-changed="${(ev) => {- tunnel.targetPort = ev.detail.value;- updateActions();- }}"- ></or-mwc-input>+ <or-vaadin-combo-box .items=${items} value="${tunnel.gatewayId}"+ @change=${(ev: Event) => {+ tunnel.gatewayId = (ev.currentTarget as OrVaadinComboBox).value;+ updateActions();+ }}>+ <or-translate slot="label" value="gatewayTunnels.selectAsset"></or-translate>+ </or-vaadin-combo-box>+ <or-vaadin-select .items=${types} value=${tunnel.type}+ @change=${(ev: Event) => {+ tunnel.type = (ev.currentTarget as OrVaadinSelect).value as GatewayTunnelInfoType;+ updateActions();+ }}>+ <or-translate slot="label" value="gatewayTunnels.protocol"></or-translate>+ </or-vaadin-select>+ <or-vaadin-text-field value=${tunnel.target} @change=${(ev: Event) => {+ tunnel.target = (ev.currentTarget as HTMLInputElement).value;+ updateActions();+ }}>+ <or-translate slot="label" value="host"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-number-field value=${tunnel.targetPort} min="0" step="1" @change=${(ev: Event) => {+ const value = (ev.currentTarget as HTMLInputElement).value;+ tunnel.targetPort = value ? Number(value) : undefined;+ updateActions();+ }}>+ <or-translate slot="label" value="port"></or-translate>++ </or-vaadin-number-field></div>`}@@ -422,7 +436,7 @@ export class PageGatewayTunnel extends Page<AppStateKeyed> {this._updateRefreshTimer(response.data);return response.data;} else {- console.warn("No tunnels were received from the manager.")+ console.warn("No tunnels were received from the manager.");}}diff --git a/ui/app/manager/src/pages/page-gateway.ts b/ui/app/manager/src/pages/page-gateway.tsindex 0ab7cdb70..b9409bef9 100644--- a/ui/app/manager/src/pages/page-gateway.ts+++ b/ui/app/manager/src/pages/page-gateway.ts@@ -124,7 +124,7 @@ export class PageGateway extends Page<AppStateKeyed> {}.gateway-sharing-control-child {- margin-left: 20px;+ margin-left: 24px;display: flex;gap: 10px;align-items: center;@@ -257,9 +257,10 @@ export class PageGateway extends Page<AppStateKeyed> {<or-panel ?disabled="${disabled}" heading="${i18next.t("gateway.dataSharing")}"><div class="gateway-status-header">- <or-mwc-input .type="${InputType.BUTTON}" label="JSON" outlined icon="pencil"- @or-mwc-input-changed="${() => this._openConnectionJSONEditor(connection)}"- ></or-mwc-input>+ <or-vaadin-button @click=${() => this._openConnectionJSONEditor(connection)}>+ <or-icon slot="prefix" icon="pencil"></or-icon>+ <or-translate value="JSON"></or-translate>+ </or-vaadin-button></div>${until(this._getContentTemplate(() => this._getDataSharingColumns(connection, this._isDataSharingCustom(connection), disabled)))}</or-panel>@@ -285,7 +286,10 @@ export class PageGateway extends Page<AppStateKeyed> {@or-mwc-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("disabled", !e.detail.value)}"></or-mwc-input></div>- <or-mwc-input label="save" ?disabled="${!this._dirty || !this._invalid || disabled}" .type="${InputType.BUTTON}" raised @or-mwc-input-changed="${() => this._save()}"></or-mwc-input>+ <or-vaadin-button theme="primary" ?disabled=${!this._dirty || !this._invalid || disabled}+ @click=${() => this._save()}>+ <or-translate value="save"></or-translate>+ </or-vaadin-button></div></div>`;@@ -307,29 +311,34 @@ export class PageGateway extends Page<AppStateKeyed> {return html`<div id="gateway-column-1" class="gateway-column"><div></div>- <or-mwc-input id="gateway-host" .label="${i18next.t("host")}" required .type="${InputType.TEXT}" ?disabled="${disabled}" .value="${connection?.host}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("host", e.detail.value)}"- ></or-mwc-input>- <or-mwc-input id="gateway-port" .label="${i18next.t("port")}" .type="${InputType.NUMBER}"- ?disabled="${disabled}" min="1" max="65536" step="1" .value="${connection?.port}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("port", e.detail.value)}"- ></or-mwc-input>- <or-mwc-input id="gateway-realm" .label="${i18next.t("realm")}" required .type="${InputType.TEXT}" ?disabled="${disabled}" .value="${connection?.realm}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("realm", e.detail.value)}"- ></or-mwc-input>+ <or-vaadin-text-field id="gateway-host" required ?disabled=${disabled} value=${connection?.host}+ @change=${(ev: Event) => this._setConnectionProperty("host", (ev.currentTarget as HTMLInputElement).value)}>+ <or-translate slot="label" value="host"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-number-field id="gateway-port" ?disabled=${disabled} min="1" max="65536" step="1" value=${connection?.port}+ @change=${(ev: Event) => this._setConnectionProperty("port", (ev.currentTarget as HTMLInputElement).value)}>+ <or-translate slot="label" value="port"></or-translate>+ </or-vaadin-number-field>+ <or-vaadin-text-field id="gateway-realm" required ?disabled=${disabled} value=${connection?.realm}+ @change=${(ev: Event) => this._setConnectionProperty("realm", (ev.currentTarget as HTMLInputElement).value)}>+ <or-translate slot="label" value="realm"></or-translate>+ </or-vaadin-text-field><div></div></div><div id="gateway-column-2" class="gateway-column"><div></div>- <or-mwc-input id="gateway-clientid" .label="${i18next.t("clientId")}" required .type="${InputType.TEXT}" ?disabled="${disabled}" .value="${connection?.clientId}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("clientId", e.detail.value)}"- ></or-mwc-input>- <or-mwc-input id="gateway-clientsecret" .label="${i18next.t("clientSecret")}" required .type="${InputType.TEXT}" ?disabled="${disabled}" .value="${connection?.clientSecret}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("clientSecret", e.detail.value)}"- ></or-mwc-input>- <or-mwc-input id="gateway-secured" .label="${i18next.t("secured")}" .type="${InputType.CHECKBOX}" style="height: 56px;" ?disabled="${disabled}" .value="${connection?.secured || false}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._setConnectionProperty("secured", e.detail.value)}"- ></or-mwc-input>+ <or-vaadin-text-field id="gateway-clientid" required ?disabled=${disabled} value=${connection?.clientId}+ @change=${(ev: Event) => this._setConnectionProperty("clientId", (ev.currentTarget as HTMLInputElement).value)}>+ <or-translate slot="label" value="clientId"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-text-field id="gateway-clientsecret" required ?disabled=${disabled} value=${connection?.clientSecret}+ @change=${(ev: Event) => this._setConnectionProperty("clientSecret", (ev.currentTarget as HTMLInputElement).value)}>+ <or-translate slot="label" value="clientSecret"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-checkbox id="gateway-secured" ?disabled=${disabled} ?checked=${connection?.secured}+ @change=${(ev: Event) => this._setConnectionProperty("secured", (ev.currentTarget as HTMLInputElement).checked)}>+ <label slot="label"><or-translate value="secured"></or-translate></label>+ </or-vaadin-checkbox></div>`;}@@ -355,26 +364,25 @@ export class PageGateway extends Page<AppStateKeyed> {<div></div>`)}<div class="gateway-sharing-control" style="${controlStyling}">- <or-mwc-input .label="${i18next.t("gateway.limit_sharing_attribute")}" .type="${InputType.CHECKBOX}"- ?disabled="${controlsDisabled}" .value="${controlsDisabled ? undefined : filterChecked}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._onLimitAttributesCheck(e)}"- ></or-mwc-input>+ <or-vaadin-checkbox ?disabled=${controlsDisabled} ?checked=${controlsDisabled ? false : filterChecked}+ @change=${(ev: Event) => this._onLimitAttributesCheck(ev)}>+ <label slot="label"><or-translate value="gateway.limit_sharing_attribute"></or-translate></label>+ </or-vaadin-checkbox><div class="gateway-sharing-control-child">- <or-mwc-input .type="${InputType.BUTTON}" raised ?disabled="${filterDisabled}"- label="${attrAmount || 0} ${i18next.t("gateway.limit_sharing_attribute_selected")}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._onLimitAttributesButtonClick(e)}"- ></or-mwc-input>+ <or-vaadin-button theme="primary" ?disabled=${filterDisabled} @click=${() => this._onLimitAttributesButtonClick()}>+ <span>${attrAmount || 0} <or-translate value="gateway.limit_sharing_attribute_selected"></or-translate></span>+ </or-vaadin-button></div></div>- <div class="gateway-sharing-control" style="${controlStyling}">- <or-mwc-input .label="${i18next.t("gateway.limit_sharing_rate")}" .type="${InputType.CHECKBOX}"- ?disabled="${controlsDisabled}" .value="${!controlsDisabled && interval !== undefined}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._onAttributesIntervalUpdate(e.detail.value ? 1 : undefined)}"- ></or-mwc-input>+ <div class="gateway-sharing-control" style="${controlStyling}">+ <or-vaadin-checkbox ?disabled=${controlsDisabled} ?checked=${!controlsDisabled && interval !== undefined}+ @change=${(ev: Event) => this._onAttributesIntervalUpdate((ev.currentTarget as HTMLInputElement).checked ? 1 : undefined)}>+ <label slot="label"><or-translate value="gateway.limit_sharing_rate"></or-translate></label>+ </or-vaadin-checkbox><div class="gateway-sharing-control-child">- <or-mwc-input .type="${InputType.NUMBER}" compact outlined ?disabled="${intervalDisabled}" .value="${controlsDisabled ? undefined : interval}" style="width: 84px;"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._onAttributesIntervalUpdate(e.detail.value)}"- ></or-mwc-input>+ <or-vaadin-number-field ?disabled=${intervalDisabled} value=${controlsDisabled ? undefined : interval} min="0" style="width: 84px"+ @change=${(ev: Event) => this._onAttributesIntervalUpdate(Number((ev.currentTarget as HTMLInputElement)?.value ?? 0))}>+ </or-vaadin-number-field><or-translate value="gateway.limit_sharing_rate_suffix"></or-translate></div></div>@@ -387,10 +395,10 @@ export class PageGateway extends Page<AppStateKeyed> {return html`<div id="gateway-column-4" class="gateway-column"><div class="gateway-sharing-control" style="${controlStyling}">- <or-mwc-input .label="${i18next.t("gateway.assetSyncRulesEnable")}" .type="${InputType.CHECKBOX}"- ?disabled="${disabled}" .value="${!!connection.assetSyncRules}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._onAssetSyncRulesToggle(!!e.detail.value)}"- ></or-mwc-input>+ <or-vaadin-checkbox ?disabled=${disabled} ?checked=${!!connection.assetSyncRules}+ @change=${(ev: Event) => this._onAssetSyncRulesToggle((ev.currentTarget as HTMLInputElement).checked)}>+ <label slot="label"><or-translate value="gateway.assetSyncRulesEnable"></or-translate></label>+ </or-vaadin-checkbox><div class="gateway-sharing-control-child"><or-mwc-input .type="${InputType.JSON_OBJECT}" ?disabled="${disabled || !connection.assetSyncRules}".value="${connection?.assetSyncRules}"@@ -407,11 +415,12 @@ export class PageGateway extends Page<AppStateKeyed> {/*** HTML callback for checking the "limit data sharing by attribute" checkbox.*/- protected _onLimitAttributesCheck(ev: OrInputChangedEvent) {+ protected _onLimitAttributesCheck(ev: Event) {+ const value = (ev.currentTarget as HTMLInputElement).checked;const attrFilters = this._connection.attributeFilters;if(attrFilters?.length > 0) {attrFilters?.forEach(filter => {- if(ev.detail.value) {+ if(value) {filter.matcher = {};} else {delete filter.matcher;@@ -420,7 +429,7 @@ export class PageGateway extends Page<AppStateKeyed> {});this._updateAttributeFilters(attrFilters);} else {- this._updateAttributeFilters(ev.detail.value ? [{ matcher: {} }] as GatewayAttributeFilter[] : undefined);+ this._updateAttributeFilters(value ? [{ matcher: {} }] as GatewayAttributeFilter[] : undefined);}}@@ -428,7 +437,7 @@ export class PageGateway extends Page<AppStateKeyed> {* HTML callback for clicking the "X attributes selected" button.* Here, it opens an attribute picker and handles its callback.*/- protected _onLimitAttributesButtonClick(_ev: OrInputChangedEvent) {+ protected _onLimitAttributesButtonClick() {const selectedAttrs = this._getAttrDescriptorMapFromFilters(this._connection.attributeFilters);const dialog = showDialog(new OrAssetTypeAttributePicker().setSelectedAttributes(selectedAttrs).setMultiSelect(true));dialog.addEventListener(OrAssetTypeAttributePickerPickedEvent.NAME, (ev) => {diff --git a/ui/app/manager/src/pages/page-provisioning.ts b/ui/app/manager/src/pages/page-provisioning.tsindex a8825735f..b1158a9b7 100644--- a/ui/app/manager/src/pages/page-provisioning.ts+++ b/ui/app/manager/src/pages/page-provisioning.ts@@ -8,10 +8,12 @@ import {AppStateKeyed, Page, PageProvider} from "@openremote/or-app";import {ClientRole, ProvisioningConfig, X509ProvisioningData} from "@openremote/model";import {i18next} from "@openremote/or-translate";import {OrIcon} from "@openremote/or-icon";-import {InputType, OrInputChangedEvent, OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";+import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import {showOkCancelDialog} from "@openremote/or-mwc-components/or-mwc-dialog";import {showSnackbar} from "@openremote/or-mwc-components/or-mwc-snackbar";import {GenericAxiosResponse} from "@openremote/rest";+import {OrVaadinSelect} from "@openremote/or-vaadin-components/or-vaadin-select";+import {OrVaadinMultiSelectComboBox} from "@openremote/or-vaadin-components/or-vaadin-multi-select-combo-box";const tableStyle = require("@material/data-table/dist/mdc.data-table.css");@@ -101,11 +103,6 @@ export class PageProvisioning extends Page<AppStateKeyed> {td, th {width: 25%}-- or-mwc-input {- margin-bottom: 20px;- margin-right: 16px;- }or-icon {vertical-align: middle;@@ -120,6 +117,7 @@ export class PageProvisioning extends Page<AppStateKeyed> {flex-direction: row;margin: 10px 0;flex: 1 1 0;+ gap: 16px;}.column {@@ -128,6 +126,7 @@ export class PageProvisioning extends Page<AppStateKeyed> {margin: 0px;flex: 1 1 0;max-width: 50%;+ gap: 16px;}.mdc-data-table__header-cell {@@ -147,7 +146,7 @@ export class PageProvisioning extends Page<AppStateKeyed> {flex-direction: row;overflow: hidden;max-height: 0;- padding-left: 16px;+ padding: 0 16px;}.item-row.expanded .item-row-content {@@ -204,9 +203,9 @@ export class PageProvisioning extends Page<AppStateKeyed> {@state()protected _configs?: ProvisioningConfig<any, any>[];@state()- protected _roleOptions?: [string, string][];+ protected _roleOptions?: {value: any, label: string}[];@state()- protected _realmOptions?: string[];+ protected _realmOptions?: {value: any, label: string}[];@state()protected _configFilter: (configs: ProvisioningConfig<any, any>[]) => ProvisioningConfig<any, any>[] = (configs) => configs;@@ -243,9 +242,10 @@ export class PageProvisioning extends Page<AppStateKeyed> {<div class="panel"><div class="panel-title" style="justify-content: space-between;"><p><or-translate value="provisioningConfigs"></or-translate></p>- <or-mwc-input style="margin: 0; text-transform: none;" type="${InputType.TEXT}" iconTrailing="magnify" placeholder="${i18next.t('search')}" compact outlined- @input="${(ev: InputEvent) => this.onConfigSearch(ev)}"- ></or-mwc-input>+ <or-vaadin-text-field placeholder=${i18next.t("search")} style="width: 240px;"+ @input=${(ev: InputEvent) => this.onConfigSearch(ev)}>+ <or-icon slot="suffix" icon="magnify"></or-icon>+ </or-vaadin-text-field></div><div id="table-users" class="mdc-data-table"><table class="mdc-data-table__table" aria-label="attribute list">@@ -327,8 +327,8 @@ export class PageProvisioning extends Page<AppStateKeyed> {return;}- this._realmOptions = realmResponse.data.map(r => r.name);- this._roleOptions = rolesResponse.data.filter(role => !role.composite).map(r => [r.name, r.name] as [string, string]).sort();+ this._realmOptions = realmResponse.data.map(r => ({value: r.name, label: r.displayName}));+ this._roleOptions = rolesResponse.data.filter(role => !role.composite).map(r => ({value: r.name, label: r.name})).sort();this._configs = provisioningResponse.data;}@@ -382,16 +382,14 @@ export class PageProvisioning extends Page<AppStateKeyed> {const data = config.data as X509ProvisioningData;typeColumnContents = html`- <or-mwc-input label="${i18next.t("CACertPem")}" required- .type="${InputType.TEXTAREA}"- .value="${data.CACertPEM}"- resizeVertical- @or-mwc-input-changed="${(e: OrInputChangedEvent) => { data.CACertPEM = e.detail.value; this.requestUpdate(); }}"></or-mwc-input>- <or-mwc-input label="${i18next.t("ignoreExpiryDate")}"- .type="${InputType.CHECKBOX}"- .value="${data.ignoreExpiryDate}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => data.ignoreExpiryDate = !e.detail.value}"- style="height: 56px;"></or-mwc-input>+ <or-vaadin-text-area required value=${data.CACertPEM}+ @change=${(ev: Event) => { data.CACertPEM = (ev.currentTarget as HTMLInputElement).value; this.requestUpdate(); }}>+ <or-translate slot="label" value="CACertPem"></or-translate>+ </or-vaadin-text-area>+ <or-vaadin-checkbox ?checked=${data.ignoreExpiryDate}+ @change=${(ev: Event) => data.ignoreExpiryDate = !(ev.currentTarget as HTMLInputElement).checked}>+ <label slot="label"><or-translate value="ignoreExpiryDate"></or-translate></label>+ </or-vaadin-checkbox>`;} else {typeColumnContents = html`@@ -420,41 +418,39 @@ export class PageProvisioning extends Page<AppStateKeyed> {<div class="item-row-content"><div class="row"><div class="column">- <or-mwc-input label="${i18next.t("name")}"- .type="${InputType.TEXT}" min="1" required- .value="${config.name}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => { config.name = e.detail.value; this.requestUpdate(); }}"></or-mwc-input>- <or-mwc-input ?disabled="${!!config.id}" required- label="${i18next.t("type")}"- .type="${InputType.SELECT}"- .options="${[["x509", "X.509"]]}"- .value="${!config.type ? "x509" : config.type}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => config.type = e.detail.value}"></or-mwc-input>- <or-mwc-input ?disabled="${!!config.id}" required- label="${i18next.t("realm")}"- .type="${InputType.SELECT}"- .options="${this._realmOptions}"- .value="${config.realm}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => { config.realm = e.detail.value; this.requestUpdate(); }}"></or-mwc-input>- <or-mwc-input ?disabled="${!!config.id}"- .value="${config.userRoles}"- .type="${InputType.SELECT}" multiple- .options="${this._roleOptions}"- label="${i18next.t("role_plural")}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => config.userRoles = e.detail.value as ClientRole[]}"></or-mwc-input>+ <or-vaadin-text-field required minlength="1" maxlength="255" value=${config.name}+ @change=${(ev: Event) => { config.name = (ev.currentTarget as HTMLInputElement).value; this.requestUpdate(); }}>+ <or-translate slot="label" value="name"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-select required readonly+ .items=${[{value: "x509", label: "X.509"}]}+ value=${!config.type ? "x509" : config.type}>+ <or-translate slot="label" value="type"></or-translate>+ </or-vaadin-select>+ <or-vaadin-select required ?readonly=${!!config.id}+ .items=${this._realmOptions} value=${config.realm}+ @change=${(ev: Event) => { config.realm = (ev.currentTarget as OrVaadinSelect).value; this.requestUpdate(); }}>+ <or-translate slot="label" value="realm"></or-translate>+ </or-vaadin-select>+ <or-vaadin-multi-select-combo-box ?readonly=${!!config.id}+ .items=${this._roleOptions}+ .selectedItems=${this._roleOptions?.filter(r => config.userRoles?.includes(r.value))}+ @change=${(ev: Event) => { config.userRoles = (ev.currentTarget as OrVaadinMultiSelectComboBox).selectedItems.map(i => i.value as ClientRole)}}>+ <or-translate slot="label" value="role_plural"></or-translate>+ </or-vaadin-multi-select-combo-box><or-mwc-input label="${i18next.t("assetTemplate")}".type="${InputType.JSON}".value="${config.assetTemplate ? JSON.stringify(JSON.parse(config.assetTemplate), null, 2) : undefined}"resizeVertical@or-mwc-input-changed="${(e: OrInputChangedEvent) => config.assetTemplate = e.detail.value ? JSON.stringify(e.detail.value) : undefined}"></or-mwc-input>- <or-mwc-input label="${i18next.t("createAsRestrictedUser")}"- .type="${InputType.CHECKBOX}"- .value="${config.restrictedUser}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => config.restrictedUser = e.detail.value}"></or-mwc-input>- <or-mwc-input label="${i18next.t("disabled")}"- .type="${InputType.CHECKBOX}"- .value="${config.disabled}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => config.disabled = e.detail.value}"></or-mwc-input>+ <or-vaadin-checkbox ?checked=${config.restrictedUser}+ @change=${(ev: Event) => config.restrictedUser = (ev.currentTarget as HTMLInputElement).checked}>+ <label slot="label"><or-translate value="createAsRestrictedUser"></or-translate></label>+ </or-vaadin-checkbox>+ <or-vaadin-checkbox ?checked=${config.disabled}+ @change=${(ev: Event) => config.disabled = (ev.currentTarget as HTMLInputElement).checked}>+ <label slot="label"><or-translate value="disabled"></or-translate></label>+ </or-vaadin-checkbox></div><div class="column">@@ -462,20 +458,22 @@ export class PageProvisioning extends Page<AppStateKeyed> {</div></div>- <div class="row" style="margin-bottom: 0;">- ${config.id ? html`<or-mwc-input label="delete"- .type="${InputType.BUTTON}"- @or-mwc-input-changed="${() => this._deleteConfig(config)}"></or-mwc-input>+ <div class="row" style="justify-content: space-between; margin: 16px 0;">+ ${config.id ? html`+ <or-vaadin-button @click=${() => this._deleteConfig(config)}>+ <or-translate value="delete"></or-translate>+ </or-vaadin-button>` : ``}- ${!config.id ? html`<or-mwc-input label="cancel"- .type="${InputType.BUTTON}"- @or-mwc-input-changed="${() => addCancel()}"></or-mwc-input>+ ${!config.id ? html`+ <or-vaadin-button @click=${() => addCancel()}>+ <or-translate value="cancel"></or-translate>+ </or-vaadin-button>` : ``}- <or-mwc-input class="savebtn" style="margin-left: auto;"- label="${config.id ? "save" : "create"}"- .type="${InputType.BUTTON}"- ?disabled="${!config.id && (!config.name || !config.realm || !config.type || !(config.data as X509ProvisioningData)?.CACertPEM)}"- @or-mwc-input-changed="${() => this._createUpdateConfig(config)}"></or-mwc-input>+ <or-vaadin-button class="savebtn" theme="primary"+ ?disabled=${!config.id && (!config.name || !config.realm || !config.type || !(config.data as X509ProvisioningData)?.CACertPEM)}+ @click=${() => this._createUpdateConfig(config)}>+ <or-translate value=${config.id ? "save" : "create"}></or-translate>+ </or-vaadin-button></div></div></td>@@ -484,7 +482,7 @@ export class PageProvisioning extends Page<AppStateKeyed> {}protected onConfigSearch(ev: InputEvent) {- const value = (ev.target as OrMwcInput).nativeValue?.toLowerCase();+ const value = (ev.target as HTMLInputElement).value?.toLowerCase();if (!value) {this._configFilter = (configs) => configs;} else {diff --git a/ui/app/manager/src/pages/page-realms.ts b/ui/app/manager/src/pages/page-realms.tsindex 3bd532bf6..23b3bbd44 100644--- a/ui/app/manager/src/pages/page-realms.ts+++ b/ui/app/manager/src/pages/page-realms.ts@@ -10,10 +10,11 @@ import {AppStateKeyed, Page, PageProvider} from "@openremote/or-app";import {ClientRole, Realm} from "@openremote/model";import {i18next} from "@openremote/or-translate";import {OrIcon} from "@openremote/or-icon";-import {Util} from "@openremote/core"-import {InputType, OrInputChangedEvent, OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";+import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import {DialogAction, OrMwcDialog, showDialog} from "@openremote/or-mwc-components/or-mwc-dialog";import {showSnackbar} from "@openremote/or-mwc-components/or-mwc-snackbar";+import {OrVaadinTextField} from "@openremote/or-vaadin-components/or-vaadin-text-field";+import {OrVaadinButton} from "@openremote/or-vaadin-components/or-vaadin-button";const tableStyle = require("@material/data-table/dist/mdc.data-table.css");@@ -115,12 +116,7 @@ export class PageRealms extends Page<AppStateKeyed> {overflow: hidden;max-height: 0;transition: max-height 0.25s ease-out;- padding-left: 16px;- }-- or-mwc-input {- margin-bottom: 20px;- margin-right: 16px;+ padding: 0 16px;}or-icon {@@ -136,6 +132,7 @@ export class PageRealms extends Page<AppStateKeyed> {flex-direction: row;margin: 10px 0;flex: 1 1 0;+ gap: 16px;}.column {@@ -143,7 +140,7 @@ export class PageRealms extends Page<AppStateKeyed> {flex-direction: column;margin: 0px;flex: 1 1 0;-+ gap: 16px;}.mdc-data-table__header-cell {@@ -234,10 +231,23 @@ export class PageRealms extends Page<AppStateKeyed> {return "realm_plural";}- protected _onRealmNameChanged(e: OrInputChangedEvent, realm: Realm): void {- realm.name = e.detail.value;- const isDuplicate = this._realms.some(r => r !== realm && r.name === realm.name);- (e.target as OrMwcInput).setCustomValidity(isDuplicate ? i18next.t('realmAlreadyExists') : undefined);+ protected _onRealmNameChanged(e: Event, realm: Realm): void {+ const elem = e.currentTarget as OrVaadinTextField;+ if(!elem.checkValidity()) {+ console.debug("The realm name was invalid.");+ elem.errorMessage = i18next.t("invalidRealm");+ elem.invalid = true;+ return;+ }+ const isDuplicate = this._realms.some(r => r !== realm && r.name === elem.value);+ if(isDuplicate) {+ console.debug("The realm name was a duplicate.");+ elem.errorMessage = i18next.t("realmAlreadyExists");+ elem.invalid = true;+ return;+ }+ elem.invalid = false;+ realm.name = elem.value;this.requestUpdate();}@@ -286,9 +296,10 @@ export class PageRealms extends Page<AppStateKeyed> {<div class="panel"><div class="panel-title" style="justify-content: space-between;"><p><or-translate value="realm_plural"></or-translate></p>- <or-mwc-input style="margin: 0; text-transform: none;" type="${InputType.TEXT}" iconTrailing="magnify" placeholder="${i18next.t('search')}" compact outlined- @input="${(ev: InputEvent) => this.onRealmSearch(ev)}"- ></or-mwc-input>+ <or-vaadin-text-field placeholder=${i18next.t('search')} style="width: 240px;"+ @input=${(ev: InputEvent) => this.onRealmSearch(ev)}>+ <or-icon slot="suffix" icon="magnify"></or-icon>+ </or-vaadin-text-field></div><div id="table-roles" class="mdc-data-table"><table class="mdc-data-table__table" aria-label="realm list" >@@ -324,27 +335,49 @@ export class PageRealms extends Page<AppStateKeyed> {<div class="row"><div class="column">- <or-mwc-input ?readonly="${realm.id}" label="${i18next.t("realm")}" .type="${InputType.TEXT}" min="1" required .value="${realm.name}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._onRealmNameChanged(e, realm)}"></or-mwc-input>- <or-mwc-input ?readonly="${readonly}" label="${i18next.t("loginTheme", Util.camelCaseToSentenceCase("loginTheme"))}" .type="${InputType.TEXT}" .value="${realm.loginTheme}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => realm.loginTheme = e.detail.value}"></or-mwc-input>- <or-mwc-input ?readonly="${readonly}" label="${i18next.t("resetPasswordAllowed")}" .type="${InputType.SWITCH}" min="1" .value="${realm.resetPasswordAllowed}" @or-mwc-input-changed="${(e: OrInputChangedEvent) =>realm.resetPasswordAllowed = e.detail.value}"></or-mwc-input>- <or-mwc-input ?readonly="${readonly}" label="${i18next.t("enabled")}" .type="${InputType.SWITCH}" min="1" .value="${realm.enabled}" @or-mwc-input-changed="${(e: OrInputChangedEvent) =>realm.enabled = e.detail.value}"></or-mwc-input>- <or-mwc-input ?readonly="${readonly}" label="${i18next.t("rememberMe")}" .type="${InputType.SWITCH}" min="1" .value="${realm.rememberMe}" @or-mwc-input-changed="${(e: OrInputChangedEvent) =>realm.rememberMe = e.detail.value}"></or-mwc-input>+ <or-vaadin-text-field ?readonly=${realm.id} minlength="2" maxlength="255" required manual-validation value=${realm.name}+ @change=${(ev: Event) => this._onRealmNameChanged(ev, realm)}>+ <or-translate slot="label" value="realm"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-text-field ?readonly=${readonly} maxlength="255" value=${realm.loginTheme}+ @change=${(ev: Event) => realm.loginTheme = (ev.currentTarget as HTMLInputElement).value}>+ <or-translate slot="label" value="loginTheme"></or-translate>+ </or-vaadin-text-field>+ <or-mwc-input ?readonly="${readonly}" label="${i18next.t("resetPasswordAllowed")}" .type="${InputType.SWITCH}" min="1" .value="${realm.resetPasswordAllowed}" @or-mwc-input-changed="${(e: OrInputChangedEvent) =>realm.resetPasswordAllowed = e.detail.value}"></or-mwc-input>+ <or-mwc-input ?readonly="${readonly}" label="${i18next.t("enabled")}" .type="${InputType.SWITCH}" min="1" .value="${realm.enabled}" @or-mwc-input-changed="${(e: OrInputChangedEvent) =>realm.enabled = e.detail.value}"></or-mwc-input>+ <or-mwc-input ?readonly="${readonly}" label="${i18next.t("rememberMe")}" .type="${InputType.SWITCH}" min="1" .value="${realm.rememberMe}" @or-mwc-input-changed="${(e: OrInputChangedEvent) =>realm.rememberMe = e.detail.value}"></or-mwc-input></div><div class="column">- <or-mwc-input label="${i18next.t("displayName")}" .type="${InputType.TEXT}" min="1" required .value="${realm.displayName}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => { realm.displayName = e.detail.value; this.requestUpdate(); }}"></or-mwc-input>- <or-mwc-input ?readonly="${readonly}" label="${i18next.t("emailTheme", Util.camelCaseToSentenceCase("emailTheme"))}" .type="${InputType.TEXT}" .value="${realm.emailTheme}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => realm.emailTheme = e.detail.value}"></or-mwc-input>+ <or-vaadin-text-field ?readonly=${readonly} minlength="1" maxlength="255" required value=${realm.displayName} error-message=${i18next.t("invalidRealm")}+ @change=${(ev: Event) => { realm.displayName = (ev.currentTarget as HTMLInputElement).value; this.requestUpdate(); }}>+ <or-translate slot="label" value="displayName"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-text-field ?readonly=${readonly} maxlength="255" value=${realm.emailTheme}+ @change=${(ev: Event) => realm.emailTheme = (ev.currentTarget as HTMLInputElement).value}>+ <or-translate slot="label" value="emailTheme"></or-translate>+ </or-vaadin-text-field></div></div>- <div class="row" style="margin-bottom: 0;">+ <div class="row" style="justify-content: space-between; margin-bottom: 8px;">${realm.id && !readonly ? html`${realm.name !== "master" && manager.isSuperUser() ? html`- <or-mwc-input label="delete" .type="${InputType.BUTTON}" .disabled="${manager.displayRealm === realm.name}" @or-mwc-input-changed="${() => this._deleteRealm(realm)}"></or-mwc-input>+ <or-vaadin-button ?disabled=${manager.displayRealm === realm.name}+ @click=${() => this._deleteRealm(realm)}>+ <or-translate value="delete"></or-translate>+ </or-vaadin-button>` : ``}- <or-mwc-input style="margin-left: auto;" label="save" .type="${InputType.BUTTON}" @or-mwc-input-changed="${() => this._updateRealm(realm)}"></or-mwc-input>+ <or-vaadin-button theme="primary" style="margin-left: auto;" @click=${() => this._updateRealm(realm)}>+ <or-translate value="save"></or-translate>+ </or-vaadin-button>` : !readonly ? html`- <or-mwc-input label="cancel" .type="${InputType.BUTTON}" @or-mwc-input-changed="${() => {this._realms.splice(-1,1); this._realms = [...this._realms]}}"></or-mwc-input>- <or-mwc-input ?disabled="${!realm.name || !realm.displayName || this._realms.some(r => r !== realm && r.name === realm.name)}" style="margin-left: auto;" label="create" .type="${InputType.BUTTON}" @or-mwc-input-changed="${() => this._createRealm(realm)}"></or-mwc-input>+ <or-vaadin-button @click=${() => {this._realms.splice(-1,1); this._realms = [...this._realms]}}>+ <or-translate value="cancel"></or-translate>+ </or-vaadin-button>+ <or-vaadin-button theme="primary" ?disabled=${!realm.name || !realm.displayName || this._realms.some(r => r !== realm && r.name === realm.name)}+ @click=${() => this._createRealm(realm)}>+ <or-translate value="create"></or-translate>+ </or-vaadin-button>`: ``}</div></div>@@ -403,7 +436,7 @@ export class PageRealms extends Page<AppStateKeyed> {private _deleteRealm(realm: Realm) {let confirmedName = "";- let okBtnRef: Ref<OrMwcInput> = createRef();+ let okBtnRef: Ref<OrVaadinButton> = createRef();const doDelete = async (dialog: OrMwcDialog) => {if (okBtnRef.value.disabled) return;@@ -425,7 +458,9 @@ export class PageRealms extends Page<AppStateKeyed> {const dialogContent = html`<div><p style="text-align: justify; font-weight: bold;">${i18next.t("realmDeleteConfirm", {realmName: realm.name})}</p>- <or-mwc-input .type="${InputType.TEXT}" @input=${(ev: Event) => inputChanged((ev.target as OrMwcInput).nativeValue)} label="${i18next.t("realm")}"></or-mwc-input>+ <or-vaadin-text-field @input=${(ev: Event) => inputChanged((ev.currentTarget as HTMLInputElement).value)}>+ <or-translate slot="label" value="realm"></or-translate>+ </or-vaadin-text-field></div>`;const dialogActions: DialogAction[] = [@@ -469,7 +504,7 @@ export class PageRealms extends Page<AppStateKeyed> {}protected onRealmSearch(ev: InputEvent) {- const value = (ev.target as OrMwcInput).nativeValue?.toLowerCase();+ const value = (ev.target as HTMLInputElement).value?.toLowerCase();if (!value) {this._realmFilter = (realms) => realms;} else {@@ -480,11 +515,6 @@ export class PageRealms extends Page<AppStateKeyed> {}}- private async _doDelete(realm) {- await manager.rest.api.RealmResource.delete(realm.realm);- this._realms = [...this._realms.filter(u => u.id != realm.id)];- }-private expanderToggle(ev: MouseEvent, index:number) {const metaRow = this.shadowRoot.getElementById('realm-row-'+index)const expanderIcon = this.shadowRoot.getElementById('mdc-data-table-icon-'+index) as OrIcondiff --git a/ui/app/manager/src/pages/page-roles.ts b/ui/app/manager/src/pages/page-roles.tsindex e6982b38c..4c7f66f12 100644--- a/ui/app/manager/src/pages/page-roles.ts+++ b/ui/app/manager/src/pages/page-roles.ts@@ -15,8 +15,8 @@ import {AppStateKeyed} from "@openremote/or-app";import { ClientRole, Role } from "@openremote/model";import { i18next } from "@openremote/or-translate";import { OrIcon } from "@openremote/or-icon";-import { InputType, OrInputChangedEvent, OrMwcInput } from "@openremote/or-mwc-components/or-mwc-input";import {showOkCancelDialog} from "@openremote/or-mwc-components/or-mwc-dialog";+import {OrVaadinTextField} from "@openremote/or-vaadin-components/or-vaadin-text-field";const tableStyle = require("@material/data-table/dist/mdc.data-table.css");@@ -121,11 +121,6 @@ export class PageRoles extends Page<AppStateKeyed> {padding-right: 16px;}- or-mwc-input {- margin-bottom: 10px;- margin-right: 16px;- }-or-icon {vertical-align: middle;--or-icon-width: 20px;@@ -139,6 +134,7 @@ export class PageRoles extends Page<AppStateKeyed> {flex-direction: row;margin: 10px 0;flex: 1 1 0;+ gap: 16px;}.column {@@ -245,10 +241,21 @@ export class PageRoles extends Page<AppStateKeyed> {return "role_plural";}- protected _onRoleNameChanged(e: OrInputChangedEvent, role: Role): void {- role.name = e.detail.value;- const isDuplicate = this._compositeRoles.some(r => r !== role && r.name === role.name);- (e.target as OrMwcInput).setCustomValidity(isDuplicate ? i18next.t('roleAlreadyExists') : undefined);+ protected _onRoleNameChanged(e: Event, role: Role): void {+ const elem = e.currentTarget as OrVaadinTextField;+ if(!elem.checkValidity()) {+ elem.invalid = true;+ elem.errorMessage = i18next.t("roleInvalid");+ return;+ }+ const isDuplicate = this._compositeRoles.some(r => r !== role && r.name === elem.value);+ if(isDuplicate) {+ elem.invalid = true;+ elem.errorMessage = i18next.t("roleAlreadyExists");+ return;+ }+ elem.invalid = false;+ role.name = elem.value;this.requestUpdate();}@@ -303,8 +310,8 @@ export class PageRoles extends Page<AppStateKeyed> {this._updateRoles()}- private addRemoveRole(e, r, index) {- if(e.detail.value) {+ private addRemoveRole(ev: Event, r, index) {+ if((ev.currentTarget as HTMLInputElement).checked) {this._compositeRoles[index].compositeRoleIds = [...this._compositeRoles[index].compositeRoleIds, r.id]} else {this._compositeRoles[index].compositeRoleIds = this._compositeRoles[index].compositeRoleIds.filter(id=> id !== r.id)@@ -353,9 +360,10 @@ export class PageRoles extends Page<AppStateKeyed> {<div class="panel"><div class="panel-title" style="justify-content: space-between;"><p style="margin: 0;"><or-translate value="role"></or-translate></p>- <or-mwc-input style="margin: 0; text-transform: none;" type="${InputType.TEXT}" iconTrailing="magnify" placeholder="${i18next.t('search')}" compact outlined- @input="${(ev: InputEvent) => this.onRoleSearch(ev)}"- ></or-mwc-input>+ <or-vaadin-text-field placeholder=${i18next.t("search")} style="width: 240px;"+ @input=${(ev: InputEvent) => this.onRoleSearch(ev)}>+ <or-icon slot="suffix" value="magnify"></or-icon>+ </or-vaadin-text-field></div><div id="table-roles" class="mdc-data-table"><table class="mdc-data-table__table" aria-label="attribute list">@@ -393,46 +401,72 @@ export class PageRoles extends Page<AppStateKeyed> {<div class="row"><div class="column">- <or-mwc-input label="${i18next.t("role")}" .type="${InputType.TEXT}" min="1" required .value="${role.name || undefined}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._onRoleNameChanged(e, role)}"></or-mwc-input>+ <or-vaadin-text-field minlength="1" maxlength="255" required manual-validation value=${role.name}+ @change=${(ev: Event) => this._onRoleNameChanged(ev, role)}>+ <or-translate slot="label" value="role"></or-translate>+ </or-vaadin-text-field></div><div class="column">- <or-mwc-input label="${i18next.t("description")}" .type="${InputType.TEXT}" min="1" required .value="${role.description}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => role.description = e.detail.value}"></or-mwc-input>+ <or-vaadin-text-field minlength="1" maxlength="255" required value=${role.description}+ @change=${(ev: Event) => {role.description = (ev.currentTarget as HTMLInputElement).value; this.requestUpdate()}}>+ <or-translate slot="label" value="description"></or-translate>+ </or-vaadin-text-field></div></div><div class="row"><div class="column">- <strong class="column-title"><or-translate value="readPermissions"></or-translate></strong> ${readRoles.map(r => {- return html`- <or-mwc-input ?readonly="${readonly}" .label="${r.name.split(":")[1]}: ${r.description}" .type="${InputType.CHECKBOX}" .value="${role.compositeRoleIds && role.compositeRoleIds.find(id => id === r.id)}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.addRemoveRole(e, r, index)}"></or-mwc-input>- ` })}-+ <strong class="column-title"><or-translate value="readPermissions"></or-translate></strong>+ ${readRoles.map(r => html`+ <or-vaadin-checkbox ?readonly=${readonly}+ ?checked=${role.compositeRoleIds && role.compositeRoleIds.find(id => id === r.id)}+ @change=${(ev: Event) => this.addRemoveRole(ev, r, index)}>+ <label slot="label">${r.name.split(":")[1]}: ${r.description}</label>+ </or-vaadin-checkbox>+ `)}</div><div class="column">- <strong class="column-title"><or-translate value="writePermissions"></or-translate></strong> ${writeRoles.map(r => {- return html`- <or-mwc-input ?readonly="${readonly}" .label="${r.name.split(":")[1]}: ${r.description}" .type="${InputType.CHECKBOX}" .value="${role.compositeRoleIds && role.compositeRoleIds.find(id => id === r.id)}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.addRemoveRole(e, r, index)}"></or-mwc-input>- ` })}+ <strong class="column-title"><or-translate value="writePermissions"></or-translate></strong>+ ${writeRoles.map(r => html`+ <or-vaadin-checkbox ?readonly=${readonly}+ ?checked=${role.compositeRoleIds && role.compositeRoleIds.find(id => id === r.id)}+ @change=${(ev: Event) => this.addRemoveRole(ev, r, index)}>+ <label slot="label">${r.name.split(":")[1]}: ${r.description}</label>+ </or-vaadin-checkbox>+ `)}</div></div><div class="row"><div class="column">- ${otherRoles.map(r => {- return html`- <or-mwc-input ?readonly="${readonly}" .label="${r.name.split(" : ")[1]}: ${r.description}" .type="${InputType.CHECKBOX}" .value="${role.compositeRoleIds && role.compositeRoleIds.find(id => id === r.id)}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.addRemoveRole(e, r, index)}"></or-mwc-input>- ` })}+ ${otherRoles.map(r => html`+ <or-vaadin-checkbox ?readonly=${readonly}+ ?checked=${role.compositeRoleIds && role.compositeRoleIds.find(id => id === r.id)}+ @change=${(ev: Event) => this.addRemoveRole(ev, r, index)}>+ <label slot="label">${r.name.split(":")[1]}: ${r.description}</label>+ </or-vaadin-checkbox>+ `)}</div></div>${readonly ? html`` : html`- <div class="row" style="margin-bottom: 0;">+ <div class="row" style="justify-content: space-between; margin-bottom: 8px;">${role.id ? html`- <or-mwc-input label="delete" .type="${InputType.BUTTON}" @or-mwc-input-changed="${() => this._deleteRole(role, index)}"></or-mwc-input>- <or-mwc-input ?disabled="${this._compositeRoles.some(r => r.compositeRoleIds.length === 0) || this._compositeRoles.some((r, i) => this._compositeRoles.some((o, j) => i !== j && r.name && r.name === o.name))}" style="margin-left: auto;" label="save" .type="${InputType.BUTTON}" @or-mwc-input-changed="${() => this._updateRoles()}"></or-mwc-input>+ <or-vaadin-button @click=${() => this._deleteRole(role, index)}>+ <or-translate value="delete"></or-translate>+ </or-vaadin-button>+ <or-vaadin-button theme="primary" ?disabled=${!role.name || !role.description || this._compositeRoles.some(r => r.compositeRoleIds.length === 0) || this._compositeRoles.some((r, i) => this._compositeRoles.some((o, j) => i !== j && r.name && r.name === o.name))}+ @click=${() => this._updateRoles()}>+ <or-translate value="update"></or-translate>+ </or-vaadin-button>` : html`- <or-mwc-input label="cancel" .type="${InputType.BUTTON}" @or-mwc-input-changed="${() => { this._compositeRoles.splice(-1, 1); this._compositeRoles = [...this._compositeRoles] }}"></or-mwc-input>- <or-mwc-input ?disabled="${this._compositeRoles.some(r => r.compositeRoleIds.length === 0) || this._compositeRoles.some((r, i) => this._compositeRoles.some((o, j) => i !== j && r.name && r.name === o.name))}" style="margin-left: auto;" label="create" .type="${InputType.BUTTON}" @or-mwc-input-changed="${() => this._updateRoles()}"></or-mwc-input>+ <or-vaadin-button @click=${() => { this._compositeRoles.splice(-1, 1); this._compositeRoles = [...this._compositeRoles] }}>+ <or-translate value="cancel"></or-translate>+ </or-vaadin-button>+ <or-vaadin-button theme="primary" ?disabled=${!role.name || !role.description || this._compositeRoles.some(r => r.compositeRoleIds.length === 0) || this._compositeRoles.some((r, i) => this._compositeRoles.some((o, j) => i !== j && r.name && r.name === o.name))}+ @click=${() => this._updateRoles()}>+ <or-translate value="create"></or-translate>+ </or-vaadin-button>`}</div>`}@@ -456,7 +490,7 @@ export class PageRoles extends Page<AppStateKeyed> {}protected onRoleSearch(ev: InputEvent) {- const value = (ev.target as OrMwcInput).nativeValue?.toLowerCase();+ const value = (ev.target as HTMLInputElement).value?.toLowerCase();if (!value) {this._roleFilter = (roles) => roles;} else {diff --git a/ui/app/manager/src/pages/page-users.ts b/ui/app/manager/src/pages/page-users.tsindex a03b0d264..4bde9f3ed 100644--- a/ui/app/manager/src/pages/page-users.ts+++ b/ui/app/manager/src/pages/page-users.ts@@ -7,7 +7,6 @@ import {Store} from "@reduxjs/toolkit";import {AppStateKeyed, Page, PageProvider, router} from "@openremote/or-app";import {ClientRole, Credential, Role, User, UserAssetLink, UserQuery, UserSession} from "@openremote/model";import {i18next} from "@openremote/or-translate";-import {InputType, OrInputChangedEvent, OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";import {OrMwcDialog, showDialog, showOkCancelDialog} from "@openremote/or-mwc-components/or-mwc-dialog";import {showSnackbar} from "@openremote/or-mwc-components/or-mwc-snackbar";import {GenericAxiosResponse, isAxiosError} from "@openremote/rest";@@ -17,6 +16,11 @@ import {when} from 'lit/directives/when.js';import {until} from 'lit/directives/until.js';import {map} from 'lit/directives/map.js';import {OrMwcTableRowClickEvent, TableColumn, TableRow} from "@openremote/or-mwc-components/or-mwc-table";+import {OrVaadinButton} from "@openremote/or-vaadin-components/or-vaadin-button";+import {OrVaadinPasswordField} from "@openremote/or-vaadin-components/or-vaadin-password-field";+import {OrVaadinMultiSelectComboBox} from "@openremote/or-vaadin-components/or-vaadin-multi-select-combo-box";+import {OrVaadinCheckbox} from "@openremote/or-vaadin-components/or-vaadin-checkbox";+import {OrVaadinTextField} from "@openremote/or-vaadin-components/or-vaadin-text-field";const tableStyle = require("@material/data-table/dist/mdc.data-table.css");@@ -106,7 +110,8 @@ export class PageUsers extends Page<AppStateKeyed> {min-height: 36px;}- or-mwc-input {+ or-mwc-input, or-vaadin-text-field, or-vaadin-email-field,+ or-vaadin-password-field, or-vaadin-multi-select-combo-box {margin-bottom: 20px;}@@ -466,8 +471,12 @@ export class PageUsers extends Page<AppStateKeyed> {const users = this._userFilter(this._users);const serviceUsers = this._serviceUserFilter(this._serviceUsers);- const compositeRoleOptions: string[] = this._compositeRoles.map(cr => cr.name);- const realmRoleOptions: [string, string][] = this._realmRoles.map(r => [r, i18next.t("realmRole." + r, Util.camelCaseToSentenceCase(r.replace("_", " ").replace("-", " ")))]);+ const compositeRoleOptions: {value: any, label: string}[] = this._compositeRoles.map(cr => ({+ value: cr.name, label: i18next.t(cr.name)+ }));+ const realmRoleOptions: {value: any, label: string}[] = this._realmRoles.map(r => ({+ value: r, label: i18next.t("realmRole." + r, Util.camelCaseToSentenceCase(r.replace("_", " ").replace("-", " ")))+ }));const readonly = !manager.hasRole(ClientRole.WRITE_ADMIN);// Content of User Table@@ -552,13 +561,16 @@ export class PageUsers extends Page<AppStateKeyed> {<div class="panel-title" style="justify-content: space-between;"><p>${i18next.t("regularUser_plural")}</p><div style="display: flex; align-items: center; gap: 12px;">- <or-mwc-input type="${InputType.TEXT}" placeholder="${i18next.t('search')}"- style="margin: 0; text-transform: none;" iconTrailing="magnify" compact outlined- @input="${(ev) => this.onRegularUserSearch(ev)}"- ></or-mwc-input>- <or-mwc-input style="margin: 0;" type="${InputType.BUTTON}" icon="plus" label="${i18next.t('add')} ${i18next.t("user")}"- @or-mwc-input-changed="${() => this.creationState = {userModel: this.getNewUserModel(false)}}"- ></or-mwc-input>+ <or-vaadin-text-field placeholder=${i18next.t('search')} style="margin: 0;"+ @input=${(ev: InputEvent) => this.onRegularUserSearch(ev)}>+ <or-translate slot="placeholder" value="search"></or-translate>+ <or-icon slot="suffix" icon="magnify"></or-icon>+ </or-vaadin-text-field>+ <or-vaadin-button @click=${() => this.creationState = {userModel: this.getNewUserModel(false)}}>+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value="add"></or-translate>+ <or-translate value="user"></or-translate>+ </or-vaadin-button></div></div>${until(this.getUsersTable(userTableColumns, userTableRows, tableConfig, (ev) => {@@ -570,12 +582,16 @@ export class PageUsers extends Page<AppStateKeyed> {<div class="panel-title" style="justify-content: space-between;"><p>${i18next.t("serviceUser_plural")}</p><div style="display: flex; align-items: center; gap: 12px;">- <or-mwc-input style="margin: 0; text-transform: none;" type="${InputType.TEXT}" iconTrailing="magnify" placeholder="${i18next.t('search')}" compact outlined- @input="${(ev) => this.onServiceUserSearch(ev)}"- ></or-mwc-input>- <or-mwc-input style="margin: 0;" type="${InputType.BUTTON}" icon="plus" label="${i18next.t('add')} ${i18next.t("user")}"- @or-mwc-input-changed="${() => this.creationState = {userModel: this.getNewUserModel(true)}}"- ></or-mwc-input>+ <or-vaadin-text-field placeholder=${i18next.t('search')} style="margin: 0;"+ @input=${(ev: InputEvent) => this.onServiceUserSearch(ev)}>+ <or-translate slot="placeholder" value="search"></or-translate>+ <or-icon slot="suffix" icon="magnify"></or-icon>+ </or-vaadin-text-field>+ <or-vaadin-button @click=${() => this.creationState = {userModel: this.getNewUserModel(true)}}>+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value="add"></or-translate>+ <or-translate value="user"></or-translate>+ </or-vaadin-button></div></div>${until(this.getUsersTable(serviceUserTableColumns, serviceUserTableRows, tableConfig, (ev) => {@@ -621,7 +637,7 @@ export class PageUsers extends Page<AppStateKeyed> {}protected onRegularUserSearch(ev: InputEvent) {- const value = (ev.target as OrMwcInput).nativeValue?.toLowerCase();+ const value = (ev.target as HTMLInputElement).value?.toLowerCase();if(!value) {this._userFilter = this.getDefaultUserFilter(false);} else {@@ -638,7 +654,7 @@ export class PageUsers extends Page<AppStateKeyed> {}protected onServiceUserSearch(ev: InputEvent) {- const value = (ev.target as OrMwcInput).nativeValue?.toLowerCase();+ const value = (ev.target as HTMLInputElement).value?.toLowerCase();if(!value) {this._serviceUserFilter = this.getDefaultUserFilter(true);} else {@@ -687,8 +703,8 @@ export class PageUsers extends Page<AppStateKeyed> {this.requestUpdate();}- protected _openAssetSelector(ev: MouseEvent, user: UserModel, readonly: boolean, suffix: string) {- const openBtn = ev.target as OrMwcInput;+ protected _openAssetSelector(ev: Event, user: UserModel, readonly: boolean, suffix: string) {+ const openBtn = ev.target as OrVaadinButton;openBtn.disabled = true;user.previousAssetLinks = [...user.userAssetLinks];@@ -756,28 +772,36 @@ export class PageUsers extends Page<AppStateKeyed> {protected onUserChanged(suffix: string) {// Don't have form-associated custom element support in lit at time of writing which would be the way to go hereconst validateArray = this.shadowRoot.querySelectorAll(".validate");- const saveBtn = this.shadowRoot.getElementById("savebtn-" + suffix) as OrMwcInput;- const saveDisabled = Array.from(validateArray).filter(e => e instanceof OrMwcInput).some(input => !(input as OrMwcInput).valid);+ const saveBtn = this.shadowRoot.getElementById("savebtn-" + suffix) as OrVaadinButton;+ const saveDisabled = Array.from(validateArray)+ .filter(e => e instanceof HTMLInputElement)+ .some(input => !(input as HTMLInputElement).checkValidity());saveBtn.disabled = saveDisabled;}protected _onPasswordChanged(user: UserModel, suffix: string) {- const passwordComponent = this.shadowRoot.getElementById("new-password-" + suffix) as OrMwcInput;- const repeatPasswordComponent = this.shadowRoot.getElementById("new-repeatPassword-" + suffix) as OrMwcInput;+ const passwordComponent = this.shadowRoot.getElementById("new-password-" + suffix) as OrVaadinPasswordField;+ const repeatPasswordComponent = this.shadowRoot.getElementById("new-repeatPassword-" + suffix) as OrVaadinPasswordField;if (repeatPasswordComponent.value !== passwordComponent.value) {- const error = i18next.t("passwordMismatch");- repeatPasswordComponent.setCustomValidity(error);+ console.debug("The passwords are a mismatch.")+ repeatPasswordComponent.errorMessage = i18next.t("passwordMismatch");+ repeatPasswordComponent.invalid = true;+ user.password = "";+ } else if(!passwordComponent.checkValidity() || !repeatPasswordComponent.checkValidity()) {+ console.debug("The passwords are invalid.")+ repeatPasswordComponent.errorMessage = i18next.t("passwordInvalid");+ repeatPasswordComponent.invalid = true;user.password = "";} else {- repeatPasswordComponent.setCustomValidity(undefined);+ repeatPasswordComponent.invalid = false;user.password = passwordComponent.value;}}- protected async _regenerateSecret(ev: OrInputChangedEvent, user: UserModel, secretInputId: string) {- const btnElem = ev.currentTarget as OrMwcInput;- const secretElem = this.shadowRoot.getElementById(secretInputId) as OrMwcInput;+ protected async _regenerateSecret(ev: Event, user: UserModel, secretInputId: string) {+ const btnElem = ev.currentTarget as OrVaadinButton;+ const secretElem = this.shadowRoot.getElementById(secretInputId) as OrVaadinPasswordField;if (!btnElem || !secretElem) {showSnackbar(undefined, "errorOccurred");return;@@ -793,13 +817,13 @@ export class PageUsers extends Page<AppStateKeyed> {}protected _updateUserSelectedRoles(user: UserModel, suffix: string) {- const roleCheckboxes = [...((this.shadowRoot.getElementById("role-list-" + suffix) as HTMLDivElement).children as any)] as OrMwcInput[];+ const roleCheckboxes = [...((this.shadowRoot.getElementById("role-list-" + suffix) as HTMLDivElement).children as any)] as OrVaadinCheckbox[];const implicitRoleNames = this.getImplicitUserRoles(user);roleCheckboxes.forEach((checkbox) => {const roleName = checkbox.label;const r = this._roles.find(role => roleName === role.name);checkbox.disabled = !!implicitRoleNames.find(name => r.name === name);- checkbox.value = !!user.roles.find(userRole => userRole === r.name) || implicitRoleNames.some(implicitRoleName => implicitRoleName === r.name);+ checkbox.checked = !!user.roles.find(userRole => userRole === r.name) || implicitRoleNames.some(implicitRoleName => implicitRoleName === r.name);});}@@ -807,7 +831,7 @@ export class PageUsers extends Page<AppStateKeyed> {return this._compositeRoles.filter((role) => user.roles.some(ur => ur === role.name)).flatMap((role) => role.compositeRoleIds).map(id => this._roles.find(r => r.id === id).name);}- protected getSingleUserView(user: UserModel, compositeRoleOptions: string[], realmRoleOptions: [string, string][], suffix: string, readonly: boolean = true): TemplateResult {+ protected getSingleUserView(user: UserModel, compositeRoleOptions: {value: any, label: string}[], realmRoleOptions: {value: any, label: string}[], suffix: string, readonly: boolean = true): TemplateResult {return html`${when((user.loaded || (user.roles && user.realmRoles)), () => {return this.getSingleUserTemplate(user, compositeRoleOptions, realmRoleOptions, suffix, readonly);@@ -847,7 +871,11 @@ export class PageUsers extends Page<AppStateKeyed> {const cols = [i18next.t("address"), i18next.t("since"), ""];const rows = userSessionsResponse.data.map((session) => {- return [session.remoteAddress, new Date(session.startTimeMillis), html`<or-mwc-input .type="${InputType.BUTTON}" label="disconnect" @or-mwc-input-changed="${() => {this.disconnectSession(user, session)}}"></or-mwc-input>`]+ return [session.remoteAddress, new Date(session.startTimeMillis), html`+ <or-vaadin-button @click=${() => {this.disconnectSession(user, session)}}>+ <or-translate value="disconnect"></or-translate>+ </or-vaadin-button>+ `]});if (rows.length < 1){return html`<or-mwc-table .rows="${[['This user has no active MQTT sessions',null]]}" .config="${{stickyFirstColumn:false}}" .columns="${cols}"></or-mwc-table>`;@@ -856,7 +884,7 @@ export class PageUsers extends Page<AppStateKeyed> {return html`<or-mwc-table id="session-table" .rows="${rows}" .config="${{stickyFirstColumn:false}}" .columns="${cols}"></or-mwc-table>`;}- protected getSingleUserTemplate(user: UserModel, compositeRoleOptions: string[], realmRoleOptions: [string, string][], suffix: string, readonly: boolean = true): TemplateResult {+ protected getSingleUserTemplate(user: UserModel, compositeRoleOptions: {value: any, label: string}[], realmRoleOptions: {value: any, label: string}[], suffix: string, readonly: boolean = true): TemplateResult {const isServiceUser = user.serviceAccount;const isSameUser = user.username === manager.username;const isGatewayServiceUser = isServiceUser && user.username?.startsWith("gateway-");@@ -864,113 +892,110 @@ export class PageUsers extends Page<AppStateKeyed> {return html`<div class="row"><div class="column">- <h5>${i18next.t("details")}</h5>+ <h5><or-translate value="details"></h5><!-- user details -->- <or-mwc-input id="new-username-${suffix}" ?readonly="${!!user.id || readonly}" .disabled="${!!user.id || (!isServiceUser && this._registrationEmailAsUsername)}"- class = "validate"- .label="${i18next.t("username")}"- .type="${InputType.TEXT}" minLength="3" maxLength="255"- ?required="${isServiceUser || !this._registrationEmailAsUsername}"- pattern="[A-Za-z0-9_+@\\.\\-ßçʊÇʊ]+"- .value="${user.username}" autocomplete="false"- .validationMessage="${i18next.t("invalidUsername")}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- user.username = e.detail.value;- this.onUserChanged(suffix)- }}"></or-mwc-input>+ <or-vaadin-text-field id="new-username-${suffix}"+ class="validate" minlength="3" maxlength="255"+ ?readonly=${!!user.id || readonly || (!isServiceUser && this._registrationEmailAsUsername)}+ ?required=${isServiceUser || !this._registrationEmailAsUsername}+ pattern="[A-Za-z0-9_+@\\.\\-ßçʊÇʊ]+"+ value=${user.username} autocomplete="false"+ error-message=${i18next.t("invalidUsername")}+ @change=${(ev: Event) => {+ user.username = (ev.currentTarget as HTMLInputElement).value;+ this.onUserChanged(suffix)+ }}>+ <or-translate slot="label" value="username"></or-translate>+ </or-vaadin-text-field><!-- if identity provider is set to use email as username, make it required -->- <or-mwc-input id="new-email" ?readonly="${(!!user.id && this._registrationEmailAsUsername) || readonly}"- .disabled="${!!user.id && this._registrationEmailAsUsername}"- class="${isServiceUser ? "hidden" : "validate"}"- .label="${i18next.t("email")}"- .type="${InputType.EMAIL}"- .value="${user.email}" autocomplete="false"- ?required="${!isServiceUser && this._registrationEmailAsUsername}"- pattern="^[\\w\\.\\-\\+\\%]+@([\\w\\-]+\\.)+[\\w]{2,}$"- .validationMessage="${i18next.t("invalidEmail")}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- if(this._registrationEmailAsUsername) {- user.username = e.detail.value;- }- user.email = e.detail.value;- this.onUserChanged(suffix);- this.requestUpdate(); // in case of username update, we trigger a state change- }}"></or-mwc-input>- <or-mwc-input id="new-firstName" ?readonly="${readonly}"- class="${isServiceUser ? "hidden" : "validate"}"- .label="${i18next.t("firstName")}"- .type="${InputType.TEXT}" minLength="1"- .value="${user.firstName}" autocomplete="false"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- user.firstName = e.detail.value;- this.onUserChanged(suffix)- }}"></or-mwc-input>- <or-mwc-input id="new-surname" ?readonly="${readonly}"- class="${isServiceUser ? "hidden" : "validate"}"- .label="${i18next.t("surname")}"- .type="${InputType.TEXT}" minLength="1"- .value="${user.lastName}" autocomplete="false"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- user.lastName = e.detail.value;- this.onUserChanged(suffix)- }}"></or-mwc-input>- <or-mwc-input id="new-tag" ?readonly="${readonly || isGatewayServiceUser}"- class= "validate"- .label="${i18next.t("tag")}"- .type="${InputType.TEXT}" minLength="1"- .value="${user.attributes?.Tag?.[0]}" autocomplete="false"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- // Ensure 'attributes' and 'Tag' exist before assigning- if (!user.attributes) {- user.attributes = {};- }- if (!Array.isArray(user.attributes.Tag)) {- user.attributes.Tag = [];- }- user.attributes.Tag[0] = e.detail.value;- this.onUserChanged(suffix)- }}"></or-mwc-input>+ <or-vaadin-email-field id="new-email" class=${isServiceUser ? "hidden" : "validate"}+ ?readonly=${(!!user.id && this._registrationEmailAsUsername) || readonly}+ ?required=${!isServiceUser && this._registrationEmailAsUsername}+ value=${user.email} autocomplete="false"+ error-message=${i18next.t("invalidEmail")}+ @change=${(ev: Event) => {+ if(this._registrationEmailAsUsername) {+ user.username = (ev.currentTarget as HTMLInputElement).value;+ }+ user.email = (ev.currentTarget as HTMLInputElement).value;+ this.onUserChanged(suffix);+ this.requestUpdate(); // in case of username update, we trigger a state change+ }}>+ <or-translate slot="label" value="email"></or-translate>+ </or-vaadin-email-field>+ <or-vaadin-text-field id="new-firstName" class="${isServiceUser ? "hidden" : "validate"}"+ ?readonly="${readonly}" minlength="1" maxlength="255"+ value=${user.firstName} autocomplete="false"+ @change=${(ev: Event) => {+ user.firstName = (ev.currentTarget as HTMLInputElement).value;+ this.onUserChanged(suffix);+ }}>+ <or-translate slot="label" value="firstName"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-text-field id="new-surname" class="${isServiceUser ? "hidden" : "validate"}"+ ?readonly="${readonly}" minlength="1" maxlength="255"+ value=${user.lastName} autocomplete="false"+ @change=${(ev: Event) => {+ user.lastName = (ev.currentTarget as HTMLInputElement).value;+ this.onUserChanged(suffix)+ }}>+ <or-translate slot="label" value="surname"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-text-field id="new-tag" class="validate"+ ?readonly=${readonly || isGatewayServiceUser}+ minlength="1" maxlength="255"+ value=${user.attributes?.Tag?.[0]} autocomplete="false"+ @change=${(ev: Event) => {+ // Ensure 'attributes' and 'Tag' exist before assigning+ if (!user.attributes) {+ user.attributes = {};+ }+ if (!Array.isArray(user.attributes.Tag)) {+ user.attributes.Tag = [];+ }+ user.attributes.Tag[0] = (ev.currentTarget as HTMLInputElement).value;+ this.onUserChanged(suffix)+ }}>+ <or-translate slot="label" value="tag"></or-translate>+ </or-vaadin-text-field><!-- password -->- <h5>${i18next.t("password")}</h5>+ <h5><or-translate value="password"></or-translate></h5>${isServiceUser ? html`${when(user.secret, () => html`- <or-mwc-input id="new-password-${suffix}" readonly- class = "validate"- .label="${i18next.t("secret")}"- .value="${user.secret}"- .type="${InputType.TEXT}"></or-mwc-input>- <or-mwc-input ?readonly="${!user.id || readonly}"- ?disabled="${isGatewayServiceUser}"- .label="${i18next.t("regenerateSecret")}"- .type="${InputType.BUTTON}"- @or-mwc-input-changed="${(ev) => {- this._regenerateSecret(ev, user, "new-password-" + suffix).catch(() => showSnackbar(undefined, 'errorOccurred'));- this.onUserChanged(suffix);- }}"></or-mwc-input>+ <or-vaadin-password-field id="new-password-${suffix}" readonly class="validate"+ value=${user.secret}>+ <or-translate slot="label" value="secret"></or-translate>+ </or-vaadin-password-field>+ <or-vaadin-button ?disabled=${!user.id || readonly || isGatewayServiceUser}+ @click=${(ev: Event) => {+ this._regenerateSecret(ev, user, "new-password-" + suffix).catch(() => showSnackbar(undefined, 'errorOccurred'));+ this.onUserChanged(suffix);+ }}>+ <or-translate value="regenerateSecret"></or-translate>+ </or-vaadin-button>`, () => html`- <span>${i18next.t("generateSecretInfo")}</span>+ <or-translate value="generateSecretInfo"></or-translate>`)}` : html`- <or-mwc-input id="new-password-${suffix}"- ?readonly="${readonly}"- class = "validate"- .label="${i18next.t("password")}"- .type="${InputType.PASSWORD}" min="1" autocomplete="false"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- this._onPasswordChanged(user, suffix);- this.onUserChanged(suffix);- }}"- ></or-mwc-input>- <or-mwc-input id="new-repeatPassword-${suffix}"- helperPersistent ?readonly="${readonly}"- .label="${i18next.t("repeatPassword")}"- .type="${InputType.PASSWORD}" min="1" autocomplete="false"- style="${this._passwordPolicy ? 'margin-bottom: 0' : undefined}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- this._onPasswordChanged(user, suffix);- this.onUserChanged(suffix);- }}"- ></or-mwc-input>+ <or-vaadin-password-field id="new-password-${suffix}" class="validate"+ ?readonly=${readonly} autocomplete="false"+ minlength="1" maxlength="255" manual-validation+ @change=${(ev: Event) => {+ this._onPasswordChanged(user, suffix);+ this.onUserChanged(suffix);+ }}>+ <or-translate slot="label" value="password"></or-translate>+ </or-vaadin-password-field>+ <or-vaadin-password-field id="new-repeatPassword-${suffix}" class="validate"+ ?readonly="${readonly}" autocomplete="false"+ minlength="1" maxlength="255" manual-validation+ style="${this._passwordPolicy ? 'margin-bottom: 0' : undefined}"+ @change=${(ev: Event) => {+ this._onPasswordChanged(user, suffix);+ this.onUserChanged(suffix);+ }}>+ <or-translate slot="label" value="repeatPassword"></or-translate>+ </or-vaadin-password-field>${when(this._passwordPolicy, () => until(this._getPasswordPolicyTemplate(user, this._passwordPolicy)))}`}</div>@@ -978,80 +1003,75 @@ export class PageUsers extends Page<AppStateKeyed> {<div class="column"><h5>${i18next.t("settings")}</h5><!-- enabled -->- <or-mwc-input ?readonly="${readonly || isGatewayServiceUser}"- class="validate"- .label="${i18next.t("active")}"- .type="${InputType.CHECKBOX}"- .value="${user.enabled}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- user.enabled = e.detail.value;- this.onUserChanged(suffix);- }}"- style="height: 56px;"- ></or-mwc-input>+ <div style="height: 56px; display: flex; align-items: center; margin-bottom: 20px;">+ <or-vaadin-checkbox class="validate"+ ?readonly=${readonly || isGatewayServiceUser}+ ?checked=${user.enabled}+ @change=${(ev: Event) => {+ user.enabled = (ev.currentTarget as HTMLInputElement).checked;+ this.onUserChanged(suffix);+ }}>+ <label slot="label"><or-translate value="active"></or-translate></label>+ </or-vaadin-checkbox>+ </div><!-- realm roles -->- <or-mwc-input- ?readonly="${readonly}"- ?disabled="${isSameUser || isGatewayServiceUser}"- class = "validate"- .value="${user.realmRoles}"- .type="${InputType.SELECT}" multiple- .options="${realmRoleOptions}"- .label="${i18next.t("realm_role_plural")}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- this.onUserChanged(suffix);- user.realmRoles = e.detail.value as string[];- }}"></or-mwc-input>+ <or-vaadin-multi-select-combo-box class="validate"+ ?readonly="${readonly || isSameUser || isGatewayServiceUser}"+ .items=${realmRoleOptions}+ .selectedItems=${user.realmRoles.map(r => realmRoleOptions.find(o => o.value === r))}+ @change=${(ev: Event) => {+ this.onUserChanged(suffix);+ user.realmRoles = (ev.currentTarget as OrVaadinMultiSelectComboBox).selectedItems.map(i => i.value);+ }}>+ <or-translate slot="label" value="realm_role_plural"></or-translate>+ </or-vaadin-multi-select-combo-box><!-- composite client roles -->- <or-mwc-input- ?readonly="${readonly}"- ?disabled="${isSameUser || isGatewayServiceUser}"- class = "validate"- .value="${user.roles && user.roles.length > 0 ? user.roles.filter(r => this._compositeRoles.some(cr => cr.name === r)) : undefined}"- .type="${InputType.SELECT}" multiple- .options="${compositeRoleOptions}"- .label="${i18next.t("manager_role_plural")}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- user.roles = e.detail.value as string[];- this._updateUserSelectedRoles(user, suffix);- this.onUserChanged(suffix);- }}"></or-mwc-input>+ <or-vaadin-multi-select-combo-box class="validate"+ ?readonly=${readonly || isSameUser || isGatewayServiceUser}+ .items=${compositeRoleOptions}+ .selectedItems=${user.roles+ ?.filter(r => this._compositeRoles.some(cr => cr.name === r))+ ?.map(r => compositeRoleOptions.find(o => o.value === r))}+ @change=${(ev: Event) => {+ user.roles = (ev.currentTarget as OrVaadinMultiSelectComboBox).selectedItems.map(i => i.value);+ console.debug(user.roles);+ this._updateUserSelectedRoles(user, suffix);+ this.onUserChanged(suffix);+ }}>+ <or-translate slot="label" value="manager_role_plural"></or-translate>+ </or-vaadin-multi-select-combo-box><!-- roles --><div style="display:flex;flex-wrap:wrap;margin-bottom: 20px;"id="role-list-${suffix}">${this._roles.map(r => {return html`- <or-mwc-input- ?readonly="${readonly}"- ?disabled="${implicitRoleNames.find(name => r.name === name) || isGatewayServiceUser}"- class = "validate"- .value="${!!user.roles.find(userRole => userRole === r.name) || implicitRoleNames.some(implicitRoleName => implicitRoleName === r.name)}"- .type="${InputType.CHECKBOX}"- .label="${r.name}"- title="${r.description}"- style="flex: 0 1 160px; margin: 0; overflow: hidden;"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- if (!!e.detail.value) {- user.roles.push(r.name);- } else {- user.roles = user.roles.filter(ur => ur !== r.name);- }- this.onUserChanged(suffix);- }}"></or-mwc-input>+ <or-vaadin-checkbox class="validate" style="flex: 0 1 160px; overflow: hidden; margin: 4px 0;"+ ?disabled=${readonly || implicitRoleNames.find(name => r.name === name) || isGatewayServiceUser}+ title=${r.description} label=${r.name}+ ?checked=${!!user.roles.find(userRole => userRole === r.name) || implicitRoleNames.some(implicitRoleName => implicitRoleName === r.name)}+ @change=${(ev: Event) => {+ if ((ev.currentTarget as HTMLInputElement).checked) {+ user.roles.push(r.name);+ } else {+ user.roles = user.roles.filter(ur => ur !== r.name);+ }+ this.onUserChanged(suffix);+ }}>+ </or-vaadin-checkbox>`})}</div><!-- Asset-User links --><div>- <span>${i18next.t("linkedAssets")}:</span>- <or-mwc-input outlined ?disabled="${readonly || isGatewayServiceUser}" style="margin-left: 4px;"- .type="${InputType.BUTTON}"- .label="${i18next.t("selectRestrictedAssets", {number: user.userAssetLinks.length})}"- @or-mwc-input-changed="${(ev: MouseEvent) => this._openAssetSelector(ev, user, readonly, suffix)}"></or-mwc-input>+ <or-translate value="linkedAssets"></or-translate>+ <or-vaadin-button ?disabled=${readonly || isGatewayServiceUser} style="margin-left: 4px;"+ @click=${(ev: Event) => this._openAssetSelector(ev, user, readonly, suffix)}>+ <span>${i18next.t("selectRestrictedAssets", {number: user.userAssetLinks.length})}</span>+ </or-vaadin-button></div></div></div>@@ -1060,49 +1080,45 @@ export class PageUsers extends Page<AppStateKeyed> {<div class="row button-row">${when((!isSameUser && !isGatewayServiceUser && user.id), () => html`- <or-mwc-input style="margin: 0;" outlined ?disabled="${readonly}"- .label="${i18next.t("delete")}"- .type="${InputType.BUTTON}"- @or-mwc-input-changed="${() => this._deleteUser(user)}"- ></or-mwc-input>+ <or-vaadin-button ?disabled=${readonly} @click=${() => this._deleteUser(user)}>+ <or-translate value="delete"></or-translate>+ </or-vaadin-button>`)}<div style="display: flex; align-items: center; gap: 16px; margin: 0 0 0 auto;"><!-- Button disabled until an input has input, and by that a valid check is done -->- <or-mwc-input id="savebtn-${suffix}" style="margin: 0;" raised disabled- .label="${i18next.t(user.id ? "save" : "create")}"- .type="${InputType.BUTTON}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- let error: { status?: number, text: string };- this._saveUserPromise = this._createUpdateUser(user, user.id ? 'update' : 'create').then((result) => {- // Return to the users page on successful user create/update- if (result) {- showSnackbar(undefined, "saveUserSucceeded");- this.reset();- }- }).catch((ex) => {- console.error(ex);- if (isAxiosError(ex)) {- error = {- status: ex.response.status,- text: (ex.response.status == 403 ? i18next.t('userAlreadyExists') : i18next.t('errorOccurred'))- }- }- }).finally(() => {- this._saveUserPromise = undefined;- if (error) {- this.updateComplete.then(() => {- showSnackbar(undefined, error.text);- if (error.status === 403) {- const elem = this.shadowRoot.getElementById('username-' + suffix) as OrMwcInput;- elem.setCustomValidity(error.text);- (elem.shadowRoot.getElementById("elem") as HTMLInputElement).reportValidity(); // manually reporting was required since we're not editing the username at all.- this.onUserChanged(suffix); // onUserChanged to trigger validation of all fields again.- }- })- }- })- }}">- </or-mwc-input>+ <or-vaadin-button id="savebtn-${suffix}" theme="primary" disabled @click=${() => {+ let error: { status?: number, text: string };+ this._saveUserPromise = this._createUpdateUser(user, user.id ? 'update' : 'create').then((result) => {+ // Return to the users page on successful user create/update+ if (result) {+ showSnackbar(undefined, "saveUserSucceeded");+ this.reset();+ }+ }).catch((ex) => {+ console.error(ex);+ if (isAxiosError(ex)) {+ error = {+ status: ex.response.status,+ text: (ex.response.status == 403 ? i18next.t('userAlreadyExists') : i18next.t('errorOccurred'))+ }+ }+ }).finally(() => {+ this._saveUserPromise = undefined;+ if (error) {+ this.updateComplete.then(() => {+ showSnackbar(undefined, error.text);+ if (error.status === 403) {+ const elem = this.shadowRoot.getElementById('username-' + suffix) as OrVaadinTextField;+ elem.errorMessage = error.text;+ (elem.shadowRoot.getElementById("elem") as HTMLInputElement).reportValidity(); // manually reporting was required since we're not editing the username at all.+ this.onUserChanged(suffix); // onUserChanged to trigger validation of all fields again.+ }+ })+ }+ })+ }}>+ <or-translate value=${user.id ? "save" : "create"}></or-translate>+ </or-vaadin-button></div></div>`)}diff --git a/ui/app/manager/test/assets.test.ts b/ui/app/manager/test/assets.test.tsindex 8eae897c9..5b400d5af 100644--- a/ui/app/manager/test/assets.test.ts+++ b/ui/app/manager/test/assets.test.ts@@ -56,7 +56,7 @@ assets.forEach(({ type, name, attributes }) => {const item = page.locator(`#field-${attribute3} input[type="${type}"]`);if (await item.isEditable()) {await item.fill(value3);- await page.click(`#field-${attribute3} #send-btn span`);+ await page.click(`#field-${attribute3} #send-btn`);}await assetViewer.switchMode("modify");@@ -236,11 +236,11 @@ test.describe("Attributes", () => {await page.getByRole("button", { name: "Add attribute" }).click();const dialog = page.getByLabel("Add attribute");- await dialog.locator("label").filter({ hasText: "Name" }).fill("test");- await dialog.getByRole("button", { name: "Value type" }).click();- await mwcInput.getSelectInputOption("Integer", dialog).click();- await dialog.getByRole("button", { name: "Add" }).click();- await page.getByRole("button", { name: "Save" }).click();+ await dialog.getByLabel("Name").fill("test");+ await dialog.getByRole("combobox", { name: "Value type", exact: true }).fill("Int");+ await dialog.getByRole("option", { name: "Integer", exact: true }).click();+ await dialog.getByRole("button", { name: "Add", exact: true }).click();+ await page.getByRole("button", { name: "Save", exact: true }).click();await expect(assetViewer.getAttributeLocator("test")).toBeVisible();await expect(assetViewer.getAttributeLocator("test")).toContainText(/Integer/);diff --git a/ui/app/manager/test/export.test.ts b/ui/app/manager/test/export.test.tsindex 4fb88e722..9d9b8e7a9 100644--- a/ui/app/manager/test/export.test.ts+++ b/ui/app/manager/test/export.test.ts@@ -61,7 +61,7 @@ async function addAttributeViaPicker(page: import("@playwright/test").Page, asseconst attributeList = dialog.locator("#attribute-selector");await attributeList.waitFor();const displayName = attributeName.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/^./, c => c.toUpperCase());- const attributeCheckbox = attributeList.locator("li.mdc-list-item").filter({ hasText: displayName });+ const attributeCheckbox = attributeList.getByRole("option", { name: displayName });await attributeCheckbox.click();await dialog.locator("#add-btn").click();@@ -93,13 +93,19 @@ test("Export datapoints successfully triggers download", async ({ page, managerconst latestDatapoint = await page.locator("table tbody tr").first().locator("td").nth(3).textContent();const toDatetimeLocal = (dateStr: string) => {const date = new Date(dateStr);- return date.toISOString().slice(0, 16);+ return date.toLocaleString('en-US', {hour12: false}).replaceAll(' ', '').split(',') as [string, string];};- await page.locator("or-mwc-input[label='Export from']").locator("input").fill(toDatetimeLocal(oldestDatapoint!));- await page.locator("or-mwc-input[label='To']").locator("input").fill(toDatetimeLocal(latestDatapoint!));-- await page.locator("or-mwc-input[label='Export format']").click();- await page.locator("li.mdc-list-item:has-text('CSV')").first().click();+ await page.getByLabel("Export from").locator("vaadin-date-picker").getByRole("combobox").fill(toDatetimeLocal(oldestDatapoint!)[0]);+ await page.getByLabel("Export from").locator("vaadin-date-picker").getByRole("combobox").press("Enter");+ await page.getByLabel("Export from").locator("vaadin-time-picker").getByRole("combobox").fill(toDatetimeLocal(oldestDatapoint!)[1]);+ await page.getByLabel("Export from").locator("vaadin-time-picker").getByRole("combobox").press("Enter");+ await page.getByLabel("to").locator("vaadin-date-picker").getByRole("combobox").fill(toDatetimeLocal(latestDatapoint!)[0]);+ await page.getByLabel("to").locator("vaadin-date-picker").getByRole("combobox").press("Enter");+ await page.getByLabel("to").locator("vaadin-time-picker").getByRole("combobox").fill(toDatetimeLocal(latestDatapoint!)[1]);+ await page.getByLabel("to").locator("vaadin-time-picker").getByRole("combobox").press("Enter");++ await page.getByLabel("Export format").click();+ await page.getByRole("option", {name: "CSV", exact: true}).first().click();const exportResponsePromise = page.waitForResponse(response => response.url().includes("/asset/datapoint/export")diff --git a/ui/app/manager/test/fixtures/data/assets.ts b/ui/app/manager/test/fixtures/data/assets.tsindex 014d69036..593ca1cb9 100644--- a/ui/app/manager/test/fixtures/data/assets.ts+++ b/ui/app/manager/test/fixtures/data/assets.ts@@ -6,8 +6,8 @@ export const location = { name: "location", type: "GEO_JSONPoint" };export const commonAttrs = { notes, location };export const assetMap = {- Battery: "ElectricityBatteryAsset",- "Solar Panel": "ElectricityProducerSolarAsset",+ "Battery": "Electricity Battery Asset",+ "Solar Panel": "PV Solar Asset"};const assets = [{diff --git a/ui/app/manager/test/fixtures/manager.ts b/ui/app/manager/test/fixtures/manager.tsindex d045ddee9..e9bfe7368 100644--- a/ui/app/manager/test/fixtures/manager.ts+++ b/ui/app/manager/test/fixtures/manager.ts@@ -86,8 +86,8 @@ export class Manager {* @param setting Name of the setting menu item*/async navigateToMenuItem(setting: string) {- await this.page.click("button#menu-btn-desktop");- const menu = this.page.locator("#menu > #list > li").filter({ hasText: setting });+ await this.page.click("#drawer-menu");+ const menu = this.page.locator("#drawer-menu").getByRole("menuitem").filter({ hasText: setting });await menu.waitFor({ state: "visible" });await menu.click();}@@ -98,7 +98,7 @@ export class Manager {*/async switchToRealmByRealmPicker(realm: string) {await this.page.click("#realm-picker");- await this.page.locator("#desktop-right li", { hasText: realm }).click();+ await this.page.locator("#realm-picker").getByRole("option").filter({ hasText: realm }).click();}/**diff --git a/ui/app/manager/test/fixtures/pages/assets.ts b/ui/app/manager/test/fixtures/pages/assets.tsindex a2df4a535..ea474e82f 100644--- a/ui/app/manager/test/fixtures/pages/assets.ts+++ b/ui/app/manager/test/fixtures/pages/assets.ts@@ -23,8 +23,8 @@ export class AssetsPage implements BasePage {*/async addAsset(type: string, name: string) {await this.page.click(".mdi-plus");- await this.page.click(`li[data-value="${type}"]`);- await this.page.fill('#name-input input[type="text"]', name);+ await this.page.getByRole("option", { name: type }).click();+ await this.page.locator("#name-input").getByRole("textbox").fill(name);await this.shared.interceptResponse<Asset>("**/asset", (asset) => {if (asset) this.manager.assets.push(asset);});diff --git a/ui/app/manager/test/fixtures/pages/realms.ts b/ui/app/manager/test/fixtures/pages/realms.tsindex 8d96da914..1e6ea3cc0 100644--- a/ui/app/manager/test/fixtures/pages/realms.ts+++ b/ui/app/manager/test/fixtures/pages/realms.ts@@ -13,15 +13,15 @@ export class RealmsPage implements BasePage {* @param name The realm name*/async addRealm(name: string) {- const locator = this.page.getByRole("cell", { name, exact: true });- await this.page.getByRole("cell", { name: "Master", exact: true }).waitFor();+ const locator = this.page.getByRole("button", { name, exact: true });+ await this.page.getByRole("button", { name: "Master", exact: true }).waitFor();if (await locator.isVisible()) {console.warn(`Realm "${name}" already present`);} else {await this.page.click("text=Add Realm");const realmRow = this.page.locator("#realm-row-1");- const realmNameInput = realmRow.locator("or-mwc-input").filter({ hasText: "Realm" }).locator("input");- const displayNameInput = realmRow.locator("or-mwc-input").filter({ hasText: "Friendly name" }).locator("input");+ const realmNameInput = realmRow.getByLabel("Realm");+ const displayNameInput = realmRow.getByLabel("Friendly name");await realmNameInput.fill(name);await realmNameInput.dispatchEvent("change");await displayNameInput.fill(name);diff --git a/ui/app/manager/test/fixtures/pages/users.ts b/ui/app/manager/test/fixtures/pages/users.tsindex 746d5fa71..8cb9491d1 100644--- a/ui/app/manager/test/fixtures/pages/users.ts+++ b/ui/app/manager/test/fixtures/pages/users.ts@@ -27,13 +27,12 @@ export class UsersPage implements BasePage {* @param roles The roles to toggle*/async toggleUserRoles(...roles: string[]) {- const roleSelector = this.page.getByRole("button", { name: "Manager roles" });- const itemSelector = this.page.locator("li");- await roleSelector.click({ delay: 500 });+ const roleSelector = this.page.locator("or-vaadin-multi-select-combo-box", { hasText: "Manager roles" });+ await roleSelector.click();for (const role of roles) {- await itemSelector.filter({ hasText: role }).click();+ await this.page.getByRole("option", {name: role}).click();}- await roleSelector.click();+ await roleSelector.locator("#toggleButton").click();}/**@@ -67,14 +66,11 @@ export class UsersPage implements BasePage {.filter({ hasText: "Regular users" }).getByRole("button", { name: "Add User" }).click();- await this.page.locator("label").filter({ hasText: "Username" }).fill(username);- await this.page- .locator("label")- .filter({ hasText: /Password/ })- .fill(password);- await this.page.locator("label").filter({ hasText: "Repeat password" }).fill(password);+ await this.page.getByLabel("Username", {exact: true}).fill(username);+ await this.page.getByLabel("Password", {exact: true}).fill(password);+ await this.page.getByLabel("Repeat password", {exact: true}).fill(password);if (tag) {- await this.page.locator("label").filter({ hasText: "Tag" }).fill(tag);+ await this.page.getByLabel("Tag", {exact: true}).fill(tag);}await this.toggleUserRoles("Read", "Write");await this.toHavePermissions(...permissions);@@ -96,9 +92,9 @@ export class UsersPage implements BasePage {.filter({ hasText: "Service users" }).getByRole("button", { name: "Add User" }).click();- await this.page.locator("label").filter({ hasText: "Username" }).fill(username);+ await this.page.getByLabel("Username").fill(username);if (tag) {- await this.page.locator("label").filter({ hasText: "Tag" }).fill(tag);+ await this.page.getByLabel("Tag").fill(tag);}await this.toggleUserRoles("Read", "Write");await this.toHavePermissions(...permissions);@@ -114,7 +110,7 @@ export class UsersPage implements BasePage {*/async searchRegularUsers(searchTerm: string) {const panel = this.page.locator("#content").filter({ hasText: "Regular users" }).first();- const input = panel.locator('or-mwc-input[placeholder="Search"] input');+ const input = panel.locator('*[placeholder="Search"] input');await input.fill(searchTerm);}@@ -124,7 +120,7 @@ export class UsersPage implements BasePage {*/async searchServiceUsers(searchTerm: string) {const panel = this.page.locator("#content").filter({ hasText: "Service users" }).first();- const input = panel.locator('or-mwc-input[placeholder="Search"] input');+ const input = panel.locator('*[placeholder="Search"] input');await input.fill(searchTerm);}}diff --git a/ui/app/manager/test/insights.test.ts b/ui/app/manager/test/insights.test.tsindex 2b74bac85..ce8f6b9d5 100644--- a/ui/app/manager/test/insights.test.ts+++ b/ui/app/manager/test/insights.test.ts@@ -65,7 +65,7 @@ test("Create a Line Chart widget", async ({ manager, shared, page, insightsPageawait expect(insightsPage.getWidgetAttributes().last()).toContainText("Power");});-test("Create a Map widget with text thresholds", async ({ manager, shared, page, insightsPage, mwcMenu, mwcInput }) => {+test("Create a Map widget with text thresholds", async ({ manager, shared, page, insightsPage, mwcInput }) => {await shared.interceptResponse<Dashboard>("**/dashboard", (dashboard) => {if (dashboard) manager.dashboards.push(dashboard.id!);});@@ -105,16 +105,16 @@ test("Create a Map widget with text thresholds", async ({ manager, shared, page,await mapWidget.click();await expect(insightsPage.getBrowser()).toBeHidden();await expect(insightsPage.getWidgetSettings({ hasText: "Map" })).toBeVisible();- await page.getByRole("textbox", { name: "Asset type" }).click();- await mwcMenu.getMenuItem("Thing asset").click();+ await page.getByRole("combobox", { name: "Asset type" }).fill("Thing");+ await page.getByRole("option", { name: "Thing asset" }).click();await expect(thresholdPanel).toBeHidden();- await insightsPage.getWidgetSettings().getByRole("button", { name: "Attribute" }).click();- await mwcInput.getSelectInputOption("Notes", insightsPage.getWidgetSettings()).click();+ await insightsPage.getWidgetSettings().getByRole("combobox", { name: "Attribute" }).click();+ await insightsPage.getWidgetSettings().getByRole("option", { name: "Notes" }).click();await expect(page.locator(".or-map-marker")).toBeVisible();await expect(thresholdPanel).toBeVisible();// Check default text configuration is correct- const textThresholds = mwcInput.getInputByType("text", thresholdPanel);+ const textThresholds = thresholdPanel.locator("or-vaadin-text-field").getByRole("textbox")const thresholdsColors = mwcInput.getInputByType("color", thresholdPanel);await expect(textThresholds).toHaveCount(2);await expect(textThresholds.first()).toHaveValue("example1");diff --git a/ui/app/manager/test/map.test.ts b/ui/app/manager/test/map.test.tsindex d6b09783e..0b27c3056 100644--- a/ui/app/manager/test/map.test.ts+++ b/ui/app/manager/test/map.test.ts@@ -55,7 +55,7 @@ test.describe("Map markers", () => {await expect(page.locator("or-map").locator(".marker-container")).toBeVisible();await page.getByRole("button", { name: "Modify" }).click();- await page.locator("or-mwc-input[icon=crosshairs-gps]").click();+ await page.locator("or-icon[icon=crosshairs-gps]").click();await expect(page.locator("or-map").locator(".marker-container")).toBeVisible();});diff --git a/ui/app/manager/test/rules.test.ts b/ui/app/manager/test/rules.test.tsindex 5f52c1863..e1cf94532 100644--- a/ui/app/manager/test/rules.test.ts+++ b/ui/app/manager/test/rules.test.ts@@ -109,25 +109,29 @@ test("Create a When-Then rule for an asset with a trigger and action", async ({pawait manager.navigateToTab("Rules");await page.click(".mdi-plus >> nth=0");await page.locator("li").filter({hasText: "When-Then"}).click();- await page.fill("text=Rule name", energyRule.name);-- await page.click("or-rule-when #component span");- await page.locator("or-rule-when li").filter({hasText: energyRule.asset_type}).click();- await page.click("text=Asset Any of this type");- await page.click(`#idSelect >> text=${energyRule.asset}`);- await page.getByRole("button", {name: "Attribute", exact: true}).click();- await page.click(`li[role="option"]:has-text("${energyRule.attribute_when}")`);- await page.getByRole("button", {name: "Operator", exact: true}).click();- await page.click("text=Less than or equal to");- await page.getByRole("spinbutton", {name: "Energy level"}).fill(energyRule.value.toString());-- await page.getByRole("button", {name: "Add action"}).click();- await page.click(`or-rule-then-otherwise li[role="menuitem"]:has-text("${energyRule.asset_type}")`);- await page.click("text=Asset Matched");- await page.click(`#matchSelect li[role="option"]:has-text("${energyRule.asset}")`);- await page.getByRole("button", {name: "Attribute", exact: true}).click();- await page.click(`li[role="option"]:has-text("${energyRule.attribute_then}")`);- await page.getByRole("spinbutton", {name: "Value"}).fill(energyRule.value.toString());+ await page.getByRole("textbox", { name: "Rule name" }).fill(energyRule.name);++ // When clause+ const when = page.locator("or-rule-when");+ await when.getByRole("button", { name: "Add condition", exact: true }).click();+ await when.locator("li[role='menuitem']").filter({hasText: energyRule.asset_type}).click();+ await when.getByRole("combobox", { name: "Asset", exact: true }).click();+ await when.getByRole("option", { name: energyRule.asset, exact: true }).click();+ await when.getByRole("combobox", { name: "Attribute", exact: true }).click();+ await when.getByRole("option", { name: energyRule.attribute_when, exact: true }).click();+ await when.getByRole("combobox", { name: "Operator", exact: true }).click();+ await when.getByRole("option", { name: "Less than or equal to", exact: true }).click();+ await when.getByRole("spinbutton", {name: "Energy level"}).fill(energyRule.value.toString());++ // Then clause+ const then = page.locator("or-rule-then-otherwise")+ await then.getByRole("button", {name: "Add action", exact: true}).click();+ await then.locator("li[role='menuitem']").filter({hasText: energyRule.asset_type}).click();+ await then.getByRole("combobox", { name: "Asset", exact: true }).click();+ await then.getByRole("option", { name: energyRule.asset, exact: true }).click();+ await then.getByRole("combobox", {name: "Attribute", exact: true}).click();+ await then.getByRole("option", {name: energyRule.attribute_then, exact: true}).click();+ await then.getByRole("spinbutton", {name: "Value"}).fill(energyRule.value.toString());await shared.interceptResponse<number>("**/rules/realm", (rule) => {if (rule) manager.rules.push(rule);@@ -161,35 +165,29 @@ test("Create a When-Then rule by searching for an asset", async ({page, manager,await page.click(".mdi-plus >> nth=0");await page.locator("li").filter({hasText: "When-Then"}).click();- await page.fill("text=Rule name", energyRule.name);+ await page.getByRole("textbox", { name: "Rule name" }).fill(energyRule.name);// Select asset type of the When clause, search for the last asset in the list, and select the attribute- await page.click("or-rule-when #component span");- await page.locator("or-rule-when li").filter({hasText: energyRule.asset_type}).click();- await page.click(`text=Asset Any of this type`);- await expect(page.getByRole('textbox', { name: 'Search'})).toBeVisible();- await page.getByRole('textbox', {name: 'Search'}).click();- await page.keyboard.type(lastAssetName);- await expect(page.locator("or-rule-asset-query or-mwc-input li[role=option]").getByText(lastAssetName, { exact: true })).toBeVisible();- await page.locator("or-rule-asset-query or-mwc-input li[role=option]").filter({hasText: lastAssetName}).click();- await page.getByRole("button", {name: "Attribute", exact: true}).click();- await page.click(`or-rule-asset-query or-mwc-input li[role="option"]:has-text("${energyRule.attribute_when}")`);- await page.getByRole("button", {name: "Operator", exact: true}).click();- await page.click("text=Less than or equal to");- await page.getByRole("spinbutton", {name: "Energy level"}).fill(energyRule.value.toString());+ const when = page.locator("or-rule-when")+ await when.getByRole("button", { name: "Add condition" }).click();+ await when.locator("li[role='menuitem']").filter({hasText: energyRule.asset_type}).click();+ await when.getByRole("combobox", {name: "Asset", exact: true}).fill(lastAssetName);+ await when.getByRole("option", { name: lastAssetName, exact: true }).click();+ await when.getByRole("combobox", {name: "Attribute", exact: true}).fill(energyRule.attribute_when);+ await when.getByRole("option", {name: energyRule.attribute_when, exact: true}).click();+ await when.getByRole("combobox", { name: "Operator", exact: true }).fill("Less than or");+ await when.getByRole("option", {name: "Less than or equal to", exact: true}).click();+ await when.getByRole("spinbutton", {name: "Energy level"}).fill(energyRule.value.toString());// Configure Then clause- await page.getByRole("button", {name: "Add action"}).click();- await page.click(`or-rule-then-otherwise li[role="menuitem"]:has-text("${energyRule.asset_type}")`);- await page.click("text=Matched");- await expect(page.getByRole('textbox', { name: 'Search'})).toBeVisible();- await page.getByRole('textbox', {name: 'Search'}).click();- await page.keyboard.type(firstAssetName);- await expect(page.locator("or-rule-action-attribute or-mwc-input li[role=option]").getByText(firstAssetName, { exact: true })).toBeVisible();- await page.locator("or-rule-action-attribute or-mwc-input li[role=option]").filter({hasText: firstAssetName}).click();- await page.getByRole("button", {name: "Attribute", exact: true}).click();- await page.click(`or-rule-action-attribute or-mwc-input li[role=option]:has-text("${energyRule.attribute_then}")`);- await page.getByRole("spinbutton", {name: "Value"}).fill(energyRule.value.toString());+ const then = page.locator("or-rule-then-otherwise");+ await then.getByRole("button", {name: "Add action"}).click();+ await then.locator("li[role='menuitem']").filter({hasText: energyRule.asset_type}).click();+ await then.getByRole("combobox", {name: "Asset", exact: true}).fill(firstAssetName);+ await then.getByRole("option", {name: firstAssetName, exact: true}).click();+ await then.getByRole("combobox", {name: "Attribute", exact: true}).fill(energyRule.attribute_then);+ await then.getByRole("option", {name: energyRule.attribute_then, exact: true}).click();+ await then.getByRole("spinbutton", {name: "Value"}).fill(energyRule.value.toString());await shared.interceptResponse<number>("**/rules/realm", (rule) => {if (rule) manager.rules.push(rule);@@ -214,7 +212,7 @@ test("Create a Flow rule for an asset with logic connections", async ({page, shaawait manager.navigateToTab("Rules");await page.click(".mdi-plus >> nth=0");await page.locator("li", {hasText: "Flow"}).click();- await page.fill("text=Rule name", "Solar panel");+ await page.getByRole("textbox", { name: "Rule name" }).fill("Solar panel");await page.locator(".node-item.input-node", {hasText: "Attribute value"}).hover();await shared.drag(450, 250);@@ -316,7 +314,7 @@ test("Legacy JavaScript rules can still be deleted from the rules UI", async ({pawait manager.navigateToTab("Rules");await page.locator("or-rule-tree").getByText(legacyJavascriptRule.name!).click();- await page.locator("or-rule-tree").locator("or-mwc-input[icon='delete']").click();+ await page.locator("or-rule-tree").getByRole("button").filter({ has: page.locator('*[icon="delete"]') }).click();await page.getByRole("button", {name: "Delete"}).click();await expect(page.locator("or-rule-tree").getByText(legacyJavascriptRule.name!)).toHaveCount(0);diff --git a/ui/app/manager/test/test.cleanup.ts b/ui/app/manager/test/test.cleanup.tsindex cc8dfede9..5d476c285 100644--- a/ui/app/manager/test/test.cleanup.ts+++ b/ui/app/manager/test/test.cleanup.ts@@ -36,5 +36,5 @@ cleanup(`Delete the "smartcity" realm`, async ({ page, manager, realmsPage }) =>await expect(page.getByRole("cell", { name: "smartcity", exact: true })).toHaveCount(0);await manager.goToRealmStartPage("master");await page.locator("#desktop-right").waitFor();- await expect(page.locator("#desktop-right #realm-picker")).not.toBeVisible();+ await expect(page.locator("#desktop-right #realm-picker").getByRole("button")).toBeDisabled();});diff --git a/ui/app/manager/test/users.test.ts b/ui/app/manager/test/users.test.tsindex 9a9a6ec07..f046635a0 100644--- a/ui/app/manager/test/users.test.ts+++ b/ui/app/manager/test/users.test.ts@@ -71,8 +71,8 @@ test(`Create service users with tags and search by tag`, async ({ page, manager,*/test(`Verify browser behavior while creating regular users`, async ({ page, usersPage }) => {await usersPage.gotoUserCreation("master", "regular");- await page.locator("label").filter({ hasText: "Username" }).fill("mycustomusername");- await page.locator("label").filter({ hasText: "Email" }).fill("[email protected]");+ await page.getByLabel("Username").fill("mycustomusername");+ await page.getByLabel("Email").fill("[email protected]");await usersPage.toHavePermissions();await usersPage.toggleUserRoles("Read", "Write");await usersPage.toHavePermissions(...permissions);@@ -95,7 +95,7 @@ test(`Verify gateway service user is read-only`, async ({ page, manager, usersPaawait manager.goToRealmStartPage("master");await manager.switchToRealmByRealmPicker("smartcity");await manager.navigateToTab("Assets");- await assetsPage.addAsset("GatewayAsset", "TestGateway");+ await assetsPage.addAsset("Gateway Asset", "TestGateway");await page.waitForURL("**/assets/**");const clientIdInput = page.locator(`#field-clientId input`);await expect(clientIdInput).not.toHaveValue("", { timeout: 15000 });@@ -109,14 +109,14 @@ test(`Verify gateway service user is read-only`, async ({ page, manager, usersPaawait page.getByRole("cell", { name: gatewayUsername, exact: true }).click();const usernameInput = page.locator('[id*="username"]');await expect(usernameInput).toHaveAttribute("readonly");- const tagInput = page.locator('or-mwc-input#new-tag');+ const tagInput = page.getByLabel("Tag");await expect(tagInput).toHaveAttribute("readonly");- const activeCheckbox = page.locator('or-mwc-input').filter({ hasText: 'Active' }).locator('input[type="checkbox"]');- await expect(activeCheckbox).toBeDisabled();- const realmRolesSelect = page.locator('or-mwc-input').filter({ hasText: 'Realm roles' });- await expect(realmRolesSelect).toHaveAttribute("disabled");- const managerRolesSelect = page.locator('or-mwc-input').filter({ hasText: 'Manager roles' });- await expect(managerRolesSelect).toHaveAttribute("disabled");+ const activeCheckbox = page.getByRole("checkbox", { name: "Active" });+ await expect(activeCheckbox).toHaveAttribute("aria-readonly");+ const realmRolesSelect = page.getByLabel("Realm roles");+ await expect(realmRolesSelect).toHaveAttribute("readonly");+ const managerRolesSelect = page.getByLabel('Manager roles');+ await expect(managerRolesSelect).toHaveAttribute("readonly");const saveButton = page.getByRole("button", { name: "Save" });await expect(saveButton).toBeDisabled();});diff --git a/ui/app/shared/locales/ar/or.json b/ui/app/shared/locales/ar/or.jsonindex bc7c076bf..4011ba792 100644--- a/ui/app/shared/locales/ar/or.json+++ b/ui/app/shared/locales/ar/or.json@@ -411,7 +411,7 @@"writePermissions": "صلاحيات الكتابة","valueType": "نوع القيمة","filter": {- "action": "FILTER",+ "action": "Filter","assetTypeLabel": "Asset type","assetTypeNone": "None","assetTypeMenuNone": "None",diff --git a/ui/app/shared/locales/cn/or.json b/ui/app/shared/locales/cn/or.jsonindex c081a97ed..936316f6c 100644--- a/ui/app/shared/locales/cn/or.json+++ b/ui/app/shared/locales/cn/or.json@@ -460,7 +460,7 @@"yes": "是的","no": "不","filter": {- "action": "FILTER",+ "action": "Filter","assetTypeLabel": "Asset type","assetTypeNone": "None","assetTypeMenuNone": "None",diff --git a/ui/app/shared/locales/de/or.json b/ui/app/shared/locales/de/or.jsonindex f34fbf213..f7cdc7f4f 100644--- a/ui/app/shared/locales/de/or.json+++ b/ui/app/shared/locales/de/or.json@@ -506,7 +506,7 @@"yes": "Ja","no": "Nein","filter": {- "action": "FILTER",+ "action": "Filter","assetTypeLabel": "Asset type","assetTypeNone": "None","assetTypeMenuNone": "None",diff --git a/ui/app/shared/locales/en/or.json b/ui/app/shared/locales/en/or.jsonindex 821b73836..0a8b95320 100644--- a/ui/app/shared/locales/en/or.json+++ b/ui/app/shared/locales/en/or.json@@ -101,6 +101,7 @@"lengthLessThan": "Array length less than","valueChanges": "Value changes","save": "Save",+ "create": "Create","close": "Close","active": "Active","deleteRulesets": "Delete rule(s)",@@ -395,6 +396,7 @@"role_plural": "Roles","description": "Description","passwordMismatch": "Passwords do not match",+ "passwordInvalid": "Passwords are invalid","twoFactorAuth": "Two Factor Authentication","twoFactorConfigure": "Configure","username": "Username",@@ -403,6 +405,7 @@"deleteUser": "Delete user","deleteRole": "Delete role","roleAlreadyExists": "A role with this name already exists",+ "roleInvalid": "This role name is invalid","deleteUserConfirm": "Are you sure you want to delete the user '{{userName}}'?","deleteRoleConfirm": "Are you sure you want to delete the role '{{roleName}}'?","realmRules": "Realm",@@ -505,6 +508,8 @@"linkedAssets": "Linked assets","realm_role_plural": "Realm roles","manager_role_plural": "Manager roles",+ "read": "Read",+ "write": "Write","restrictAccess": "Restrict access","selectRestrictedAssets": "{{number}} assets","restrictedAccessToAssets": "Restricted access to",@@ -800,6 +805,7 @@"realmAlreadyExists": "Realm name already exists","invalidUsername": "Username must be 3-255 alpha numerical characters","invalidEmail": "Invalid email address",+ "invalidRealm": "Realm must be 2-255 alpha numerical characters","yes": "Yes","no": "No","tag": "Tag",@@ -808,8 +814,8 @@"close": "Close filter","open": "Open filter","filter": "Filter",- "clear": "CLEAR",- "action": "FILTER",+ "clear": "Clear",+ "action": "Filter","assetTypeLabel": "Asset type","assetTypeNone": "None","assetTypeMenuNone": "None",diff --git a/ui/app/shared/locales/es/or.json b/ui/app/shared/locales/es/or.jsonindex 7915397d0..6507d7e94 100644--- a/ui/app/shared/locales/es/or.json+++ b/ui/app/shared/locales/es/or.json@@ -463,7 +463,7 @@"yes": "Sí","no": "No","filter": {- "action": "FILTER",+ "action": "Filter","assetTypeLabel": "Asset type","assetTypeNone": "None","assetTypeMenuNone": "None",diff --git a/ui/app/shared/locales/fr/or.json b/ui/app/shared/locales/fr/or.jsonindex 1784352c0..30575a705 100644--- a/ui/app/shared/locales/fr/or.json+++ b/ui/app/shared/locales/fr/or.json@@ -463,7 +463,7 @@"yes": "Oui","no": "Non","filter": {- "action": "FILTER",+ "action": "Filter","assetTypeLabel": "Asset type","assetTypeNone": "None","assetTypeMenuNone": "None",diff --git a/ui/app/shared/locales/it/or.json b/ui/app/shared/locales/it/or.jsonindex 45941efd8..0dcc07e3e 100644--- a/ui/app/shared/locales/it/or.json+++ b/ui/app/shared/locales/it/or.json@@ -460,7 +460,7 @@"yes": "Sì","no": "No","filter": {- "action": "FILTER",+ "action": "Filter","assetTypeLabel": "Asset type","assetTypeNone": "None","assetTypeMenuNone": "None",diff --git a/ui/app/shared/locales/nl/or.json b/ui/app/shared/locales/nl/or.jsonindex 9e8e68c16..efd70e46e 100644--- a/ui/app/shared/locales/nl/or.json+++ b/ui/app/shared/locales/nl/or.json@@ -99,6 +99,7 @@"lengthLessThan": "Aantal elementen kleiner dan","valueChanges": "Waarde verandert","save": "Opslaan",+ "create": "Aanmaken","close": "Sluiten","active": "Actief","deleteRulesets": "Regels verwijderen",@@ -222,7 +223,7 @@"clear": "wissen","export": "exporteer","addAssetAttribute": "Voeg asset attribuut toe",- "add": "toevoegen",+ "add": "Toevoegen","input": "Input","processors": "Processors","output": "Output",@@ -393,9 +394,11 @@"deleteUser": "Gebruiker verwijderen","deleteRole": "Rol verwijderen","roleAlreadyExists": "Er is al een rol met deze naam",+ "roleInvalid": "Deze naam is ongeldig","deleteUserConfirm": "De gebruiker '{{userName}}' verwijderen?","deleteRoleConfirm": "De rol '{{roleName}}' verwijderen?","passwordMismatch": "Wachtwoorden komen niet overeen",+ "passwordInvalid": "Wachtwoorden zijn ongeldig","twoFactorAuth": "Tweestapsverificatie","twoFactorConfigure": "Configureer","firstName": "Voornaam",@@ -499,6 +502,8 @@"linkedAssets": "Gekoppelde assets","realm_role_plural": "Realm rollen","manager_role_plural": "Manager rollen",+ "read": "Lezen",+ "write": "Schrijven","restrictAccess": "Beperkte toegang","selectRestrictedAssets": "{{number}} assets","restrictedAccessToAssets": "Beperkte toegang tot",@@ -793,6 +798,7 @@"realmAlreadyExists": "Realm naam bestaat al","invalidUsername": "De gebruikersnaam mag 3-255 numerieke tekens bevatten","invalidEmail": "Ongeldig emailadres",+ "invalidRealm": "De realm naam mag 2-255 numerieke tekens bevatten","yes": "Ja","no": "Nee","linked": "Gelinkt",@@ -800,8 +806,8 @@"close": "Filter sluiten","open": "Filter openen","filter": "Filter",- "clear": "LEEGMAKEN",- "action": "FILTER",+ "clear": "Leegmaken",+ "action": "Filter","assetTypeLabel": "Asset type","assetTypeNone": "Geen","assetTypeMenuNone": "Geen",diff --git a/ui/app/shared/locales/pt/or.json b/ui/app/shared/locales/pt/or.jsonindex a1ab7a2e9..01de53793 100644--- a/ui/app/shared/locales/pt/or.json+++ b/ui/app/shared/locales/pt/or.json@@ -461,7 +461,7 @@"yes": "Sim","no": "Não","filter": {- "action": "FILTER",+ "action": "Filter","assetTypeLabel": "Asset type","assetTypeNone": "None","assetTypeMenuNone": "None",diff --git a/ui/app/storybook/.storybook/preview.ts b/ui/app/storybook/.storybook/preview.tsindex 8b19931e6..c9516d1cb 100644--- a/ui/app/storybook/.storybook/preview.ts+++ b/ui/app/storybook/.storybook/preview.ts@@ -22,7 +22,7 @@ import {setStorybookHelpersConfig} from "@wc-toolkit/storybook-helpers";import {themes} from "storybook/theming";import "./styles.css";-setStorybookHelpersConfig({ hideArgRef: true, categoryOrder: ["attributes", "cssProps", "cssParts", "events", "methods"] });+setStorybookHelpersConfig({ hideArgRef: true, categoryOrder: ["attributes", "slots", "cssProps", "cssParts", "events", "methods"] });const style = globalThis.getComputedStyle(document.documentElement);const preview: Preview = {diff --git a/ui/app/storybook/docs/components/or-vaadin-combo-box.mdx b/ui/app/storybook/docs/components/or-vaadin-combo-box.mdxnew file mode 100644index 000000000..636757230--- /dev/null+++ b/ui/app/storybook/docs/components/or-vaadin-combo-box.mdx@@ -0,0 +1,27 @@+{/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+*/}++import { Meta } from '@storybook/addon-docs/blocks';+import * as ComponentStory from "../../../../component/or-vaadin-components/stories/or-vaadin-combo-box.stories"; // stories need relative imports+import {ComponentDocs} from "../../util/componentdocs.mdx";++<Meta title="Components/Combo Box" />++<ComponentDocs story={ComponentStory} options={{displayName: "Combo Box"}} elementsjson={ComponentStory.customElements} />diff --git a/ui/app/storybook/docs/components/or-vaadin-date-time-picker.mdx b/ui/app/storybook/docs/components/or-vaadin-date-time-picker.mdxnew file mode 100644index 000000000..20e31de2a--- /dev/null+++ b/ui/app/storybook/docs/components/or-vaadin-date-time-picker.mdx@@ -0,0 +1,27 @@+{/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+*/}++import { Meta } from '@storybook/addon-docs/blocks';+import * as ComponentStory from "../../../../component/or-vaadin-components/stories/or-vaadin-date-time-picker.stories.ts"; // stories need relative imports+import {ComponentDocs} from "../../util/componentdocs.mdx";++<Meta title="Components/Date Time Picker" />++<ComponentDocs story={ComponentStory} options={{displayName: "Date Time Picker"}} elementsjson={ComponentStory.customElements} />diff --git a/ui/app/storybook/docs/components/or-vaadin-list-box.mdx b/ui/app/storybook/docs/components/or-vaadin-list-box.mdxnew file mode 100644index 000000000..5a1eaf345--- /dev/null+++ b/ui/app/storybook/docs/components/or-vaadin-list-box.mdx@@ -0,0 +1,27 @@+{/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+*/}++import { Meta } from '@storybook/addon-docs/blocks';+import * as ComponentStory from "../../../../component/or-vaadin-components/stories/or-vaadin-list-box.stories"; // stories need relative imports+import {ComponentDocs} from "../../util/componentdocs.mdx";++<Meta title="Components/List Box" />++<ComponentDocs story={ComponentStory} options={{displayName: "List Box"}} elementsjson={ComponentStory.customElements} />diff --git a/ui/app/storybook/docs/components/or-vaadin-select.mdx b/ui/app/storybook/docs/components/or-vaadin-select.mdxnew file mode 100644index 000000000..83cf98794--- /dev/null+++ b/ui/app/storybook/docs/components/or-vaadin-select.mdx@@ -0,0 +1,27 @@+{/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+*/}++import { Meta } from '@storybook/addon-docs/blocks';+import * as ComponentStory from "../../../../component/or-vaadin-components/stories/or-vaadin-select.stories"; // stories need relative imports+import {ComponentDocs} from "../../util/componentdocs.mdx";++<Meta title="Components/Select" />++<ComponentDocs story={ComponentStory} options={{displayName: "Select"}} elementsjson={ComponentStory.customElements} />diff --git a/ui/app/storybook/rsbuild.config.ts b/ui/app/storybook/rsbuild.config.tsindex f697539c5..1ba588a5a 100644--- a/ui/app/storybook/rsbuild.config.ts+++ b/ui/app/storybook/rsbuild.config.ts@@ -49,6 +49,7 @@ export default defineConfig({"@openremote/or-translate": "../../component/or-translate/src","@openremote/or-tree-menu": "../../component/or-tree-menu/src","@openremote/or-vaadin-components": "../../component/or-vaadin-components/src",+ "@openremote/theme": "../../component/theme/src","@openremote/util": "../../util"},// Enable symlinks resolution for workspace packagesdiff --git a/ui/component/or-app/package.json b/ui/component/or-app/package.jsonindex c17d5cb60..db1810532 100644--- a/ui/component/or-app/package.json+++ b/ui/component/or-app/package.json@@ -30,6 +30,7 @@"@openremote/or-icon": "workspace:*","@openremote/or-mwc-components": "workspace:*","@openremote/or-translate": "workspace:*",+ "@openremote/or-vaadin-components": "workspace:*","@reduxjs/toolkit": "^1.8.1","@webcomponents/webcomponentsjs": "^2.6.0","lit": "^3.3.1",diff --git a/ui/component/or-app/src/or-header.ts b/ui/component/or-app/src/or-header.tsindex 1160417e0..6ef53e54e 100644--- a/ui/component/or-app/src/or-header.ts+++ b/ui/component/or-app/src/or-header.ts@@ -8,15 +8,14 @@ import manager, {DefaultColor4,DefaultColor5,DefaultHeaderHeight,- Util,- DEFAULT_LANGUAGES,- Languages+ DEFAULT_LANGUAGES,+ Languages} from "@openremote/core";import "@openremote/or-mwc-components/or-mwc-dialog";import "@openremote/or-icon";-import {getContentWithMenuTemplate} from "@openremote/or-mwc-components/or-mwc-menu";-import {ListItem} from "@openremote/or-mwc-components/or-mwc-list";-import {Alarm, AlarmEvent, AlarmStatus, PersistenceEvent, Realm} from "@openremote/model";+import {OrVaadinSelect} from "@openremote/or-vaadin-components/or-vaadin-select";+import {AlarmEvent, Realm} from "@openremote/model";+import {createMenuBarItem, MenuBarItem} from "@openremote/or-vaadin-components/or-vaadin-menu-bar";import {AppStateKeyed, router, updateRealm} from "./index";import {AnyAction, Store} from "@reduxjs/toolkit";import * as Model from "@openremote/model";@@ -42,17 +41,6 @@ export interface HeaderItem {roles?: string[] | {[client: string]: string[]} | (() => boolean);}-function getHeaderMenuItems(items: HeaderItem[]): ListItem[] {- return items.filter(hasRequiredRole).map((option) => {- return {- text: option.text,- value: option.value ? option.value : "",- icon: option.icon,- href: option.href- };- });-}-function hasRequiredRole(option: HeaderItem): boolean {if (!option.roles) {return true;@@ -133,32 +121,8 @@ export class OrHeader extends LitElement {box-shadow: ${unsafeCSS(DefaultBoxShadowBottom)};}- #drawer {- width: 100%;- position: absolute;- top: var(--internal-or-header-height);- max-height: 0;- height: calc(100% - var(--internal-or-header-height));- transition: max-height 0.25s ease-out;- background: var(--internal-or-header-drawer-color);- color: var(--internal-or-header-drawer-text-color);- --or-icon-fill: var(--internal-or-header-drawer-text-color);- --or-icon-height: calc(var(--internal-or-header-drawer-item-size) - 10px);- --or-icon-width: calc(var(--internal-or-header-drawer-item-size) - 10px);- overflow: auto;- }-- #drawer[opened] {- max-height: 10000px;- transition: max-height 0.75s ease-in;- }-- #drawer > div {- box-sizing: border-box;- width: 100%;- height: 100%;- padding: 10px 0px;- position: relative;+ #drawer-menu vaadin-menu-bar-item::part(content) {+ gap: 8px;}.menu-btn {@@ -169,23 +133,15 @@ export class OrHeader extends LitElement {height: 100%;}- #menu-btn-mobile {+ #mobile-right {display: flex;+ padding-right: 4px;+ gap: 4px;+ align-items: center;margin-left: auto;--or-icon-height: calc(var(--internal-or-header-item-size) - 8px);--or-icon-width: calc(var(--internal-or-header-item-size) - 8px);}-- #menu-btn-mobile #realm-picker > span{- max-width: 70px;- text-overflow: ellipsis;- overflow: hidden;- white-space: nowrap;- }-- #menu-btn-desktop {- display: none;- }#desktop-right {margin-left: auto;@@ -204,7 +160,7 @@ export class OrHeader extends LitElement {cursor: pointer;text-decoration: none !important;color: inherit;- padding: 0 20px;+ padding: 0 10px;font-size: 14px;}@@ -252,26 +208,18 @@ export class OrHeader extends LitElement {}#realm-picker {- position: relative;- display: flex;- height: 50px;- align-items: center;- cursor: pointer;- margin-left: 10px;+ min-width: 140px;}- #realm-picker > span {- margin-right: 2px;+ /* Hides the default menu bar content (three horizontal dots) and replace it ourselves using the slot="prefix" */+ #drawer-menu-button::part(label) {+ display: none;}/* Wide layout: when the viewport width is bigger than 768px, layoutchanges to a wide layout. */- @media (min-width: 768px) {- #menu-btn-desktop {- display: block;- }-- #menu-btn-mobile {+ @media (min-width: 900px) {+ #mobile-right {display: none;}@@ -281,6 +229,8 @@ export class OrHeader extends LitElement {#desktop-right {display: flex;+ align-items: center;+ gap: 8px;}#desktop-left .menu-item {@@ -305,6 +255,10 @@ export class OrHeader extends LitElement {#logo-mobile {display: none;}++ #realm-picker {+ min-width: 160px;+ }#desktop-left ::slotted(*) {display: inline-block;@@ -314,9 +268,13 @@ export class OrHeader extends LitElement {border-bottom: 4px solid var(--internal-or-header-selected-color);line-height: calc(var(--internal-or-header-height) - 4px);}++ .menu-item {+ padding: 0 20px;+ }}- @media (min-width: 1024px) {+ @media (min-width: 1100px) {#desktop-left .menu-item or-icon{@@ -406,8 +364,8 @@ export class OrHeader extends LitElement {return html``;}- const mainItems = this.config.mainMenu;- const secondaryItems = this.config.secondaryMenu;+ const mainItems: HeaderItem[] | undefined = this.config.mainMenu?.filter(hasRequiredRole);+ const secondaryItems: HeaderItem[] | undefined = this.config.secondaryMenu?.filter(hasRequiredRole);return html`<!-- Header -->@@ -418,7 +376,7 @@ export class OrHeader extends LitElement {<!-- This gets hidden on a small screen--><nav id="toolbar-list"><div id="desktop-left">- ${mainItems ? mainItems.filter(hasRequiredRole).map((headerItem) => {+ ${mainItems ? mainItems.map((headerItem) => {return html`<a class="menu-item" href=${this._getHeaderHref(headerItem)} @click="${(e: MouseEvent) => this._onHeaderItemSelect(headerItem, e)}" ?selected="${this.activeMenu === headerItem.href}"><or-icon icon="${headerItem.icon}"></or-icon><or-translate value="${headerItem.text}"></or-translate></a>`;@@ -426,81 +384,34 @@ export class OrHeader extends LitElement {</div></nav><div id="desktop-right">- <div id="alarm-btn">- <a class="menu-item" @click="${(e: MouseEvent) => router.navigate('alarms')}">- <or-icon icon="${this.alarmButton}" style="color:var(${this.alarmColor})" title="${i18next.t("alarm.alarm_plural")}"></or-icon>- </a>- </div>+ <or-vaadin-button theme="icon" title=${i18next.t("alarm.alarm_plural")} @click=${() => router.navigate('alarms')}>+ <or-icon icon=${this.alarmButton} style="color:var(${this.alarmColor})"></or-icon>+ </or-vaadin-button>${this._getRealmMenu((value: string) => this._onRealmSelect(value))}- ${secondaryItems ? getContentWithMenuTemplate(html`- <button id="menu-btn-desktop" class="menu-btn" title="Menu"><or-icon icon="dots-vertical"></or-icon></button>- `,- getHeaderMenuItems(secondaryItems),- undefined,- (value) => this._onSecondaryMenuSelect(value as string)) : ``}+ ${when(secondaryItems, () => this._getSecondaryMenu([secondaryItems ?? []]))}</div>- <div id="menu-btn-mobile">+ <div id="mobile-right">${this._getRealmMenu((value: string) => this._onRealmSelect(value))}- <button id="menu-btn" class="menu-btn" title="Menu" @click="${this._toggleDrawer}"><or-icon icon="${this._drawerOpened ? "close" : "menu"}"></or-icon></button>+ ${when(secondaryItems, () => this._getSecondaryMenu([+ (mainItems?.filter(i => !i.hideMobile) ?? []),+ (secondaryItems?.filter(i => !i.hideMobile) ?? [])+ ]))}</div></div></div>- <div id="drawer" ?opened="${this._drawerOpened}" @click="${this._closeDrawer}">- <div>- <div id="mobile-top">- <nav id="drawer-list">- ${mainItems ? mainItems.filter((option) => !option.hideMobile && hasRequiredRole(option)).map((headerItem) => {- return html`- <a class="menu-item" href=${this._getHeaderHref(headerItem)} @click="${(e: MouseEvent) => this._onHeaderItemSelect(headerItem, e)}" ?selected="${this.activeMenu === headerItem.href}"><or-icon icon="${headerItem.icon}"></or-icon><or-translate value="${headerItem.text}"></or-translate></a>- `;- }) : ``}- </nav>- </div>-- ${secondaryItems ? html`- <div id="mobile-bottom" class="${mainItems.length > 0 ? 'mobile-bottom-border' : ''}">- ${secondaryItems.filter((option) => !option.hideMobile && hasRequiredRole(option)).map((headerItem) => {- return html`- <a class="menu-item" href=${this._getHeaderHref(headerItem)} @click="${(e: MouseEvent) => this._onHeaderItemSelect(headerItem, e)}" ?selected="${this.activeMenu === headerItem.href}"><or-icon icon="${headerItem.icon}"></or-icon><or-translate value="${headerItem.text}"></or-translate></a>- `;- })}- </div>` : ``}- </div>- </div>`;}protected _getRealmMenu(callback: (realm: string) => void): TemplateResult {const currentRealm = this.realms.find((t) => t.name === this.realm);-- let realmTemplate = html`- ${when(this.realms?.length > 1, () => html`- <div id="realm-picker">- <span>${currentRealm ? currentRealm.displayName : ""}</span>- <or-icon icon="chevron-down"></or-icon>- </div>- `)}+ const items = this.realms.map(r => ({value: r.name, label: r.displayName}));+ return html`+ <or-vaadin-select id="realm-picker" .items=${items} .value=${currentRealm?.name}+ ?readonly=${!manager.isSuperUser()} ?disabled=${(items?.length ?? 0) <= 1}+ @change="${(ev: CustomEvent) => callback((ev.currentTarget as OrVaadinSelect).value)}"+ ></or-vaadin-select>`;-- if (manager.isSuperUser()) {- const menuItems = this.realms.map((r) => {- return {- text: r.displayName!,- value: r.name!- } as ListItem;- });-- realmTemplate = html`- ${getContentWithMenuTemplate(- realmTemplate,- menuItems,- currentRealm ? currentRealm.name : undefined,- (value) => callback(value as string))}- `;- }-- return realmTemplate;}protected async _getAlarmButton() {@@ -513,10 +424,34 @@ export class OrHeader extends LitElement {this.alarmColor = newAlarms ? '--or-app-color4, ${unsafeCSS(DefaultColor4)}' : '--or-app-color3, ${unsafeCSS(DefaultColor3)}';}+ protected _getSecondaryMenu(items: HeaderItem[][]): TemplateResult {+ const menuItems: MenuBarItem[][] = items.map(group => {+ return group.map(s => ({...s, text: undefined,+ component: createMenuBarItem(html`+ <or-icon icon=${s.icon}></or-icon>+ <or-translate value=${s.text}></or-translate>+ `)+ }));+ });+ const flatItems: MenuBarItem[] = menuItems.flatMap((group, i) =>+ (i < menuItems.length - 1) ? [...group, {component: createMenuBarItem(html`<hr style="width: 100%; color: white;">`)}] : group+ );+ return html`+ <or-vaadin-menu-bar id="drawer-menu" theme="icon" .items=${flatItems} style="min-width: 40px; width: 40px;"+ @item-selected=${(ev: CustomEvent)=> this._onSecondaryMenuSelect((ev.detail.value as HeaderItem).value!)}>+ <vaadin-menu-bar-button slot="overflow" id="drawer-menu-button" theme="icon">+ <or-icon slot="prefix" icon="dots-vertical"></or-icon>+ </vaadin-menu-bar-button>+ </or-vaadin-menu-bar>+ `;+ }+protected _onSecondaryMenuSelect(value: string) {- const headerItem = this.config!.secondaryMenu!.find((item) => item.value === value);+ const headerItem = [...this.config!.mainMenu!, ...this.config!.secondaryMenu!].find((item) => item.value === value);if (headerItem) {this._onHeaderItemSelect(headerItem);+ } else {+ console.warn("Could not find header item to navigate towards.");}}diff --git a/ui/component/or-app/tsconfig.json b/ui/component/or-app/tsconfig.jsonindex 98ad8a632..d0624eb4a 100644--- a/ui/component/or-app/tsconfig.json+++ b/ui/component/or-app/tsconfig.json@@ -24,6 +24,7 @@{ "path": "../../component/or-rules" },{ "path": "../../component/or-services" },{ "path": "../../component/or-dashboard-builder" },- { "path": "../../component/or-gauge" }+ { "path": "../../component/or-gauge" },+ { "path": "../../component/or-vaadin-components" }]}diff --git a/ui/component/or-asset-tree/package.json b/ui/component/or-asset-tree/package.jsonindex 1384118d1..8ffce2f62 100644--- a/ui/component/or-asset-tree/package.json+++ b/ui/component/or-asset-tree/package.json@@ -27,6 +27,7 @@"@openremote/or-icon": "workspace:*","@openremote/or-mwc-components": "workspace:*","@openremote/or-translate": "workspace:*",+ "@openremote/or-vaadin-components": "workspace:*","lit": "^3.3.1","lodash.debounce": "^4.0.8","qs": "^6.8.0"diff --git a/ui/component/or-asset-tree/src/index.ts b/ui/component/or-asset-tree/src/index.tsindex 9846dfc76..f14a00933 100644--- a/ui/component/or-asset-tree/src/index.ts+++ b/ui/component/or-asset-tree/src/index.ts@@ -1,7 +1,9 @@import {html, LitElement, PropertyValues, TemplateResult} from "lit";import {customElement, property, query, state} from "lit/decorators.js";-import "@openremote/or-mwc-components/or-mwc-input";-import {InputType, OrInputChangedEvent, OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";+import {type OrVaadinTextField} from "@openremote/or-vaadin-components/or-vaadin-text-field";+import {type OrVaadinButton} from "@openremote/or-vaadin-components/or-vaadin-button";+import {comboBoxRenderer, ComboBoxLitRenderer, OrVaadinComboBox} from "@openremote/or-vaadin-components/or-vaadin-combo-box";+import {createMenuBarItem, MenuBarItem} from "@openremote/or-vaadin-components/or-vaadin-menu-bar";import "@openremote/or-icon";import {Asset,@@ -29,7 +31,6 @@ import manager, {EventCallback, subscribe, Util} from "@openremote/core";import Qs from "qs";import {getAssetDescriptorIconTemplate, OrIcon} from "@openremote/or-icon";import "@openremote/or-mwc-components/or-mwc-menu";-import {getContentWithMenuTemplate} from "@openremote/or-mwc-components/or-mwc-menu";import {ListItem} from "@openremote/or-mwc-components/or-mwc-list";import "@openremote/or-mwc-components/or-mwc-list";import {i18next} from "@openremote/or-translate";@@ -321,15 +322,17 @@ export class OrAssetTree extends subscribe(manager)(LitElement) {@query("#clearIconContainer")protected _clearIconContainer!: HTMLElement;@query("#filterInput")- protected _filterInput!: OrMwcInput;+ protected _filterInput!: OrVaadinTextField;@state()protected _filterSettingOpen: boolean = false;@state()protected _assetTypes: AssetDescriptor[] = [];+ @query("#attributeTypeFilter")+ protected _attributeTypeFilter!: OrVaadinComboBox;@query("#attributeNameFilter")- protected _attributeNameFilter!: OrMwcInput;+ protected _attributeNameFilter!: OrVaadinTextField;@query("#attributeValueFilter")- protected _attributeValueFilter!: OrMwcInput;+ protected _attributeValueFilter!: OrVaadinTextField;@state()protected _assetTypeFilter!: string;protected _uniqueAssetTypes: string[] = [];@@ -424,28 +427,25 @@ export class OrAssetTree extends subscribe(manager)(LitElement) {- protected getSelectHeader(): TemplateResult {- return html `<or-mwc-input style="width:100%;" ?disabled="${this._loading}" type="${InputType.TEXT}" .label="${i18next.t("filter.assetTypeLabel")}" iconTrailing="menu-down" iconColor="rgba(0, 0, 0, 0.87)" icon="selection-ellipse" value="${i18next.t("filter.assetTypeNone")}"></or-mwc-input>`;- }-- protected getSelectedHeader(descriptor: AssetDescriptor): TemplateResult {- return html `<or-mwc-input style="width:100%;" ?disabled="${this._loading}" type="${InputType.TEXT}" .label="${i18next.t("filter.assetTypeLabel")}" .iconColor="${descriptor.colour}" iconTrailing="menu-down" icon="${descriptor.icon}" value="${Util.getAssetTypeLabel(descriptor)}"></or-mwc-input>`;- }-- protected assetTypeSelect(): TemplateResult {- if (this._assetTypeFilter) {- const descriptor: AssetDescriptor | undefined = this._assetTypes.find((at: AssetDescriptor) => { return at.name === this._assetTypeFilter });- if (descriptor) {- return this.getSelectedHeader(descriptor);- } else {- return this.getSelectHeader();- }- } else {- return this.getSelectHeader();- }+ protected _getSelectHeader(selected?: AssetDescriptor, descriptors: AssetDescriptor[] = [], disabled = this._loading): TemplateResult {+ const itemRenderer: ComboBoxLitRenderer<AssetDescriptor> = (descriptor: AssetDescriptor) => html`+ <div style="display: flex; align-items: center; gap: 6px;">+ <or-icon icon=${descriptor.icon} style="--or-icon-fill: #${descriptor.colour ?? "000000"}; min-width: 24px;"></or-icon>+ <or-translate value=${Util.getAssetTypeLabel(descriptor)}></or-translate>+ </div>+ `;+ return html`+ <or-vaadin-combo-box id="attributeTypeFilter" ?disabled=${disabled} .items=${descriptors} .selectedItem=${selected}+ style="width: 100%; --vaadin-combo-box-overlay-width: 350px; padding-top: 0px;"+ .itemLabelGenerator=${(descriptor: AssetDescriptor) => Util.getAssetTypeLabel(descriptor)} item-value-path="name"+ ${comboBoxRenderer(itemRenderer, [])}+ @change=${(ev: CustomEvent) => { this._assetTypeFilter = (ev.currentTarget as OrVaadinComboBox).value; }}>+ <or-icon slot="prefix" icon=${selected?.icon ?? "selection-ellipse"} style="color: var(--or-icon-fill); --or-icon-fill: #${selected?.colour ?? "inherit"}"></or-icon>+ <or-translate slot="label" value="filter.assetTypeLabel"></or-translate>+ </or-vaadin-combo-box>+ `;}-protected atLeastOneNodeToBeShown(): boolean {let atLeastOne: boolean = false;this._nodes?.forEach((value: UiAssetTreeNode) => {@@ -459,6 +459,14 @@ export class OrAssetTree extends subscribe(manager)(LitElement) {protected render() {const canAdd = this._canAdd();+ const menuItems: MenuBarItem[] = [{+ component: createMenuBarItem(html`<or-icon icon="sort-variant"></or-icon>`),+ children: [+ { className: "name", checked: this.sortBy === "name", component: createMenuBarItem(html`<or-translate value="name"></or-translate>`) },+ { className: "type", checked: this.sortBy === "type", component: createMenuBarItem(html`<or-translate value="type"></or-translate>`) },+ { className: "createdOn", checked: this.sortBy === "createdOn", component: createMenuBarItem(html`<or-translate value="createdOn"></or-translate>`) }+ ]+ }];return html`<div id="header">@@ -467,35 +475,35 @@ export class OrAssetTree extends subscribe(manager)(LitElement) {</div><div id="header-btns">- <or-mwc-input ?hidden="${!this.selectedIds || this.selectedIds.length === 0 || !this.showDeselectBtn}" type="${InputType.BUTTON}" icon="close" title="${i18next.t("deselect")}" @or-mwc-input-changed="${() => this._onDeselectClicked()}"></or-mwc-input>- <or-mwc-input ?hidden="${this._isReadonly() || !this.selectedIds || this.selectedIds.length !== 1 || !canAdd}" type="${InputType.BUTTON}" icon="content-copy" title="${i18next.t("duplicate")}" @or-mwc-input-changed="${() => this._onCopyClicked()}"></or-mwc-input>- <or-mwc-input ?hidden="${this._isReadonly() || !this.selectedIds || this.selectedIds.length === 0 || this._gatewayDescendantIsSelected()}" type="${InputType.BUTTON}" icon="delete" title="${i18next.t("delete")}" @or-mwc-input-changed="${() => this._onDeleteClicked()}"></or-mwc-input>- <or-mwc-input ?hidden="${this._isReadonly() || !canAdd}" type="${InputType.BUTTON}" icon="plus" title="${i18next.t("addAsset")}" @or-mwc-input-changed="${() => this._onAddClicked()}"></or-mwc-input>-- ${getContentWithMenuTemplate(- html`<or-mwc-input type="${InputType.BUTTON}" ?hidden="${!this.showSortBtn}" icon="sort-variant" title="${i18next.t("sort")}" ></or-mwc-input>`,- ["name", "type", "createdOn"].map((sort) => { return {value: sort, text: i18next.t(sort)} as ListItem; }),- this.sortBy,- (v) => this._onSortClicked(v as string))}+ <or-vaadin-button theme="icon" ?hidden=${!this.selectedIds || this.selectedIds.length === 0 || !this.showDeselectBtn}+ title=${i18next.t("deselect")} @click=${() => this._onDeselectClicked()}>+ <or-icon icon="close"></or-icon>+ </or-vaadin-button>+ <or-vaadin-button theme="icon" ?hidden=${this._isReadonly() || !this.selectedIds || this.selectedIds.length !== 1 || !canAdd}+ title=${i18next.t("duplicate")} @click=${() => this._onCopyClicked()}>+ <or-icon icon="content-copy"></or-icon>+ </or-vaadin-button>+ <or-vaadin-button theme="icon" ?hidden=${this._isReadonly() || !this.selectedIds || this.selectedIds.length === 0 || this._gatewayDescendantIsSelected()}+ title=${i18next.t("delete")} @click=${() => this._onDeleteClicked()}>+ <or-icon icon="delete"></or-icon>+ </or-vaadin-button>+ <or-vaadin-button theme="icon" ?hidden=${this._isReadonly() || !canAdd}+ title=${i18next.t("addAsset")} @click=${() => this._onAddClicked()}>+ <or-icon icon="plus"></or-icon>+ </or-vaadin-button>+ <or-vaadin-menu-bar theme="icon" .items=${menuItems}+ @item-selected=${(ev: CustomEvent)=> this._onSortClicked((ev.detail.value as MenuBarItem).className)}+ ></or-vaadin-menu-bar></div></div>${when(this.showFilter, () => html`<div id="asset-tree-filter">- <or-mwc-input id="filterInput"- ?disabled="${this._loading}"- style="width: 100%;"- type="${InputType.TEXT}"- placeholder="${i18next.t("filter.filter")}..."- compact="true"- outlined="true"- @input="${debounce(() => {- // Means some input is occurring so delay filter- this._onFilterInput(this._filterInput.nativeValue);- }, 200)}">- </or-mwc-input>+ <or-vaadin-text-field id="filterInput" ?disabled=${this._loading} style="width: 100%;" placeholder="${i18next.t("filter.filter")}..."+ @input=${debounce(() => { this._onFilterInput(this._filterInput.value); }, 200)}+ ></or-vaadin-text-field>${when(this.showFilterIcon, () => html`- <or-icon id="filterSettingsIcon" icon="${this._filterSettingOpen ? "window-close" : "tune"}" title="${i18next.t(this._filterSettingOpen ? "filter.close" : "filter.open")}" @click="${() => {+ <or-vaadin-button id="filterSettingsIcon" theme="icon" title=${i18next.t(this._filterSettingOpen ? "filter.close" : "filter.open")} @click=${() => {if (this._filterSettingOpen) {this._filterSettingOpen = false;} else {@@ -521,46 +529,34 @@ export class OrAssetTree extends subscribe(manager)(LitElement) {this._assetTypeFilter = '';}}- }}"></or-icon>+ }}>+ <or-icon icon=${this._filterSettingOpen ? "window-close" : "tune"}></or-icon>+ </or-vaadin-button>`)}</div><div id="asset-tree-filter-setting" class="${this._filterSettingOpen ? "visible" : ""}"><div class="advanced-filter">- ${this._assetTypes.length > 0 ? getContentWithMenuTemplate(- this.assetTypeSelect(),- this.mapDescriptors(this._assetTypes, {text: i18next.t("filter.assetTypeMenuNone"), value: "", icon: "selection-ellipse"}),- undefined,- (v: string[] | string) => {- this._assetTypeFilter = (v as string);- },- undefined,- false,- true,- true) : html``- }- <or-mwc-input id="attributeNameFilter" .label="${i18next.t("filter.attributeLabel")}"-- .type="${InputType.TEXT}"- style="margin-top: 10px;"- ?disabled="${this._loading}"- @input="${(e: KeyboardEvent) => {- this._shouldEnableAttrTypeEvent(e);- }}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- this._shouldEnableAttrType((e.detail.value as string) || undefined);- }}"></or-mwc-input>- <or-mwc-input id="attributeValueFilter" .label="${i18next.t("filter.attributeValueLabel")}"-- .type="${InputType.TEXT}"- style="margin-top: 10px;"- disabled></or-mwc-input>+ ${when(this._assetTypes.length > 0, () => this._getSelectHeader(+ this._assetTypes?.find((at: AssetDescriptor) => { return at.name === this._assetTypeFilter }),+ this._assetTypes+ ))}+ <or-vaadin-text-field id="attributeNameFilter" style="margin-top: 10px;" ?disabled=${this._loading}+ @input=${(e: KeyboardEvent) => this._shouldEnableAttrTypeEvent(e)}+ @change=${(e: CustomEvent) => this._shouldEnableAttrType((e.currentTarget as OrVaadinTextField).value)}>+ <or-translate slot="label" value="filter.attributeLabel"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-text-field id="attributeValueFilter" style="margin-top: 10px;" disabled>+ <or-translate slot="label" value="filter.attributeValueLabel"></or-translate>+ </or-vaadin-text-field>+<div style="margin-top: 10px;">- <or-mwc-input style="float:left;" type="${InputType.BUTTON}" label="filter.clear" @or-mwc-input-changed="${() => {+ <or-vaadin-button style="float: left" @click=${() => {// Wipe the current value and hide the clear button- this._filterInput.value = undefined;+ this._filterInput.toggleAttribute("value", false);- this._attributeValueFilter.value = undefined;- this._attributeNameFilter.value = undefined;+ this._attributeTypeFilter?.clear();+ this._attributeValueFilter.clear();+ this._attributeNameFilter.clear();this._attributeValueFilter.disabled = true;@@ -570,10 +566,12 @@ export class OrAssetTree extends subscribe(manager)(LitElement) {// Call filteringthis._doFiltering();- }}"></or-mwc-input>- <or-mwc-input style="float: right;" type="${InputType.BUTTON}" label="filter.action" raised @or-mwc-input-changed="${() => {- this._filterFromSettings();- }}"></or-mwc-input>+ }}>+ <or-translate value="filter.clear"></or-translate>+ </or-vaadin-button>+ <or-vaadin-button style="float: right;" theme="primary" @click=${() => {this._filterFromSettings()}}>+ <or-translate value="filter.action"></or-translate>+ </or-vaadin-button></div></div></div>@@ -593,11 +591,13 @@ export class OrAssetTree extends subscribe(manager)(LitElement) {<div class="end-element loadmore-element" node-asset-id="${''}" @dragleave=${(ev: DragEvent) => { this._onDragLeave(ev) }}@dragenter="${(ev: DragEvent) => this._onDragEnter(ev)}" @dragend="${(ev: DragEvent) => this._onDragEnd(ev)}"@dragover="${(ev: DragEvent) => this._onDragOver(ev)}">- <or-mwc-input type=${InputType.BUTTON} label="loadMore" outlined compact @or-mwc-input-changed=${() => {+ <or-vaadin-button @click=${() => {const cache: Asset[] = [];OrAssetTree._forEachNodeRecursive(this._nodes ?? [], n => n.asset && cache.push(n.asset));this._loadAssets(undefined, this._nodes?.length ?? 0, cache);- }}></or-mwc-input>+ }}>+ <or-translate value="loadMore"></or-translate>+ </or-vaadin-button></div></li>`)}@@ -824,7 +824,9 @@ export class OrAssetTree extends subscribe(manager)(LitElement) {const isExpander = evt && (evt.target as HTMLElement).className.indexOf("expander") >= 0;const isParentCheckbox = evt && (evt.target as OrIcon)?.icon?.includes("checkbox-multiple");- const isLoadMoreButton = evt && (evt.target as OrMwcInput)?.parentElement?.classList.contains("loadmore-element");+ const isLoadMoreButton = evt && (+ (evt.target as OrVaadinButton)?.parentElement?.classList.contains("loadmore-element") ||+ (evt.target as HTMLElement)?.parentElement?.parentElement?.classList.contains("loadmore-element"));if (isExpander) {this._toggleExpander((evt.target as HTMLElement), node);@@ -1274,7 +1276,7 @@ export class OrAssetTree extends subscribe(manager)(LitElement) {let foundAssetIds: string[];try {- console.debug(`Querying assets using filter '${this._filterInput.nativeValue}'...`);+ console.debug(`Querying assets using filter '${this._filterInput.value}'...`);const promises = assetQueries.map(q => manager.rest.api.AssetResource.queryAssetTree(q));const responses = await Promise.all(promises);foundAssets = responses.flatMap(r => r.data.assets ?? []);@@ -1468,7 +1470,7 @@ export class OrAssetTree extends subscribe(manager)(LitElement) {const onAddChanged = (ev: OrAddChangedEvent) => {const nameValid = !!ev.detail.name && ev.detail.name.trim().length > 0 && ev.detail.name.trim().length < 1024;- const addBtn = dialog.shadowRoot!.getElementById("add-btn") as OrMwcInput;+ const addBtn = dialog.shadowRoot!.getElementById("add-btn") as OrVaadinButton;addBtn.disabled = !ev.detail.descriptor || !nameValid;};@@ -1480,11 +1482,14 @@ export class OrAssetTree extends subscribe(manager)(LitElement) {.setActions([{actionName: "cancel",- content: "cancel"+ content: html`<or-vaadin-button><or-translate value="cancel"></or-translate></or-vaadin-button>`},{actionName: "add",- content: html`<or-mwc-input id="add-btn" class="button" .type="${InputType.BUTTON}" label="add" disabled></or-mwc-input>`,+ content: html`+ <or-vaadin-button id="add-btn" theme="primary" disabled>+ <or-translate value="add"></or-translate>+ </or-vaadin-button>`,action: () => {const addAssetDialog = dialog.shadowRoot!.getElementById("add-panel") as OrAddAssetDialog;@@ -1583,7 +1588,7 @@ export class OrAssetTree extends subscribe(manager)(LitElement) {}}- protected _onSortClicked(sortBy: string) {+ protected _onSortClicked(sortBy?: string) {this.sortBy = sortBy;}@@ -2192,7 +2197,9 @@ export class OrAssetTree extends subscribe(manager)(LitElement) {${!treeNode.children || (treeNode.expandable && !treeNode.expanded) ? `` : treeNode.children.map((childNode) => this._treeNodeTemplate(childNode, level + 1)).filter(t => !!t)}${when(treeNode.asset?.id && this._incompleteParentIds.includes(treeNode.asset.id), () => html`<li class="asset-list-element loadmore-element">- <or-mwc-input type=${InputType.BUTTON} outlined label="loadMore" style="padding-left: ${(level + 1) * 22}px;"></or-mwc-input>+ <or-vaadin-button style="padding-left: ${(level + 1) * 22}px;">+ <or-translate value="loadMore"></or-translate>+ </or-vaadin-button></li>`)}</ol>diff --git a/ui/component/or-asset-tree/src/or-add-asset-dialog.ts b/ui/component/or-asset-tree/src/or-add-asset-dialog.tsindex db05dafc3..e0daf698f 100644--- a/ui/component/or-asset-tree/src/or-add-asset-dialog.ts+++ b/ui/component/or-asset-tree/src/or-add-asset-dialog.ts@@ -1,21 +1,19 @@-import {css, html, LitElement, unsafeCSS} from "lit";+import {css, html, LitElement, TemplateResult, unsafeCSS} from "lit";import {customElement, property, query} from "lit/decorators.js";import {AgentDescriptor, Asset, AssetDescriptor, AttributeDescriptor, AssetModelUtil} from "@openremote/model";-import "@openremote/or-mwc-components/or-mwc-input";import {AssetTreeConfig, OrAssetTreeSelectionEvent} from "./index";-import {- createListGroup,- ListGroupItem,- ListItem,- OrMwcList,- OrMwcListChangedEvent-} from "@openremote/or-mwc-components/or-mwc-list";import {i18next} from "@openremote/or-translate";+import {ifDefined} from "lit/directives/if-defined.js";+import {styleMap} from "lit/directives/style-map.js";+import "@openremote/or-vaadin-components/or-vaadin-list-box";+import "@openremote/or-vaadin-components/or-vaadin-item";+import {OrVaadinTextField} from "@openremote/or-vaadin-components/or-vaadin-text-field";+import {OrVaadinCheckbox} from "@openremote/or-vaadin-components/or-vaadin-checkbox";+import {OrVaadinListBox, ListItem} from "@openremote/or-vaadin-components/or-vaadin-list-box";+import { when } from "lit/directives/when.js";import {DefaultColor2, DefaultColor3, DefaultColor5, Util} from "@openremote/core";-import {InputType, OrMwcInput, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import debounce from "lodash.debounce";-export type OrAddAssetDetail = {name: string | undefined;descriptor: AssetDescriptor | AgentDescriptor | undefined;@@ -73,19 +71,16 @@ export class OrAddAssetDialog extends LitElement {public name: string = "New Asset";@query("#name-input")- protected nameInput!: OrMwcInput;+ protected nameInput!: OrVaadinTextField;@query("#agent-list")- protected agentList?: OrMwcList;+ protected agentList?: OrVaadinListBox;@query("#asset-list")- protected assetList?: OrMwcList;-- @query("#parent-asset-list")- protected parentAssetList?: OrMwcList;+ protected assetList?: OrVaadinListBox;@query("#filterInput")- private _filterInput!: OrMwcInput;+ private _filterInput!: OrVaadinTextField;public static get styles() {// language=CSS@@ -104,7 +99,6 @@ export class OrAddAssetDialog extends LitElement {#toggle-parent-selector,#remove-parent {- flex: 0 0 50px;margin: 4px 0 0 5px;}@@ -115,6 +109,7 @@ export class OrAddAssetDialog extends LitElement {#parent-wrapper {display: flex;+ align-items: end;}#parent {@@ -168,7 +163,7 @@ export class OrAddAssetDialog extends LitElement {#type-list-container {display: flex;flex-direction: column;- width: 260px;+ width: 300px;border-right: 1px solid var(--or-app-color5, ${unsafeCSS(DefaultColor5)});}@@ -230,29 +225,26 @@ export class OrAddAssetDialog extends LitElement {const agentItems = mapDescriptors(this.agentTypes);const assetItems = mapDescriptors(this.assetTypes);-const searchProvider = (item: ListItem) => (item.text ?? "").toLowerCase().includes(this.typeFilter.toLowerCase());const filteredAgentItems = agentItems.filter(searchProvider);const filteredAssetItems = assetItems.filter(searchProvider);--- const lists: ListGroupItem[] = [];- if (agentItems.length > 0) {- lists.push(- {- heading: i18next.t("agents"),- list: html`<or-mwc-list @or-mwc-list-changed="${(evt: OrMwcListChangedEvent) => {if (evt.detail.length === 1) this.onTypeChanged(true, evt.detail[0] as ListItem); }}" .listItems="${filteredAgentItems}" id="agent-list"></or-mwc-list>`- }- );- }- if (assetItems.length > 0) {- lists.push(- {- heading: i18next.t("assets"),- list: html`<or-mwc-list @or-mwc-list-changed="${(evt: OrMwcListChangedEvent) => {if (evt.detail.length === 1) this.onTypeChanged(false, evt.detail[0] as ListItem); }}" .listItems="${filteredAssetItems}" id="asset-list"></or-mwc-list>`- }- );- }++ const getListTemplate = (items: ListItem[], isAgent = false): TemplateResult => html`+ <or-vaadin-list-box id="${isAgent ? "agent-list" : "asset-list"}" style="padding: var(--lumo-space-s) 0;"+ @selected-changed=${(ev: CustomEvent) => this.onTypeChanged(isAgent, items[ev.detail.value])}>+ <b style="padding: 0 var(--lumo-space-s);"><or-translate value=${isAgent ? "agents" : "assets"}></or-translate></b>+ ${items.map(item => html`+ <or-vaadin-item style=${styleMap(item.styleMap ?? {})}>+ <div style="display: flex; align-items: center; gap: 8px;">+ <or-icon icon=${ifDefined(item.icon)}></or-icon>+ <span style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">+ ${item.text ?? item.value ?? html`<or-translate value="unknown"></or-translate>`}+ </span>+ </div>+ </or-vaadin-item>+ `)}+ </or-vaadin-list-box>+ `;const parentStr = this.parent ? this.parent.name + " (" + this.parent.id + ")" : i18next.t("none");@@ -261,19 +253,15 @@ export class OrAddAssetDialog extends LitElement {<form id="mdc-dialog-form-add" class="row"><div id="type-list-container" class="col"><div id="type-list-filter">- <or-mwc-input- id="filterInput"- .type="${InputType.TEXT}"- placeholder="${i18next.t("filter.filter")}..."- compact="true"- outlined="true"- @input="${debounce(() => {- this.typeFilter = this._filterInput.nativeValue ?? "";- }, 200)}"- ></or-mwc-input>+ <or-vaadin-text-field id="filterInput" placeholder=${i18next.t("search")}+ @input=${debounce(() => this.typeFilter = this._filterInput.value ?? "", 200)}>+ <or-icon slot="suffix" icon="magnify"></or-icon>+ </or-vaadin-text-field></div><div id="type-list">- ${createListGroup(lists)}+ ${when(agentItems.length > 0, () => getListTemplate(filteredAgentItems, true))}+ <hr style="color: white;" />+ ${when(assetItems.length > 0, () => getListTemplate(filteredAssetItems, false))}</div></div>@@ -307,11 +295,23 @@ export class OrAddAssetDialog extends LitElement {<or-translate id="type-description" .value="${Util.getAssetTypeLabel(descriptor)}"></or-translate></div><div id="name-wrapper">- <or-mwc-input id="name-input" .type="${InputType.TEXT}" min="1" max="1023" required label="${i18next.t("name")}" .value="${this.name}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.onNameChanged(e.detail.value)}"></or-mwc-input>+ <or-vaadin-text-field id="name-input" minlength="1" maxlength="1023" required value=${this.name}+ @change=${(ev: Event) => {+ const elem = ev.currentTarget as OrVaadinTextField;+ if(elem.checkValidity()) this.onNameChanged(elem.value);+ }}>+ <or-translate slot="label" value="name"></or-translate>+ </or-vaadin-text-field><div id="parent-wrapper">- <or-mwc-input id="parent" .type="${InputType.TEXT}" readonly label="${i18next.t("parent")}" .value="${parentStr}" @click="${() => this._onToggleParentAssetSelector()}"></or-mwc-input>- <or-mwc-input id="remove-parent" ?disabled="${!this.parent}" type="${InputType.BUTTON}" icon="close" @or-mwc-input-changed="${() => this._onDeselectClicked()}"></or-mwc-input>- <or-mwc-input id="toggle-parent-selector" icon="${this.showParentAssetSelector ? "pencil-off" : "pencil"}" type="${InputType.BUTTON}" @or-mwc-input-changed="${() => this._onToggleParentAssetSelector()}"></or-mwc-input>+ <or-vaadin-text-field id="parent" readonly value=${parentStr}>+ <or-translate slot="label" value="parent"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-button id="remove-parent" theme="icon" ?disabled=${!this.parent} @click=${() => this._onDeselectClicked()}>+ <or-icon icon="close"></or-icon>+ </or-vaadin-button>+ <or-vaadin-button id="toggle-parent-selector" theme="icon" @click=${() => this._onToggleParentAssetSelector()}>+ <or-icon icon=${this.showParentAssetSelector ? "pencil-off" : "pencil"}></or-icon>+ </or-vaadin-button></div></div>@@ -323,8 +323,7 @@ export class OrAddAssetDialog extends LitElement {<div style="display: grid">${attributes.sort(Util.sortByString((attribute) => attribute.name!)).map(attribute => html`- <or-mwc-input .type="${InputType.CHECKBOX}" .label="${Util.getAttributeLabel(undefined, attribute, descriptor.name, true)}"- .disabled="${true}" .value="${true}"></or-mwc-input>+ <or-vaadin-checkbox readonly checked label=${Util.getAttributeLabel(undefined, attribute, undefined, true)}></or-vaadin-checkbox>`)}</div>`}@@ -333,15 +332,20 @@ export class OrAddAssetDialog extends LitElement {? html``: html`<div>- <div class="heading"><or-translate value="optional_attributes"></or-translate></div>- <div style="display: grid">+ <div class="heading">${i18next.t("optional_attributes")}</div>+ <or-vaadin-checkbox-group theme="vertical" .value=${this.selectedAttributes.map(attr => attr.name)}>${optionalAttributes.sort(Util.sortByString((attribute) => attribute.name!))- .map(attribute => html`- <or-mwc-input .type="${InputType.CHECKBOX}" .label="${Util.getAttributeLabel(undefined, attribute, descriptor.name, true)}"- .value="${this.selectedAttributes.find((selected) => selected === attribute)}"- @or-mwc-input-changed="${(evt: OrInputChangedEvent) => evt.detail.value ? this.selectedAttributes.push(attribute) : this.selectedAttributes.splice(this.selectedAttributes.findIndex((s) => s === attribute), 1)}"></or-mwc-input>- `)}- </div>+ .map(attribute => {+ return html`+ <or-vaadin-checkbox value=${attribute.name} label=${Util.getAttributeLabel(undefined, attribute, undefined, true)}+ @change=${(ev: Event) => (ev.currentTarget as OrVaadinCheckbox).checked+ ? this.selectedAttributes.push(attribute)+ : this.selectedAttributes.splice(this.selectedAttributes.findIndex((s) => s.name === attribute.name), 1)+ }>+ </or-vaadin-checkbox>+ `+ })}+ </or-vaadin-checkbox-group></div>`}`;@@ -361,7 +365,7 @@ export class OrAddAssetDialog extends LitElement {// Deselect other list selectionconst otherList = isAgent ? this.assetList : this.agentList;if (otherList) {- otherList.values = undefined;+ otherList.selected = undefined;}this.onModified();};diff --git a/ui/component/or-asset-tree/src/style.ts b/ui/component/or-asset-tree/src/style.tsindex 0fcb833a0..58eadb574 100644--- a/ui/component/or-asset-tree/src/style.ts+++ b/ui/component/or-asset-tree/src/style.ts@@ -85,6 +85,7 @@ export const style = css`#header-btns {display: flex;flex-direction: row;+ align-items: center;padding-right: 5px;}@@ -252,7 +253,7 @@ export const style = css`}#filterInput {- padding: 7px 12px 7px 7px;+ padding: 7px;}#filterAssetTypeDownIcon {@@ -265,8 +266,7 @@ export const style = css`}#filterSettingsIcon {- cursor: pointer;- margin-right: 12px;+ margin-right: 7px;}#asset-tree-filter-setting {diff --git a/ui/component/or-asset-tree/test/fixtures/index.ts b/ui/component/or-asset-tree/test/fixtures/index.tsindex fb9818ea1..7ba36f56c 100644--- a/ui/component/or-asset-tree/test/fixtures/index.ts+++ b/ui/component/or-asset-tree/test/fixtures/index.ts@@ -7,7 +7,7 @@ export class AssetTree {* Returns a locator of the filter input*/getFilterInput() {- return this.page.locator(`or-asset-tree #filterInput input[type="text"]`);+ return this.page.locator("or-asset-tree #filterInput").getByRole("textbox");}/**diff --git a/ui/component/or-asset-tree/tsconfig.json b/ui/component/or-asset-tree/tsconfig.jsonindex f4eb27c61..a0889762d 100644--- a/ui/component/or-asset-tree/tsconfig.json+++ b/ui/component/or-asset-tree/tsconfig.json@@ -12,6 +12,7 @@{ "path": "../rest" },{ "path": "../model" },{ "path": "../or-mwc-components" },+ { "path": "../or-vaadin-components" },{ "path": "../or-translate" },{ "path": "../or-icon" }]diff --git a/ui/component/or-asset-viewer/package.json b/ui/component/or-asset-viewer/package.jsonindex 0cdb07143..78e309217 100644--- a/ui/component/or-asset-viewer/package.json+++ b/ui/component/or-asset-viewer/package.json@@ -33,6 +33,7 @@"@openremote/or-icon": "workspace:*","@openremote/or-mwc-components": "workspace:*","@openremote/or-translate": "workspace:*",+ "@openremote/or-vaadin-components": "workspace:*","i18next": "^21.5.3","lit": "^3.3.1"},diff --git a/ui/component/or-asset-viewer/src/index.ts b/ui/component/or-asset-viewer/src/index.tsindex 8badbd3f4..9a8a741e9 100644--- a/ui/component/or-asset-viewer/src/index.ts+++ b/ui/component/or-asset-viewer/src/index.ts@@ -1,4 +1,6 @@// Declare require method which we'll use for importing webpack resources (using ES6 imports will confuse typescript parser)+import {OrVaadinButton} from "@openremote/or-vaadin-components/or-vaadin-button";+declare function require(name: string): any;import {html, LitElement, PropertyValues, TemplateResult, unsafeCSS} from "lit";@@ -13,12 +15,14 @@ import "@openremote/or-components/or-panel";import "@openremote/or-mwc-components/or-mwc-dialog";import {showOkCancelDialog, showOkDialog} from "@openremote/or-mwc-components/or-mwc-dialog";import "@openremote/or-mwc-components/or-mwc-list";-import {translate} from "@openremote/or-translate";+import {OrTranslate, translate} from "@openremote/or-translate";import {InputType, OrInputChangedEvent, OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";import manager, {OPENREMOTE_CLIENT_ID, RESTRICTED_USER_REALM_ROLE, subscribe, Util} from "@openremote/core";import {OrMwcTable, OrMwcTableRowClickEvent} from "@openremote/or-mwc-components/or-mwc-table";import {OrChartConfig} from "@openremote/or-chart";import {HistoryConfig, OrAttributeHistory} from "@openremote/or-attribute-history";+import {type OrVaadinSelect} from "@openremote/or-vaadin-components/or-vaadin-select";+import {type OrVaadinTextField} from "@openremote/or-vaadin-components/or-vaadin-text-field";import {AgentDescriptor,Asset,@@ -45,7 +49,10 @@ import {OrEditAssetModifiedEvent, OrEditAssetPanel, ValidatorResult} from "./or-import "@openremote/or-mwc-components/or-mwc-snackbar";import {showSnackbar} from "@openremote/or-mwc-components/or-mwc-snackbar";import {progressCircular} from "@openremote/or-mwc-components/style";-import { when } from "lit/directives/when.js";+import {when} from "lit/directives/when.js";+import {ifDefined} from "lit/directives/if-defined.js";+import {OrVaadinCheckbox} from "@openremote/or-vaadin-components/or-vaadin-checkbox";+import {OrVaadinInput} from "@openremote/or-vaadin-components/or-vaadin-input";export interface PanelConfig {type: "info" | "setup" | "history" | "group" | "linkedUsers" | "alarm.linkedAlarms";@@ -397,7 +404,7 @@ function getPanelContent(id: string, assetInfo: AssetInfo, hostElement: LitElemeconst updateFileName = () => {const fileInputElem = hostElement.shadowRoot!.getElementById('fileupload-elem') as HTMLInputElement;const fileNameElem = hostElement.shadowRoot!.getElementById('filename-elem') as HTMLInputElement;- const fileUploadBtn: OrMwcInput = hostElement.shadowRoot!.getElementById("fileupload-btn") as OrMwcInput;+ const fileUploadBtn = hostElement.shadowRoot!.getElementById("fileupload-btn") as OrVaadinButton;const str = fileInputElem.value;if (!str) {@@ -416,8 +423,8 @@ function getPanelContent(id: string, assetInfo: AssetInfo, hostElement: LitEleme}const discoverAssets = () => {- const discoverBtn: OrMwcInput = hostElement.shadowRoot!.getElementById("discover-btn") as OrMwcInput,- cancelBtn: OrMwcInput = hostElement.shadowRoot!.getElementById("cancel-discover-btn") as OrMwcInput;+ const discoverBtn = hostElement.shadowRoot!.getElementById("discover-btn") as OrVaadinButton,+ cancelBtn = hostElement.shadowRoot!.getElementById("cancel-discover-btn") as OrVaadinButton;if (!discoverBtn || !cancelBtn) {return false;@@ -425,7 +432,7 @@ function getPanelContent(id: string, assetInfo: AssetInfo, hostElement: LitElemecancelBtn.hidden = false;discoverBtn.disabled = true;- discoverBtn.label = i18next.t("discovering") + '...';+ (discoverBtn.firstElementChild as OrTranslate).value = "discovering"manager.rest.api.AgentResource.doProtocolAssetDiscovery(asset.id!).then(response => {@@ -443,16 +450,16 @@ function getPanelContent(id: string, assetInfo: AssetInfo, hostElement: LitEleme.finally(() => {cancelBtn.hidden = true;discoverBtn.disabled = false;- discoverBtn.label = i18next.t("discoverAssets");+ (discoverBtn.firstElementChild as OrTranslate).value = "discoverAssets";});}const cancelDiscovery = () => {- const discoverBtn: OrMwcInput = hostElement.shadowRoot!.getElementById("discover-btn") as OrMwcInput,- cancelBtn: OrMwcInput = hostElement.shadowRoot!.getElementById("cancel-discover-btn") as OrMwcInput;+ const discoverBtn = hostElement.shadowRoot!.getElementById("discover-btn") as OrVaadinButton,+ cancelBtn = hostElement.shadowRoot!.getElementById("cancel-discover-btn") as OrVaadinButton;discoverBtn.disabled = false;- discoverBtn.label = i18next.t("discoverAssets");+ (discoverBtn.firstElementChild as OrTranslate).value = "discoverAssets";cancelBtn.hidden = true;// TODO: cancel the request to the manager@@ -460,7 +467,7 @@ function getPanelContent(id: string, assetInfo: AssetInfo, hostElement: LitElemeconst doImport = () => {const fileNameElem = hostElement.shadowRoot!.getElementById('filename-elem') as HTMLInputElement;- const fileUploadBtn = hostElement.shadowRoot!.getElementById("fileupload-btn") as OrMwcInput;+ const fileUploadBtn = hostElement.shadowRoot!.getElementById("fileupload-btn") as OrVaadinButton;const progressElement = hostElement.shadowRoot!.getElementById("progress-circular") as HTMLProgressElement;if (!fileUploadBtn || !progressElement) {@@ -525,18 +532,29 @@ function getPanelContent(id: string, assetInfo: AssetInfo, hostElement: LitElemereturn html`${when(descriptor.assetImport, () => html`<div id="fileupload">- <or-mwc-input style="flex: 0 1 auto;" outlined label="selectFile" .type="${InputType.BUTTON}" @or-mwc-input-changed="${() => hostElement.shadowRoot!.getElementById('fileupload-elem')!.click()}">- <input id="fileupload-elem" name="configfile" type="file" accept=".*" @change="${() => updateFileName()}"/>- </or-mwc-input>- <or-mwc-input style="flex: 1 1 auto; margin: 0 4px 0 10px;" id="filename-elem" .label="${i18next.t("file")}" .type="${InputType.TEXT}" disabled></or-mwc-input>- <or-mwc-input style="flex: 0 1 auto;" id="fileupload-btn" icon="upload" .type="${InputType.BUTTON}" @or-mwc-input-changed="${() => doImport()}" disabled></or-mwc-input>- <progress id="progress-circular" class="hidden pure-material-progress-circular"></progress>+ <or-vaadin-button @click=${() => hostElement.shadowRoot?.getElementById('fileupload-elem')!.click()}>+ <or-translate value="selectFile"></or-translate>+ <input id="fileupload-elem" slot="invisible" name="configfile" type="file" accept=".*" @change="${() => updateFileName()}"/>+ </or-vaadin-button>+ <or-vaadin-text-field id="filename-elem" readonly style="flex: 1 1 auto;">+ <or-translate slot="label" value="file"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-button id="fileupload-btn" theme="icon" @click=${() => doImport()} disabled>+ <or-icon icon="upload"></or-icon>+ </or-vaadin-button>+ <div id="progress-circular" class="hidden" style="flex: 0 0 48px;">+ <progress class="pure-material-progress-circular"></progress>+ </div></div>`)}${when(descriptor.assetDiscovery, () => html`<div id="discovery">- <or-mwc-input outlined id="discover-btn" .type="${InputType.BUTTON}" label="discoverAssets" @or-mwc-input-changed="${() => discoverAssets()}"></or-mwc-input>- <or-mwc-input id="cancel-discover-btn" .type="${InputType.BUTTON}" label="cancel" @or-mwc-input-changed="${() => cancelDiscovery()}" hidden style="margin-left:20px"></or-mwc-input>+ <or-vaadin-button id="discover-btn" @click=${() => discoverAssets()}>+ <or-translate value="discoverAssets"></or-translate>+ </or-vaadin-button>+ <or-vaadin-button id="cancel-discover-btn" hidden theme="tertiary" @click=${() => cancelDiscovery()}>+ <or-translate value="cancel"></or-translate>+ </or-vaadin-button></div>`)}`;@@ -576,12 +594,14 @@ function getPanelContent(id: string, assetInfo: AssetInfo, hostElement: LitElemeconst options = historyAttrs.map((attr) => {const descriptors = AssetModelUtil.getAttributeAndValueDescriptors(asset.type, attr.name, attr);const label = Util.getAttributeLabel(attr, descriptors[0], asset.type, true);- return [attr.name, label];- }).sort(Util.sortByString((item) => item[1] === undefined ? item[0]! : item[1]));+ return { value: attr.name, label: label };+ }).sort(Util.sortByString((item) => item.label ?? item.value));let attrTemplate = html`<div id="attribute-picker">- <or-mwc-input .checkAssetWrite="${false}" .label="${i18next.t("attribute")}" @or-mwc-input-changed="${(evt: OrInputChangedEvent) => attributeChanged(evt.detail.value)}" .type="${InputType.SELECT}" .options="${options}"></or-mwc-input>+ <or-vaadin-select .items=${options} @change=${(ev: Event) => attributeChanged((ev.currentTarget as OrVaadinSelect).value)}>+ <or-translate slot="label" value="attribute"></or-translate>+ </or-vaadin-select></div>`;return html`@@ -593,7 +613,7 @@ function getPanelContent(id: string, assetInfo: AssetInfo, hostElement: LitElemez-index: 1;}- #attribute-picker > or-mwc-input {+ #attribute-picker > or-vaadin-select {width: 250px;}@@ -603,7 +623,7 @@ function getPanelContent(id: string, assetInfo: AssetInfo, hostElement: LitEleme--or-attribute-history-controls-justify-content: flex-start;}- @media screen and (min-width: 1900px) {+ @media screen and (min-width: 2050px) {#attribute-picker {position: absolute;}@@ -733,11 +753,16 @@ function getPanelContent(id: string, assetInfo: AssetInfo, hostElement: LitElemehtml`<div style="display: flex; flex-direction: column;">${availableAttributes.sort().map((attribute) => html`- <or-mwc-input .type="${InputType.CHECKBOX}" .label="${i18next.t(Util.camelCaseToSentenceCase(attribute))}" style="display: inline-flex;"- .value="${!!selectedAttributes.find((selected) => selected === attribute)}"- @or-mwc-input-changed="${(evt: OrInputChangedEvent) =>- evt.detail.value ? newlySelectedAttributes.push(attribute) : newlySelectedAttributes.splice(newlySelectedAttributes.findIndex((s) => s === attribute), 1)}"- ></or-mwc-input>+ <or-vaadin-checkbox label=${i18next.t(Util.camelCaseToSentenceCase(attribute))} style="display: inline-flex;"+ .checked=${!!selectedAttributes.find((selected) => selected === attribute)}+ @change=${(ev: Event) => {+ if((ev.currentTarget as OrVaadinCheckbox).checked) {+ newlySelectedAttributes.push(attribute);+ } else {+ newlySelectedAttributes.splice(newlySelectedAttributes.indexOf(attribute), 1);+ }+ }}+ ></or-vaadin-checkbox>`)}</div>`@@ -755,7 +780,6 @@ function getPanelContent(id: string, assetInfo: AssetInfo, hostElement: LitEleme<style>.asset-group-add-remove-button {position: absolute;- --or-mwc-input-color: currentColor;top: calc(var(--internal-or-asset-viewer-panel-padding) - 15px);right: calc(var(--internal-or-asset-viewer-panel-padding) - 15px);}@@ -764,7 +788,9 @@ function getPanelContent(id: string, assetInfo: AssetInfo, hostElement: LitElemeopacity: 1;}</style>- <or-mwc-input .type="${InputType.BUTTON}" class="asset-group-add-remove-button" icon="pencil" @or-mwc-input-changed="${() => attributePickerModalOpen()}"></or-mwc-input>+ <or-vaadin-button theme="icon" class="asset-group-add-remove-button" @click=${() => attributePickerModalOpen()}>+ <or-icon icon="pencil"></or-icon>+ </or-vaadin-button><or-mwc-table .columns="${headersAndRows[0]}" .rows="${headersAndRows[1]}" .id="${id}-attribute-table" .config="${{stickyFirstColumn: true}}"></or-mwc-table>`;}@@ -881,9 +907,9 @@ export function getPropertyTemplate(asset: Asset, property: string, hostElement:(names) => {if (names) {if (hostElement && hostElement.shadowRoot) {- const pathField = hostElement.shadowRoot.getElementById("property-parentId") as OrMwcInput;+ const pathField = hostElement.shadowRoot.getElementById("property-parentId") as OrVaadinInput;if (pathField) {- pathField.value = names.join(" > ");+ pathField.setAttribute("value", names.join(" > "));}}}@@ -900,7 +926,12 @@ export function getPropertyTemplate(asset: Asset, property: string, hostElement:break;}- return html`<or-mwc-input id="property-${property}" .type="${type}" dense .value="${value}" .readonly="${itemConfig.readonly !== undefined ? itemConfig.readonly : true}" .label="${itemConfig.label}"></or-mwc-input>`;+ return html`+ <or-vaadin-input id="property-${property}" type=${type} value=${value}+ ?readonly=${itemConfig.readonly !== undefined ? itemConfig.readonly : true}+ label=${ifDefined(itemConfig.label)}+ ></or-vaadin-input>+ `;}export function getField(name: string, itemConfig?: InfoPanelItemConfig, content?: TemplateResult): TemplateResult {@@ -1020,6 +1051,7 @@ export async function saveAsset(asset: Asset): Promise<SaveResult> {if (!asset.id) {throw new Error("Request to update existing asset but asset ID is not set");}+ console.debug("Updating asset to", asset);const response = await manager.rest.api.AssetResource.update(asset.id!, asset);success = response.status === 200;savedAsset = response.data;@@ -1155,10 +1187,10 @@ export class OrAssetViewer extends subscribe(manager)(translate(i18next)(LitElemprotected wrapperElem!: HTMLDivElement;@query("#save-btn")- protected saveBtnElem!: OrMwcInput;+ protected saveBtnElem!: OrVaadinButton;@query("#edit-btn")- protected editBtnElem!: OrMwcInput;+ protected editBtnElem!: OrVaadinButton;@query("#editor")protected editor!: OrEditAssetPanel;@@ -1383,17 +1415,35 @@ export class OrAssetViewer extends subscribe(manager)(translate(i18next)(LitElem</a><div id="title"><or-icon title="${descriptor && descriptor.name ? descriptor.name : "unset"}" style="--or-icon-fill: ${descriptor && descriptor.colour ? "#" + descriptor.colour : "unset"}" icon="${descriptor && descriptor.icon ? descriptor.icon : AssetModelUtil.getAssetDescriptorIcon(WellknownAssets.THINGASSET)}"></or-icon>- ${editMode- ? html`- <or-mwc-input id="name-input" .type="${InputType.TEXT}" min="1" max="1023" comfortable required outlined .label="${i18next.t("name")}" .value="${asset.name}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => {asset!.name = e.detail.value; this._assetInfo!.modified = true; this._doValidation();}}"></or-mwc-input>- `- : html`<span>${asset.name}</span>`}+ ${when(editMode, () => html`+ <or-vaadin-text-field minlength="1" maxlength="1023" value=${asset.name}+ @change=${(ev: CustomEvent) => {+ const elem = ev.currentTarget as OrVaadinTextField;+ if(elem.checkValidity()) {+ asset!.name = elem.value;+ this._assetInfo!.modified = true;+ this._doValidation();+ }+ }}>+ <or-translate slot="label" value="name"></or-translate>+ </or-vaadin-text-field>+ `, () => html`+ <span>${asset.name}</span>+ `)}</div><div id="right-wrapper" class="mobileHidden">${validationErrors.length === 0 ? (asset!.createdOn ? html`<or-translate id="created-time" class="tabletHidden" value="createdOnWithDate" .options="${{ date: new Date(asset!.createdOn!) } as TOptions<InitOptions>}"></or-translate>` : ``) : html`<span id="error-wrapper" .title="${validationErrors.join("\n")}"><or-icon icon="alert"></or-icon><or-translate class="tabletHidden" value="validation.invalidAsset"></or-translate></span>`}- ${editMode ? html`<or-mwc-input id="save-btn" .disabled="${!this.isModified()}" raised .type="${InputType.BUTTON}" label="save" @or-mwc-input-changed="${() => this._onSaveClicked()}"></or-mwc-input>` : ``}- ${!this._isReadonly() ? html`<or-mwc-input id="edit-btn" .disabled="${!this._assetInfo.asset.id}" outlined .type="${InputType.BUTTON}" .value="${this.editMode}" .label="${this.editMode ? i18next.t("viewAsset") : i18next.t("editAsset")}" icon="${this.editMode ? "eye" : "pencil"}" @or-mwc-input-changed="${() => this._onEditToggleClicked(!this.editMode!)}"></or-mwc-input>- `: ``}+ ${when(editMode, () => html`+ <or-vaadin-button id="save-btn" theme="primary" ?disabled=${!this.isModified()} @click=${() => this._onSaveClicked()}>+ <or-translate value="save"></or-translate>+ </or-vaadin-button>+ `)}+ ${when(!this._isReadonly(), () => html`+ <or-vaadin-button id="edit-btn" ?disabled=${!this._assetInfo?.asset.id} @click=${() => this._onEditToggleClicked(!this.editMode)}>+ <or-icon slot="prefix" icon=${this.editMode ? "eye" : "pencil"}></or-icon>+ <or-translate value=${this.editMode ? "viewAsset" : "editAsset"}></or-translate>+ </or-vaadin-button>+ `)}</div></div>${content}@@ -1416,8 +1466,6 @@ export class OrAssetViewer extends subscribe(manager)(translate(i18next)(LitElem(detail) => {if (detail.allow) {this._doEditToggle(edit);- } else {- this.editBtnElem.value = !edit;}});}@@ -1471,6 +1519,7 @@ export class OrAssetViewer extends subscribe(manager)(translate(i18next)(LitElemprotected _onAssetModified(validationResults: ValidatorResult[]) {if (this._assetInfo) {+ console.debug("Changing modified state to TRUE!")this._assetInfo.modified = true;this._validationResults = validationResults;}diff --git a/ui/component/or-asset-viewer/src/or-add-attribute-panel.ts b/ui/component/or-asset-viewer/src/or-add-attribute-panel.tsindex e41a2f20f..22699eeab 100644--- a/ui/component/or-asset-viewer/src/or-add-attribute-panel.ts+++ b/ui/component/or-asset-viewer/src/or-add-attribute-panel.ts@@ -1,10 +1,12 @@import {html, LitElement, css, PropertyValues} from "lit";-import {customElement, property, query} from "lit/decorators.js";-import {InputType, OrMwcInput, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";+import {customElement, property} from "lit/decorators.js";+import {OrVaadinTextField} from "@openremote/or-vaadin-components/or-vaadin-text-field";+import {OrVaadinComboBox} from "@openremote/or-vaadin-components/or-vaadin-combo-box";+import {OrVaadinCheckbox} from "@openremote/or-vaadin-components/or-vaadin-checkbox";+import {OrVaadinNumberField} from "@openremote/or-vaadin-components/or-vaadin-number-field";import {i18next} from "@openremote/or-translate"import {Asset, Attribute, AssetModelUtil} from "@openremote/model";import {Util} from "@openremote/core";-import "@openremote/or-mwc-components/or-mwc-input";export class OrAddAttributePanelAttributeChangedEvent extends CustomEvent<Attribute<any>> {@@ -42,21 +44,21 @@ export class OrAddAttributePanel extends LitElement {@property()public arrayDimensions: number = 1;- @query("#array-input")- protected arrayInput!: OrMwcInput;-protected customAttribute: boolean = true;protected attributeTypes?: [string, string][];protected attributeValueTypes?: [string, string][];protected arrayRegex: RegExp = /\[\]/g;public static get styles() {- return css`- or-mwc-input {- width: 300px;- display: block;- padding: 10px 20px;- }`;+ return css`+ #attribute-creator {+ min-width: 300px;+ padding: 20px;+ display: flex;+ flex-direction: column;+ gap: 10px;+ }+ `;}protected shouldUpdate(_changedProperties: PropertyValues) {@@ -99,14 +101,34 @@ export class OrAddAttributePanel extends LitElement {if (!this.attributeTypes || !this.attributeValueTypes) {return;}+ const nameItems = this.attributeTypes.map(type => ({key: type[0], value: type[1]}));+ const nameSelected = nameItems.find(n => n.key === this.attribute.name) ?? nameItems[0];+ const typeItems = this.attributeValueTypes.map(type => ({key: type[0], value: type[1]}));+ const typeSelected = typeItems.find(i => i.key === this.attribute?.type?.replace(this.arrayRegex, ""));return html`<div id="attribute-creator">- <or-mwc-input .type="${InputType.SELECT}" .options="${this.attributeTypes}" .label="${i18next.t("type")}" .value="${"@custom"}" @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onTypeChanged(ev.detail.value)}"></or-mwc-input>- <or-mwc-input id="name-input" .type="${InputType.TEXT}" ?disabled="${!this.customAttribute}" .value="${(this.attribute && this.attribute.name) ? this.attribute.name : undefined}" .label="${i18next.t("name")}" pattern="\\w+" required @keyup="${(ev: KeyboardEvent) => this.onNameChanged((ev.target as OrMwcInput).currentValue)}" @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onNameChanged(ev.detail.value)}"></or-mwc-input>- <or-mwc-input id="type-input" .type="${InputType.SELECT}" ?disabled="${!this.customAttribute}" .value="${this.attribute && this.attribute.type ? this.attribute.type.replace(this.arrayRegex, "") : undefined}" .options="${this.attributeValueTypes}" .label="${i18next.t("valueType")}" @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onValueTypeChanged(ev.detail.value)}"></or-mwc-input>- <or-mwc-input id="array-checkbox" .type="${InputType.CHECKBOX}" ?disabled="${!this.customAttribute}" .value="${this.isArray}" .label="${i18next.t("array")}" @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onArrayChanged(ev.detail.value, 1)}"></or-mwc-input>- <or-mwc-input id="array-input" .type="${InputType.NUMBER}" ?disabled="${!this.isArray || !this.customAttribute}" .value="${this.arrayDimensions}" min="1" max="2" .label="${i18next.t("arrayDimensions")}" @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onArrayChanged(true, ev.detail.value)}"></or-mwc-input>+ <or-vaadin-combo-box .items=${nameItems} .selectedItem=${nameSelected} item-value-path="key" item-label-path="value"+ @change=${(ev: CustomEvent) => this.onTypeChanged((ev.currentTarget as OrVaadinComboBox).value)}>+ <or-translate slot="label" value="type"></or-translate>+ </or-vaadin-combo-box>+ <or-vaadin-text-field id="name-input" ?readonly=${!this.customAttribute} value=${this.attribute?.name} pattern="\\w+" required+ @input=${(ev: InputEvent) => this.onNameChanged((ev.currentTarget as OrVaadinTextField).value)}>+ <or-translate slot="label" value="name"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-combo-box id="type-input" ?readonly=${!this.customAttribute} item-value-path="key" item-label-path="value"+ .items=${typeItems} .selectedItem=${typeSelected}+ @change=${(ev: CustomEvent) => this.onValueTypeChanged((ev.currentTarget as OrVaadinComboBox).value)}>+ <or-translate slot="label" value="valueType"></or-translate>+ </or-vaadin-combo-box>+ <or-vaadin-checkbox id="array-checkbox" ?readonly=${!this.customAttribute} ?checked=${this.isArray}+ @change=${(ev: Event) => this.onArrayChanged((ev.currentTarget as OrVaadinCheckbox).checked, 1)}>+ <label slot="label"><or-translate slot="label" value="array"></label></or-translate>+ </or-vaadin-checkbox>+ <or-vaadin-number-field id="array-input" ?disabled=${!this.isArray} ?readonly=${!this.customAttribute} value=${this.arrayDimensions} min="1" max="2"+ @change=${(ev: Event) => this.onArrayChanged(true, Number((ev.currentTarget as OrVaadinNumberField).value))}>+ <or-translate slot="label" value="arrayDimensions"></or-translate>+ </or-vaadin-number-field></div>`;}diff --git a/ui/component/or-asset-viewer/src/or-edit-asset-panel.ts b/ui/component/or-asset-viewer/src/or-edit-asset-panel.tsindex daa3894a5..c23a9ca39 100644--- a/ui/component/or-asset-viewer/src/or-edit-asset-panel.ts+++ b/ui/component/or-asset-viewer/src/or-edit-asset-panel.ts@@ -1,32 +1,23 @@import {css, html, LitElement, PropertyValues, TemplateResult, unsafeCSS} from "lit";import {until} from "lit/directives/until.js";-import {customElement, property, state} from "lit/decorators.js";-import {- InputType,- OrMwcInput,- OrInputChangedEvent,- getValueHolderInputTemplateProvider,- ValueInputProviderOptions,- OrInputChangedEventDetail,- ValueInputProvider,- ValueInputProviderGenerator-} from "@openremote/or-mwc-components/or-mwc-input";+import {customElement, property} from "lit/decorators.js";+import {type ValueInputProviderOptions, getValueHolderInputTemplateProvider} from "@openremote/or-vaadin-components/value-input-provider";+import {InputType, OrMwcInput, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import {i18next} from "@openremote/or-translate"import {Asset, Attribute, NameValueHolder, AssetModelUtil, WellknownMetaItems} from "@openremote/model";-import { DefaultColor5, DefaultColor3, DefaultColor2, Util} from "@openremote/core";+import {DefaultColor5, DefaultColor3, Util} from "@openremote/core";import "@openremote/or-mwc-components/or-mwc-input";import {OrIcon} from "@openremote/or-icon";import {showDialog, OrMwcDialog, DialogAction} from "@openremote/or-mwc-components/or-mwc-dialog";import {ListItem, ListType, OrMwcList} from "@openremote/or-mwc-components/or-mwc-list";import "./or-add-attribute-panel";import {getField, getPanel, getPropertyTemplate} from "./index";-import {- OrAddAttributePanelAttributeChangedEvent,-} from "./or-add-attribute-panel";+import {OrAddAttributePanelAttributeChangedEvent} from "./or-add-attribute-panel";import {panelStyles} from "./style";-import { OrAssetTree, UiAssetTreeNode } from "@openremote/or-asset-tree";-import {jsonFormsInputTemplateProvider, OrAttributeInput, OrAttributeInputChangedEvent } from "@openremote/or-attribute-input";-import {createRef, ref, Ref } from "lit/directives/ref.js";+import {OrAssetTree, UiAssetTreeNode} from "@openremote/or-asset-tree";+import {jsonFormsInputTemplateProvider, OrAttributeInput, OrAttributeInputChangedEvent} from "@openremote/or-attribute-input";+import {createRef, ref, Ref} from "lit/directives/ref.js";+import {when} from "lit/directives/when.js";// TODO: Add webpack/rollup to build so consumers aren't forced to use the same toolingconst tableStyle = require("@material/data-table/dist/mdc.data-table.css");@@ -40,7 +31,7 @@ const style = css`#parent-edit-wrapper {display: flex;- align-items: center;+ align-items: end;}#parent-edit-wrapper > #property-parentId {@@ -107,7 +98,7 @@ const style = css`.attribute-meta-row.expanded .meta-item-container {transition: max-height 0.5s ease-in-out;}- .meta-item-container or-mwc-input {+ .meta-item-container or-mwc-input, .meta-item-container or-vaadin-input {width: 100%;}.meta-item-wrapper {@@ -237,7 +228,7 @@ export class OrEditAssetPanel extends LitElement {const properties: TemplateResult[] = [getField("type", undefined, getPropertyTemplate(this.asset, "type", this, undefined, undefined, {readonly: true, label: i18next.t("assetType")})),getField("parent", undefined, this._getParentTemplate()),- html`<div @or-mwc-input-changed="${(ev: OrInputChangedEvent) => updatePublicRead(ev.detail.value as boolean)}">+ html`<div @change="${(ev: OrInputChangedEvent) => updatePublicRead(Boolean((ev.currentTarget as HTMLInputElement).value))}">${getField("accessPublicRead", undefined, getPropertyTemplate(this.asset, "accessPublicRead", this, undefined, undefined, {readonly: false, label: i18next.t("accessPublicRead")}))}</div>`];@@ -290,7 +281,7 @@ export class OrEditAssetPanel extends LitElement {expandToggle(tdElems[i] as HTMLElement);}}- tdElem.setAttribute("label", this.expandedAll ? "expandAll" : "collapseAll");+ tdElem.setAttribute("value", this.expandedAll ? "expandAll" : "collapseAll");this.expandedAll = !this.expandedAll;}};@@ -311,7 +302,11 @@ export class OrEditAssetPanel extends LitElement {<th class="mdc-data-table__header-cell" role="columnheader" scope="col"><or-translate value="name"></or-translate></th><th class="mdc-data-table__header-cell" role="columnheader" scope="col"><or-translate value="type"></or-translate></th><th class="mdc-data-table__header-cell" role="columnheader" scope="col"><or-translate value="value"></or-translate></th>- <th class="mdc-data-table__header-cell" role="columnheader" scope="col" style="padding-right:8px;"><or-mwc-input style="float:right;" .type="${InputType.BUTTON}" .label="${i18next.t("expandAll")}" @or-mwc-input-changed="${expandAllToggle}"></or-mwc-input></th>+ <th class="mdc-data-table__header-cell" role="columnheader" scope="col" style="padding-right:8px;">+ <or-vaadin-button style="float: right;" @click=${expandAllToggle}>+ <or-translate value="expandAll"></or-translate>+ </or-vaadin-button>+ </th></tr></thead><tbody class="mdc-data-table__content">@@ -319,7 +314,10 @@ export class OrEditAssetPanel extends LitElement {<tr class="mdc-data-table__row"><td colspan="4"><div class="item-add-attribute">- <or-mwc-input .type="${InputType.BUTTON}" label="addAttribute" icon="plus" @or-mwc-input-changed="${() => this._addAttribute()}"></or-mwc-input>+ <or-vaadin-button @click=${() => this._addAttribute()}>+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value="addAttribute"></or-translate>+ </or-vaadin-button></div></td></tr>@@ -376,7 +374,12 @@ export class OrEditAssetPanel extends LitElement {disableWrite disableSubscribe disableButton compact@or-attribute-input-changed="${(e: OrAttributeInputChangedEvent) => this._onAttributeModified(attribute, e.detail.value)}"></or-attribute-input></td>- <td class="padded-cell mdc-data-table__cell actions-cell">${canDelete ? html`<or-mwc-input type="${InputType.BUTTON}" icon="delete" @or-mwc-input-changed="${deleteAttribute}">` : ``}</td>+ <td class="padded-cell mdc-data-table__cell actions-cell">+ ${when(canDelete, () => html`+ <or-vaadin-button theme="icon" @click=${deleteAttribute}>+ <or-icon icon="delete"></or-icon>+ </or-vaadin-button>+ `)}</tr><tr class="attribute-meta-row"><td colspan="4">@@ -386,7 +389,10 @@ export class OrEditAssetPanel extends LitElement {${metaTemplatesAndValidators.map((metaTemplateAndValidator) => metaTemplateAndValidator.template)}</div><div class="item-add">- <or-mwc-input .type="${InputType.BUTTON}" label="addMetaItems" icon="plus" @or-mwc-input-changed="${() => this._addMetaItems(attribute)}"></or-mwc-input>+ <or-vaadin-button @click=${() => this._addMetaItems(attribute)}>+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value="addMetaItems"></or-translate>+ </or-vaadin-button></div></div></div>@@ -409,6 +415,7 @@ export class OrEditAssetPanel extends LitElement {}protected _onAttributeModified(attribute: Attribute<any>, newValue: any) {+ console.debug("Detected attribute modification;", attribute, newValue);// Check if modification came from external changeconst index = this.changedAttributes.indexOf(attribute.name!);@@ -422,8 +429,9 @@ export class OrEditAssetPanel extends LitElement {this._onModified();}- protected _onMetaItemModified(attribute: Attribute<any>, metaItem: NameValueHolder<any>, detail: OrInputChangedEventDetail | undefined) {- metaItem.value = detail ? detail.value : undefined;+ protected _onMetaItemModified(attribute: Attribute<any>, metaItem: NameValueHolder<any>, value: any) {+ console.debug("Detected Meta item modification;", attribute, metaItem);+ metaItem.value = value ?? undefined;attribute.meta![metaItem.name!] = metaItem.value;this._onModified();}@@ -441,14 +449,14 @@ export class OrEditAssetPanel extends LitElement {if (!valueDescriptor) {console.log("Couldn't find value descriptor for meta item so falling back to simple JSON input: " + metaItem.name);- content = html`<or-mwc-input @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this._onMetaItemModified(attribute, metaItem, ev.detail)}" .type="${InputType.JSON}" .value="${metaItem.value}"></or-mwc-input>`;+ content = html`<or-mwc-input @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this._onMetaItemModified(attribute, metaItem, ev.detail.value)}" .type="${InputType.JSON}" .value="${metaItem.value}"></or-mwc-input>`;} else {const options: ValueInputProviderOptions = {label: Util.getMetaLabel(metaItem, descriptor!, this.asset.type!, true),resizeVertical: true};- const standardInputProvider = getValueHolderInputTemplateProvider(this.asset.type!, metaItem, descriptor, valueDescriptor, (detail) => this._onMetaItemModified(attribute, metaItem, detail), options);- let provider = jsonFormsInputTemplateProvider(standardInputProvider)(this.asset.type!, metaItem, descriptor, valueDescriptor, (detail) => this._onMetaItemModified(attribute, metaItem, detail), options);+ const standardInputProvider = getValueHolderInputTemplateProvider(this.asset.type!, metaItem, descriptor, valueDescriptor, (value: any) => this._onMetaItemModified(attribute, metaItem, value), options);+ let provider = jsonFormsInputTemplateProvider(standardInputProvider)(this.asset.type!, metaItem, descriptor, valueDescriptor, (detail) => this._onMetaItemModified(attribute, metaItem, detail?.value), options);if (!provider) {provider = standardInputProvider;@@ -700,7 +708,9 @@ export class OrEditAssetPanel extends LitElement {return html`<div id="parent-edit-wrapper">${getPropertyTemplate(this.asset, "parentId", this, undefined, undefined, {readonly: true, label: i18next.t("parent")})}- <or-mwc-input id="change-parent-btn" type="${InputType.BUTTON}" outlined label="edit" @or-mwc-input-changed="${openDialog}"></or-mwc-input>+ <or-vaadin-button id="change-parent-btn" @click=${openDialog}>+ <or-translate value="edit"></or-translate>+ </or-vaadin-button></div>`;}diff --git a/ui/component/or-asset-viewer/src/style.ts b/ui/component/or-asset-viewer/src/style.tsindex fe871d1df..76e0288ec 100644--- a/ui/component/or-asset-viewer/src/style.ts+++ b/ui/component/or-asset-viewer/src/style.ts@@ -35,13 +35,11 @@ export const panelStyles = css`}.panel-title {- text-transform: uppercase;- font-weight: bolder;- line-height: 1em;+ font-size: 18px;+ font-weight: bold;color: var(--internal-or-asset-viewer-title-text-color);margin-bottom: 20px;flex: 0 0 auto;- letter-spacing: 0.025em;}.field {@@ -259,9 +257,10 @@ export const style = css`#fileupload, #discovery {display: flex;- align-items: center;+ align-items: end;width: 100%;margin-bottom: 10px;+ gap: 10px;}.hidden {diff --git a/ui/component/or-asset-viewer/test/asset-viewer.test.ts b/ui/component/or-asset-viewer/test/asset-viewer.test.tsindex 90d6c76d3..4626be832 100644--- a/ui/component/or-asset-viewer/test/asset-viewer.test.ts+++ b/ui/component/or-asset-viewer/test/asset-viewer.test.ts@@ -34,7 +34,7 @@ ct("Should show asset invalid error", async ({ mount, assetViewer }) => {});await assetViewer.getAttributeValueLocator("invalid").fill("0.1");await assetViewer.getAttributeValueLocator("invalid").press("Enter");- await expect(component).toContainText("Asset is not valid");+ await expect(assetViewer.getAttributeValueLocator("invalid")).toHaveAttribute("invalid")});ct("Should not show asset invalid error after switching assets", async ({ mount, assetViewer }) => {@@ -43,7 +43,7 @@ ct("Should not show asset invalid error after switching assets", async ({ mount,});await assetViewer.getAttributeValueLocator("invalid").fill("0.1");await assetViewer.getAttributeValueLocator("invalid").press("Enter");- await expect(component).toContainText("Asset is not valid");+ await expect(assetViewer.getAttributeValueLocator("invalid")).toHaveAttribute("invalid")await component.update({ props: { assetId: validId, editMode: true } });await expect(component).not.toContainText("Asset is not valid");diff --git a/ui/component/or-asset-viewer/tsconfig.json b/ui/component/or-asset-viewer/tsconfig.jsonindex 1b805cbb8..2cfad8206 100644--- a/ui/component/or-asset-viewer/tsconfig.json+++ b/ui/component/or-asset-viewer/tsconfig.json@@ -19,6 +19,7 @@{ "path": "../or-attribute-input" },{ "path": "../or-attribute-history" },{ "path": "../or-mwc-components" },- { "path": "../or-json-forms" }+ { "path": "../or-json-forms" },+ { "path": "../or-vaadin-components" }]}diff --git a/ui/component/or-attribute-barchart/package.json b/ui/component/or-attribute-barchart/package.jsonindex fdfab2cac..d751a8701 100644--- a/ui/component/or-attribute-barchart/package.json+++ b/ui/component/or-attribute-barchart/package.json@@ -23,6 +23,7 @@"@openremote/or-icon": "workspace:*","@openremote/or-mwc-components": "workspace:*","@openremote/or-translate": "workspace:*",+ "@openremote/or-vaadin-components": "workspace:*","@openremote/rest": "workspace:*","echarts": "~6.0.0","lit": "^3.3.1",diff --git a/ui/component/or-attribute-barchart/src/index.ts b/ui/component/or-attribute-barchart/src/index.tsindex e8da271bd..dc3d505f2 100644--- a/ui/component/or-attribute-barchart/src/index.ts+++ b/ui/component/or-attribute-barchart/src/index.ts@@ -36,7 +36,6 @@ import {DatasetComponentOption, DataZoomComponent, DataZoomComponentOption, Gridimport {BarChart, BarSeriesOption} from "echarts/charts";import {CanvasRenderer} from "echarts/renderers";import {UniversalTransition} from "echarts/features";-import {InputType, OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";import moment from "moment";import {getAssetDescriptorIconTemplate} from "@openremote/or-icon";import {isAxiosError} from "@openremote/rest";@@ -44,8 +43,8 @@ import {OrMwcDialog, showDialog} from "@openremote/or-mwc-components/or-mwc-dialimport {showSnackbar} from "@openremote/or-mwc-components/or-mwc-snackbar";import {cache} from "lit/directives/cache.js";import "@openremote/or-mwc-components/or-mwc-menu";-import {getContentWithMenuTemplate} from "@openremote/or-mwc-components/or-mwc-menu";-import {ListItem} from "@openremote/or-mwc-components/or-mwc-list";+import {createMenuBarItem, MenuBarItem} from "@openremote/or-vaadin-components/or-vaadin-menu-bar";+import {OrVaadinDateTimePicker} from "@openremote/or-vaadin-components/or-vaadin-date-time-picker";import {when} from "lit/directives/when.js";import {createRef, Ref, ref} from "lit/directives/ref.js";import "@openremote/or-translate";@@ -235,21 +234,6 @@ const style = css`margin-bottom: 5px;}- .dialog-container {- display: flex;- flex-direction: row;- flex: 1 1 0;- }-- .dialog-container > * {- flex: 1 1 0;- }-- .dialog-container > or-mwc-input {- background-color: var(--or-app-color2);- border-left: 3px solid var(--or-app-color4);- }-#chart-container {flex: 1 1 0;position: relative;@@ -603,15 +587,7 @@ export class OrAttributeBarChart extends LitElement {${when(this.timestampControls || this.showLegend, () => html`<div id="chart-controls"><div id="controls">- ${when(this.timestampControls && this.timePrefixKey && this.timePrefixOptions && this.timeWindowKey && this.timeWindowOptions,- () => this._getTimeControlsTemplate(disabled || !!this.timeframe),- () => html`- <div style="display: flex; justify-content: center;">- <or-mwc-input .type="${InputType.BUTTON}" label="${i18next.t(this.timePrefixKey?.toLowerCase() ?? '???')}" disabled style="margin-right: -2px;"></or-mwc-input>- <or-mwc-input .type="${InputType.BUTTON}" label="${i18next.t(this.timeWindowKey?.toLowerCase() ?? '???')}" disabled style="margin-left: -2px;"></or-mwc-input>- </div>- `- )}+ ${when(this.timestampControls && this.timePrefixKey && this.timeWindowKey, () => this._getTimeControlsTemplate(disabled || !!this.timeframe))}${when(this.timeframe, () => this._getTimeframeStatusTemplate(this.timeframe))}</div>${cache(when(this.showLegend, () => this._getLegendTemplate()))}@@ -621,49 +597,37 @@ export class OrAttributeBarChart extends LitElement {`;}- protected _getTimeControlsTemplate(disabled = true): TemplateResult {+ protected _getTimeControlsTemplate(disabled: boolean): TemplateResult {+ console.debug("Disabled?", disabled);+ const menuItems: MenuBarItem[] = [{+ component: createMenuBarItem(html`<or-translate value=${this.timeframe ? "dashboard.customTimeSpan" : this.timePrefixKey}></or-translate>`),+ children: this.timePrefixOptions.map(o => (+ {type: "prefix", value: o, component: createMenuBarItem(html`<or-translate value=${o}></or-translate>`)}+ ))+ }, {+ component: createMenuBarItem(html`<or-translate value=${this._isCustomWindow ? "timeframe" : i18next.t(this.timeWindowKey?.toLowerCase() ?? "")}></or-translate>`),+ children: Array.from(this.timeWindowOptions).map(o => (+ {type: "window", value: o[0], component: createMenuBarItem(html`<or-translate value=${o[0]?.toLowerCase()}></or-translate>`)}+ ))+ }];+ const intervalMenuItems: MenuBarItem[] = [{+ component: createMenuBarItem(html`<or-translate value=${`intervalBy${this._intervalConfig?.displayName?.toLowerCase()}`}></or-translate>`),+ children: Array.from(this.intervalOptions.keys()).map(o => (+ {value: o, component: createMenuBarItem(html`<or-translate value=${`intervalBy${o.toLowerCase()}`}></or-translate>`)}+ ))+ }]return html`<div id="period-controls">+ <!-- Time prefix & window selection --><div id="period-dropdown-controls">- <!-- Time prefix selection -->- ${getContentWithMenuTemplate(- html`<or-mwc-input .type="${InputType.BUTTON}" label="${this.timeframe ? "dashboard.customTimeSpan" : this.timePrefixKey}" ?disabled="${disabled}"></or-mwc-input>`,- disabled ? null as any : this.timePrefixOptions.map(option => ({value: option} as ListItem)),- this.timePrefixKey,- (value: string | string[]) => {- this.timeframe = undefined; // remove any custom start & end times- this.timePrefixKey = value.toString();- },- undefined,- undefined,- undefined,- true- )}- <!-- Time window selection -->- ${getContentWithMenuTemplate(- html`<or-mwc-input .type="${InputType.BUTTON}" label="${this._isCustomWindow ? "timeframe" : i18next.t(this.timeWindowKey?.toLowerCase() ?? "")}" ?disabled="${disabled}"></or-mwc-input>`,- disabled ? null as any : Array.from(this.timeWindowOptions.keys()).map(key => ({value: key, text: key.toLowerCase(), translate: true} as ListItem)),- this.timeWindowKey,- (value: string | string[]) => {- this.timeframe = undefined; // remove any custom start & end times- this.timeWindowKey = value.toString();- },- undefined,- undefined,- undefined,- true- )}+ <or-vaadin-menu-bar .items=${menuItems} ?disabled=${disabled}+ @item-selected=${(ev: CustomEvent) => this._onTimeframeMenuSelect(ev)}+ ></or-vaadin-menu-bar></div><!-- Interval selection -->- ${getContentWithMenuTemplate(html`<or-mwc-input .type="${InputType.BUTTON}" label="${i18next.t(`intervalBy${this._intervalConfig?.displayName?.toLowerCase()}`)}"></or-mwc-input>`,- Array.from(this.intervalOptions.keys()).map(key => ({value: key, text: `intervalBy${key.toLowerCase()}`, translate: true} as ListItem)),- this.interval,- value => this.interval = value as BarChartInterval,- undefined,- undefined,- undefined,- true- )}+ <or-vaadin-menu-bar .items=${intervalMenuItems} ?disabled=${disabled}+ @item-selected=${(ev: CustomEvent) => this.interval = ev.detail.value.value}+ ></or-vaadin-menu-bar></div><div class="navigate" style="text-align: right"><!-- Scroll left button -->@@ -679,6 +643,20 @@ export class OrAttributeBarChart extends LitElement {`;}+ protected _onTimeframeMenuSelect(ev: CustomEvent) {+ const type = ev.detail.value.type as "prefix" | "window";+ const value = ev.detail.value.value;+ if(type === "prefix") {+ // Handle time prefix+ this.timeframe = undefined; // remove any custom start & end times+ this.timePrefixKey = value;+ } else {+ // Handle time window+ this.timeframe = undefined; // remove any custom start & end times+ this.timeWindowKey = value;+ }+ }+protected _getTimeframeStatusTemplate(timeframe = this.timeframe): TemplateResult {return html`<div style="margin-left: 18px; font-size: 12px; display: flex; justify-content: flex-end;">@@ -752,14 +730,18 @@ export class OrAttributeBarChart extends LitElement {}protected _openTimeDialog(startTimestamp?: number, endTimestamp?: number) {- const startRef: Ref<OrMwcInput> = createRef();- const endRef: Ref<OrMwcInput> = createRef();+ const startRef: Ref<OrVaadinDateTimePicker> = createRef();+ const endRef: Ref<OrVaadinDateTimePicker> = createRef();showDialog(new OrMwcDialog().setHeading(i18next.t("timeframe")).setContent(() => html`- <div>- <or-mwc-input ${ref(startRef)} type="${InputType.DATETIME}" required label="${i18next.t("start")}" .value="${startTimestamp}"></or-mwc-input>- <or-mwc-input ${ref(endRef)} type="${InputType.DATETIME}" required label="${i18next.t("ending")}" .value="${endTimestamp}"></or-mwc-input>+ <div style="max-width: 480px; display: flex; flex-direction: column; gap: 8px;">+ <or-vaadin-date-time-picker ${ref(startRef)} required value=${startTimestamp ? OrVaadinDateTimePicker.getLocalizedISOString(new Date(startTimestamp)) : undefined}>+ <or-translate slot="label" value="start"></or-translate>+ </or-vaadin-date-time-picker>+ <or-vaadin-date-time-picker ${ref(endRef)} required value=${endTimestamp ? OrVaadinDateTimePicker.getLocalizedISOString(new Date(endTimestamp)) : undefined}>+ <or-translate slot="label" value="ending"></or-translate>+ </or-vaadin-date-time-picker></div>`).setActions([{diff --git a/ui/component/or-attribute-card/package.json b/ui/component/or-attribute-card/package.jsonindex c2a40f797..3e14339ca 100644--- a/ui/component/or-attribute-card/package.json+++ b/ui/component/or-attribute-card/package.json@@ -24,12 +24,12 @@"dependencies": {"@openremote/core": "workspace:*","@openremote/model": "workspace:*",- "@openremote/or-asset-tree": "workspace:*","@openremote/or-attribute-picker": "workspace:*","@openremote/or-chart": "workspace:*","@openremote/or-icon": "workspace:*","@openremote/or-mwc-components": "workspace:*","@openremote/or-translate": "workspace:*",+ "@openremote/or-vaadin-components": "workspace:*","@openremote/rest": "workspace:*","chart.js": "^3.6.0","chartjs-adapter-moment": "^1.0.0",diff --git a/ui/component/or-attribute-card/src/index.ts b/ui/component/or-attribute-card/src/index.tsindex d3a1348b5..585931fa8 100644--- a/ui/component/or-attribute-card/src/index.ts+++ b/ui/component/or-attribute-card/src/index.ts@@ -19,19 +19,15 @@ import {isAxiosError} from "@openremote/rest";import {Chart, ScatterDataPoint, LineController, LineElement, PointElement, LinearScale, TimeSeriesScale, Title} from "chart.js";import "chartjs-adapter-moment";import {OrChartConfig} from "@openremote/or-chart";-import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import {getAssetDescriptorIconTemplate} from "@openremote/or-icon";import "@openremote/or-mwc-components/or-mwc-dialog";import "@openremote/or-attribute-picker";import moment from "moment";-import {OrAssetTreeSelectionEvent} from "@openremote/or-asset-tree";-import {OrMwcDialog, showDialog} from "@openremote/or-mwc-components/or-mwc-dialog";+import {showDialog} from "@openremote/or-mwc-components/or-mwc-dialog";import {OrAssetAttributePicker, OrAssetAttributePickerPickedEvent} from "@openremote/or-attribute-picker";-import {getContentWithMenuTemplate} from "@openremote/or-mwc-components/or-mwc-menu";import {when} from "lit/directives/when.js";import debounce from "lodash.debounce";--export type ContextMenuOption = "editAttribute" | "editDelta" | "editCurrentValue" | "delete";+import {createMenuBarItem, MenuBarItem} from "@openremote/or-vaadin-components/or-vaadin-menu-bar";Chart.register(LineController, LineElement, PointElement, LinearScale, Title, TimeSeriesScale);@@ -69,24 +65,6 @@ const style = css`display: flex;flex-direction: column;}-- .panel-title {- display: flex;- align-items: center;- /*margin: -15px -15px 0 0;*/ /* compensate for the click-space of the plusminus button */- font-weight: bolder;- line-height: 1em;- color: var(--internal-or-asset-viewer-title-text-color);- flex: 0 0 auto;- }-- .panel-title-text {- flex: 1;- text-transform: uppercase;- white-space: nowrap;- text-overflow: ellipsis;- overflow: hidden;- }.panel-content {display: flex;@@ -219,8 +197,6 @@ export class OrAttributeCard extends LitElement {@property()public hideAttributePicker: boolean = false;@property()- public showTitle: boolean = true;- @property()protected _loading: boolean = false;@property()@@ -359,9 +335,6 @@ export class OrAttributeCard extends LitElement {shouldShowControls(): boolean { // Checking for string input as well since that was not workingreturn (this.showControls && this.showControls.toString() == "true");}- shouldShowTitle(): boolean {- return (this.showTitle && this.showTitle.toString() == "true");- }protected render() {@@ -370,10 +343,13 @@ export class OrAttributeCard extends LitElement {<div class="panel panel-empty"><div class="panel-content-wrapper"><div class="panel-content">- ${!this.shouldHideAttributePicker() ? html`- <or-mwc-input class="button" .type="${InputType.BUTTON}" label="selectAttribute" icon="plus" @or-mwc-input-changed="${() => this._openDialog("editAttribute")}"></or-mwc-input>+ ${this.shouldHideAttributePicker() ? html`+ <or-vaadin-button class="button" @click=${() => this._openDialog()}>+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value="selectAttribute"></or-translate>+ </or-vaadin-button>` : html`- <span style="text-align: center;">${i18next.t('noAttributeConnected')}</span>+ <or-translate style="text-align: center;" value="noAttributeConnected"></or-translate>`}</div></div>@@ -389,35 +365,16 @@ export class OrAttributeCard extends LitElement {this.resizeObserver.observe(this.shadowRoot!.querySelector(".graph-wrapper")!);})+ const periodItems: MenuBarItem[] = [{+ component: createMenuBarItem(html`<or-translate value=${this.period ?? '-'}></or-translate>`),+ children: ["hour", "day", "week", "month", "year"].map(o => (+ {value: o, component: createMenuBarItem(html`<or-translate value=${o}></or-translate>`)}+ ))+ }]+return html`<div class="panel" id="attribute-card"><div class="panel-content-wrapper">- <div class="panel-title">- ${this.shouldShowTitle() ? html`<span class="panel-title-text">${this.assets[0].name + " - " + i18next.t(this.assetAttributes[0][1].name!)}</span>` : undefined}- ${this.shouldShowTitle() ? getContentWithMenuTemplate(html`- <or-mwc-input icon="dots-vertical" type="button"></or-mwc-input>- `,- [- {- text: i18next.t("editAttribute"),- value: "editAttribute"- },- {- text: i18next.t("editDelta"),- value: "editDelta"- },- {- text: i18next.t("editCurrentValue"),- value: "editCurrentValue"- },- {- text: i18next.t("delete"),- value: "delete"- }- ],- undefined,- (option) => this.handleMenuSelect(option as ContextMenuOption)) : undefined}- </div><div class="panel-content"><div class="mainvalue-wrapper">${when(!this._loading, () => html`@@ -445,28 +402,11 @@ export class OrAttributeCard extends LitElement {<div class="delta-wrapper"><span class="delta">${this.delta ? this.deltaPlus + (this.delta.val !== undefined && this.delta.val !== null ? this.delta.val : "") + (this.delta.unit || "") : ""}</span></div>- ${this.shouldShowControls() ? html`- <div class="period-selector-wrapper">- ${getContentWithMenuTemplate(- html`<or-mwc-input class="period-selector" .type="${InputType.BUTTON}" label="${this.period ? this.period : '-'}"></or-mwc-input>`,- [{value: "hour", text: "hour"}, {value: "day", text: "day"}, {value: "week", text: "week"}, {value: "month", text: "month"}, {value: "year", text: "year"}].map((option) => {- option.text = i18next.t(option.value);- return option;- }),- this.period,- (value) => this._setPeriodOption(value),- undefined, // closedCallback- false, // multiSelect- true, // translateValues- false, // midHeight- false, // fullWidth- "kpi-menu-id", // Menu Id- true // fixToHost- )}- </div>- ` : html`- <or-mwc-input class="period-selector" .type="${InputType.BUTTON}" disabled .label="${i18next.t(this.period ? this.period : "-")}"></or-mwc-input>- `}+ <div class="period-selector-wrapper">+ <or-vaadin-menu-bar class="period-selector" .items=${periodItems} ?disabled=${!this.shouldShowControls()}+ @item-selected=${(ev: CustomEvent) => this._setPeriodOption(ev.detail.value.value)}+ ></or-vaadin-menu-bar>+ </div></div></div></div>@@ -475,94 +415,24 @@ export class OrAttributeCard extends LitElement {`;}- protected _openDialog(dialogContent?: ContextMenuOption) {-- let dialog: OrMwcDialog | undefined;-- switch (dialogContent) {- case "editDelta":- case "editCurrentValue":- dialog = new OrMwcDialog()- .setHeading(i18next.t(dialogContent))- .setDismissAction(null)- .setContent(- dialogContent === "editDelta"- ? html`- <or-mwc-input id="delta-mode-picker" value="${this.deltaFormat}" @or-mwc-input-changed="${(evt: OrInputChangedEvent) => {this.deltaFormat = evt.detail.value;this.saveSettings();}}" .type="${InputType.LIST}" .options="${[- ["percentage", "Percentage"],- ["absolute", "Absolute"]- ]}"></or-mwc-input>- `- : html`- <or-mwc-input id="current-value-decimals" .label="${i18next.t("decimals")}" value="${this.mainValueDecimals}" .type="${InputType.TEXT}"></or-mwc-input>- `- )- .setActions([- {- actionName: "cancel",- content: html`<or-mwc-input class="button" .type="${InputType.BUTTON}" label="cancel"></or-mwc-input>`,- action: () => {- // Nothing to do here- }- },- {- actionName: "yes",- default: true,- content: html`<or-mwc-input class="button" .type="${InputType.BUTTON}" label="ok" data-mdc-dialog-action="yes"></or-mwc-input>`,- action: () => {- if (dialogContent === "editDelta") {- this.delta = this.data ? this.getFormattedDelta(this.getFirstKnownMeasurement(this.data), this.getLastKnownMeasurement(this.data)) : undefined;- } else {- if (dialog && dialog.shadowRoot && dialog.shadowRoot.getElementById("current-value-decimals")) {- const elm = dialog.shadowRoot.getElementById("current-value-decimals") as HTMLInputElement;- const input = parseInt(elm.value, 10);- if (input < 0) {this.mainValueDecimals = 0;}- else if (input > 10) {this.mainValueDecimals = 10;}- else {this.mainValueDecimals = input;}- this.formattedMainValue = this.getFormattedValue(this.mainValue!);- this.saveSettings();- }- }- }- }- ]);-- dialog.addEventListener(OrAssetTreeSelectionEvent.NAME, async (ev: OrAssetTreeSelectionEvent) => {- const selectedNode = ev.detail && ev.detail.newNodes.length > 0 ? ev.detail.newNodes[0] : undefined;-- if (!selectedNode) {- this.asset = undefined;- } else {- // fully load the asset- const assetEvent: AssetEvent = await manager.events!.sendEventWithReply({- eventType: "read-asset",- assetId: selectedNode.asset!.id- });- this.asset = assetEvent.asset;- }- });- break;- default:- dialog = new OrAssetAttributePicker()- .setHeading(i18next.t("selectAttribute"));-- dialog.addEventListener(OrAssetAttributePickerPickedEvent.NAME, async (ev: OrAssetAttributePickerPickedEvent) => {- // handle selected attrs- const attrRef = ev.detail[0];- try {- const response = await manager.rest.api.AssetResource.get(attrRef.id!);- this.asset = response.data;- this._setAttribute(attrRef.name as string);- } catch (e) {- console.error("Failed to get assets requested in settings", e);- }- });- break;- }+ protected _openDialog() {- if (dialog) {- showDialog(dialog);- }+ let dialog = new OrAssetAttributePicker()+ .setHeading(i18next.t("selectAttribute"));++ dialog.addEventListener(OrAssetAttributePickerPickedEvent.NAME, async (ev: OrAssetAttributePickerPickedEvent) => {+ // handle selected attrs+ const attrRef = ev.detail[0];+ try {+ const response = await manager.rest.api.AssetResource.get(attrRef.id!);+ this.asset = response.data;+ this._setAttribute(attrRef.name as string);+ } catch (e) {+ console.error("Failed to get assets requested in settings", e);+ }+ });++ showDialog(dialog);}private _setAttribute(attributeName: string) {@@ -801,16 +671,6 @@ export class OrAttributeCard extends LitElement {}}- protected getTotalValue(data: ValueDatapoint<any>[]): number {- return data.reduce(( acc: number, val: ValueDatapoint<any> ) => {- return val.y ? acc + Math.round(val.y) : acc;- }, 0);- }-- protected getHighestValue(data: ValueDatapoint<any>[]): number {- return Math.max.apply(Math, data.map((e: ValueDatapoint<any>) => e.y || false ));- }-protected getFormattedValue(value: number | undefined): {value: number, unit: string} | undefined {if (value === undefined || !this.assets || !this.assetAttributes || this.assets.length === 0 || this.assetAttributes.length === 0) {return;@@ -864,16 +724,6 @@ export class OrAttributeCard extends LitElement {return {val: Math.round(lastVal - firstVal), unit: ""};}- protected handleMenuSelect(value: ContextMenuOption) {- if (value === "delete") {- this.assets = [];- this.assetAttributes = [];- this.saveSettings();- } else {- this._openDialog(value);- }- }-protected setLabelSizeByLength(value: string) {if (value.length >= 20) { this.mainValueSize = "xs" }if (value.length < 20) { this.mainValueSize = "s" }diff --git a/ui/component/or-attribute-history/package.json b/ui/component/or-attribute-history/package.jsonindex 9e94fa941..39eadbef8 100644--- a/ui/component/or-attribute-history/package.json+++ b/ui/component/or-attribute-history/package.json@@ -26,8 +26,8 @@"@openremote/model": "workspace:*","@openremote/or-chart": "workspace:*","@openremote/or-components": "workspace:*",- "@openremote/or-mwc-components": "workspace:*","@openremote/or-translate": "workspace:*",+ "@openremote/or-vaadin-components": "workspace:*","@openremote/rest": "workspace:*","echarts": "~6.0.0","jsonpath-plus": "^10.3.0",diff --git a/ui/component/or-attribute-history/src/index.ts b/ui/component/or-attribute-history/src/index.tsindex 1403fcd04..9e21f6ff5 100644--- a/ui/component/or-attribute-history/src/index.ts+++ b/ui/component/or-attribute-history/src/index.ts@@ -18,17 +18,18 @@ import {customElement, property, query} from "lit/decorators.js";import {i18next, translate} from "@openremote/or-translate"import {AssetModelUtil, Attribute, AttributeRef, DatapointInterval, ValueDatapoint, ValueDescriptor} from "@openremote/model";import manager, {DefaultColor2, DefaultColor3, DefaultColor4} from "@openremote/core";-import "@openremote/or-mwc-components/or-mwc-input";import "@openremote/or-components/or-panel";import "@openremote/or-translate";import "@openremote/or-chart";-import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";+import {type OrVaadinSelect} from "@openremote/or-vaadin-components/or-vaadin-select";+import {OrVaadinDateTimePicker} from "@openremote/or-vaadin-components/or-vaadin-date-time-picker";import {MDCDataTable} from "@material/data-table";import {JSONPath} from "jsonpath-plus";import moment from "moment";import {isAxiosError} from "@openremote/rest";import {styleMap} from "lit/directives/style-map.js";-import { when } from "lit/directives/when.js";+import {when} from "lit/directives/when.js";+import {ifDefined} from "lit/directives/if-defined.js";echarts.use([GridComponent, TooltipComponent, DataZoomComponent, LineChart, CanvasRenderer, UniversalTransition]);@@ -147,13 +148,6 @@ const style = css`height: 100%;flex-direction: column;}-- .button-icon {- align-self: center;- padding: 10px;- cursor: pointer;- }-#msg {height: 100%;@@ -184,15 +178,20 @@ const style = css`max-width: 100%;display: flex;flex-wrap: wrap;- align-items: center;+ align-items: end;+ gap: 5px;}#ending-controls > * {padding: 0 3px;}+ #ending-controls > or-vaadin-date-time-picker::part(label) {+ padding-bottom: 0.5em;+ }+#ending-date {- width: 220px;+ width: 280px;padding-left: 5px;}@@ -308,7 +307,7 @@ export class OrAttributeHistory extends translate(i18next)(LitElement) {}if (!this.toTimestamp) {- this.toTimestamp = new Date();+ this.toTimestamp = this._getDefaultDate();return false;}@@ -335,16 +334,29 @@ export class OrAttributeHistory extends translate(i18next)(LitElement) {const isChart = this._type && (this._type.jsonType === "number" || this._type.jsonType === "boolean");const disabled = !this._type;+ const periodOptions = this._getPeriodOptions().map(o => ({value: o, label: i18next.t(o)}));return html`<div id="container"><div id="controls">- <or-mwc-input id="time-picker" .type="${InputType.SELECT}" ?disabled="${disabled}" .label="${i18next.t("timeframe")}" @or-mwc-input-changed="${(evt: OrInputChangedEvent) => this.period = evt.detail.value}" .value="${this.period}" .options="${this._getPeriodOptions()}"></or-mwc-input>+ <or-vaadin-select id="time-picker" value=${this.period} .items=${periodOptions} ?disabled=${disabled}+ @change=${(ev: CustomEvent) => this.period = (ev.currentTarget as OrVaadinSelect).value as any}>+ <or-translate slot="label" value="timeframe"></or-translate>+ </or-vaadin-select><div id="ending-controls">- <or-mwc-input id="ending-date" .type="${InputType.DATETIME}" ?disabled="${disabled}" label="${i18next.t("ending")}" .value="${this.toTimestamp}" @or-mwc-input-changed="${(evt: OrInputChangedEvent) => this._updateTimestamp(moment(evt.detail.value as string).toDate())}"></or-mwc-input>- <or-icon class="button button-icon" ?disabled="${disabled}" icon="chevron-left" @click="${() => this._updateTimestamp(this.toTimestamp!, false, 0)}"></or-icon>- <or-icon class="button button-icon" ?disabled="${disabled}" icon="chevron-right" @click="${() => this._updateTimestamp(this.toTimestamp!, true, 0)}"></or-icon>- <or-icon class="button button-icon" ?disabled="${disabled}" icon="chevron-double-right" @click="${() => this._updateTimestamp(new Date())}"></or-icon>+ <or-vaadin-date-time-picker id="ending-date" value=${ifDefined(OrVaadinDateTimePicker.getLocalizedISOString(this.toTimestamp))}+ @change=${(ev: CustomEvent) => this._updateTimestamp(new Date((ev.currentTarget as OrVaadinDateTimePicker).value))}>+ <or-translate slot="label" value="ending"></or-translate>+ </or-vaadin-date-time-picker>+ <or-vaadin-button class="button-icon" theme="icon" ?disabled=${disabled} @click=${() => this._updateTimestamp(this.toTimestamp!, false, 0)}>+ <or-icon icon="chevron-left"></or-icon>+ </or-vaadin-button>+ <or-vaadin-button theme="icon" ?disabled=${disabled} @click=${() => this._updateTimestamp(this.toTimestamp!, true, 0)}>+ <or-icon icon="chevron-right"></or-icon>+ </or-vaadin-button>+ <or-vaadin-button theme="icon" ?disabled=${disabled} @click=${() => this._updateTimestamp(this._getDefaultDate())}>+ <or-icon icon="chevron-double-right"></or-icon>+ </or-vaadin-button></div></div>@@ -891,5 +903,11 @@ export class OrAttributeHistory extends translate(i18next)(LitElement) {}]});}++ protected _getDefaultDate() {+ const date = new Date();+ date.setHours(date.getHours() + 1, 0, 0, 0); // Round to the beginning of the next hour+ return date;+ }}diff --git a/ui/component/or-attribute-history/tsconfig.json b/ui/component/or-attribute-history/tsconfig.jsonindex e81fd687d..5cbedb3c9 100644--- a/ui/component/or-attribute-history/tsconfig.json+++ b/ui/component/or-attribute-history/tsconfig.json@@ -11,7 +11,7 @@{ "path": "../core" },{ "path": "../or-components" },{ "path": "../or-mwc-components" },+ { "path": "../or-vaadin-components" },{ "path": "../or-translate" }-]}diff --git a/ui/component/or-attribute-input/package.json b/ui/component/or-attribute-input/package.jsonindex 3cef7bae9..56c9c4686 100644--- a/ui/component/or-attribute-input/package.json+++ b/ui/component/or-attribute-input/package.json@@ -24,11 +24,13 @@"@openremote/core": "workspace:*","@openremote/model": "workspace:*","@openremote/or-components": "workspace:*",+ "@openremote/or-icon": "workspace:*","@openremote/or-json-forms": "workspace:*","@openremote/or-map": "workspace:*","@openremote/or-mwc-components": "workspace:*","@openremote/or-scheduler": "workspace:*","@openremote/or-translate": "workspace:*",+ "@openremote/or-vaadin-components": "workspace:*","lit": "^3.3.1"},"devDependencies": {diff --git a/ui/component/or-attribute-input/src/index.ts b/ui/component/or-attribute-input/src/index.tsindex 4e1263bba..fb0df273d 100644--- a/ui/component/or-attribute-input/src/index.ts+++ b/ui/component/or-attribute-input/src/index.ts@@ -19,26 +19,23 @@ import {ValueConstraintAllowedValues} from "@openremote/model";import manager, {subscribe, Util} from "@openremote/core";+import "@openremote/or-icon";import "@openremote/or-mwc-components/or-mwc-input";+import "@openremote/or-vaadin-components/or-vaadin-button";+import "@openremote/or-vaadin-components/or-vaadin-input";import {progressCircular} from "@openremote/or-mwc-components/style";import "@openremote/or-components/or-loading-wrapper";import {OrLoadingWrapper} from "@openremote/or-components/or-loading-wrapper";import {- getValueHolderInputTemplateProvider,- InputType,- OrInputChangedEvent,- OrInputChangedEventDetail,- SUPPORTED_WELLKNOWN_VALUE_TYPES,- SupportedWellknownValueTypes,- ValueInputProvider,- ValueInputProviderGenerator,- ValueInputProviderOptions,- ValueInputTemplateFunction-} from "@openremote/or-mwc-components/or-mwc-input";+ getValueHolderInputTemplateProvider, type ValueInputProvider,+ ValueInputProviderGenerator, type ValueInputProviderOptions, type ValueInputTemplateFunction+} from "@openremote/or-vaadin-components/value-input-provider";+import {InputType, SUPPORTED_WELLKNOWN_VALUE_TYPES, SupportedWellknownValueTypes} from "@openremote/or-vaadin-components/util";import "@openremote/or-map";import {geoJsonPointInputTemplateProvider} from "@openremote/or-map";import "@openremote/or-json-forms";import {ErrorObject, OrJSONForms, StandardRenderers} from "@openremote/or-json-forms";+import {type OrInputChangedEventDetail} from "@openremote/or-mwc-components/or-mwc-input";import {agentIdRendererRegistryEntry} from "./renderers/agent-link";import {schedulerRendererRegistryEntry} from "./renderers/scheduler";@@ -83,14 +80,11 @@ export function getAttributeInputWrapper(content: TemplateResult, value: any, loif (buttonIcon) {content = html`- ${content}- <or-mwc-input id="send-btn" icon="${buttonIcon}" type="button" .disabled="${disabled || loading}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- e.stopPropagation();- if (sendValue) {- sendValue();- }- }}"></or-mwc-input>- `;+ ${content}+ <or-vaadin-button id="send-btn" theme="icon" ?disabled=${disabled || loading} @click=${(ev: Event) => { ev.stopPropagation(); sendValue?.(); }}>+ <or-icon icon=${buttonIcon}></or-icon>+ </or-vaadin-button>+ `;}return html`@@ -192,7 +186,7 @@ export const jsonFormsInputTemplateProvider: (fallback: ValueInputProvider, clea}};- const templateFunction: ValueInputTemplateFunction = (value, focused, loading, sending, error, helperText) => {+ const templateFunction: ValueInputTemplateFunction = (value, _focused, _loading, _sending, _error, _helperText) => {// Schedule loadingwindow.setTimeout(() => doLoad(value), 0);@@ -220,9 +214,9 @@ export const jsonFormsInputTemplateProvider: (fallback: ValueInputProvider, clea.schema="${schema}" .uischema="${uiSchema}" .onChange="${onChanged}"></or-json-forms>${when(clear, () => html`- <or-mwc-input id="clear" outlined .type="${InputType.BUTTON}" icon="backspace" @or-mwc-input-changed="${- () => valueChangeNotifier({ value: null })- }"></or-mwc-input>+ <or-vaadin-button id="clear" theme="icon" @click="${() => valueChangeNotifier({ value: null })}">+ <or-icon icon="backspace"></or-icon>+ </or-vaadin-button>`)}</div></or-loading-wrapper>@@ -265,7 +259,7 @@ export class OrAttributeInput extends subscribe(manager)(translate(i18next)(LitE/*padding-right: 52px;*/}- #wrapper or-mwc-input, #wrapper or-map {+ #wrapper or-mwc-input, #wrapper or-vaadin-input, #wrapper or-map {width: 100%;}@@ -280,6 +274,7 @@ export class OrAttributeInput extends subscribe(manager)(translate(i18next)(LitE#wrapper {display: flex;position: relative;+ align-items: center;}#wrapper.right-padding {@@ -333,7 +328,7 @@ export class OrAttributeInput extends subscribe(manager)(translate(i18next)(LitE#send-btn {flex: 0;margin-left: 4px;- margin-top: 4px;+ --or-icon-width: 20px;}`];}@@ -591,7 +586,7 @@ export class OrAttributeInput extends subscribe(manager)(translate(i18next)(LitEreturn;}- const standardInputProvider = getValueHolderInputTemplateProvider(this.assetType, this.attribute, this._attributeDescriptor, valueDescriptor, (detail) => valueChangeHandler(detail), options);+ const standardInputProvider = getValueHolderInputTemplateProvider(this.assetType, this.attribute, this._attributeDescriptor, valueDescriptor, (value, updateImmediately) => valueChangeHandler({value, enterPressed: !!updateImmediately}), options);this._templateProvider = jsonFormsInputTemplateProvider(standardInputProvider, true)(this.assetType, this.attribute, this._attributeDescriptor, valueDescriptor, (detail) => valueChangeHandler(detail), options);if (!this._templateProvider) {diff --git a/ui/component/or-attribute-input/tsconfig.json b/ui/component/or-attribute-input/tsconfig.jsonindex 268175387..b0ceb7a0c 100644--- a/ui/component/or-attribute-input/tsconfig.json+++ b/ui/component/or-attribute-input/tsconfig.json@@ -14,6 +14,7 @@{ "path": "../or-mwc-components" },{ "path": "../or-components" },{ "path": "../or-json-forms" },- { "path": "../or-scheduler" },+ { "path": "../or-vaadin-components" },+ { "path": "../or-scheduler" }]}diff --git a/ui/component/or-attribute-picker/package.json b/ui/component/or-attribute-picker/package.jsonindex a119801dc..a9db50c28 100644--- a/ui/component/or-attribute-picker/package.json+++ b/ui/component/or-attribute-picker/package.json@@ -26,6 +26,7 @@"@openremote/or-asset-tree": "workspace:*","@openremote/or-mwc-components": "workspace:*","@openremote/or-translate": "workspace:*",+ "@openremote/or-vaadin-components": "workspace:*","lit": "^3.3.1"},"devDependencies": {diff --git a/ui/component/or-attribute-picker/src/asset-attribute-picker.ts b/ui/component/or-attribute-picker/src/asset-attribute-picker.tsindex ee9631e61..4e9836205 100644--- a/ui/component/or-attribute-picker/src/asset-attribute-picker.ts+++ b/ui/component/or-attribute-picker/src/asset-attribute-picker.ts@@ -4,7 +4,6 @@ import {Asset, Attribute, AttributeRef, WellknownMetaItems} from "@openremote/moimport manager, {DefaultColor5, Util} from "@openremote/core";import {OrAssetTree, OrAssetTreeSelectionEvent} from "@openremote/or-asset-tree";import {html, unsafeCSS} from "lit";-import {InputType} from "@openremote/or-mwc-components/or-mwc-input";import {when} from "lit/directives/when.js";import {until} from "lit/directives/until.js";@@ -74,12 +73,19 @@ export class OrAssetAttributePicker extends AttributePicker {this.actions = [{actionName: "cancel",- content: "cancel"+ content: html`+ <or-vaadin-button class="button">+ <or-translate value="cancel"></or-translate>+ </or-vaadin-button>+ `},{actionName: "add",content: html`- <or-mwc-input id="add-btn" class="button" label="add" .type="${InputType.BUTTON}"></or-mwc-input>`,+ <or-vaadin-button id="add-btn" theme="primary" class="button">+ <or-translate value="add"></or-translate>+ </or-vaadin-button>+ `,action: () => {if (!this.addBtn.disabled) {this.dispatchEvent(new OrAssetAttributePickerPickedEvent(this.selectedAttributes));@@ -102,14 +108,14 @@ export class OrAssetAttributePicker extends AttributePicker {${when(this._assetAttributes && this._assetAttributes.length > 0, () => {const selectedNames = this.selectedAttributes.filter(attrRef => attrRef.id === this._asset?.id).map(attrRef => attrRef.name!);return html`- <div class="attributes-header">- <or-translate value="attribute_plural"></or-translate>- </div>- ${until(- this._getAttributesTemplate(this._assetAttributes!, undefined, selectedNames, this.multiSelect, (attrNames) => this._onAttributesSelect(attrNames)),- html`<or-loading></or-loading>`- )}- `+ <div class="attributes-header">+ <or-translate value="attribute_plural"></or-translate>+ </div>+ ${until(this._getAttributesTemplate(this._assetAttributes!, undefined, selectedNames, this.multiSelect,+ (attrNames) => this._onAttributesSelect(attrNames)),+ html`<or-loading></or-loading>`+ )}+ `;}, () => html`<div style="display: flex;align-items: center;text-align: center;height: 100%;padding: 0 20px;"><span style="width:100%">diff --git a/ui/component/or-attribute-picker/src/assettype-attribute-picker.ts b/ui/component/or-attribute-picker/src/assettype-attribute-picker.tsindex aa42091dd..224dcbd44 100644--- a/ui/component/or-attribute-picker/src/assettype-attribute-picker.ts+++ b/ui/component/or-attribute-picker/src/assettype-attribute-picker.ts@@ -4,10 +4,10 @@ import {PropertyValues, html, unsafeCSS} from "lit";import {DefaultColor5, Util} from "@openremote/core";import {when} from "lit/directives/when.js";import {until} from "lit/directives/until.js";-import {ListItem, OrMwcListChangedEvent} from "@openremote/or-mwc-components/or-mwc-list";import {AssetDescriptor, AssetModelUtil, AssetTypeInfo, AttributeDescriptor, WellknownMetaItems} from "@openremote/model";-import {InputType} from "@openremote/or-mwc-components/or-mwc-input";-import "./assettype-list";+import {ListItem} from "@openremote/or-vaadin-components/or-vaadin-list-box";+import { ifDefined } from "lit/directives/if-defined.js";+import { styleMap } from "lit/directives/style-map.js";/*** Custom Event that is dispatched upon closing the dialog.@@ -136,10 +136,19 @@ export class OrAssetTypeAttributePicker extends AttributePicker {this.content = () => html`<div class="row" style="display: flex;height: 600px;width: 800px;border-top: 1px solid ${unsafeCSS(DefaultColor5)};"><div class="col" style="width: 320px;overflow: auto;border-right: 1px solid ${unsafeCSS(DefaultColor5)};">- <asset-type-list .listItems="${assetTypeItems}" style="--or-icon-fill: #000000;" @or-mwc-list-changed="${(evt: OrMwcListChangedEvent) => {- if (evt.detail.length === 1) this._onAssetTypeItemClick(evt.detail[0] as ListItem);- }}"- ></asset-type-list>++ <or-vaadin-list-box @selected-changed=${(ev: CustomEvent) => this._onAssetTypeItemClick(assetTypeItems[ev.detail.value])}>+ ${assetTypeItems.map(item => html`+ <or-vaadin-item style=${styleMap(item.styleMap ?? {})}>+ <div style="display: flex; align-items: center; gap: 8px;">+ <or-icon icon=${ifDefined(item.icon)}></or-icon>+ <span style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">+ ${item.text ?? item.value ?? html`<or-translate value="unknown"></or-translate>`}+ </span>+ </div>+ </or-vaadin-item>+ `)}+ </or-vaadin-list-box></div><div class="col" style="flex: 1 1 auto;width: 320px;overflow: auto;">${when(attributeTypes && attributeTypes.length > 0, () => {@@ -176,12 +185,19 @@ export class OrAssetTypeAttributePicker extends AttributePicker {this.actions = [{actionName: "cancel",- content: "cancel"+ content: html`+ <or-vaadin-button class="button">+ <or-translate value="cancel"></or-translate>+ </or-vaadin-button>+ `},{actionName: "add",content: html`- <or-mwc-input id="add-btn" class="button" label="add" .type="${InputType.BUTTON}"></or-mwc-input>`,+ <or-vaadin-button id="add-btn" theme="primary" class="button">+ <or-translate value="add"></or-translate>+ </or-vaadin-button>+ `,action: () => {if (!this.addBtn.disabled) {this.dispatchEvent(new OrAssetTypeAttributePickerPickedEvent(this.selectedAttributes));@@ -195,7 +211,7 @@ export class OrAssetTypeAttributePicker extends AttributePicker {/*** HTML Callback function when the selected asset type has been updated.*/- protected _onAssetTypeItemClick(listItem: ListItem) {+ protected _onAssetTypeItemClick(listItem: ListItem) {;this._selectedAssetType = (listItem.data as AssetDescriptor).name;}diff --git a/ui/component/or-attribute-picker/src/assettype-list.ts b/ui/component/or-attribute-picker/src/assettype-list.tsdeleted file mode 100644index f99ef165b..000000000--- a/ui/component/or-attribute-picker/src/assettype-list.ts+++ /dev/null@@ -1,15 +0,0 @@-import { OrMwcList } from "@openremote/or-mwc-components/or-mwc-list";-import { css } from "lit";-import { customElement } from "lit/decorators.js";--@customElement("asset-type-list")-export class AssettypeList extends OrMwcList {-- static get styles() {- return [...super.styles, css`- .mdc-list-item__meta or-icon {- --or-icon-fill: gray;- }- `];- }-}diff --git a/ui/component/or-attribute-picker/src/attribute-picker.ts b/ui/component/or-attribute-picker/src/attribute-picker.tsindex e83749463..67077ba2a 100644--- a/ui/component/or-attribute-picker/src/attribute-picker.ts+++ b/ui/component/or-attribute-picker/src/attribute-picker.ts@@ -2,15 +2,14 @@ import {html, TemplateResult, unsafeCSS} from "lit";import {property, query} from "lit/decorators.js";import "@openremote/or-asset-tree";import "@openremote/or-translate";-import "@openremote/or-mwc-components/or-mwc-input";-import "@openremote/or-mwc-components/or-mwc-list";-import {InputType, OrInputChangedEvent, OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";import {i18next} from "@openremote/or-translate";import {DefaultColor2, DefaultColor4, DefaultColor5, Util} from "@openremote/core";import {Attribute, AttributeDescriptor} from "@openremote/model";import {DialogAction, DialogActionBase, OrMwcDialog} from "@openremote/or-mwc-components/or-mwc-dialog";-import {when} from "lit/directives/when.js";-import {ListItem, ListType, OrMwcListChangedEvent} from "@openremote/or-mwc-components/or-mwc-list";+import {OrVaadinButton} from "@openremote/or-vaadin-components/or-vaadin-button";+import {ListItem} from "@openremote/or-vaadin-components/or-vaadin-list-box";+import {styleMap} from "lit/directives/style-map.js";+import {ifDefined} from "lit/directives/if-defined.js";export abstract class AttributePickerPickedEvent extends CustomEvent<any> {@@ -42,7 +41,7 @@ export abstract class AttributePicker extends OrMwcDialog {public showOnlyRuleStateAttrs?: boolean = false;@query("#add-btn")- protected addBtn!: OrMwcInput;+ protected addBtn!: OrVaadinButton;connectedCallback() {super.connectedCallback();@@ -120,7 +119,7 @@ export abstract class AttributePicker extends OrMwcDialog {/*** Function that creates the HTML template for selecting attributes.- * Currently uses {@link OrMwcList} with or without checkboxes, and uses {@link Util.getAttributeLabel} to formulate the text.+ * Currently uses {@link OrVaadinListBox} with or without checkboxes, and uses {@link Util.getAttributeLabel} to formulate the text.** @remarks TODO: Move this template into a separate component, such as an "or-attribute-list"*/@@ -133,17 +132,17 @@ export abstract class AttributePicker extends OrMwcDialog {value: (attributes?.[i].name || descriptors?.[i].name),});}+ const selectedIndexes = selectedNames?.map(name => listItems.findIndex(i => i.value === name));return html`- ${when(multi, () => html`- <or-mwc-list id="attribute-selector" .type="${ListType.MULTI_CHECKBOX}" .listItems="${listItems}" .values="${selectedNames}"- @or-mwc-list-changed="${(ev: OrMwcListChangedEvent) => onSelect?.(ev.detail.map(item => item.value))}"- </or-mwc-list>- `, () => html`- <or-mwc-input id="attribute-selector" .type="${InputType.LIST}" .options="${listItems?.map(item => ([item, item.text]))}"- style="display:flex;" .label="${i18next.t("attribute")}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => onSelect?.([(ev.detail.value as ListItem).value])}"- ></or-mwc-input>- `)}+ <or-vaadin-list-box id="attribute-selector" ?multiple=${multi} .selectedValues=${ifDefined(selectedIndexes)}+ @selected-changed=${(ev: CustomEvent) => onSelect?.([listItems[ev.detail.value as number].value])}+ @selected-values-changed=${(ev: CustomEvent) => onSelect?.((ev.detail.value as number[])?.map(n => listItems[n].value) ?? [])}>+ ${listItems.map(item => html`+ <or-vaadin-item style=${styleMap(item.styleMap ?? {})}>+ ${item.text ?? item.value ?? html`<or-translate value="unknown"></or-translate>`}+ </or-vaadin-item>+ `)}+ </or-vaadin-list-box>`;}diff --git a/ui/component/or-chart/package.json b/ui/component/or-chart/package.jsonindex 695391722..1a60fdd12 100644--- a/ui/component/or-chart/package.json+++ b/ui/component/or-chart/package.json@@ -32,6 +32,7 @@"@openremote/or-icon": "workspace:*","@openremote/or-mwc-components": "workspace:*","@openremote/or-translate": "workspace:*",+ "@openremote/or-vaadin-components": "workspace:*","@openremote/rest": "workspace:*","echarts": "~6.0.0","lit": "^3.3.1",diff --git a/ui/component/or-chart/src/index.ts b/ui/component/or-chart/src/index.tsindex 1032579b3..05bc82d3f 100644--- a/ui/component/or-chart/src/index.ts+++ b/ui/component/or-chart/src/index.ts@@ -14,7 +14,6 @@ import {} from "@openremote/model";import manager, {DefaultColor2, DefaultColor3, DefaultColor4, DefaultColor5, Util} from "@openremote/core";import "@openremote/or-asset-tree";-import "@openremote/or-mwc-components/or-mwc-input";import "@openremote/or-components/or-panel";import "@openremote/or-translate";import * as echarts from "echarts/core";@@ -22,7 +21,6 @@ import {DatasetComponentOption, DataZoomComponent, DataZoomComponentOption, Gridimport {LineChart, LineSeriesOption} from "echarts/charts";import {CanvasRenderer} from "echarts/renderers";import {UniversalTransition} from "echarts/features";-import {InputType, OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";import "@openremote/or-components/or-loading-indicator";import moment from "moment";import {OrAssetTreeSelectionEvent} from "@openremote/or-asset-tree";@@ -32,11 +30,11 @@ import {OrAssetAttributePicker, OrAssetAttributePickerPickedEvent} from "@openreimport {OrMwcDialog, showDialog} from "@openremote/or-mwc-components/or-mwc-dialog";import {cache} from "lit/directives/cache.js";import debounce from "lodash.debounce";-import {getContentWithMenuTemplate} from "@openremote/or-mwc-components/or-mwc-menu";-import {ListItem} from "@openremote/or-mwc-components/or-mwc-list";+import {OrVaadinDateTimePicker} from "@openremote/or-vaadin-components/or-vaadin-date-time-picker";import {when} from "lit/directives/when.js";import {map} from "lit/directives/map.js";import {createRef, Ref, ref } from "lit/directives/ref.js";+import {createMenuBarItem, MenuBarItem} from "@openremote/or-vaadin-components/or-vaadin-menu-bar";echarts.use([GridComponent, TooltipComponent, DataZoomComponent, MarkLineComponent, LineChart, CanvasRenderer, UniversalTransition]);@@ -305,21 +303,6 @@ const style = css`.attribute-list-item:hover .button.delete {display: block;}-- .dialog-container {- display: flex;- flex-direction: row;- flex: 1 1 0;- }-- .dialog-container > * {- flex: 1 1 0;- }-- .dialog-container > or-mwc-input {- background-color: var(--or-app-color2);- border-left: 3px solid var(--or-app-color4);- }#chart-container {flex: 1 1 0;@@ -740,7 +723,7 @@ export class OrChart extends translate(i18next)(LitElement) {}render() {- const disabled = this._latestError;+ const disabled = this._loading || !!this._latestError;return html`<div id="container"><div id="chart-container" style="opacity: ${this._loading ? '0.7' : '1'};">@@ -760,62 +743,7 @@ export class OrChart extends translate(i18next)(LitElement) {${(this.timestampControls || this.attributeControls || this.showLegend) ? html`<div id="chart-controls"><div id="controls">- ${this.timePrefixKey && this.timePrefixOptions && this.timeWindowKey && this.timeWindowOptions ? html`- ${this.timestampControls ? html`- <div id="period-controls">- <div id="period-dropdown-controls">- <!-- Time prefix selection -->- ${getContentWithMenuTemplate(- html`<or-mwc-input .type="${InputType.BUTTON}" label="${this.timeframe ? "dashboard.customTimeSpan" : this.timePrefixKey.toLowerCase()}"></or-mwc-input>`,- this.timePrefixOptions.map(option => ({value: option, text: option.toLowerCase() } as ListItem)),- this.timePrefixKey,- (value: string | string[]) => {- this.timeframe = undefined; // remove any custom start & end times- this.timePrefixKey = value.toString();- },- undefined,- undefined,- undefined,- true- )}- <!-- Time window selection -->- ${getContentWithMenuTemplate(- html`<or-mwc-input .type="${InputType.BUTTON}" label="${this._isCustomWindow ? "timeframe" : this.timeWindowKey.toLowerCase()}"></or-mwc-input>`,- Array.from(this.timeWindowOptions!.keys()).map(key => ({ value: key, text: key.toLowerCase() } as ListItem)),- this.timeWindowKey,- (value: string | string[]) => {- this.timeframe = undefined; // remove any custom start & end times- this.timeWindowKey = value.toString();- },- undefined,- undefined,- undefined,- true- )}- </div>- </div>- <div style="text-align: center">- <!-- Scroll left button -->- <or-icon class="button button-icon" ?disabled="${disabled}" icon="chevron-left"- @click="${() => this._shiftTimeframe(this.timeframe?.[0] ?? new Date(this._startOfPeriod!), this.timeframe?.[1] ?? new Date(this._endOfPeriod!), this.timeWindowKey!, "previous")}"- ></or-icon>- <!-- Scroll right button -->- <or-icon class="button button-icon" ?disabled="${disabled}" icon="chevron-right"- @click="${() => this._shiftTimeframe(this.timeframe?.[0] ?? new Date(this._startOfPeriod!), this.timeframe?.[1] ?? new Date(this._endOfPeriod!), this.timeWindowKey!, "next")}"- ></or-icon>- <!-- Button that opens custom time selection or restores to widget setting-->- <or-icon class="button button-icon" ?disabled="${disabled}" icon="${this.timeframe ? 'restore' : 'calendar-clock'}"- @click="${() => this.timeframe ? (this._isCustomWindow = false, this.timeframe = undefined) : this._openTimeDialog(this._startOfPeriod, this._endOfPeriod)}"- ></or-icon>- </div>- ` : html`- <div style = "display: flex; flex-direction: column; align-items: center">- <or-mwc-input .type="${InputType.BUTTON}" label="${this.timePrefixKey}" disabled></or-mwc-input>- <or-mwc-input .type="${InputType.BUTTON}" label="${this.timeWindowKey}" disabled></or-mwc-input>- </div>- `}- ` : undefined}-+ ${when(this.timestampControls && this.timePrefixKey && this.timeWindowKey, () => this._getTimeControlsTemplate(disabled || !!this.timeframe))}${this.timeframe ? html`<div style="font-size: 12px; display: flex; justify-content: flex-end;"><table style="text-align: right;">@@ -834,9 +762,12 @@ export class OrChart extends translate(i18next)(LitElement) {</table></div>` : undefined}- ${this.attributeControls ? html`- <or-mwc-input class="button" .type="${InputType.BUTTON}" ?disabled="${disabled}" label="selectAttributes" icon="plus" @or-mwc-input-changed="${() => this._openDialog()}"></or-mwc-input>- ` : undefined}+ ${when(this.attributeControls, () => html`+ <or-vaadin-button ?disabled=${disabled} @click=${() => this._openDialog()}>+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value="selectAttributes"></or-translate>+ </or-vaadin-button>+ `)}</div>${cache(this.showLegend ? html`<div id="attribute-list" class="${this.denseLegend ? 'attribute-list-dense' : undefined}">@@ -877,6 +808,59 @@ export class OrChart extends translate(i18next)(LitElement) {`;}+ protected _getTimeControlsTemplate(disabled: boolean) {+ const menuItems: MenuBarItem[] = [{+ component: createMenuBarItem(html`<or-translate value=${this.timeframe ? "dashboard.customTimeSpan" : this.timePrefixKey}></or-translate>`),+ children: this.timePrefixOptions?.map(o => (+ {type: "prefix", value: o, component: createMenuBarItem(html`<or-translate value=${o}></or-translate>`)}+ ))+ }, {+ component: createMenuBarItem(html`<or-translate value=${this._isCustomWindow ? "timeframe" : i18next.t(this.timeWindowKey?.toLowerCase() ?? "")}></or-translate>`),+ children: Array.from(this.timeWindowOptions ?? []).map(o => (+ {type: "window", value: o[0], component: createMenuBarItem(html`<or-translate value=${o[0]?.toLowerCase()}></or-translate>`)}+ ))+ }];+ return html`+ <div id="period-controls">+ <div id="period-dropdown-controls">+ <!-- Time prefix and window selection -->+ <or-vaadin-menu-bar .items=${menuItems} ?disabled=${disabled}+ @item-selected=${(ev: CustomEvent) => this._onTimeframeMenuSelect(ev)}+ ></or-vaadin-menu-bar>+ </div>+ </div>+ <div style="text-align: center">+ <!-- Scroll left button -->+ <or-icon class="button button-icon" ?disabled="${disabled}" icon="chevron-left"+ @click="${() => this._shiftTimeframe(this.timeframe?.[0] ?? new Date(this._startOfPeriod!), this.timeframe?.[1] ?? new Date(this._endOfPeriod!), this.timeWindowKey!, "previous")}"+ ></or-icon>+ <!-- Scroll right button -->+ <or-icon class="button button-icon" ?disabled="${disabled}" icon="chevron-right"+ @click="${() => this._shiftTimeframe(this.timeframe?.[0] ?? new Date(this._startOfPeriod!), this.timeframe?.[1] ?? new Date(this._endOfPeriod!), this.timeWindowKey!, "next")}"+ ></or-icon>+ <!-- Button that opens custom time selection or restores to widget setting-->+ <or-icon class="button button-icon" ?disabled="${disabled}"+ icon="${this.timeframe ? 'restore' : 'calendar-clock'}"+ @click="${() => this.timeframe ? (this._isCustomWindow = false, this.timeframe = undefined) : this._openTimeDialog(this._startOfPeriod, this._endOfPeriod)}"+ ></or-icon>+ </div>+ `;+ }++ protected _onTimeframeMenuSelect(ev: CustomEvent) {+ const type = ev.detail.value.type as "prefix" | "window";+ const value = ev.detail.value.value;+ if(type === "prefix") {+ // Handle time prefix+ this.timeframe = undefined; // remove any custom start & end times+ this.timePrefixKey = value;+ } else {+ // Handle time window+ this.timeframe = undefined; // remove any custom start & end times+ this.timeWindowKey = value;+ }+ }+protected async _onTreeSelectionChanged(event: OrAssetTreeSelectionEvent) {// Need to fully load the assetif (!manager.events) {@@ -1071,14 +1055,18 @@ export class OrChart extends translate(i18next)(LitElement) {}protected _openTimeDialog(startTimestamp?: number, endTimestamp?: number) {- const startRef: Ref<OrMwcInput> = createRef();- const endRef: Ref<OrMwcInput> = createRef();+ const startRef: Ref<OrVaadinDateTimePicker> = createRef();+ const endRef: Ref<OrVaadinDateTimePicker> = createRef();showDialog(new OrMwcDialog().setHeading(i18next.t('timeframe')).setContent(() => html`- <div>- <or-mwc-input ${ref(startRef)} type="${InputType.DATETIME}" required label="${i18next.t('beginning')}" .value="${startTimestamp}"></or-mwc-input>- <or-mwc-input ${ref(endRef)} type="${InputType.DATETIME}" required label="${i18next.t('ending')}" .value="${endTimestamp}"></or-mwc-input>+ <div style="max-width: 480px; display: flex; flex-direction: column; gap: 8px;">+ <or-vaadin-date-time-picker ${ref(startRef)} required value=${startTimestamp ? OrVaadinDateTimePicker.getLocalizedISOString(new Date(startTimestamp)) : undefined}>+ <or-translate slot="label" value="beginning"></or-translate>+ </or-vaadin-date-time-picker>+ <or-vaadin-date-time-picker ${ref(endRef)} required value=${endTimestamp ? OrVaadinDateTimePicker.getLocalizedISOString(new Date(endTimestamp)) : undefined}>+ <or-translate slot="label" value="ending"></or-translate>+ </or-vaadin-date-time-picker></div>`).setActions([{diff --git a/ui/component/or-dashboard-builder/package.json b/ui/component/or-dashboard-builder/package.jsonindex a24563cad..1f7b27230 100644--- a/ui/component/or-dashboard-builder/package.json+++ b/ui/component/or-dashboard-builder/package.json@@ -37,6 +37,7 @@"@openremote/or-map": "workspace:*","@openremote/or-mwc-components": "workspace:*","@openremote/or-translate": "workspace:*",+ "@openremote/or-vaadin-components": "workspace:*","@openremote/rest": "workspace:*","gridstack": "^12.4.2","lit": "^3.3.1",diff --git a/ui/component/or-dashboard-builder/src/controls/dashboard-refresh-controls.ts b/ui/component/or-dashboard-builder/src/controls/dashboard-refresh-controls.tsindex 600bfa7be..bad72a456 100644--- a/ui/component/or-dashboard-builder/src/controls/dashboard-refresh-controls.ts+++ b/ui/component/or-dashboard-builder/src/controls/dashboard-refresh-controls.ts@@ -1,11 +1,27 @@-import {InputType} from "@openremote/or-mwc-components/or-mwc-input";-import {ListItem} from "@openremote/or-mwc-components/or-mwc-list";-import {getContentWithMenuTemplate} from "@openremote/or-mwc-components/or-mwc-menu";+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {html, LitElement, PropertyValues, TemplateResult} from "lit";import {customElement, property} from "lit/decorators.js";import {when} from "lit/directives/when.js";import {DashboardRefreshInterval} from "@openremote/model";-import {i18next} from "@openremote/or-translate";+import {createMenuBarItem, MenuBarItem} from "@openremote/or-vaadin-components/or-vaadin-menu-bar";export function intervalToMillis(interval: DashboardRefreshInterval): number | undefined {switch (interval) {@@ -58,32 +74,17 @@ export class DashboardRefreshControls extends LitElement {protected render(): TemplateResult {const intervalOptions: string[] = this.getRefreshOptions();- const value = this.getIntervalString(this.interval);+ const menuItems: MenuBarItem[] = [{+ component: createMenuBarItem(when(this.interval === DashboardRefreshInterval.OFF,+ () => html`<or-icon icon="pause"></or-icon>`,+ () => html`<or-translate value=${this.getIntervalString(this.interval)}></or-translate>`)+ ),+ children: intervalOptions.map(o => ({interval: o, component: createMenuBarItem(html`<or-translate value=${o}></or-translate>`)}))+ }]return html`- <div style="height: 100%; display: flex; align-items: center;">- ${when(this.readonly, () => html`- ${when(this.interval === DashboardRefreshInterval.OFF, () => html`- <or-mwc-input .type="${InputType.BUTTON}" icon="pause" disabled="true" title="${i18next.t("dashboard.interval.off")}" style="height: 36px; margin-top: -12px;"></or-mwc-input>- `, () => html`- <or-mwc-input .type="${InputType.BUTTON}" label="${value}" disabled="true" title="${i18next.t("dashboard.refreshInterval")}"></or-mwc-input>- `)}- `, () => html`- ${getContentWithMenuTemplate(- this.interval === DashboardRefreshInterval.OFF ? html`- <or-mwc-input .type="${InputType.BUTTON}" icon="pause" title="${i18next.t("dashboard.interval.off")}" style="height: 36px; margin-top: -12px;"></or-mwc-input>- ` : html`- <or-mwc-input .type="${InputType.BUTTON}" label="${value}" title="${i18next.t("dashboard.refreshInterval")}"></or-mwc-input>- `,- intervalOptions.map(o => ({value: o} as ListItem)),- value,- (newVal) => this.onIntervalSelect(intervalOptions, newVal as string),- undefined,- false,- true,- true- )}- `)}- </div>+ <or-vaadin-menu-bar .items=${menuItems} ?disabled=${this.readonly}+ @item-selected=${(ev: CustomEvent)=> this.onIntervalSelect(intervalOptions, ev.detail.value.interval as string)}+ ></or-vaadin-menu-bar>`;}diff --git a/ui/component/or-dashboard-builder/src/index.ts b/ui/component/or-dashboard-builder/src/index.tsindex 13af51982..e334206e0 100644--- a/ui/component/or-dashboard-builder/src/index.ts+++ b/ui/component/or-dashboard-builder/src/index.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {css, html, LitElement, PropertyValues, unsafeCSS} from "lit";import {customElement, property, query, state} from "lit/decorators.js";import {when} from 'lit/directives/when.js';@@ -8,7 +27,6 @@ import "./or-dashboard-preview";import "./or-dashboard-widgetsettings";import "./or-dashboard-boardsettings";import "./controls/dashboard-refresh-controls";-import {InputType, OrInputChangedEvent} from '@openremote/or-mwc-components/or-mwc-input';import "@openremote/or-icon";import {style} from "./style";import {ClientRole, Dashboard, DashboardAccess, DashboardRefreshInterval, DashboardScalingPreset, DashboardScreenPreset, DashboardTemplate, DashboardWidget} from "@openremote/model";@@ -34,6 +52,7 @@ import {AttributeInputWidget} from "./widgets/attribute-input-widget";import {TableWidget} from "./widgets/table-widget";import {GatewayWidget} from "./widgets/gateway-widget";import {BarChartWidget} from "./widgets/barchart-widget";+import {OrVaadinTextField} from "@openremote/or-vaadin-components/or-vaadin-text-field";// language=CSSconst styling = css`@@ -71,6 +90,8 @@ const styling = css`border-bottom: 1px solid ${unsafeCSS(DefaultColor5)};}#header-title {+ display: flex;+ align-items: baseline;font-size: 18px;}#header-title > or-icon {@@ -105,10 +126,6 @@ const styling = css`font-weight: bold;color: var(--or-app-color3, ${unsafeCSS(DefaultColor3)});}- #fullscreen-header-title > or-mwc-input {- margin-right: 4px;- --or-icon-fill: ${unsafeCSS(DefaultColor3)};- }#fullscreen-header-actions {flex: 1 1 auto;text-align: right;@@ -496,10 +513,13 @@ export class OrDashboardBuilder extends translate(i18next)(LitElement) {}}- changeDashboardName(value: string) {+ _onDashboardNameChanged(ev: Event) {+ const elem = ev.currentTarget as OrVaadinTextField;+ if(!elem?.checkValidity()) {+ return;+ }if(this.selectedDashboard != null) {- const dashboard = this.selectedDashboard;- dashboard.displayName = value;+ this.selectedDashboard.displayName = elem.value;this.requestUpdate("selectedDashboard");}}@@ -602,32 +622,38 @@ export class OrDashboardBuilder extends translate(i18next)(LitElement) {<div id="header-wrapper"><div id="header-title"><or-icon icon="view-dashboard"></or-icon>- ${this.selectedDashboard != null ? html`- <or-mwc-input .type="${InputType.TEXT}" min="1" max="1023" comfortable required outlined label="${i18next.t('name')}"- ?readonly="${this._isReadonly() || !this._hasEditAccess()}" .value="${this.selectedDashboard.displayName}"- .disabled="${this.isLoading}" style="width: 300px;"- @or-mwc-input-changed="${(event: OrInputChangedEvent) => { this.changeDashboardName(event.detail.value); }}"- ></or-mwc-input>- ` : undefined}+ ${when(this.selectedDashboard, () => html`+ <or-vaadin-text-field minlength="1" maxlength="1023" required ?readonly=${this._isReadonly() || !this._hasEditAccess()}+ value=${this.selectedDashboard?.displayName} ?disabled=${this.isLoading} style="width: 300px;"+ @change=${(ev: Event) => this._onDashboardNameChanged(ev)}>+ <or-translate slot="label" value="name"></or-translate>+ </or-vaadin-text-field>+ `)}</div><div id="header-actions"><div id="header-actions-content">${when(this.selectedDashboard, () => html`- <or-mwc-input id="refresh-btn" class="small-btn" .disabled="${this.isLoading}" type="${InputType.BUTTON}" icon="refresh" title="${i18next.t("dashboard.refresh")}"- @or-mwc-input-changed="${() => { this.deselectWidget(); this.dashboardPreview?.refreshPreview(); }}">- </or-mwc-input>- <or-mwc-input id="responsive-btn" class="small-btn" .disabled="${this.isLoading}" type="${InputType.BUTTON}" icon="responsive" title="${i18next.t("dashboard.previewScreenSizes")}"- @or-mwc-input-changed="${() => { this.dispatchEvent(new CustomEvent('fullscreenToggle', { detail: !this.fullscreen })); }}">- </or-mwc-input>- <or-mwc-input id="share-btn" class="small-btn" .disabled="${this.isLoading}" type="${InputType.BUTTON}" icon="open-in-new" title="${i18next.t("dashboard.openInNewTab")}"- @or-mwc-input-changed="${() => { this.openDashboardInInsights(); }}">- </or-mwc-input>- <or-mwc-input id="save-btn" ?hidden="${this._isReadonly() || !this._hasEditAccess()}" .disabled="${this.isLoading || !this.hasChanged}" type="${InputType.BUTTON}" raised label="save"- @or-mwc-input-changed="${() => { this.saveDashboard(); }}">- </or-mwc-input>- <or-mwc-input id="view-btn" ?hidden="${this._isReadonly() || !this._hasViewAccess()}" type="${InputType.BUTTON}" outlined icon="eye" label="viewAsset"- @or-mwc-input-changed="${() => { this.dispatchEvent(new CustomEvent('editToggle', { detail: false })); }}">- </or-mwc-input>+ <or-vaadin-button id="refresh-btn" theme="icon tertiary" ?disabled=${this.isLoading} title=${i18next.t("dashboard.refresh")}+ @click=${() => { this.deselectWidget(); this.dashboardPreview?.refreshPreview(); }}>+ <or-icon slot="prefix" icon="refresh"></or-icon>+ </or-vaadin-button>+ <or-vaadin-button id="responsive-btn" theme="icon tertiary" ?disabled=${this.isLoading} title=${i18next.t("dashboard.previewScreenSizes")}+ @click=${() => { this.dispatchEvent(new CustomEvent('fullscreenToggle', { detail: !this.fullscreen })); }}>+ <or-icon slot="prefix" icon="responsive"></or-icon>+ </or-vaadin-button>+ <or-vaadin-button id="share-btn" theme="icon tertiary" ?disabled=${this.isLoading} title=${i18next.t("dashboard.openInNewTab")}+ @click=${() => this.openDashboardInInsights()}>+ <or-icon slot="prefix" icon="open-in-new"></or-icon>+ </or-vaadin-button>+ <or-vaadin-button id="save-btn" theme="primary" ?disabled=${this.isLoading || !this.hasChanged}+ ?hidden=${this._isReadonly() || !this._hasEditAccess()} @click=${() => this.saveDashboard()}>+ <or-translate value="save"></or-translate>+ </or-vaadin-button>+ <or-vaadin-button id="view-btn" ?hidden=${this._isReadonly() || !this._hasViewAccess()}+ @click=${() => this.dispatchEvent(new CustomEvent('editToggle', { detail: false }))}>+ <or-icon slot="prefix" icon="eye"></or-icon>+ <or-translate value="viewAsset"></or-translate>+ </or-vaadin-button>`)}</div></div>@@ -644,18 +670,22 @@ export class OrDashboardBuilder extends translate(i18next)(LitElement) {<div id="fullscreen-header-actions"><div id="fullscreen-header-actions-content">${when(this.selectedDashboard, () => html`- <or-mwc-input id="refresh-btn" class="small-btn" .disabled="${(this.selectedDashboard == null)}" type="${InputType.BUTTON}" icon="refresh" title="${i18next.t("dashboard.refresh")}"- @or-mwc-input-changed="${() => { this.deselectWidget(); this.dashboardPreview?.refreshPreview(); }}"- ></or-mwc-input>+ <or-vaadin-button id="refresh-btn" theme="icon" ?disabled=${(this.selectedDashboard == null)} title=${i18next.t("dashboard.refresh")}+ @click=${() => { this.deselectWidget(); this.dashboardPreview?.refreshPreview(); }}>+ <or-icon icon="refresh"></or-icon>+ </or-vaadin-button><dashboard-refresh-controls .interval="${this.refreshInterval}" .readonly="${false}"@interval-select="${(ev: IntervalSelectEvent) => this.onIntervalSelect(ev)}"></dashboard-refresh-controls>- <or-mwc-input id="share-btn" class="small-btn" .disabled="${(this.selectedDashboard == null)}" type="${InputType.BUTTON}" icon="open-in-new" title="${i18next.t("dashboard.openInNewTab")}"- @or-mwc-input-changed="${() => { this.openDashboardInInsights(); }}"- ></or-mwc-input>- <or-mwc-input id="view-btn" class="hideMobile" ?hidden="${this.selectedDashboard == null || this._isReadonly() || !this._hasEditAccess()}" type="${InputType.BUTTON}" outlined icon="pencil" label="editAsset"- @or-mwc-input-changed="${() => { this.dispatchEvent(new CustomEvent('editToggle', { detail: true })); }}">- </or-mwc-input>+ <or-vaadin-button id="share-btn" theme="icon" ?disabled=${(this.selectedDashboard == null)} title=${i18next.t("dashboard.openInNewTab")}+ @click=${() => this.openDashboardInInsights()}>+ <or-icon icon="open-in-new"></or-icon>+ </or-vaadin-button>+ <or-vaadin-button id="view-btn" class="hideMobile" ?hidden=${this.selectedDashboard == null || this._isReadonly() || !this._hasEditAccess()}+ @click=${() => this.dispatchEvent(new CustomEvent('editToggle', { detail: true }))}>+ <or-icon slot="prefix" icon="pencil"></or-icon>+ <or-translate value="editAsset"></or-translate>+ </or-vaadin-button>`)}</div></div>@@ -699,12 +729,14 @@ export class OrDashboardBuilder extends translate(i18next)(LitElement) {<span id="title" title="${selectedWidget?.displayName}">${selectedWidget?.displayName}</span></div><div id="sidebar-widget-headeractions">- <or-mwc-input type="${InputType.BUTTON}" icon="delete" @or-mwc-input-changed="${() => {- showOkCancelDialog(i18next.t('areYouSure'), i18next.t('dashboard.deleteWidgetWarning'), i18next.t('delete')).then((ok: boolean) => {- if(ok) { this.deleteWidget(selectedWidget!); }- })- }}"></or-mwc-input>- <or-mwc-input type="${InputType.BUTTON}" icon="close" @or-mwc-input-changed="${() => { this.deselectWidget(); }}"></or-mwc-input>+ <or-vaadin-button theme="icon" @click=${() => showOkCancelDialog(i18next.t('areYouSure'), i18next.t('dashboard.deleteWidgetWarning'), i18next.t('delete')).then((ok: boolean) => {+ if(ok) { this.deleteWidget(selectedWidget!); }+ })}>+ <or-icon icon="delete"></or-icon>+ </or-vaadin-button>+ <or-vaadin-button theme="icon" @click=${() => this.deselectWidget()}>+ <or-icon icon="close"></or-icon>+ </or-vaadin-button></div></div><div id="content" class="hidescroll" style="flex: 1; overflow: hidden auto;">diff --git a/ui/component/or-dashboard-builder/src/or-dashboard-boardsettings.ts b/ui/component/or-dashboard-builder/src/or-dashboard-boardsettings.tsindex abb39c2e4..2c5133708 100644--- a/ui/component/or-dashboard-builder/src/or-dashboard-boardsettings.ts+++ b/ui/component/or-dashboard-builder/src/or-dashboard-boardsettings.ts@@ -1,12 +1,32 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {Dashboard, DashboardAccess, DashboardRefreshInterval, DashboardScalingPreset, DashboardScreenPreset} from "@openremote/model";import {css, html, LitElement} from "lit";import {customElement, property} from "lit/decorators.js";-import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import {style} from './style';import {i18next, translate} from "@openremote/or-translate";import {unsafeHTML} from 'lit/directives/unsafe-html.js';import {when} from "lit/directives/when.js";import {dashboardAccessToString, scalingPresetToString, sortScreenPresets} from ".";+import {OrVaadinSelect, SelectItem} from "@openremote/or-vaadin-components/or-vaadin-select";+import {OrVaadinNumberField} from "@openremote/or-vaadin-components/or-vaadin-number-field";//language=cssconst boardSettingsStyling = css`@@ -57,12 +77,9 @@ export class OrDashboardBoardsettings extends translate(i18next)(LitElement) {protected render() {if (this.dashboard.template?.screenPresets != null) {const screenPresets = sortScreenPresets(this.dashboard.template.screenPresets, true);- const accessOptions = [DashboardAccess.PRIVATE, DashboardAccess.SHARED, DashboardAccess.PUBLIC].map((access) => ({key: access, value: dashboardAccessToString(access)}));- const refreshIntervalOptions = [DashboardRefreshInterval.OFF, DashboardRefreshInterval.ONE_MIN, DashboardRefreshInterval.FIVE_MIN, DashboardRefreshInterval.QUARTER, DashboardRefreshInterval.ONE_HOUR].map(interval => ({key: interval, value: `dashboard.interval.${interval.toLowerCase()}`}))- const scalingPresets: { key: DashboardScalingPreset, value: string }[] = [];- [DashboardScalingPreset.KEEP_LAYOUT, DashboardScalingPreset.WRAP_TO_SINGLE_COLUMN, /*DashboardScalingPreset.REDIRECT,*/ DashboardScalingPreset.BLOCK_DEVICE].forEach((preset: DashboardScalingPreset) => {- scalingPresets.push({key: preset, value: scalingPresetToString(preset)});- });+ const accessOptions: SelectItem[] = [DashboardAccess.PRIVATE, DashboardAccess.SHARED, DashboardAccess.PUBLIC].map((access) => ({value: access, label: dashboardAccessToString(access)}));+ const refreshIntervalOptions: SelectItem[] = [DashboardRefreshInterval.OFF, DashboardRefreshInterval.ONE_MIN, DashboardRefreshInterval.FIVE_MIN, DashboardRefreshInterval.QUARTER, DashboardRefreshInterval.ONE_HOUR].map(interval => ({value: interval, label: i18next.t(`dashboard.interval.${interval.toLowerCase()}`)}))+ const scalingPresets: SelectItem[] = [DashboardScalingPreset.KEEP_LAYOUT, DashboardScalingPreset.WRAP_TO_SINGLE_COLUMN, /*DashboardScalingPreset.REDIRECT,*/ DashboardScalingPreset.BLOCK_DEVICE].map((preset) => ({value: preset, label: scalingPresetToString(preset)}));return html`<!-- Permissions panel, to set who can view/edit the selected dashboard -->@@ -70,15 +87,11 @@ export class OrDashboardBoardsettings extends translate(i18next)(LitElement) {<settings-panel displayName="permissions" expanded="${true}"><div><div class="label">- ${html`<span>${unsafeHTML(i18next.t('dashboard.whoCanView').toString())}</span>`}+ <or-translate value="dashboard.whoCanView"></or-translate></div>- <or-mwc-input class="permissionInput" comfortable type="${InputType.SELECT}" style="width: 100%;"- .options="${accessOptions.map((access) => access.value)}"- .value="${dashboardAccessToString(this.dashboard.access!)}"- @or-mwc-input-changed="${(event: OrInputChangedEvent) => {- this.setAccess(accessOptions.find((access) => access.value == event.detail.value)?.key!);- }}"- ></or-mwc-input>+ <or-vaadin-select .items=${accessOptions} value=${this.dashboard.access}+ @change=${(ev: Event) => this.setAccess((ev.currentTarget as OrVaadinSelect).value as DashboardAccess)}+ ></or-vaadin-select></div></settings-panel>`)}@@ -90,12 +103,15 @@ export class OrDashboardBoardsettings extends translate(i18next)(LitElement) {<!-- Number of Columns control --><div style="margin-bottom: 24px; display: flex; align-items: center;"><span style="min-width: 180px;"><or-translate value="dashboard.numberOfColumns"></or-translate></span>- <or-mwc-input type="${InputType.NUMBER}" comfortable .value="${this.dashboard.template.columns}" min="1" max="24" @or-mwc-input-changed="${(event: OrInputChangedEvent) => {- if (this.dashboard.template != null && event.detail.value as number <= 24 && event.detail.value as number >= 1) {- this.dashboard.template.columns = event.detail.value as number;- this.forceParentUpdate(true);- }- }}"></or-mwc-input>+ <or-vaadin-number-field value=${this.dashboard.template.columns} min="1" max="24"+ @change=${(ev: Event) => {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if (elem.checkValidity() && this.dashboard.template != null) {+ this.dashboard.template.columns = Number(elem.value);+ this.forceParentUpdate(true);+ }+ }}+ ></or-vaadin-number-field></div><!-- Scaling preset -->@@ -111,27 +127,21 @@ export class OrDashboardBoardsettings extends translate(i18next)(LitElement) {<!-- Max Screen Width control--><div style="margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between;"><span style="min-width: 150px;"><or-translate value="dashboard.maxScreenWidth"></or-translate></span>- <div>- <or-mwc-input type="${InputType.NUMBER}" comfortable .value="${this.dashboard.template.maxScreenWidth}" style="width: 70px;"- @or-mwc-input-changed="${(event: OrInputChangedEvent) => {- if (this.dashboard.template != null) {- this.dashboard.template.maxScreenWidth = event.detail.value as number;- this.forceParentUpdate(true);- }- }}">- </or-mwc-input>- <span style="margin-left: 2px;">px</span>- </div>+ <or-vaadin-number-field value=${this.dashboard.template.maxScreenWidth} min="0" style="width: 110px;" @change=${(ev: Event) => {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if (elem.checkValidity() && this.dashboard.template != null) {+ this.dashboard.template.maxScreenWidth = Number(elem.value);+ this.forceParentUpdate(true);+ }+ }}>+ <span slot="suffix">px</span>+ </or-vaadin-number-field></div><!-- "Set to mobile" preset button, for ease of use -->- <div>- <or-mwc-input type="${InputType.BUTTON}" comfortable label="dashboard.setToMobilePreset"- @or-mwc-input-changed="${() => {- this.setToMobilePreset();- }}">- </or-mwc-input>- </div>+ <or-vaadin-button @click=${() => this.setToMobilePreset()}>+ <or-translate value="dashboard.setToMobilePreset"></or-translate>+ </or-vaadin-button></div></settings-panel>@@ -141,15 +151,16 @@ export class OrDashboardBoardsettings extends translate(i18next)(LitElement) {<div class="label"><span><or-translate value="dashboard.defaultRefreshInterval"></or-translate></span></div>- <or-mwc-input type="${InputType.SELECT}" comfortable .options="${refreshIntervalOptions.map(o => o.value)}" style="width: 100%;"- .value="${`dashboard.interval.${this.dashboard.template.refreshInterval?.toLowerCase() || `off`}`}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- const intervalEntry = refreshIntervalOptions.find(o => o.value === ev.detail.value);- if(intervalEntry) {- this.setRefreshInterval(intervalEntry.key)- }- }}">- </or-mwc-input>+ <or-vaadin-select .items=${refreshIntervalOptions} value=${this.dashboard.template.refreshInterval}+ @change=${(ev: Event) => {+ const elem = ev.currentTarget as OrVaadinSelect;+ const intervalEntry = refreshIntervalOptions.find(o => o.value === elem.value)?.value;+ console.debug(intervalEntry);+ if(intervalEntry) {+ this.setRefreshInterval(intervalEntry as DashboardRefreshInterval);+ }+ }}>+ </or-vaadin-select></div></settings-panel>@@ -177,23 +188,21 @@ export class OrDashboardBoardsettings extends translate(i18next)(LitElement) {/* ======================== */- scalingPresetTemplate(screenPresets: DashboardScreenPreset[], scalingPresets: { key: DashboardScalingPreset, value: string }[]) {+ scalingPresetTemplate(screenPresets: DashboardScreenPreset[], scalingPresets: SelectItem[]) {return html`${screenPresets.map((preset) => {return html`<div style="margin-bottom: ${screenPresets.length > 1 ? '24px' : '16px'}"><div class="label">- ${html`<span>${unsafeHTML(i18next.t("dashboard.onScreenMyBoardShould").replace("{{size}}", ("<b>" + i18next.t(preset.displayName!) + "</b>")))}</span>`}+ ${unsafeHTML(i18next.t("dashboard.onScreenMyBoardShould").replace("{{size}}", "<b>" + i18next.t(preset.displayName!) + "</b>"))}</div>- <or-mwc-input class="displayInput" type="${InputType.SELECT}" comfortable style="width: 100%;"- .options="${scalingPresets.map((x) => x.value)}"- .value="${scalingPresets.find((p) => p.key == preset.scalingPreset)?.value}"- @or-mwc-input-changed="${(event: OrInputChangedEvent) => {- preset.scalingPreset = scalingPresets.find((p) => p.value == event.detail.value)?.key;- this.forceParentUpdate(true);- this.requestUpdate();- }}"- ></or-mwc-input>+ <or-vaadin-select .items=${scalingPresets} value=${preset.scalingPreset}+ @change=${(ev: Event) => {+ preset.scalingPreset = (ev.currentTarget as OrVaadinSelect).value as DashboardScalingPreset;+ this.forceParentUpdate(true);+ this.requestUpdate();+ }}+ ></or-vaadin-select></div>`})}@@ -206,16 +215,15 @@ export class OrDashboardBoardsettings extends translate(i18next)(LitElement) {return html`<div style="margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between;"><span style="min-width: 140px;">${customLabels ? customLabels[index] : (preset.displayName + " " + i18next.t('screen'))}</span>- <div>- <span style="margin-right: 4px;">${(screenPresets.indexOf(preset) == 0) ? '>' : '<'}</span>- <or-mwc-input type="${InputType.NUMBER}" comfortable .disabled="${(screenPresets.length > 1 && screenPresets.indexOf(preset) == 0)}" style="width: 70px;"- .value="${(screenPresets.length > 1 && screenPresets.indexOf(preset) == 0 ? screenPresets[1].breakpoint : preset.breakpoint)}"- @or-mwc-input-changed="${(event: OrInputChangedEvent) => {- this.setBreakpoint(screenPresets.indexOf(preset), event.detail.value)- }}"- ></or-mwc-input>- <span style="margin-left: 2px;">px</span>- </div>+ <or-vaadin-number-field value=${(screenPresets.length > 1 && screenPresets.indexOf(preset) == 0 ? screenPresets[1].breakpoint : preset.breakpoint)}+ ?disabled=${(screenPresets.length > 1 && screenPresets.indexOf(preset) == 0)}+ min="0" style="width: 110px;" @change=${(ev: Event) => {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if(elem.checkValidity()) this.setBreakpoint(screenPresets.indexOf(preset), Number(elem.value))+ }}>+ <span slot="prefix">></span>+ <span slot="suffix">px</span>+ </or-vaadin-number-field></div>`})}diff --git a/ui/component/or-dashboard-builder/src/or-dashboard-browser.ts b/ui/component/or-dashboard-builder/src/or-dashboard-browser.tsindex 9ffc8f7cd..de6877f25 100644--- a/ui/component/or-dashboard-builder/src/or-dashboard-browser.ts+++ b/ui/component/or-dashboard-builder/src/or-dashboard-browser.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {GridStack, GridStackNode} from "gridstack";import {css, html, LitElement, PropertyValues, TemplateResult, unsafeCSS} from "lit";import {customElement, property, query, state} from "lit/decorators.js";diff --git a/ui/component/or-dashboard-builder/src/or-dashboard-engine.ts b/ui/component/or-dashboard-builder/src/or-dashboard-engine.tsindex 30f551d4f..ad5b8445b 100644--- a/ui/component/or-dashboard-builder/src/or-dashboard-engine.ts+++ b/ui/component/or-dashboard-builder/src/or-dashboard-engine.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import { GridStackEngine, GridStackNode, GridStackMoveOpts } from 'gridstack';export class OrDashboardEngine extends GridStackEngine {diff --git a/ui/component/or-dashboard-builder/src/or-dashboard-keyhandler.ts b/ui/component/or-dashboard-builder/src/or-dashboard-keyhandler.tsindex b21bb3259..71fa277d0 100644--- a/ui/component/or-dashboard-builder/src/or-dashboard-keyhandler.ts+++ b/ui/component/or-dashboard-builder/src/or-dashboard-keyhandler.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import { EventEmitter } from "events";// Inspired by or-rules flow editor Input classdiff --git a/ui/component/or-dashboard-builder/src/or-dashboard-preview.ts b/ui/component/or-dashboard-builder/src/or-dashboard-preview.tsindex f5a228e20..f10097c77 100644--- a/ui/component/or-dashboard-builder/src/or-dashboard-preview.ts+++ b/ui/component/or-dashboard-builder/src/or-dashboard-preview.ts@@ -1,23 +1,42 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import manager, {DefaultColor4, DefaultColor5} from "@openremote/core";-import {css, html, LitElement, TemplateResult, unsafeCSS} from "lit";+import {css, html, LitElement, unsafeCSS} from "lit";import {customElement, property, state} from "lit/decorators.js";import {style} from "./style";import "./or-dashboard-widgetcontainer";import debounce from "lodash.debounce";import {DashboardGridItem, DashboardScalingPreset, DashboardScreenPreset, DashboardTemplate, DashboardWidget} from "@openremote/model";import {getActivePreset} from "./index";-import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import "@openremote/or-components/or-loading-indicator";import {repeat} from 'lit/directives/repeat.js';import {GridItemHTMLElement, GridStack, GridStackElement, GridStackNode} from "gridstack";import {showSnackbar} from "@openremote/or-mwc-components/or-mwc-snackbar";-import {i18next, translate} from "@openremote/or-translate";import {when} from "lit/directives/when.js";-import {cache} from "lit/directives/cache.js";import {guard} from "lit/directives/guard.js";import {OrDashboardEngine} from "./or-dashboard-engine";import {WidgetService} from "./service/widget-service";import {OrDashboardWidgetContainer} from "./or-dashboard-widgetcontainer";+import {OrVaadinNumberField} from "@openremote/or-vaadin-components/or-vaadin-number-field";+import {OrVaadinSelect, SelectItem} from "@openremote/or-vaadin-components/or-vaadin-select";+import {i18next, translate} from "@openremote/or-translate";// TODO: Add webpack/rollup to build so consumers aren't forced to use the same toolingconst gridcss = require('gridstack/dist/gridstack.min.css');@@ -38,7 +57,7 @@ const editorStyling = css`padding: 24px;display: flex;justify-content: center;- align-items: center;+ align-items: baseline;}/* Margins on view options */#fit-btn { margin-right: 10px; }@@ -507,25 +526,52 @@ export class OrDashboardPreview extends translate(i18next)(LitElement) {<div id="buildingArea" style="display: flex; flex-direction: column; height: 100%; position: relative;" @click="${(event: PointerEvent) => { if((event.composedPath()[1] as HTMLElement).id === 'buildingArea') { this.onGridItemClick(undefined); }}}">${this.editMode && !this.fullscreen ? html`<div id="view-options">- <or-mwc-input id="fit-btn" type="${InputType.BUTTON}" icon="fit-to-screen"- @or-mwc-input-changed="${() => this.onFitToScreenClick()}">- </or-mwc-input>- <or-mwc-input id="zoom-input" type="${InputType.NUMBER}" outlined label="${i18next.t('dashboard.zoomPercent')}" min="25" .value="${(this.previewZoom * 100)}" style="width: 90px"- @or-mwc-input-changed="${debounce((event: OrInputChangedEvent) => { this.previewZoom = event.detail.value / 100; }, 50)}"- ></or-mwc-input>- <or-mwc-input id="view-preset-select" type="${InputType.SELECT}" outlined label="${i18next.t('dashboard.presetSize')}" style="min-width: 220px;"- .value="${this.previewSize == undefined ? customPreset : this.previewSize.displayName}" .options="${this.availablePreviewSizes?.map((x) => x.displayName)}"- @or-mwc-input-changed="${(event: OrInputChangedEvent) => { this.previewSize = this.availablePreviewSizes?.find(s => s.displayName == event.detail.value); }}"- ></or-mwc-input>- <or-mwc-input id="width-input" type="${InputType.NUMBER}" outlined label="${i18next.t('width')}" min="100" .value="${this.previewWidth?.replace('px', '')}" style="width: 90px"- @or-mwc-input-changed="${debounce((event: OrInputChangedEvent) => { this.previewWidth = event.detail.value + 'px'; }, 550)}"- ></or-mwc-input>- <or-mwc-input id="height-input" type="${InputType.NUMBER}" outlined label="${i18next.t('height')}" min="100" .value="${this.previewHeight?.replace('px', '')}" style="width: 90px;"- @or-mwc-input-changed="${(event: OrInputChangedEvent) => { this.previewHeight = event.detail.value + 'px'; }}"- ></or-mwc-input>- <or-mwc-input id="rotate-btn" type="${InputType.BUTTON}" icon="screen-rotation"- @or-mwc-input-changed="${() => { const newWidth = this.previewHeight; const newHeight = this.previewWidth; this.previewWidth = newWidth; this.previewHeight = newHeight; }}">- </or-mwc-input>+ <!-- Fit to screen button-->+ <or-vaadin-button id="fit-btn" theme="icon" @click=${() => this.onFitToScreenClick()}>+ <or-icon icon="fit-to-screen"></or-icon>+ </or-vaadin-button>+ <!-- Zoom level -->+ <or-vaadin-number-field id="zoom-input" min="25" value=${this.previewZoom * 100} style="width: 90px;"+ @change=${(ev: Event) => {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if(elem.checkValidity()) this.previewZoom = Number(elem.value) / 100;+ }}>+ <or-translate slot="label" value="dashboard.zoomPercent"></or-translate>+ <span slot="suffix">%</span>+ </or-vaadin-number-field>+ <!-- Select device size preset -->+ <or-vaadin-select id="view-preset-select" .items=${this.availablePreviewSizes?.map(s => ({value: s.displayName, label: s.displayName}) as SelectItem)}+ value=${this.previewSize == undefined ? customPreset : this.previewSize.displayName} style="width: 220px;"+ @change=${(ev: Event) => {+ const name = (ev.currentTarget as OrVaadinSelect).value;+ this.previewSize = this.availablePreviewSizes?.find(s => s.displayName == name)+ }}>+ <or-translate slot="label" value="dashboard.presetSize"></or-translate>+ </or-vaadin-select>+ <!-- Height width input fields -->+ <or-vaadin-number-field id="width-input" value=${this.previewWidth?.replace('px', '')} min="100" style="width: 90px;"+ @change=${(ev: Event) => {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if(elem.checkValidity()) this.previewWidth = (elem.value + "px");+ }}>+ <or-translate slot="label" value="width"></or-translate>+ </or-vaadin-number-field>+ <or-vaadin-number-field id="height-input" value=${this.previewHeight?.replace('px', '')} min="100" style="width: 90px;"+ @change=${(ev: Event) => {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if(elem.checkValidity()) this.previewHeight = (elem.value + "px");+ }}>+ <or-translate slot="label" value="height"></or-translate>+ </or-vaadin-number-field>+ <!-- Rotate button -->+ <or-vaadin-button id="rotate-btn" theme="icon" @click=${() => {+ const newWidth = this.previewHeight;+ const newHeight = this.previewWidth;+ this.previewWidth = newWidth;+ this.previewHeight = newHeight;+ }}>+ <or-icon icon="screen-rotation"></or-icon>+ </or-vaadin-button></div>` : undefined}${this.rerenderActive ? html`diff --git a/ui/component/or-dashboard-builder/src/or-dashboard-tree.ts b/ui/component/or-dashboard-builder/src/or-dashboard-tree.tsindex 2044adbcd..88764af6b 100644--- a/ui/component/or-dashboard-builder/src/or-dashboard-tree.ts+++ b/ui/component/or-dashboard-builder/src/or-dashboard-tree.ts@@ -1,6 +1,24 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {css, html, LitElement, PropertyValues} from 'lit';import {customElement, property} from 'lit/decorators.js';-import {InputType} from '@openremote/or-mwc-components/or-mwc-input';import '@openremote/or-icon';import {style} from './style';import {Dashboard} from '@openremote/model';@@ -13,6 +31,7 @@ import {showSnackbar} from '@openremote/or-mwc-components/or-mwc-snackbar';import {style as OrAssetTreeStyle} from '@openremote/or-asset-tree';import {DashboardService, DashboardSizeOption} from './service/dashboard-service';import {isAxiosError} from '@openremote/rest';+import {when} from "lit/directives/when.js";// language=cssconst treeStyling = css`@@ -224,34 +243,30 @@ export class OrDashboardTree extends translate(i18next)(LitElement) {<!-- Controls header -->${this.showControls ? html`<div id="header-btns">- ${this.selected != null ? html`- <or-mwc-input type="${InputType.BUTTON}" icon="close" title="${i18next.t("deselect")}" @or-mwc-input-changed="${() => {- this.selectDashboard(undefined);- }}"></or-mwc-input>- ${!this.readonly ? html`- <or-mwc-input type="${InputType.BUTTON}" class="hideMobile" icon="content-copy" title="${i18next.t("duplicate")}"- @or-mwc-input-changed="${() => {- this.duplicateDashboard(this.selected!);- }}"- ></or-mwc-input>- <or-mwc-input type="${InputType.BUTTON}" icon="delete" title="${i18next.t("delete")}" @or-mwc-input-changed="${() => {+ ${when(this.selected != null, () => html`+ <or-vaadin-button theme="icon" title=${i18next.t("deselect")} @click=${() => this.selectDashboard(undefined)}>+ <or-icon icon="close"></or-icon>+ </or-vaadin-button>+ ${when(!this.readonly, () => html`+ <or-vaadin-button theme="icon" class="hideMobile" title=${i18next.t("duplicate")} @click=${() => this.duplicateDashboard(this.selected!)}>+ <or-icon icon="content-copy"></or-icon>+ </or-vaadin-button>+ <or-vaadin-button theme="icon" title=${i18next.t("delete")} @click=${() => {if (this.selected != null) {showOkCancelDialog(i18next.t('areYouSure'), i18next.t('dashboard.deletePermanentWarning', {dashboard: this.selected.displayName}), i18next.t('delete')).then((ok: boolean) => {- if (ok) {- this.deleteDashboard(this.selected!);- }+ if (ok) this.deleteDashboard(this.selected!);});}- }}"></or-mwc-input>- ` : undefined}- ` : undefined}- ${!this.readonly ? html`- <or-mwc-input type="${InputType.BUTTON}" class="hideMobile" icon="plus" title="${i18next.t("addInsights")}"- @or-mwc-input-changed="${() => {- this.createDashboard(DashboardSizeOption.DESKTOP);- }}"- ></or-mwc-input>- ` : undefined}+ }}>+ <or-icon icon="delete"></or-icon>+ </or-vaadin-button>+ `)}+ `)}+ ${when(!this.readonly, () => html`+ <or-vaadin-button theme="icon" class="hideMobile" title=${i18next.t("addInsights")} @click=${() => this.createDashboard(DashboardSizeOption.DESKTOP)}>+ <or-icon icon="plus"></or-icon>+ </or-vaadin-button>+ `)}</div>` : undefined}</div>diff --git a/ui/component/or-dashboard-builder/src/or-dashboard-widgetcontainer.ts b/ui/component/or-dashboard-builder/src/or-dashboard-widgetcontainer.tsindex 56233bf14..0bc471992 100644--- a/ui/component/or-dashboard-builder/src/or-dashboard-widgetcontainer.ts+++ b/ui/component/or-dashboard-builder/src/or-dashboard-widgetcontainer.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {html, LitElement, PropertyValues} from "lit";import {customElement, property, query, state} from "lit/decorators.js";import {when} from "lit/directives/when.js";diff --git a/ui/component/or-dashboard-builder/src/or-dashboard-widgetsettings.ts b/ui/component/or-dashboard-builder/src/or-dashboard-widgetsettings.tsindex 6425d3f2d..ffd565c8f 100644--- a/ui/component/or-dashboard-builder/src/or-dashboard-widgetsettings.ts+++ b/ui/component/or-dashboard-builder/src/or-dashboard-widgetsettings.ts@@ -1,14 +1,33 @@-import {Asset, DashboardWidget } from "@openremote/model";+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+import {DashboardWidget} from "@openremote/model";import {html, LitElement, TemplateResult, unsafeCSS } from "lit";import { customElement, property, state } from "lit/decorators.js";-import { InputType, OrInputChangedEvent } from "@openremote/or-mwc-components/or-mwc-input";import {style} from './style';-import { i18next, translate } from "@openremote/or-translate";import { until } from "lit/directives/until.js";import {WidgetService} from "./service/widget-service";import {WidgetSettings, WidgetSettingsChangedEvent} from "./util/widget-settings";import {WidgetManifest} from "./util/or-widget";import { guard } from "lit/directives/guard.js";+import {OrVaadinTextField} from "@openremote/or-vaadin-components/or-vaadin-text-field";+import {i18next, translate} from "@openremote/or-translate";const tableStyle = require("@material/data-table/dist/mdc.data-table.css");@@ -38,12 +57,13 @@ export class OrDashboardWidgetsettings extends translate(i18next)(LitElement) {protected render() {return html`- <div style="padding: 12px;">- <div>- <or-mwc-input .type="${InputType.TEXT}" style="width: 100%;" .value="${this.selectedWidget?.displayName}" label="${i18next.t('name')}"- @or-mwc-input-changed="${(event: OrInputChangedEvent) => this.setDisplayName(event.detail.value)}"- ></or-mwc-input>- </div>+ <div style="padding: 12px; border-bottom: 1px solid #E0E0E0">+ <or-vaadin-text-field value=${this.selectedWidget?.displayName} required minlength="1" @change=${(ev: Event) => {+ const elem = ev.currentTarget as OrVaadinTextField;+ if(elem.checkValidity()) this.setDisplayName(elem.value);+ }}>+ <or-translate slot="label" value="name"></or-translate>+ </or-vaadin-text-field></div><div>${guard([this.selectedWidget], () => html`diff --git a/ui/component/or-dashboard-builder/src/panels/assettypes-panel.ts b/ui/component/or-dashboard-builder/src/panels/assettypes-panel.tsindex 6c5205575..9ead58125 100644--- a/ui/component/or-dashboard-builder/src/panels/assettypes-panel.ts+++ b/ui/component/or-dashboard-builder/src/panels/assettypes-panel.ts@@ -1,15 +1,36 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {css, html, LitElement, PropertyValues, TemplateResult} from "lit";import {customElement, property, state} from "lit/decorators.js";import {AssetDescriptor, AssetModelUtil, AssetTypeInfo} from "@openremote/model";-import {getContentWithMenuTemplate} from "@openremote/or-mwc-components/or-mwc-menu";import {i18next} from "@openremote/or-translate";-import {ListItem} from "@openremote/or-mwc-components/or-mwc-list";import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import {Util} from "@openremote/core";import {when} from "lit/directives/when.js";import {createRef, Ref, ref} from 'lit/directives/ref.js';import {AssetTreeConfig, OrAssetTree} from "@openremote/or-asset-tree";import {OrMwcDialog, showDialog} from "@openremote/or-mwc-components/or-mwc-dialog";+import {ComboBoxLitRenderer, comboBoxRenderer, OrVaadinComboBox} from "@openremote/or-vaadin-components/or-vaadin-combo-box";+import {OrVaadinMultiSelectComboBox} from "@openremote/or-vaadin-components/or-vaadin-multi-select-combo-box";+import {ListItem} from "@openremote/or-vaadin-components/or-vaadin-list-box";+import { styleMap } from "lit/directives/style-map.js";export class AssetTypeSelectEvent extends CustomEvent<string> {@@ -55,7 +76,7 @@ export class AttributeNamesSelectEvent extends CustomEvent<string | string[]> {public static readonly NAME = "attributenames-select";- constructor(attributeNames: string | string[]) {+ constructor(attributeNames: string[]) {super(AttributeNamesSelectEvent.NAME, {bubbles: true,composed: true,@@ -105,7 +126,7 @@ export class AssettypesPanel extends LitElement {protected assetIds: undefined | string | string[];@property() // names of selected attributes; either undefined, a single entry, or multi select- protected attributeNames: undefined | string | string[];+ protected attributeNames: undefined | string[];/* ----------- */@@ -138,29 +159,24 @@ export class AssettypesPanel extends LitElement {}protected render(): TemplateResult {+ const assetTypeItems = this.mapDescriptors(this._loadedAssetTypes) as ListItem[];+ const selected = this.assetType ? assetTypeItems.find(i => i.value === this.assetType) : undefined;+ const itemRenderer: ComboBoxLitRenderer<ListItem> = (listItem: ListItem) => html`+ <div style="display: flex; align-items: center; gap: 6px;">+ <or-icon icon=${listItem.icon} style=${listItem.styleMap ? styleMap(listItem.styleMap) : undefined}></or-icon>+ <span>${listItem.text}</span>+ </div>+ `;return html`<div style="display: flex; flex-direction: column; gap: 8px;"><!-- Select asset type -->- <div>- ${this._loadedAssetTypes.length > 0 ? getContentWithMenuTemplate(- this.getAssetTypeTemplate(),- this.mapDescriptors(this._loadedAssetTypes, {- text: i18next.t("filter.assetTypeMenuNone"),- value: "",- icon: "selection-ellipse"- }) as ListItem[],- undefined,- (v: string[] | string) => {- this.assetType = v as string;- },- undefined,- false,- true,- true,- true) : html``- }- </div>+ <or-vaadin-combo-box .items=${assetTypeItems} .selectedItem=${selected} required item-value-path="value" item-label-path="text"+ ${comboBoxRenderer(itemRenderer, [])}+ @change=${(ev: CustomEvent) => {this.assetType = (ev.currentTarget as OrVaadinComboBox).value}}>+ <or-icon slot="prefix" icon=${selected?.icon ?? "selection-ellipse"} style=${selected?.styleMap ? styleMap(selected.styleMap) : undefined}></or-icon>+ <or-translate slot="label" value="filter.assetTypeLabel"></or-translate>+ </or-vaadin-combo-box><!-- Switch to include all assets of this type -->${when(this.config.assets?.allOfTypeOption, () => {@@ -181,31 +197,35 @@ export class AssettypesPanel extends LitElement {const assetIds = (typeof this.assetIds === 'string') ? [this.assetIds] : this.assetIds;const label = this.allOfType ? i18next.t("allAssets") : ((this.assetIds?.length || 0) + ' ' + i18next.t('assets'));return html`- <div>- <or-mwc-input .type="${InputType.BUTTON}" label="${label}" .disabled="${!this.assetType || this.allOfType}" fullWidth outlined comfortable style="width: 100%;"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this._openAssetSelector(this.assetType!, assetIds, this.config.assets?.multi)}"- ></or-mwc-input>- </div>+ <or-vaadin-button ?disabled=${!this.assetType || this.allOfType} @click=${() => this._openAssetSelector(this.assetType!, assetIds, this.config.assets?.multi)}>+ <span>${label}</span>+ </or-vaadin-button>`;})}<!-- Select one or more attributes -->${when(this.config.attributes?.enabled, () => {- const options: [string, string][] = this._attributeSelectList.map(al => [al[0], al[1]]);- const searchProvider: (search?: string) => Promise<[any, string][]> = async (search) => {- return search ? options.filter(o => o[1].toLowerCase().includes(search.toLowerCase())) : options;- };- return html`- <div>- <or-mwc-input .type="${InputType.SELECT}" label="${i18next.t("filter.attributeLabel")}" .disabled="${!this.assetType}" style="width: 100%;"- .options="${options}" .searchProvider="${searchProvider}" .multiple="${this.config.attributes?.multi}" .value="${this.attributeNames as string}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- this.attributeNames = ev.detail.value;- }}"- ></or-mwc-input>- </div>- `-+ const options = this._attributeSelectList?.map(al => ({key: al[0], value: al[1]})) ?? [];+ const selectedItems = this.attributeNames?.map(n => options.find(o => o.key === n)) ?? [];+ if(this.config.attributes?.multi) {+ return html`+ <or-vaadin-multi-select-combo-box .items=${options} .selectedItems=${selectedItems} item-value-path="key" item-label-path="value"+ ?disabled=${!this.assetType} @change=${(ev: CustomEvent) => {+ this.attributeNames = (ev.currentTarget as OrVaadinMultiSelectComboBox).selectedItems.map(i => i.key);+ }}>+ <or-translate slot="label" value="filter.attributeLabel"></or-translate>+ </or-vaadin-multi-select-combo-box>+ `;+ } else {+ return html`+ <or-vaadin-combo-box .items=${options} .selectedItem=${selectedItems[0]} item-value-path="key" item-label-path="value"+ ?disabled=${!this.assetType} @change=${(ev: CustomEvent) => {+ this.attributeNames = [(ev.currentTarget as OrVaadinComboBox).value];+ }}>+ <or-translate slot="label" value="filter.attributeLabel"></or-translate>+ </or-vaadin-combo-box>+ `;+ }})}</div>`;@@ -214,42 +234,11 @@ export class AssettypesPanel extends LitElement {/* ----------- */- protected getAssetTypeTemplate(): TemplateResult {- if (this.assetType) {- const descriptor: AssetDescriptor | undefined = this._loadedAssetTypes.find((at: AssetDescriptor) => at.name === this.assetType);- if (descriptor) {- return this.getSelectedHeader(descriptor);- } else {- return this.getSelectHeader();- }- } else {- return this.getSelectHeader();- }- }-- protected getSelectHeader(): TemplateResult {- return html`- <or-mwc-input style="width:100%;" type="${InputType.TEXT}" readonly .label="${i18next.t("filter.assetTypeLabel")}"- iconTrailing="menu-down" iconColor="rgba(0, 0, 0, 0.87)" icon="selection-ellipse"- value="${i18next.t("filter.assetTypeNone")}">- </or-mwc-input>- `;- }-- protected getSelectedHeader(descriptor: AssetDescriptor): TemplateResult {- return html`- <or-mwc-input style="width:100%;" type="${InputType.TEXT}" readonly .label="${i18next.t("filter.assetTypeLabel")}"- .iconColor="${descriptor.colour}" iconTrailing="menu-down" icon="${descriptor.icon}"- value="${Util.getAssetTypeLabel(descriptor)}">- </or-mwc-input>- `;- }-protected mapDescriptors(descriptors: AssetDescriptor[], withNoneValue?: ListItem): ListItem[] {const items: ListItem[] = descriptors.map((descriptor) => {return {styleMap: {- "--or-icon-fill": descriptor.colour ? "#" + descriptor.colour : "unset"+ "color": descriptor.colour ? "#" + descriptor.colour : "unset"},icon: descriptor.icon,text: Util.getAssetTypeLabel(descriptor),diff --git a/ui/component/or-dashboard-builder/src/panels/attributes-panel.ts b/ui/component/or-dashboard-builder/src/panels/attributes-panel.tsindex ef0a1c0c2..8c9de4e37 100644--- a/ui/component/or-dashboard-builder/src/panels/attributes-panel.ts+++ b/ui/component/or-dashboard-builder/src/panels/attributes-panel.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {css, CSSResult, html, LitElement, PropertyValues, TemplateResult, unsafeCSS} from "lit";import {customElement, property, state} from "lit/decorators.js";import {Asset, AssetDescriptor, AssetModelUtil, Attribute, AttributeRef} from "@openremote/model";@@ -8,7 +27,6 @@ import {guard} from "lit/directives/guard.js";import {styleMap} from "lit/directives/style-map.js";import {i18next} from "@openremote/or-translate";import "@openremote/or-translate";-import {InputType} from "@openremote/or-mwc-components/or-mwc-input";import manager, {DefaultColor5, Util} from "@openremote/core";import {getAssetDescriptorIconTemplate} from "@openremote/or-icon";import {OrAssetAttributePicker, OrAssetAttributePickerPickedEvent} from "@openremote/or-attribute-picker";@@ -308,10 +326,10 @@ export class AttributesPanel extends LitElement {`)}<!-- Button that opens attribute selection -->- <or-mwc-input .type="${InputType.BUTTON}" label="attribute" icon="${(this.multi || this.attributeRefs.length === 0) ? "plus" : "swap-horizontal"}"- style="margin-top: 8px;"- @or-mwc-input-changed="${() => this.openAttributeSelector(this.attributeRefs, this.multi, this.onlyDataAttrs, this.attributeFilter)}">- </or-mwc-input>+ <or-vaadin-button style="margin-top: 8px;" @click=${() => this.openAttributeSelector(this.attributeRefs, this.multi, this.onlyDataAttrs, this.attributeFilter)}>+ <or-icon slot="prefix" icon="${(this.multi || this.attributeRefs.length === 0) ? "plus" : "swap-horizontal"}"></or-icon>+ <or-translate value="attribute"></or-translate>+ </or-vaadin-button></div>`;}diff --git a/ui/component/or-dashboard-builder/src/panels/thresholds-panel.ts b/ui/component/or-dashboard-builder/src/panels/thresholds-panel.tsindex cc7d252dd..efc4e121f 100644--- a/ui/component/or-dashboard-builder/src/panels/thresholds-panel.ts+++ b/ui/component/or-dashboard-builder/src/panels/thresholds-panel.ts@@ -1,9 +1,30 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import {css, CSSResult, html, LitElement, PropertyValues, TemplateResult, unsafeCSS} from "lit";import {customElement, property} from "lit/decorators.js";import {ifDefined} from "lit/directives/if-defined.js";import {DefaultColor5} from "@openremote/core";import {style} from "../style";+import {OrVaadinNumberField} from "@openremote/or-vaadin-components/or-vaadin-number-field";+import {OrVaadinTextField} from "@openremote/or-vaadin-components/or-vaadin-text-field";export class ThresholdChangeEvent extends CustomEvent<[number, string][]> {@@ -49,7 +70,7 @@ const styling = css`#thresholds-list {display: flex;flex-direction: column;- gap: 12px;+ gap: 8px;}.threshold-list-item {@@ -147,16 +168,15 @@ export class ThresholdsPanel extends LitElement {}}"></or-mwc-input></div>- <or-mwc-input type="${InputType.NUMBER}" comfortable .value="${threshold[0]}"- ?disabled="${index === 0 && this.max}"- .min="${ifDefined(this.min)}" .max="${ifDefined(this.max)}"- @or-mwc-input-changed="${(event: OrInputChangedEvent) => {- if ((!this.min || event.detail.value >= this.min) && (!this.max || event.detail.value <= this.max)) {- this.thresholds[index][0] = event.detail.value;- this.requestUpdate('thresholds');- }- }}"- ></or-mwc-input>+ <or-vaadin-number-field value=${threshold[0]} min=${ifDefined(this.min)} max=${ifDefined(this.max)}+ ?disabled=${index === 0 && this.max} @change=${(ev: Event) => {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if(elem.checkValidity()) {+ this.thresholds[index][0] = Number(elem.value);+ this.requestUpdate('thresholds');+ }+ }}+ ></or-vaadin-number-field>${index === 0 ? html`<button class="button-clear"style="margin-left: 8px;">@@ -174,9 +194,10 @@ export class ThresholdsPanel extends LitElement {</div>`})}- <or-mwc-input .type="${InputType.BUTTON}" label="threshold" icon="plus"- @or-mwc-input-changed="${() => this.addNewThreshold()}">- </or-mwc-input>+ <or-vaadin-button style="margin-top: 8px;" @click=${() => this.addNewThreshold()}>+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value="threshold"></or-translate>+ </or-vaadin-button>` : null}<!-- Thresholds by boolean -->@@ -188,8 +209,7 @@ export class ThresholdsPanel extends LitElement {this.onBoolColorChange(true, event.detail.value)}}"></or-mwc-input></div>- <or-mwc-input type="${InputType.TEXT}" comfortable .value="${'True'}" .readonly="${true}"- ></or-mwc-input>+ <or-vaadin-text-field value="True" readonly></or-vaadin-text-field></div><div class="threshold-list-item"><div class="threshold-list-item-colour">@@ -198,8 +218,7 @@ export class ThresholdsPanel extends LitElement {this.onBoolColorChange(false, event.detail.value)}}"></or-mwc-input></div>- <or-mwc-input type="${InputType.TEXT}" comfortable .value="${'False'}" .readonly="${true}"- ></or-mwc-input>+ <or-vaadin-text-field value="False" readonly></or-vaadin-text-field></div>` : null}@@ -216,12 +235,12 @@ export class ThresholdsPanel extends LitElement {}}"></or-mwc-input></div>- <or-mwc-input type="${InputType.TEXT}" comfortable .value="${threshold[0]}"- @or-mwc-input-changed="${(event: OrInputChangedEvent) => {- this.textColors[index][0] = event.detail.value;- this.requestUpdate('textColors');- }}"- ></or-mwc-input>+ <or-vaadin-text-field value=${threshold[0]}+ @change=${(ev: Event) => {+ this.textColors[index][0] = (ev.currentTarget as OrVaadinTextField).value;+ this.requestUpdate('textColors');+ }}+ ></or-vaadin-text-field><button class="button-clear"style="margin-left: 8px;"@click="${() => {@@ -232,9 +251,10 @@ export class ThresholdsPanel extends LitElement {</div>`})}- <or-mwc-input .type="${InputType.BUTTON}" label="threshold" icon="plus"- @or-mwc-input-changed="${() => this.addNewThreshold()}">- </or-mwc-input>+ <or-vaadin-button style="margin-top: 8px;" @click=${() => this.addNewThreshold()}>+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value="threshold"></or-translate>+ </or-vaadin-button>` : null}</div>`diff --git a/ui/component/or-dashboard-builder/src/service/dashboard-service.ts b/ui/component/or-dashboard-builder/src/service/dashboard-service.tsindex 2bf282028..ec4757ee1 100644--- a/ui/component/or-dashboard-builder/src/service/dashboard-service.ts+++ b/ui/component/or-dashboard-builder/src/service/dashboard-service.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {Dashboard, DashboardRefreshInterval, DashboardScalingPreset, DashboardScreenPreset} from "@openremote/model";import manager, {Util} from "@openremote/core";import {i18next} from "@openremote/or-translate";diff --git a/ui/component/or-dashboard-builder/src/service/widget-service.ts b/ui/component/or-dashboard-builder/src/service/widget-service.tsindex 28b7b0ae6..635ffc9de 100644--- a/ui/component/or-dashboard-builder/src/service/widget-service.ts+++ b/ui/component/or-dashboard-builder/src/service/widget-service.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {DashboardWidget} from "@openremote/model";import {widgetTypes} from "../index";import {WidgetConfig} from "../util/widget-config";diff --git a/ui/component/or-dashboard-builder/src/settings/attribute-input-settings.ts b/ui/component/or-dashboard-builder/src/settings/attribute-input-settings.tsindex fade9eb01..066b37be4 100644--- a/ui/component/or-dashboard-builder/src/settings/attribute-input-settings.ts+++ b/ui/component/or-dashboard-builder/src/settings/attribute-input-settings.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {css, html, TemplateResult } from "lit";import { customElement } from "lit/decorators.js";import {AttributeInputWidgetConfig} from "../widgets/attribute-input-widget";diff --git a/ui/component/or-dashboard-builder/src/settings/barchart-settings.ts b/ui/component/or-dashboard-builder/src/settings/barchart-settings.tsindex 3b4444073..4db50d18c 100644--- a/ui/component/or-dashboard-builder/src/settings/barchart-settings.ts+++ b/ui/component/or-dashboard-builder/src/settings/barchart-settings.ts@@ -30,6 +30,7 @@ import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mimport {when} from "lit/directives/when.js";import moment from "moment/moment";import {ListItem, ListType, OrMwcList} from "@openremote/or-mwc-components/or-mwc-list";+import {OrVaadinSelect, SelectItem} from "@openremote/or-vaadin-components/or-vaadin-select";import {showDialog, OrMwcDialog} from "@openremote/or-mwc-components/or-mwc-dialog";import {BarChartAttributeConfig, BarChartInterval, IntervalConfig, OrAttributeBarChart} from "@openremote/or-attribute-barchart";import {OrChart} from "@openremote/or-chart";@@ -37,6 +38,7 @@ import {getAssetDescriptorIconTemplate} from "@openremote/or-icon";import {createRef, Ref, ref} from "lit/directives/ref.js";import {AttributesChartPanel} from "../panels/attributes-chart-panel";import debounce from "lodash.debounce";+import {OrVaadinNumberField} from "@openremote/or-vaadin-components/or-vaadin-number-field";const styling = css`.switch-container {@@ -146,8 +148,9 @@ export class BarChartSettings extends WidgetSettings {}];};- const timeWindowOpts = Array.from(this.timeWindowOptions.keys()).map(o => ([o, i18next.t(o.toLowerCase())] as [string, string]));- const intervalOpts = Array.from(this.intervalOptions.keys()).map(o => ([o, i18next.t(`intervalBy${o.toLowerCase()}`)] as [string, string]));+ const timePrefixOpts: SelectItem[] = this.timePrefixOptions.map(o => ({ value: o, label: i18next.t(o) }))+ const timeWindowOpts: SelectItem[] = Array.from(this.timeWindowOptions.keys()).map(o => ({ value: o, label: i18next.t(o.toLowerCase()) }));+ const intervalOpts: SelectItem[] = Array.from(this.intervalOptions.keys()).map(o => ({ value: o, label: i18next.t(`intervalBy${o.toLowerCase()}`)}));return html`<div><!-- Attribute selection -->@@ -164,18 +167,18 @@ export class BarChartSettings extends WidgetSettings {<div style="padding-bottom: 12px; display: flex; flex-direction: column; gap: 6px;"><!-- Timeframe & interval -->- <or-mwc-input .type="${InputType.SELECT}" label="${i18next.t("prefixDefault")}" style="width: 100%;"- .options="${this.timePrefixOptions}" value="${this.widgetConfig.defaultTimePrefixKey}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onTimePrefixSelect(ev)}"- ></or-mwc-input>- <or-mwc-input .type="${InputType.SELECT}" label="${i18next.t("timeframeDefault")}" style="width: 100%;"- .options="${timeWindowOpts}" value="${this.widgetConfig.defaultTimeWindowKey}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onTimeWindowSelect(ev)}"- ></or-mwc-input>- <or-mwc-input .type="${InputType.SELECT}" label="${i18next.t("withInterval")}" style="width: 100%;"- .options="${intervalOpts}" value="${this.widgetConfig.defaultInterval}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onIntervalSelect(ev)}"- ></or-mwc-input>+ <or-vaadin-select .items=${timePrefixOpts} value=${this.widgetConfig.defaultTimePrefixKey}+ @change=${(ev: Event) => this.onTimePrefixSelect(ev)}>+ <or-translate slot="label" value="prefixDefault"></or-translate>+ </or-vaadin-select>+ <or-vaadin-select .items=${timeWindowOpts} value=${this.widgetConfig.defaultTimeWindowKey}+ @change=${(ev: Event) => this.onTimeWindowSelect(ev)}>+ <or-translate slot="label" value="timeframeDefault"></or-translate>+ </or-vaadin-select>+ <or-vaadin-select .items=${intervalOpts} value=${this.widgetConfig.defaultInterval}+ @change=${(ev: Event) => this.onIntervalSelect(ev)}>+ <or-translate slot="label" value="withInterval"></or-translate>+ </or-vaadin-select></div></settings-panel>@@ -205,9 +208,10 @@ export class BarChartSettings extends WidgetSettings {</div><!-- Decimal places --><div>- <or-mwc-input .type="${InputType.NUMBER}" style="width: 100%;" .value="${this.widgetConfig.decimals}" label="${i18next.t("decimals")}" .min="${0}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onDecimalsChange(ev)}"- ></or-mwc-input>+ <or-vaadin-number-field min="0" value=${this.widgetConfig.decimals}+ @change=${(ev: Event) => this.onDecimalsChange(ev)}>+ <or-translate slot="label" value="decimals"></or-translate>+ </or-vaadin-number-field></div></div></settings-panel>@@ -223,25 +227,29 @@ export class BarChartSettings extends WidgetSettings {<span><or-translate value="dashboard.leftAxis"></or-translate></span></div>`)}- <div style="display: flex;">+ <div style="display: flex; align-items: baseline;">${when(max !== undefined, () => html`- <or-mwc-input .type="${InputType.NUMBER}" label="${`${i18next.t("yAxis")} ${i18next.t("max")}`}" .value="${max}" style="width: 100%;"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueChange("left", "max", ev)}"- ></or-mwc-input>+ <or-vaadin-number-field value=${max} @change=${(ev: Event) => this.onMinMaxValueChange("left", "max", ev)}>+ <span slot="label"><or-translate value="yAxis"></or-translate> <or-translate value="max"></or-translate></span>+ </or-vaadin-number-field>`, () => html`- <or-mwc-input .type="${InputType.TEXT}" label="${`${i18next.t("yAxis")} ${i18next.t("max")}`}" disabled value="auto" style="width: 100%;"></or-mwc-input>+ <or-vaadin-text-field value="auto" readonly>+ <span slot="label"><or-translate value="yAxis"></or-translate> <or-translate value="max"></or-translate></span>+ </or-vaadin-text-field>`)}<or-mwc-input .type="${InputType.SWITCH}" style="margin: 0 -10px 0 0;" .value="${max !== undefined}"@or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueToggle("left", "max", ev)}"></or-mwc-input></div>- <div style="display: flex; margin-top: 12px;">+ <div style="display: flex; align-items: baseline; margin-top: 12px;">${when(min !== undefined, () => html`- <or-mwc-input .type="${InputType.NUMBER}" label="${`${i18next.t("yAxis")} ${i18next.t("min")}`}" .value="${min}" style="width: 100%;"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueChange("left", "min", ev)}"- ></or-mwc-input>+ <or-vaadin-number-field value=${min} @change=${(ev: Event) => this.onMinMaxValueChange("left", "min", ev)}>+ <span slot="label"><or-translate value="yAxis"></or-translate> <or-translate value="min"></or-translate></span>+ </or-vaadin-number-field>`, () => html`- <or-mwc-input .type="${InputType.TEXT}" label="${`${i18next.t("yAxis")} ${i18next.t("min")}`}" disabled value="auto" style="width: 100%;"></or-mwc-input>+ <or-vaadin-text-field value="auto" readonly>+ <span slot="label"><or-translate value="yAxis"></or-translate> <or-translate value="min"></or-translate></span>+ </or-vaadin-text-field>`)}<or-mwc-input .type="${InputType.SWITCH}" style="margin: 0 -10px 0 0;" .value="${min !== undefined}"@or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueToggle("left", "min", ev)}"@@ -258,27 +266,29 @@ export class BarChartSettings extends WidgetSettings {<div style="margin-bottom: 8px;"><span><or-translate value="dashboard.rightAxis"></or-translate></span></div>- <div style="display: flex;">+ <div style="display: flex; align-items: baseline;">${when(rightMax !== undefined, () => html`- <or-mwc-input .type="${InputType.NUMBER}" label="${`${i18next.t("yAxis")} ${i18next.t("max")}`}" .value="${rightMax}" style="width: 100%;"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueChange("right", "max", ev)}"- ></or-mwc-input>+ <or-vaadin-number-field value=${rightMax} @change=${(ev: Event) => this.onMinMaxValueChange("right", "max", ev)}>+ <span slot="label"><or-translate value="yAxis"></or-translate> <or-translate value="max"></or-translate></span>+ </or-vaadin-number-field>`, () => html`- <or-mwc-input .type="${InputType.TEXT}" label="${`${i18next.t("yAxis")} ${i18next.t("max")}`}" disabled="true" value="auto"- style="width: 100%;"></or-mwc-input>+ <or-vaadin-text-field value="auto" readonly>+ <span slot="label"><or-translate value="yAxis"></or-translate> <or-translate value="max"></or-translate></span>+ </or-vaadin-text-field>`)}<or-mwc-input .type="${InputType.SWITCH}" style="margin: 0 -10px 0 0;" .value="${rightMax !== undefined}"@or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueToggle("right", "max", ev)}"></or-mwc-input></div>- <div style="display: flex; margin-top: 12px;">+ <div style="display: flex; margin-top: 12px; align-items: baseline;">${when(rightMin !== undefined, () => html`- <or-mwc-input .type="${InputType.NUMBER}" label="${`${i18next.t("yAxis")} ${i18next.t("min")}`}" .value="${rightMin}" style="width: 100%;"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueChange("right", "min", ev)}"- ></or-mwc-input>+ <or-vaadin-number-field value=${rightMin} @change=${(ev: Event) => this.onMinMaxValueChange("right", "min", ev)}>+ <span slot="label"><or-translate value="yAxis"></or-translate> <or-translate value="min"></or-translate></span>+ </or-vaadin-number-field>`, () => html`- <or-mwc-input .type="${InputType.TEXT}" label="${`${i18next.t("yAxis")} ${i18next.t("min")}`}" disabled="true" value="auto"- style="width: 100%;"></or-mwc-input>+ <or-vaadin-text-field value="auto" readonly>+ <span slot="label"><or-translate value="yAxis"></or-translate> <or-translate value="min"></or-translate></span>+ </or-vaadin-text-field>`)}<or-mwc-input .type="${InputType.SWITCH}" style="margin: 0 -10px 0 0;" .value="${rightMin !== undefined}"@or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueToggle("right", "min", ev)}"@@ -507,18 +517,18 @@ export class BarChartSettings extends WidgetSettings {.setDismissAction(null));}- protected onTimePrefixSelect(ev: OrInputChangedEvent) {- this.widgetConfig.defaultTimePrefixKey = ev.detail.value.toString();+ protected onTimePrefixSelect(ev: Event) {+ this.widgetConfig.defaultTimePrefixKey = (ev.currentTarget as OrVaadinSelect).value;this.notifyConfigUpdate();}- protected onTimeWindowSelect(ev: OrInputChangedEvent) {- this.widgetConfig.defaultTimeWindowKey = ev.detail.value.toString();+ protected onTimeWindowSelect(ev: Event) {+ this.widgetConfig.defaultTimeWindowKey = (ev.currentTarget as OrVaadinSelect).value;this.notifyConfigUpdate();}- protected onIntervalSelect(ev: OrInputChangedEvent) {- this.widgetConfig.defaultInterval = ev.detail.value.toString();+ protected onIntervalSelect(ev: Event) {+ this.widgetConfig.defaultInterval = (ev.currentTarget as OrVaadinSelect).value as BarChartInterval;this.notifyConfigUpdate();}@@ -546,16 +556,22 @@ export class BarChartSettings extends WidgetSettings {this.notifyConfigUpdate();}- protected onMinMaxValueChange(axis: "left" | "right", type: "min" | "max", ev: OrInputChangedEvent) {- this.setAxisMinMaxValue(axis, type, ev.detail.value);+ protected onMinMaxValueChange(axis: "left" | "right", type: "min" | "max", ev: Event) {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if(elem.checkValidity()) {+ this.setAxisMinMaxValue(axis, type, Number(elem.value));+ }}protected onMinMaxValueToggle(axis: "left" | "right", type: "min" | "max", ev: OrInputChangedEvent) {this.setAxisMinMaxValue(axis, type, (ev.detail.value ? (type === "min" ? 0 : 100) : undefined));}- protected onDecimalsChange(ev: OrInputChangedEvent) {- this.widgetConfig.decimals = ev.detail.value;- this.notifyConfigUpdate();+ protected onDecimalsChange(ev: Event) {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if(elem.checkValidity()) {+ this.widgetConfig.decimals = Number(elem.value);+ this.notifyConfigUpdate();+ }}}diff --git a/ui/component/or-dashboard-builder/src/settings/chart-settings.ts b/ui/component/or-dashboard-builder/src/settings/chart-settings.tsindex 8ae5f29bf..4b82e8aea 100644--- a/ui/component/or-dashboard-builder/src/settings/chart-settings.ts+++ b/ui/component/or-dashboard-builder/src/settings/chart-settings.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {css, html, TemplateResult } from "lit";import { customElement, query } from "lit/decorators.js";import {WidgetSettings} from "../util/widget-settings";@@ -14,6 +33,8 @@ import {when} from "lit/directives/when.js";import moment from "moment/moment";import {ChartAttributeConfig, OrChart} from "@openremote/or-chart";import {getAssetDescriptorIconTemplate} from "@openremote/or-icon";+import {OrVaadinSelect, SelectItem} from "@openremote/or-vaadin-components/or-vaadin-select";+import {OrVaadinNumberField} from "@openremote/or-vaadin-components/or-vaadin-number-field";const styling = css`.switch-container {@@ -141,8 +162,8 @@ export class ChartSettings extends WidgetSettings {if(!timeWindow || !this.timeWindowOptions.has(timeWindow)) timeWindow = Array.from(this.timeWindowOptions.keys())[0];// List the available timeframes to select from- const prefixOptions = this.timePrefixOptions.map(s => s.toLowerCase());- const windowOptions = Array.from(this.timeWindowOptions.keys()).map(s => [s, i18next.t(s.toLowerCase())]);+ const prefixOptions: SelectItem[] = this.timePrefixOptions.map(s => ({value: s, label: i18next.t(s.toLowerCase()) }));+ const windowOptions: SelectItem[] = Array.from(this.timeWindowOptions.keys()).map(s => ({value: s, label: i18next.t(s.toLowerCase()) }));return html`<div><!-- Attribute selection -->@@ -158,15 +179,13 @@ export class ChartSettings extends WidgetSettings {<settings-panel displayName="time" expanded><div style="padding-bottom: 12px; display: flex; flex-direction: column; gap: 6px;"><!-- This/last selection of timeframe -->- <or-mwc-input .type="${InputType.SELECT}" label="${i18next.t('prefixDefault')}" style="width: 100%;"- .options="${prefixOptions}" value="${timePrefix.toLowerCase()}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onTimePrefixSelect(ev)}"- ></or-mwc-input>+ <or-vaadin-select .items=${prefixOptions} value=${timePrefix} @change=${(ev: Event) => this.onTimePrefixSelect(ev)}>+ <or-translate slot="label" value="prefixDefault"></or-translate>+ </or-vaadin-select><!-- Select time frame -->- <or-mwc-input .type="${InputType.SELECT}" label="${i18next.t('timeframeDefault')}" style="width: 100%;"- .options="${windowOptions}" value="${timeWindow}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onTimeWindowSelect(ev)}"- ></or-mwc-input>+ <or-vaadin-select .items=${windowOptions} .value=${timeWindow} @change=${(ev: Event) => this.onTimeWindowSelect(ev)}>+ <or-translate slot="label" value="timeframeDefault"></or-translate>+ </or-vaadin-select></div></settings-panel><!-- Display options -->@@ -210,13 +229,15 @@ export class ChartSettings extends WidgetSettings {<span><or-translate value="dashboard.leftAxis"></or-translate></span></div>`)}- <div style="display: flex;">+ <div style="display: flex; align-items: baseline;">${max !== undefined ? html`- <or-mwc-input .type="${InputType.NUMBER}" label="${i18next.t('yAxis') + ' ' + i18next.t('max')}" .value="${max}" style="width: 100%;"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueChange('left', 'max', ev)}"- ></or-mwc-input>+ <or-vaadin-number-field value=${max} @change=${(ev: Event) => this.onMinMaxValueChange("left", "max", ev)}>+ <span slot="label"><or-translate value="yAxis"></or-translate> <or-translate value="max"></or-translate></span>+ </or-vaadin-number-field>` : html`- <or-mwc-input .type="${InputType.TEXT}" label="${i18next.t('yAxis') + ' ' + i18next.t('max')}" disabled="true" value="auto" style="width: 100%;"></or-mwc-input>+ <or-vaadin-text-field value="auto" readonly>+ <span slot="label"><or-translate value="yAxis"></or-translate> <or-translate value="max"></or-translate></span>+ </or-vaadin-text-field>`}<or-mwc-input .type="${InputType.SWITCH}" style="margin: 0 -10px 0 0;" .value="${max !== undefined}"@or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueToggle('left', 'max', ev)}"@@ -224,11 +245,13 @@ export class ChartSettings extends WidgetSettings {</div><div style="display: flex; margin-top: 12px;">${min !== undefined ? html`- <or-mwc-input .type="${InputType.NUMBER}" label="${i18next.t('yAxis') + ' ' + i18next.t('min')}" .value="${min}" style="width: 100%;"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueChange('left', 'min', ev)}"- ></or-mwc-input>+ <or-vaadin-number-field value=${min} @change=${(ev: Event) => this.onMinMaxValueChange("left", "min", ev)}>+ <span slot="label"><or-translate value="yAxis"></or-translate> <or-translate value="min"></or-translate></span>+ </or-vaadin-number-field>` : html`- <or-mwc-input .type="${InputType.TEXT}" label="${i18next.t('yAxis') + ' ' + i18next.t('min')}" disabled="true" value="auto" style="width: 100%;"></or-mwc-input>+ <or-vaadin-text-field value="auto" readonly>+ <span slot="label"><or-translate value="yAxis"></or-translate> <or-translate value="min"></or-translate></span>+ </or-vaadin-text-field>`}<or-mwc-input .type="${InputType.SWITCH}" style="margin: 0 -10px 0 0;" .value="${min !== undefined}"@or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueToggle('left', 'min', ev)}"@@ -247,25 +270,27 @@ export class ChartSettings extends WidgetSettings {</div><div style="display: flex;">${rightMax !== undefined ? html`- <or-mwc-input .type="${InputType.NUMBER}" label="${i18next.t('yAxis') + ' ' + i18next.t('max')}" .value="${rightMax}" style="width: 100%;"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueChange('right', 'max', ev)}"- ></or-mwc-input>+ <or-vaadin-number-field value=${rightMax} @change=${(ev: Event) => this.onMinMaxValueChange("right", "max", ev)}>+ <span slot="label"><or-translate value="yAxis"></or-translate> <or-translate value="max"></or-translate></span>+ </or-vaadin-number-field>` : html`- <or-mwc-input .type="${InputType.TEXT}" label="${i18next.t('yAxis') + ' ' + i18next.t('max')}" disabled="true" value="auto"- style="width: 100%;"></or-mwc-input>+ <or-vaadin-text-field value="auto" readonly>+ <span slot="label"><or-translate value="yAxis"></or-translate> <or-translate value="max"></or-translate></span>+ </or-vaadin-text-field>`}<or-mwc-input .type="${InputType.SWITCH}" style="margin: 0 -10px 0 0;" .value="${rightMax !== undefined}"@or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueToggle('right', 'max', ev)}"></or-mwc-input></div>- <div style="display: flex; margin-top: 12px;">+ <div style="display: flex; margin-top: 12px; align-items: baseline;">${rightMin !== undefined ? html`- <or-mwc-input .type="${InputType.NUMBER}" label="${i18next.t('yAxis') + ' ' + i18next.t('min')}" .value="${rightMin}" style="width: 100%;"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueChange('right', 'min', ev)}"- ></or-mwc-input>+ <or-vaadin-number-field value=${rightMin} @change=${(ev: Event) => this.onMinMaxValueChange("right", "min", ev)}>+ <span slot="label"><or-translate value="yAxis"></or-translate> <or-translate value="min"></or-translate></span>+ </or-vaadin-number-field>` : html`- <or-mwc-input .type="${InputType.TEXT}" label="${i18next.t('yAxis') + ' ' + i18next.t('min')}" disabled="true" value="auto"- style="width: 100%;"></or-mwc-input>+ <or-vaadin-text-field value="auto" readonly>+ <span slot="label"><or-translate value="yAxis"></or-translate> <or-translate value="min"></or-translate></span>+ </or-vaadin-text-field>`}<or-mwc-input .type="${InputType.SWITCH}" style="margin: 0 -10px 0 0;" .value="${rightMin !== undefined}"@or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueToggle('right', 'min', ev)}"@@ -279,15 +304,15 @@ export class ChartSettings extends WidgetSettings {<!-- Data sampling options -->${when(Array.from(this.samplingOptions?.keys()).length > 1, () => {- const samplingOptions = Array.from(this.samplingOptions.entries());- const samplingValue = samplingOptions?.find((entry => entry[1] === this.widgetConfig.datapointQuery.type))?.[0] ?? samplingOptions[0];+ const samplingOptions: SelectItem[] = Array.from(this.samplingOptions.entries()).map(o => ({value: o[0], label: i18next.t(o[1])}));+ const samplingValue = this.widgetConfig.datapointQuery.type;return html`<settings-panel displayName="dataSampling" expanded="${false}"><div style="padding-bottom: 12px; display: flex; flex-direction: column; gap: 12px;"><div>- <or-mwc-input .type="${InputType.SELECT}" style="width: 100%" .options="${Array.from(this.samplingOptions.keys())}" .value="${samplingValue}"- label="${i18next.t('algorithm')}" @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onSamplingQueryChange(ev)}"- ></or-mwc-input>+ <or-vaadin-select .items=${samplingOptions} value=${samplingValue} @change=${(ev: Event) => this.onSamplingQueryChange(ev)}>+ <or-translate slot="label" value="algorithm"></or-translate>+ </or-vaadin-select></div><div>${this.getSamplingOptionsTemplate(this.widgetConfig.datapointQuery.type)}@@ -304,14 +329,15 @@ export class ChartSettings extends WidgetSettings {switch (type) {case "interval": {const intervalQuery = this.widgetConfig.datapointQuery as AssetDatapointIntervalQuery;- const formulaOptions = [AssetDatapointIntervalQueryFormula.AVG, AssetDatapointIntervalQueryFormula.MIN, AssetDatapointIntervalQueryFormula.MAX];+ const formulaOptions: SelectItem[] = [AssetDatapointIntervalQueryFormula.AVG, AssetDatapointIntervalQueryFormula.MIN, AssetDatapointIntervalQueryFormula.MAX]+ .map(o => ({value: o, label: i18next.t(o)}));return html`- <or-mwc-input .type="${InputType.SELECT}" style="width: 100%;" .options="${formulaOptions}"- .value="${intervalQuery.formula}" label="${i18next.t("algorithmMethod")}" @or-mwc-input-changed="${(event: OrInputChangedEvent) => {- intervalQuery.formula = event.detail.value;- this.notifyConfigUpdate();- }}"- ></or-mwc-input>+ <or-vaadin-select .items=${formulaOptions} value=${intervalQuery.formula} required @change=${(ev: Event) => {+ intervalQuery.formula = (ev.currentTarget as OrVaadinSelect).value as any;+ this.notifyConfigUpdate();+ }}>+ <or-translate slot="label" value="algorithmMethod"></or-translate>+ </or-vaadin-select>`;}default:@@ -471,9 +497,9 @@ export class ChartSettings extends WidgetSettings {}}- protected onTimePrefixSelect(ev: OrInputChangedEvent) {+ protected onTimePrefixSelect(ev: Event) {let oldValue = this.widgetConfig.defaultTimePresetKey;- const newPrefix = ev.detail.value.toString();+ const newPrefix = (ev.currentTarget as OrVaadinSelect).value;const prefixOptions = this.timePrefixOptions;if(!prefixOptions.find(o => oldValue.includes(o))) {oldValue = Array.from(this.timeWindowOptions.keys())[0]; // Old value was invalid, so we replace it in full@@ -485,9 +511,9 @@ export class ChartSettings extends WidgetSettings {this.notifyConfigUpdate();}- protected onTimeWindowSelect(ev: OrInputChangedEvent) {+ protected onTimeWindowSelect(ev: Event) {let oldValue = this.widgetConfig.defaultTimePresetKey;- const newWindow = ev.detail.value.toString();+ const newWindow = (ev.currentTarget as OrVaadinSelect).value;const windowOptions = Array.from(this.timeWindowOptions.keys()).sort((a, b) => b.length - a.length);if(!windowOptions.find(o => oldValue.includes(o))) {oldValue = this.timePrefixOptions[0]; // Old value was invalid, so we replace it in full@@ -536,16 +562,20 @@ export class ChartSettings extends WidgetSettings {this.notifyConfigUpdate();}- protected onMinMaxValueChange(axis: 'left' | 'right', type: 'min' | 'max', ev: OrInputChangedEvent) {- this.setAxisMinMaxValue(axis, type, ev.detail.value);+ protected onMinMaxValueChange(axis: 'left' | 'right', type: 'min' | 'max', ev: Event) {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if(elem.checkValidity()) {+ this.setAxisMinMaxValue(axis, type, Number(elem.value));+ }}protected onMinMaxValueToggle(axis: 'left' | 'right', type: 'min' | 'max', ev: OrInputChangedEvent) {this.setAxisMinMaxValue(axis, type, (ev.detail.value ? (type === 'min' ? 0 : 100) : undefined));}- protected onSamplingQueryChange(ev: OrInputChangedEvent) {- this.widgetConfig.datapointQuery.type = this.samplingOptions.get(ev.detail.value)! as any;+ protected onSamplingQueryChange(ev: Event) {+ const elem = ev.currentTarget as OrVaadinSelect;+ this.widgetConfig.datapointQuery.type = elem.value as any;this.notifyConfigUpdate();}}diff --git a/ui/component/or-dashboard-builder/src/settings/gateway-settings.ts b/ui/component/or-dashboard-builder/src/settings/gateway-settings.tsindex 773c0b603..23ff8d9ea 100644--- a/ui/component/or-dashboard-builder/src/settings/gateway-settings.ts+++ b/ui/component/or-dashboard-builder/src/settings/gateway-settings.ts@@ -1,12 +1,32 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import { customElement } from "lit/decorators.js";import {WidgetSettings} from "../util/widget-settings";import {TemplateResult, html} from "lit";-import { InputType, OrInputChangedEvent } from "@openremote/or-mwc-components/or-mwc-input";import {i18next} from "@openremote/or-translate";import {Asset, AssetQuery, AttributeRef, GatewayTunnelInfoType} from "@openremote/model";import {GatewayWidgetConfig} from "../widgets/gateway-widget";import {Task} from "@lit/task";import manager from "@openremote/core";+import {OrVaadinSelect, SelectItem} from "@openremote/or-vaadin-components/or-vaadin-select";+import {OrVaadinNumberField} from "@openremote/or-vaadin-components/or-vaadin-number-field";@customElement("gateway-settings")export class GatewaySettings extends WidgetSettings {@@ -23,6 +43,7 @@ export class GatewaySettings extends WidgetSettings {protected render(): TemplateResult {const disabled = !this.widgetConfig.gatewayId;+ const tunnelTypeItems: SelectItem[] = this.GATEWAY_TUNNEL_TYPES.map(t => ({value: t, label: i18next.t(t)}));return html`<div><settings-panel displayName="gatewayTunnels.settings" expanded="${true}">@@ -30,75 +51,71 @@ export class GatewaySettings extends WidgetSettings {<div>${this._fetchAssetsTask.render({pending: () => html`- <or-mwc-input .type="${InputType.SELECT}" compact style="width: 100%;" disabled- label="${i18next.t('gatewayTunnels.selectAsset')}"- ></or-mwc-input>+ <or-vaadin-select disabled>+ <or-translate slot="label" value="gatewayTunnels.selectAsset"></or-translate>+ </or-vaadin-select>`,complete: (gatewayAssets) => {- const options: [string, string][] = gatewayAssets.map(a => [a.id!, a.name!]);+ const options: SelectItem[] = gatewayAssets.map(a => ({value: a.id!, label: a.name! }));const selected = gatewayAssets.find(a => a.id === this.widgetConfig.gatewayId);- const value = selected ? [selected.id, selected.name] as [string, string] : undefined;+ const value = selected?.id;return html`- <or-mwc-input .type="${InputType.SELECT}" compact style="width: 100%;"- .options="${options}" .value="${value}"- label="${i18next.t('gatewayTunnels.selectAsset')}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this._onAssetSelect(ev)}"- ></or-mwc-input>+ <or-vaadin-select .items=${options} value=${value} @change=${(ev: Event) => this._onAssetSelect(ev)}>+ <or-translate slot="label" value="gatewayTunnels.selectAsset"></or-translate>+ </or-vaadin-select>`;},error: () => html`- <or-mwc-input .type="${InputType.TEXT}" compact style="width: 100%;" disabled- label="${i18next.t('gatewayTunnels.selectAsset')}" .value="${i18next.t('errorOccurred')}"- ></or-mwc-input>+ <or-vaadin-text-field readonly value=${i18next.t("errorOccurred")}>+ <or-translate slot="label" value="gatewayTunnels.selectAsset"></or-translate>+ </or-vaadin-text-field>`})}</div>- <div>- <or-mwc-input .type="${InputType.SELECT}" compact style="width: 100%;"- .disabled="${disabled}" .options="${this.GATEWAY_TUNNEL_TYPES}" .value="${this.widgetConfig.type}"- label="${i18next.t('gatewayTunnels.protocol')}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this._onTunnelTypeSelect(ev)}"- ></or-mwc-input>- </div>- <div>- <or-mwc-input .type="${InputType.TEXT}" style="width: 100%;"- .disabled="${disabled}" .value="${this.widgetConfig.target}"- label="${i18next.t('gatewayTunnels.target')}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this._onTunnelTargetSelect(ev)}"- ></or-mwc-input>- </div>- <div>- <or-mwc-input .type="${InputType.NUMBER}" style="width: 100%;"- .disabled="${disabled}" .value="${this.widgetConfig.targetPort}"- label="${i18next.t('gatewayTunnels.targetPort')}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this._onTunnelTargetPortSelect(ev)}"- ></or-mwc-input>- </div>+ <!-- Select tunnel type (HTTP/HTTPS/TCP) -->+ <or-vaadin-select .items=${tunnelTypeItems} .value=${this.widgetConfig.type} ?disabled=${disabled}+ @change=${(ev: Event) => this._onTunnelTypeSelect(ev)}>+ <or-translate slot="label" value="gatewayTunnels.protocol"></or-translate>+ </or-vaadin-select>+ <!-- Select tunnel target address -->+ <or-vaadin-text-field value=${this.widgetConfig.target} ?disabled=${disabled}+ @change=${(ev: Event) => this._onTunnelTargetSelect(ev)}>+ <or-translate slot="label" value="gatewayTunnels.target"></or-translate>+ </or-vaadin-text-field>+ <!-- Select tunnel target port -->+ <or-vaadin-number-field value=${this.widgetConfig.targetPort} ?disabled=${disabled} min="0"+ @change=${(ev: Event) => this._onTunnelTargetPortSelect(ev)}>+ <or-translate slot="label" value="gatewayTunnels.targetPort"></or-translate>+ </or-vaadin-number-field></div></settings-panel></div>`;}- protected _onAssetSelect(ev: OrInputChangedEvent): void {- this.widgetConfig.gatewayId = ev.detail.value;- this.widgetConfig.attributeRefs = [{id: ev.detail.value, name: undefined} as AttributeRef]; // Add to attributeRefs object, so the backend is aware of asset permissions+ protected _onAssetSelect(ev: Event): void {+ const elem = ev.currentTarget as OrVaadinSelect;+ this.widgetConfig.gatewayId = elem.value;+ this.widgetConfig.attributeRefs = [{id: elem.value, name: undefined} as AttributeRef]; // Add to attributeRefs object, so the backend is aware of asset permissionsthis.notifyConfigUpdate();}- protected _onTunnelTypeSelect(ev: OrInputChangedEvent) {- this.widgetConfig.type = ev.detail.value;+ protected _onTunnelTypeSelect(ev: Event) {+ this.widgetConfig.type = (ev.currentTarget as OrVaadinSelect).value as GatewayTunnelInfoType;this.notifyConfigUpdate();}- protected _onTunnelTargetSelect(ev: OrInputChangedEvent) {- this.widgetConfig.target = ev.detail.value;+ protected _onTunnelTargetSelect(ev: Event) {+ this.widgetConfig.target = (ev.currentTarget as HTMLInputElement).value;this.notifyConfigUpdate();}- protected _onTunnelTargetPortSelect(ev: OrInputChangedEvent) {- this.widgetConfig.targetPort = ev.detail.value;- this.notifyConfigUpdate();+ protected _onTunnelTargetPortSelect(ev: Event) {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if(elem.checkValidity()) {+ this.widgetConfig.targetPort = Number(elem.value);+ this.notifyConfigUpdate();+ }}diff --git a/ui/component/or-dashboard-builder/src/settings/gauge-settings.ts b/ui/component/or-dashboard-builder/src/settings/gauge-settings.tsindex 6e375023c..9c06206cc 100644--- a/ui/component/or-dashboard-builder/src/settings/gauge-settings.ts+++ b/ui/component/or-dashboard-builder/src/settings/gauge-settings.ts@@ -1,12 +1,30 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {html, TemplateResult} from "lit";import {customElement} from "lit/decorators.js";import {WidgetSettings} from "../util/widget-settings";-import {i18next} from "@openremote/or-translate";import {GaugeWidgetConfig} from "../widgets/gauge-widget";import {AttributesSelectEvent} from "../panels/attributes-panel";import {Attribute} from "@openremote/model";-import { InputType, OrInputChangedEvent } from "@openremote/or-mwc-components/or-mwc-input";import {ThresholdChangeEvent} from "../panels/thresholds-panel";+import {OrVaadinNumberField} from "@openremote/or-vaadin-components/or-vaadin-number-field";@customElement("gauge-settings")export class GaugeSettings extends WidgetSettings {@@ -31,17 +49,20 @@ export class GaugeSettings extends WidgetSettings {<settings-panel displayName="values" expanded="${true}"><div style="padding-bottom: 12px; display: flex; flex-direction: column; gap: 12px;"><div style="display: flex; gap: 8px;">- <or-mwc-input .type="${InputType.NUMBER}" label="${i18next.t('min')}" .max="${this.widgetConfig.max}" .value="${this.widgetConfig.min}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueChange('min', ev)}"- ></or-mwc-input>- <or-mwc-input .type="${InputType.NUMBER}" label="${i18next.t('max')}" .min="${this.widgetConfig.min}" .value="${this.widgetConfig.max}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onMinMaxValueChange('max', ev)}"- ></or-mwc-input>+ <or-vaadin-number-field value=${this.widgetConfig.min} max=${this.widgetConfig.max}+ @change=${(ev: Event) => this.onMinMaxValueChange("min", ev)}>+ <or-translate slot="label" value="min"></or-translate>+ </or-vaadin-number-field>+ <or-vaadin-number-field value=${this.widgetConfig.max} min=${this.widgetConfig.min}+ @change=${(ev: Event) => this.onMinMaxValueChange("max", ev)}>+ <or-translate slot="label" value="max"></or-translate>+ </or-vaadin-number-field></div><div>- <or-mwc-input .type="${InputType.NUMBER}" style="width: 100%;" .value="${this.widgetConfig.decimals}" label="${i18next.t('decimals')}" .min="${0}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onDecimalsChange(ev)}"- ></or-mwc-input>+ <or-vaadin-number-field value=${this.widgetConfig.decimals} min="0"+ @change=${(ev: Event) => this.onDecimalsChange(ev)}>+ <or-translate slot="label" value="decimals"></or-translate>+ </or-vaadin-number-field></div></div></settings-panel>@@ -69,26 +90,31 @@ export class GaugeSettings extends WidgetSettings {this.notifyConfigUpdate();}- protected onMinMaxValueChange(type: 'min' | 'max', ev: OrInputChangedEvent) {+ protected onMinMaxValueChange(type: 'min' | 'max', ev: Event) {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if(!elem.checkValidity()) {+ return;+ }+ const newValue = Number(elem.value);switch (type) {case "max": {- this.widgetConfig.max = ev.detail.value;+ this.widgetConfig.max = newValue;// Make sure every threshold value is not higher than what is allowed.const sortedThresholds = this.widgetConfig.thresholds.sort((x, y) => y[0] - x[0]);sortedThresholds.forEach((t, index) => {- t[0] = Math.max(Math.min(t[0], (ev.detail.value - index - 1)), this.widgetConfig.min);+ t[0] = Math.max(Math.min(t[0], (newValue - index - 1)), this.widgetConfig.min);});break;}case "min": {- this.widgetConfig.min = ev.detail.value;+ this.widgetConfig.min = newValue;// Update the lowest (locked) threshold value to minimum value, and make sure every threshold value is not lower than what is allowed.const sortedThresholds = this.widgetConfig.thresholds.sort((x, y) => (x[0] < y[0]) ? -1 : 1);- sortedThresholds[0][0] = ev.detail.value;+ sortedThresholds[0][0] = newValue;sortedThresholds.forEach((t, index) => {- t[0] = Math.min(Math.max(t[0], (ev.detail.value + index)), this.widgetConfig.max);+ t[0] = Math.min(Math.max(t[0], (newValue + index)), this.widgetConfig.max);})break;}@@ -96,9 +122,12 @@ export class GaugeSettings extends WidgetSettings {this.notifyConfigUpdate();}- protected onDecimalsChange(ev: OrInputChangedEvent) {- this.widgetConfig.decimals = ev.detail.value;- this.notifyConfigUpdate();+ protected onDecimalsChange(ev: Event) {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if(elem.checkValidity()) {+ this.widgetConfig.decimals = Number(elem.value);+ this.notifyConfigUpdate();+ }}protected onThresholdChange(ev: ThresholdChangeEvent) {diff --git a/ui/component/or-dashboard-builder/src/settings/image-settings.ts b/ui/component/or-dashboard-builder/src/settings/image-settings.tsindex 8be12c3ac..fefc0cd57 100644--- a/ui/component/or-dashboard-builder/src/settings/image-settings.ts+++ b/ui/component/or-dashboard-builder/src/settings/image-settings.ts@@ -1,14 +1,33 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {css, html, PropertyValues, TemplateResult } from "lit";-import { customElement, state } from "lit/decorators.js";+import { customElement} from "lit/decorators.js";import {ImageWidgetConfig} from "../widgets/image-widget";-import {i18next} from "@openremote/or-translate";import {AttributesSelectEvent} from "../panels/attributes-panel";-import {Asset, AssetModelUtil, AttributeRef} from "@openremote/model";+import {AssetModelUtil} from "@openremote/model";import { map } from "lit/directives/map.js";-import { InputType, OrInputChangedEvent } from "@openremote/or-mwc-components/or-mwc-input";import {Util} from "@openremote/core";import { when } from "lit/directives/when.js";import {AssetWidgetSettings} from "../util/or-asset-widget";+import {OrVaadinTextField} from "@openremote/or-vaadin-components/or-vaadin-text-field";+import {OrVaadinNumberField} from "@openremote/or-vaadin-components/or-vaadin-number-field";const styling = css`#marker-container {@@ -68,11 +87,9 @@ export class ImageSettings extends AssetWidgetSettings {<!-- Image settings --><settings-panel displayName="dashboard.imageSettings" expanded="${true}">- <div>- <or-mwc-input style="width: 100%;" type="${InputType.TEXT}" label="${i18next.t('dashboard.imageUrl')}" .value="${this.widgetConfig.imagePath}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onImageUrlUpdate(ev)}"- ></or-mwc-input>- </div>+ <or-vaadin-text-field value=${this.widgetConfig.imagePath} @change=${(ev: Event) => this.onImageUrlUpdate(ev)}>+ <or-translate slot="label" value="dashboard.imageUrl"></or-translate>+ </or-vaadin-text-field></settings-panel></div>`;@@ -83,9 +100,12 @@ export class ImageSettings extends AssetWidgetSettings {this.notifyConfigUpdate();}- protected onImageUrlUpdate(ev: OrInputChangedEvent) {- this.widgetConfig.imagePath = ev.detail.value;- this.notifyConfigUpdate();+ protected onImageUrlUpdate(ev: Event) {+ const elem = ev.currentTarget as OrVaadinTextField;+ if(elem.checkValidity()) {+ this.widgetConfig.imagePath = elem.value;+ this.notifyConfigUpdate();+ }}@@ -138,15 +158,14 @@ export class ImageSettings extends AssetWidgetSettings {`)}</div><div style="display: flex; gap: 8px;">- <or-mwc-input .disableSliderNumberInput="${true}" compact style="max-width: 64px;"- .type="${InputType.NUMBER}" .min="${min}" .max="${max}" .value="${coordinates[0]}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onCoordinateUpdate(index, 'x', ev.detail.value)}"- ></or-mwc-input>-- <or-mwc-input .disableSliderNumberInput="${true}" compact style="max-width: 64px;"- .type="${InputType.NUMBER}" .min="${min}" .max="${max}" .value="${coordinates[1]}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onCoordinateUpdate(index, 'y', ev.detail.value)}"- ></or-mwc-input>+ <or-vaadin-number-field value=${coordinates[0]} min=${min} max=${max} style="max-width: 64px;"+ @change=${(ev: Event) => this.onCoordinateUpdate(index, "x", ev)}>+ <span slot="suffix">%</span>+ </or-vaadin-number-field>+ <or-vaadin-number-field value=${coordinates[1]} min=${min} max=${max} style="max-width: 64px;"+ @change=${(ev: Event) => this.onCoordinateUpdate(index, "y", ev)}>+ <span slot="suffix">%</span>+ </or-vaadin-number-field></div></div>`;@@ -158,15 +177,19 @@ export class ImageSettings extends AssetWidgetSettings {}}- protected onCoordinateUpdate(index: number, coordinate: 'x' | 'y', value: number) {+ protected onCoordinateUpdate(index: number, coordinate: 'x' | 'y', ev: Event) {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if(!elem.checkValidity()) {+ return;+ }let coords = this.widgetConfig.markers[index].coordinates;if(!coords) {coords = [0, 0];}if(coordinate === 'x') {- coords[0] = value;+ coords[0] = Number(elem.value);} else if(coordinate === 'y') {- coords[1] = value;+ coords[1] = Number(elem.value);}this.widgetConfig.markers[index].coordinates = coords;this.notifyConfigUpdate();diff --git a/ui/component/or-dashboard-builder/src/settings/kpi-settings.ts b/ui/component/or-dashboard-builder/src/settings/kpi-settings.tsindex a6390cb54..84d9330cd 100644--- a/ui/component/or-dashboard-builder/src/settings/kpi-settings.ts+++ b/ui/component/or-dashboard-builder/src/settings/kpi-settings.ts@@ -1,11 +1,32 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {css, html, TemplateResult } from "lit";import { customElement } from "lit/decorators.js";import {AssetWidgetSettings} from "../util/or-asset-widget";import {i18next} from "@openremote/or-translate";import {KpiWidgetConfig} from "../widgets/kpi-widget";import {AttributesSelectEvent} from "../panels/attributes-panel";-import {Attribute, AttributeRef} from "@openremote/model";+import {Attribute} from "@openremote/model";import { InputType, OrInputChangedEvent } from "@openremote/or-mwc-components/or-mwc-input";+import {OrVaadinSelect} from "@openremote/or-vaadin-components/or-vaadin-select";+import {OrVaadinNumberField} from "@openremote/or-vaadin-components/or-vaadin-number-field";const styling = css`.switchMwcInputContainer {@@ -40,11 +61,10 @@ export class KpiSettings extends AssetWidgetSettings {<!-- Display settings --><settings-panel displayName="display" expanded="${true}"><div style="display: flex; flex-direction: column; gap: 8px;">- <or-mwc-input .type="${InputType.SELECT}" style="width: 100%;"- .options="${['year', 'month', 'week', 'day', 'hour']}"- .value="${this.widgetConfig.period}" label="${i18next.t('timeframe')}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onTimeframeSelect(ev)}"- ></or-mwc-input>+ <or-vaadin-select .items=${['year', 'month', 'week', 'day', 'hour'].map(i => ({value: i, label: i18next.t(i)}))}+ value=${this.widgetConfig.period} @change=${(ev: Event) => this.onTimeframeSelect(ev)}>+ <or-translate slot="label" value="timeframe"></or-translate>+ </or-vaadin-select><div class="switchMwcInputContainer"><span><or-translate value="dashboard.allowTimerangeSelect"></or-translate></span><or-mwc-input .type="${InputType.SWITCH}" style="margin: 0 -10px;" .value="${this.widgetConfig.showTimestampControls}"@@ -56,13 +76,14 @@ export class KpiSettings extends AssetWidgetSettings {<settings-panel displayName="values" expanded="${true}"><div style="display: flex; flex-direction: column; gap: 8px;">- <or-mwc-input .type="${InputType.SELECT}" style="width: 100%;" .options="${['absolute', 'percentage']}" .value="${this.widgetConfig.deltaFormat}"- label="${i18next.t('dashboard.showValueAs')}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onDeltaFormatSelect(ev)}"- ></or-mwc-input>- <or-mwc-input .type="${InputType.NUMBER}" style="width: 100%;" .value="${this.widgetConfig.decimals}" label="${i18next.t('decimals')}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onDecimalsChange(ev)}"- ></or-mwc-input>+ <or-vaadin-select .items=${['absolute', 'percentage'].map(i => ({value: i, label: i18next.t(i)}))}+ value=${this.widgetConfig.deltaFormat} @change=${(ev: Event) => this.onDeltaFormatSelect(ev)}>+ <or-translate slot="label" value="dashboard.showValueAs"></or-translate>+ </or-vaadin-select>+ <or-vaadin-number-field value=${this.widgetConfig.decimals} min="0"+ @change=${(ev: Event) => this.onDecimalsChange(ev)}>+ <or-translate slot="label" value="decimals"></or-translate>+ </or-vaadin-number-field></div></settings-panel>@@ -83,8 +104,8 @@ export class KpiSettings extends AssetWidgetSettings {this.notifyConfigUpdate();}- protected onTimeframeSelect(ev: OrInputChangedEvent) {- this.widgetConfig.period = ev.detail.value;+ protected onTimeframeSelect(ev: Event) {+ this.widgetConfig.period = (ev.currentTarget as OrVaadinSelect).value as any;this.notifyConfigUpdate();}@@ -93,14 +114,17 @@ export class KpiSettings extends AssetWidgetSettings {this.notifyConfigUpdate();}- protected onDeltaFormatSelect(ev: OrInputChangedEvent) {- this.widgetConfig.deltaFormat = ev.detail.value;+ protected onDeltaFormatSelect(ev: Event) {+ this.widgetConfig.deltaFormat = (ev.currentTarget as OrVaadinSelect).value as any;this.notifyConfigUpdate();}- protected onDecimalsChange(ev: OrInputChangedEvent) {- this.widgetConfig.decimals = ev.detail.value;- this.notifyConfigUpdate();+ protected onDecimalsChange(ev: Event) {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if(elem.checkValidity()) {+ this.widgetConfig.decimals = Number(elem.value);+ this.notifyConfigUpdate();+ }}}diff --git a/ui/component/or-dashboard-builder/src/settings/map-settings.ts b/ui/component/or-dashboard-builder/src/settings/map-settings.tsindex cde1d1c0e..de269d7a8 100644--- a/ui/component/or-dashboard-builder/src/settings/map-settings.ts+++ b/ui/component/or-dashboard-builder/src/settings/map-settings.ts@@ -1,7 +1,25 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {css, html, TemplateResult} from "lit";import {customElement} from "lit/decorators.js";import {AssetWidgetSettings} from "../util/or-asset-widget";-import {i18next} from "@openremote/or-translate";import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import {MapWidgetConfig} from "../widgets/map-widget";import {LngLatLike, MapMarkerColours, LngLat} from "@openremote/or-map";@@ -12,6 +30,8 @@ import {AssetIdsSelectEvent, AssetTypeSelectEvent, AssetAllOfTypeSwitchEvent, Asimport manager from "@openremote/core";import {showSnackbar} from "@openremote/or-mwc-components/or-mwc-snackbar";import {BoolColorsChangeEvent, TextColorsChangeEvent, ThresholdChangeEvent} from "../panels/thresholds-panel";+import {OrVaadinNumberField} from "@openremote/or-vaadin-components/or-vaadin-number-field";+import {OrVaadinTextField} from "@openremote/or-vaadin-components/or-vaadin-text-field";const styling = css`.switchMwcInputContainer {@@ -49,19 +69,14 @@ export class MapSettings extends AssetWidgetSettings {<!-- Map settings --><settings-panel displayName="configuration.mapSettings" expanded="${true}"><div style="display: flex; flex-direction: column; gap: 8px;">- <div>- <or-mwc-input .type="${InputType.NUMBER}" style="width: 100%;"- .value="${this.widgetConfig.zoom}" label="${i18next.t('dashboard.zoom')}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onZoomUpdate(ev)}"- ></or-mwc-input>- </div>- <div style="display: flex; gap: 8px;">- <or-mwc-input .type="${InputType.TEXT}" style="width: 100%;"- .value="${this.widgetConfig.center ? (Object.values(this.widgetConfig.center))[0] + ', ' + (Object.values(this.widgetConfig.center))[1] : undefined}"- label="${i18next.t('dashboard.center')}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onCenterUpdate(ev)}"- ></or-mwc-input>- </div>+ <!-- Zoom level -->+ <or-vaadin-number-field value=${this.widgetConfig.zoom} min="0" @change=${(ev: Event) => this.onZoomUpdate(ev)}>+ <or-translate slot="label" value="dashboard.zoom"></or-translate>+ </or-vaadin-number-field>+ <or-vaadin-text-field value=${this.widgetConfig.center ? (Object.values(this.widgetConfig.center))[0] + ', ' + (Object.values(this.widgetConfig.center))[1] : undefined}+ @change=${(ev: Event) => this.onCenterUpdate(ev)}>+ <or-translate slot="label" value="dashboard.center"></or-translate>+ </or-vaadin-text-field><div style="display: flex; justify-content: space-between; align-items: center;"><span><or-translate value="dashboard.showGeoJson"></or-translate></span><or-mwc-input .type="${InputType.SWITCH}" style="width: 70px;"@@ -74,7 +89,7 @@ export class MapSettings extends AssetWidgetSettings {<!-- Panel where Asset type and the selected attribute can be customized --><settings-panel displayName="attributes" expanded="${true}">- <assettypes-panel .assetType="${this.widgetConfig.assetType}" .attributeNames="${this.widgetConfig.attributeName}" .config="${MapSettings._config}"+ <assettypes-panel .assetType="${this.widgetConfig.assetType}" .attributeNames="${[this.widgetConfig.attributeName]}" .config="${MapSettings._config}".allOfType="${this.widgetConfig.allOfType}" .assetIds="${this.widgetConfig.assetIds}"@assettype-select="${(ev: AssetTypeSelectEvent) => this.onAssetTypeSelect(ev)}"@alloftype-switch="${(ev: AssetAllOfTypeSwitchEvent) => this.onAssetAllOfTypeSwitch(ev)}"@@ -119,14 +134,21 @@ export class MapSettings extends AssetWidgetSettings {`;}- protected onZoomUpdate(ev: OrInputChangedEvent) {- this.widgetConfig.zoom = ev.detail.value;- this.notifyConfigUpdate();+ protected onZoomUpdate(ev: Event) {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if(elem.checkValidity()) {+ this.widgetConfig.zoom = Number(elem.value);+ this.notifyConfigUpdate();+ }}- protected onCenterUpdate(ev: OrInputChangedEvent) {- if (ev.detail.value) {- const lngLatArr = (ev.detail.value as string).split(/[, ]/).filter(v => !!v);+ protected onCenterUpdate(ev: Event) {+ const elem = ev.currentTarget as OrVaadinTextField;+ if(!elem.checkValidity()) {+ return;+ }+ if (elem.value) {+ const lngLatArr = elem.value.split(/[, ]/).filter(v => !!v);if (lngLatArr.length === 2) {const value = new LngLat(Number.parseFloat(lngLatArr[0]),@@ -135,6 +157,9 @@ export class MapSettings extends AssetWidgetSettings {this.widgetConfig.center = value as LngLatLike;this.notifyConfigUpdate();}+ } else {+ this.widgetConfig.center = undefined;+ this.notifyConfigUpdate();}}@@ -168,40 +193,42 @@ export class MapSettings extends AssetWidgetSettings {}protected async onAttributeNameSelect(ev: AttributeNamesSelectEvent) {- const attrName = ev.detail as string;- this.widgetConfig.attributeName = attrName;-- const queryAssets = async (ids?: string[]) => {- try {- const response = await manager.rest.api.AssetResource.queryAssets({- realm: { name: manager.displayRealm },- select: { attributes: [attrName, 'location'] },- types: [this.widgetConfig.assetType!],- ids: ids,- limit: ids?.length ?? 1- });- this.widgetConfig.assetIds = ids?.length ? response.data.map((a) => a.id!) : [];- this.widgetConfig.valueType = response.data.length ? response.data[0].attributes![attrName].type : "text";- if (!response.data[0].attributes![attrName].type) {- throw new TypeError("Data does not contain property 'attributes' or 'type'.")- }- } catch (reason) {- console.error(reason);- if (reason instanceof TypeError) {- showSnackbar(undefined, "noAttributesToShow");- } else {- showSnackbar(undefined, "errorOccurred");+ const attrName = (ev.detail as string[])[0];+ if(this.widgetConfig.attributeName !== attrName) {+ this.widgetConfig.attributeName = attrName;++ const queryAssets = async (ids?: string[]) => {+ try {+ const response = await manager.rest.api.AssetResource.queryAssets({+ realm: { name: manager.displayRealm },+ select: { attributes: [attrName, 'location'] },+ types: [this.widgetConfig.assetType!],+ ids: ids,+ limit: ids?.length ?? 1+ });+ this.widgetConfig.assetIds = ids?.length ? response.data.map((a) => a.id!) : [];+ this.widgetConfig.valueType = response.data.length ? response.data[0].attributes![attrName].type : "text";+ if (!response.data[0].attributes![attrName].type) {+ throw new TypeError("Data does not contain property 'attributes' or 'type'.")+ }+ } catch (reason) {+ console.error(reason);+ if (reason instanceof TypeError) {+ showSnackbar(undefined, "noAttributesToShow");+ } else {+ showSnackbar(undefined, "errorOccurred");+ }}+ };++ if (this.widgetConfig.allOfType) {+ await queryAssets();+ } else {+ await queryAssets(this.widgetConfig.assetIds!);}- };- if (this.widgetConfig.allOfType) {- await queryAssets();- } else {- await queryAssets(this.widgetConfig.assetIds!);+ this.notifyConfigUpdate();}-- this.notifyConfigUpdate();}protected onShowLabelsToggle(ev: OrInputChangedEvent) {diff --git a/ui/component/or-dashboard-builder/src/settings/table-settings.ts b/ui/component/or-dashboard-builder/src/settings/table-settings.tsindex 7a4de1287..8a0d0e0f9 100644--- a/ui/component/or-dashboard-builder/src/settings/table-settings.ts+++ b/ui/component/or-dashboard-builder/src/settings/table-settings.ts@@ -1,9 +1,28 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {css, html, TemplateResult } from "lit";import { customElement } from "lit/decorators.js";import {AssetWidgetSettings} from "../util/or-asset-widget";import {TableWidgetConfig} from "../widgets/table-widget";-import { InputType, OrInputChangedEvent } from "@openremote/or-mwc-components/or-mwc-input";import {AssetIdsSelectEvent, AssetTypeSelectEvent, AssetAllOfTypeSwitchEvent, AssetTypesFilterConfig, AttributeNamesSelectEvent} from "../panels/assettypes-panel";+import {OrVaadinSelect} from "@openremote/or-vaadin-components/or-vaadin-select";const styling = css`.customMwcInputContainer {@@ -17,29 +36,29 @@ const styling = css`export class TableSettings extends AssetWidgetSettings {protected widgetConfig!: TableWidgetConfig;+ protected static _config: AssetTypesFilterConfig = {+ assets: {+ enabled: true,+ multi: true,+ allOfTypeOption: true+ },+ attributes: {+ enabled: true,+ multi: true+ }+ };static get styles() {return [...super.styles, styling];}protected render(): TemplateResult {- const config = {- assets: {- enabled: true,- multi: true,- allOfTypeOption: true- },- attributes: {- enabled: true,- multi: true- }- } as AssetTypesFilterConfigreturn html`<div><!-- Asset type, assets, and attribute picker --><settings-panel displayName="attributes" expanded="${true}"><div style="padding-bottom: 12px;">- <assettypes-panel .assetType="${this.widgetConfig.assetType}" .config="${config}"+ <assettypes-panel .assetType="${this.widgetConfig.assetType}" .config="${TableSettings._config}".assetIds="${this.widgetConfig.assetIds}" .attributeNames="${this.widgetConfig.attributeNames}".allOfType="${this.widgetConfig.allOfType}"@assettype-select="${(ev: AssetTypeSelectEvent) => this.onAssetTypeSelect(ev)}"@@ -55,9 +74,9 @@ export class TableSettings extends AssetWidgetSettings {<div style="padding-bottom: 12px;"><div class="customMwcInputContainer"><span style="min-width: 180px"><or-translate value="dashboard.numberOfRows"></or-translate></span>- <or-mwc-input type="${InputType.SELECT}" .options="${[10, 25, 100]}" .value="${this.widgetConfig.tableSize}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onTableSizeSelect(ev)}"- ></or-mwc-input>+ <or-vaadin-select .items=${['10', '25', '100'].map(i => ({value: i, label: i}))}+ value=${this.widgetConfig.tableSize} @change=${(ev: Event) => this.onTableSizeSelect(ev)}>+ </or-vaadin-select></div></div></settings-panel>@@ -87,8 +106,9 @@ export class TableSettings extends AssetWidgetSettings {this.notifyConfigUpdate();}- protected onTableSizeSelect(ev: OrInputChangedEvent) {- const value = ev.detail.value || 10;+ protected onTableSizeSelect(ev: Event) {+ const elem = ev.currentTarget as OrVaadinSelect;+ const value = Number(elem.value || 10);this.widgetConfig.tableSize = value;if(value !== 10) {this.widgetConfig.tableOptions = [value];diff --git a/ui/component/or-dashboard-builder/src/style.ts b/ui/component/or-dashboard-builder/src/style.tsindex 360101d03..4a4ab8b9c 100644--- a/ui/component/or-dashboard-builder/src/style.ts+++ b/ui/component/or-dashboard-builder/src/style.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import { css, unsafeCSS } from "lit";import {DefaultColor1, DefaultColor2, DefaultColor4, DefaultColor5} from "@openremote/core";diff --git a/ui/component/or-dashboard-builder/src/util/or-asset-widget.ts b/ui/component/or-dashboard-builder/src/util/or-asset-widget.tsindex c33fccca0..a17288ef2 100644--- a/ui/component/or-dashboard-builder/src/util/or-asset-widget.ts+++ b/ui/component/or-dashboard-builder/src/util/or-asset-widget.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {OrWidget} from "./or-widget";import {Asset, AssetQuery, Attribute, AttributeRef} from "@openremote/model";import { state } from "lit/decorators.js";diff --git a/ui/component/or-dashboard-builder/src/util/or-widget.ts b/ui/component/or-dashboard-builder/src/util/or-widget.tsindex 2bd0f7f18..406a93783 100644--- a/ui/component/or-dashboard-builder/src/util/or-widget.ts+++ b/ui/component/or-dashboard-builder/src/util/or-widget.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {CSSResult, LitElement, TemplateResult } from "lit";import { property } from "lit/decorators.js";import {WidgetConfig} from "./widget-config";diff --git a/ui/component/or-dashboard-builder/src/util/settings-panel.ts b/ui/component/or-dashboard-builder/src/util/settings-panel.tsindex ed7ed6644..92df53719 100644--- a/ui/component/or-dashboard-builder/src/util/settings-panel.ts+++ b/ui/component/or-dashboard-builder/src/util/settings-panel.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {css, html, LitElement, TemplateResult } from "lit";import { customElement, property } from "lit/decorators.js";import { until } from "lit/directives/until.js";diff --git a/ui/component/or-dashboard-builder/src/util/widget-config.ts b/ui/component/or-dashboard-builder/src/util/widget-config.tsindex de61082cc..e5e8c3583 100644--- a/ui/component/or-dashboard-builder/src/util/widget-config.ts+++ b/ui/component/or-dashboard-builder/src/util/widget-config.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {AttributeRef} from "@openremote/model";/**diff --git a/ui/component/or-dashboard-builder/src/util/widget-settings.ts b/ui/component/or-dashboard-builder/src/util/widget-settings.tsindex fdaa2ca42..5d1929337 100644--- a/ui/component/or-dashboard-builder/src/util/widget-settings.ts+++ b/ui/component/or-dashboard-builder/src/util/widget-settings.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {LitElement, PropertyValues, TemplateResult } from "lit";import { property } from "lit/decorators.js";import {WidgetConfig} from "./widget-config";diff --git a/ui/component/or-dashboard-builder/src/widgets/attribute-input-widget.ts b/ui/component/or-dashboard-builder/src/widgets/attribute-input-widget.tsindex 925a0cde6..83fbebee3 100644--- a/ui/component/or-dashboard-builder/src/widgets/attribute-input-widget.ts+++ b/ui/component/or-dashboard-builder/src/widgets/attribute-input-widget.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {css, html, PropertyValues, TemplateResult } from "lit";import {OrAssetWidget} from "../util/or-asset-widget";import {AssetWidgetConfig} from "../util/widget-config";diff --git a/ui/component/or-dashboard-builder/src/widgets/chart-widget.ts b/ui/component/or-dashboard-builder/src/widgets/chart-widget.tsindex 56cbb9106..b3292347b 100644--- a/ui/component/or-dashboard-builder/src/widgets/chart-widget.ts+++ b/ui/component/or-dashboard-builder/src/widgets/chart-widget.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {AssetDatapointLTTBQuery, AssetDatapointQueryUnion, Attribute, AttributeRef} from "@openremote/model";import {html, PropertyValues, TemplateResult } from "lit";import { when } from "lit/directives/when.js";diff --git a/ui/component/or-dashboard-builder/src/widgets/gateway-widget.ts b/ui/component/or-dashboard-builder/src/widgets/gateway-widget.tsindex 976aa44fc..8482a4d3d 100644--- a/ui/component/or-dashboard-builder/src/widgets/gateway-widget.ts+++ b/ui/component/or-dashboard-builder/src/widgets/gateway-widget.ts@@ -1,10 +1,28 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {customElement, state} from "lit/decorators.js";import {OrWidget, WidgetManifest} from "../util/or-widget";import {css, html, PropertyValues, TemplateResult} from "lit";import {WidgetSettings} from "../util/widget-settings";-import {AssetWidgetConfig, WidgetConfig} from "../util/widget-config";+import {AssetWidgetConfig} from "../util/widget-config";import {GatewaySettings} from "../settings/gateway-settings";-import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import {GatewayTunnelInfo, GatewayTunnelInfoType} from "@openremote/model";import manager from "@openremote/core";import {when} from "lit/directives/when.js";@@ -141,19 +159,22 @@ export class GatewayWidget extends OrWidget {if (this._activeTunnel) {return html`<div>- <or-mwc-input .type="${InputType.BUTTON}" icon="stop" label="${i18next.t('gatewayTunnels.stop')}" .disabled="${disabled}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this._onStopTunnelClick(ev)}"- ></or-mwc-input>-- ${when(this.widgetConfig.type === GatewayTunnelInfoType.TCP, () => html`- <or-mwc-input .type="${InputType.BUTTON}" icon="content-copy" label="${i18next.t('gatewayTunnels.copyAddress')}" outlined .disabled="${disabled}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this._onCopyTunnelAddressClick(ev)}"- ></or-mwc-input>- `, () => html`- <or-mwc-input .type="${InputType.BUTTON}" icon="open-in-new" label="${i18next.t('gatewayTunnels.open')}" outlined .disabled="${disabled}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this._onTunnelNavigateClick(ev, this._activeTunnel)}"- ></or-mwc-input>- `)}+ <or-vaadin-button theme="primary" ?disabled=${disabled} @click=${(ev: Event) => this._onStopTunnelClick(ev)}>+ <or-icon slot="prefix" icon="stop"></or-icon>+ <or-translate value="gatewayTunnels.stop"></or-translate>+ </or-vaadin-button>++ ${when(this.widgetConfig.type === GatewayTunnelInfoType.TCP, () => html`+ <or-vaadin-button ?disabled=${disabled} @click=${(ev: Event) => this._onCopyTunnelAddressClick(ev)}>+ <or-icon slot="prefix" icon="content-copy"></or-icon>+ <or-translate value="gatewayTunnels.copyAddress"></or-translate>+ </or-vaadin-button>+ `, () => html`+ <or-vaadin-button ?disabled=${disabled} @click=${(ev: Event) => this._onTunnelNavigateClick(ev, this._activeTunnel)}>+ <or-icon slot="prefix" icon="open-in-new"></or-icon>+ <or-translate value="gatewayTunnels.open"></or-translate>+ </or-vaadin-button>+ `)}</div>${when(this._activeTunnel?.autoCloseTime, () => html`<div><or-translate value="gatewayTunnels.closesAt"></or-translate>: ${moment(this._activeTunnel?.autoCloseTime).format("lll")}</div>@@ -161,9 +182,9 @@ export class GatewayWidget extends OrWidget {`;} else {return html`- <or-mwc-input .type="${InputType.BUTTON}" label="${disabled ? i18next.t('gatewayTunnels.offline') : i18next.t('gatewayTunnels.start')}" outlined .disabled="${disabled}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this._onStartTunnelClick(ev)}"- ></or-mwc-input>+ <or-vaadin-button ?disabled=${disabled} @click=${(ev: Event) => this._onStartTunnelClick(ev)}>+ <or-translate value=${disabled ? "gatewayTunnels.offline" : "gatewayTunnels.start"}></or-translate>+ </or-vaadin-button>`;}})}@@ -175,7 +196,7 @@ export class GatewayWidget extends OrWidget {/*** HTML callback function when 'copy address' button is pressed for a TCP tunnel.*/- protected _onCopyTunnelAddressClick(ev: OrInputChangedEvent) {+ protected _onCopyTunnelAddressClick(_ev: Event) {if (this._isConfigComplete(this.widgetConfig)) {const tunnelInfo = this._getTunnelInfoByConfig(this.widgetConfig);const address = this._getTunnelAddress(tunnelInfo);@@ -196,21 +217,21 @@ export class GatewayWidget extends OrWidget {/*** HTML callback function when 'start' button is pressed, meant to create / start a new tunnel.*/- protected _onStartTunnelClick(ev: OrInputChangedEvent) {+ protected _onStartTunnelClick(_ev: Event) {this._tryStartTunnel(this.widgetConfig);}/*** HTML callback function when 'stop' button is pressed, meant to destroy the active tunnel.*/- protected _onStopTunnelClick(ev: OrInputChangedEvent) {+ protected _onStopTunnelClick(_ev: Event) {this._tryStopTunnel(this.widgetConfig);}/*** HTML callback function when 'open' button is pressed, meant to start using the tunnel.*/- protected _onTunnelNavigateClick(ev: OrInputChangedEvent, activeTunnel?: GatewayTunnelInfo) {+ protected _onTunnelNavigateClick(_ev: Event, activeTunnel?: GatewayTunnelInfo) {if(activeTunnel) {this._navigateToTunnel(activeTunnel);} else {diff --git a/ui/component/or-dashboard-builder/src/widgets/gauge-widget.ts b/ui/component/or-dashboard-builder/src/widgets/gauge-widget.tsindex 4ba96f5ef..55529f157 100644--- a/ui/component/or-dashboard-builder/src/widgets/gauge-widget.ts+++ b/ui/component/or-dashboard-builder/src/widgets/gauge-widget.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {html, css, TemplateResult} from "lit";import {customElement, state} from "lit/decorators.js";import {OrAssetWidget} from "../util/or-asset-widget";diff --git a/ui/component/or-dashboard-builder/src/widgets/image-widget.ts b/ui/component/or-dashboard-builder/src/widgets/image-widget.tsindex be1f9ae6c..280fc1368 100644--- a/ui/component/or-dashboard-builder/src/widgets/image-widget.ts+++ b/ui/component/or-dashboard-builder/src/widgets/image-widget.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {AssetWidgetConfig} from "../util/widget-config";import {AssetModelUtil, Attribute, AttributeRef, WellknownValueTypes} from "@openremote/model";import {OrWidget, WidgetManifest} from "../util/or-widget";diff --git a/ui/component/or-dashboard-builder/src/widgets/kpi-widget.ts b/ui/component/or-dashboard-builder/src/widgets/kpi-widget.tsindex 6316f4423..09dab4ed8 100644--- a/ui/component/or-dashboard-builder/src/widgets/kpi-widget.ts+++ b/ui/component/or-dashboard-builder/src/widgets/kpi-widget.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import { customElement, state } from "lit/decorators.js";import { when } from "lit/directives/when.js";import {OrAssetWidget} from "../util/or-asset-widget";diff --git a/ui/component/or-dashboard-builder/src/widgets/map-widget.ts b/ui/component/or-dashboard-builder/src/widgets/map-widget.tsindex 808fcead6..f41f424ea 100644--- a/ui/component/or-dashboard-builder/src/widgets/map-widget.ts+++ b/ui/component/or-dashboard-builder/src/widgets/map-widget.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {html, PropertyValues, TemplateResult} from "lit";import {customElement, query, state} from "lit/decorators.js";import {OrAssetWidget} from "../util/or-asset-widget";diff --git a/ui/component/or-dashboard-builder/src/widgets/table-widget.ts b/ui/component/or-dashboard-builder/src/widgets/table-widget.tsindex fa10bc70b..972450245 100644--- a/ui/component/or-dashboard-builder/src/widgets/table-widget.ts+++ b/ui/component/or-dashboard-builder/src/widgets/table-widget.ts@@ -1,3 +1,22 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {css, html, PropertyValues, TemplateResult } from "lit";import { customElement } from "lit/decorators.js";import {OrAssetWidget} from "../util/or-asset-widget";diff --git a/ui/component/or-json-forms/package.json b/ui/component/or-json-forms/package.jsonindex b3e83f81c..ed216a291 100644--- a/ui/component/or-json-forms/package.json+++ b/ui/component/or-json-forms/package.json@@ -27,6 +27,7 @@"@openremote/or-components": "workspace:*","@openremote/or-mwc-components": "workspace:*","@openremote/or-translate": "workspace:*",+ "@openremote/or-vaadin-components": "workspace:*","ajv": "^8.8.2","lit": "^3.3.1"},diff --git a/ui/component/or-json-forms/src/controls/control-array-element.ts b/ui/component/or-json-forms/src/controls/control-array-element.tsindex de03bd2f2..7d3e28ec9 100644--- a/ui/component/or-json-forms/src/controls/control-array-element.ts+++ b/ui/component/or-json-forms/src/controls/control-array-element.ts@@ -11,12 +11,13 @@ import {import {css, html, PropertyValues, TemplateResult, unsafeCSS} from "lit";import {customElement, property} from "lit/decorators.js";import {CombinatorInfo, controlWithoutLabel, getCombinatorInfos, getTemplateFromProps, showJsonEditor} from "../util";-import {InputType, OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";import {i18next} from "@openremote/or-translate";import {OrMwcDialog, showDialog} from "@openremote/or-mwc-components/or-mwc-dialog";import "@openremote/or-mwc-components/or-mwc-list";import {addItemOrParameterDialogStyle, baseStyle, panelStyle} from "../styles";import {ListItem, OrMwcListChangedEvent} from "@openremote/or-mwc-components/or-mwc-list";+import {OrVaadinButton} from "@openremote/or-vaadin-components/or-vaadin-button";+import "@openremote/or-vaadin-components/or-vaadin-button";import {DefaultColor4, DefaultColor5} from "@openremote/core";import {ControlBaseElement} from "./control-base-element";import {getTemplateWrapper} from "../index";@@ -165,7 +166,12 @@ export class ControlArrayElement extends ControlBaseElement {<div id="errors">${!this.errors ? `` : html`<or-icon icon="alert"></or-icon><span>${this.errors}</span>`}</div>- <div id="header-buttons"><or-mwc-input .type="${InputType.BUTTON}" outlined label="json" icon="pencil" @or-mwc-input-changed="${(ev: Event) => this._showJson(ev)}"></or-mwc-input></div>+ <div id="header-buttons">+ <or-vaadin-button @click=${(ev: Event) => this._showJson(ev)}>+ <or-icon slot="prefix" icon="pencil"></or-icon>+ <or-translate value="JSON"></or-translate>+ </or-vaadin-button>+ </div></div>`;@@ -191,7 +197,10 @@ export class ControlArrayElement extends ControlBaseElement {</div>${this.errors ? `` : html`<div id="footer">- <or-mwc-input .disabled="${itemCount && itemCount >= maxItems}" .type="${InputType.BUTTON}" label="addItem" icon="plus" @or-mwc-input-changed="${() => this.doAddItem()}"></or-mwc-input>+ <or-vaadin-button ?disabled=${itemCount && itemCount >= maxItems} @click=${() => this.doAddItem()}>+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value="addItem"></or-translate>+ </or-vaadin-button></div>`}</div>@@ -311,7 +320,7 @@ export class ControlArrayElement extends ControlBaseElement {selectedItemInfo = itemInfo;const descElem = dialog.shadowRoot!.getElementById("parameter-desc") as HTMLDivElement;descElem.innerHTML = itemInfo.description || "";- (dialog.shadowRoot!.getElementById("add-btn") as OrMwcInput).disabled = false;+ (dialog.shadowRoot!.getElementById("add-btn") as OrVaadinButton).disabled = false;};const dialog = showDialog(new OrMwcDialog()@@ -341,7 +350,11 @@ export class ControlArrayElement extends ControlBaseElement {this.addItem(value);}},- content: html`<or-mwc-input id="add-btn" .type="${InputType.BUTTON}" disabled label="add"></or-mwc-input>`+ content: html`+ <or-vaadin-button id="add-btn" disabled>+ <or-translate value="add"></or-translate>+ </or-vaadin-button>+ `}]).setDismissAction(null));diff --git a/ui/component/or-json-forms/src/layouts/layout-vertical-element.ts b/ui/component/or-json-forms/src/layouts/layout-vertical-element.tsindex 688a273b6..4144055da 100644--- a/ui/component/or-json-forms/src/layouts/layout-vertical-element.ts+++ b/ui/component/or-json-forms/src/layouts/layout-vertical-element.ts@@ -26,6 +26,9 @@ import {showJsonEditor} from "../util";import {InputType, OrInputChangedEvent, OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";+import {OrVaadinTextField} from "@openremote/or-vaadin-components/or-vaadin-text-field";+import "@openremote/or-vaadin-components/or-vaadin-text-field";+import "@openremote/or-vaadin-components/or-vaadin-button";import {i18next} from "@openremote/or-translate";import {OrMwcDialog, showDialog} from "@openremote/or-mwc-components/or-mwc-dialog";import "@openremote/or-mwc-components/or-mwc-list";@@ -152,7 +155,12 @@ export class LayoutVerticalElement extends LayoutBaseElement<VerticalLayout | Gr<div id="errors">${!this.errors ? `` : html`<or-icon icon="alert"></or-icon><span>${this.errors}</span>`}</div>- <div id="header-buttons"><or-mwc-input .type="${InputType.BUTTON}" outlined label="json" icon="pencil" @or-mwc-input-changed="${(ev: Event) => this._showJson(ev)}"></or-mwc-input></div>+ <div id="header-buttons">+ <or-vaadin-button @click=${(ev: Event) => this._showJson(ev)}>+ <or-icon slot="prefix" icon="pencil"></or-icon>+ <or-translate value="JSON"></or-translate>+ </or-vaadin-button>+ </div></div>`;@@ -191,9 +199,13 @@ export class LayoutVerticalElement extends LayoutBaseElement<VerticalLayout | Gr</div>${this.errors || (optionalProps.length === 0 && !dynamic) ? `` : html`- <div id="footer">- <or-mwc-input .type="${InputType.BUTTON}" label="addParameter" icon="plus" @or-mwc-input-changed="${() => this._addParameter(rootSchema, optionalProps, dynamicPropertyRegex, dynamicValueSchema)}"></or-mwc-input>- </div>`}+ <div id="footer">+ <or-vaadin-button @click=${() => this._addParameter(rootSchema, optionalProps, dynamicPropertyRegex, dynamicValueSchema)}>+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value="addParameter"></or-translate>+ </or-vaadin-button>+ </div>+ `}</div>`;@@ -211,17 +223,17 @@ export class LayoutVerticalElement extends LayoutBaseElement<VerticalLayout | Grthis.handleChange(this.path, data);};- const keyChangeHandler = (orInput: OrMwcInput, oldKey: string, newKey: string) => {+ const keyChangeHandler = (orInput: OrVaadinTextField, oldKey: string, newKey: string) => {- if (!orInput.valid) {+ if (!orInput.checkValidity()) {return;}if (this.data[newKey] !== undefined) {- orInput.setCustomValidity(i18next.t("validation.keyAlreadyExists"));+ orInput.errorMessage = i18next.t("validation.keyAlreadyExists");return;} else {- orInput.setCustomValidity(undefined);+ orInput.errorMessage = undefined;}const data = {...this.data};const value = data[oldKey];@@ -253,7 +265,12 @@ export class LayoutVerticalElement extends LayoutBaseElement<VerticalLayout | Grreturn html`<div class="row"><div class="key-container">- <or-mwc-input .type="${InputType.TEXT}" @or-mwc-input-changed="${(ev:OrInputChangedEvent) => keyChangeHandler(ev.currentTarget as OrMwcInput, key, ev.detail.value)}" required .pattern="${dynamicPropertyRegex}" .value="${key}"></or-mwc-input>+ <or-vaadin-text-field value=${key} required pattern="${dynamicPropertyRegex}"+ @change=${(ev: Event) => {+ const elem = ev.currentTarget as OrVaadinTextField;+ keyChangeHandler(elem, key, elem.value)+ }}>+ </or-vaadin-text-field></div><div class="value-container">${getDynamicValueTemplate(key, value)}diff --git a/ui/component/or-json-forms/src/standard-renderers.ts b/ui/component/or-json-forms/src/standard-renderers.tsindex 4dca7002b..fb7821157 100644--- a/ui/component/or-json-forms/src/standard-renderers.ts+++ b/ui/component/or-json-forms/src/standard-renderers.ts@@ -40,6 +40,7 @@ import {} from "@jsonforms/core";import {html, TemplateResult} from "lit";import "@openremote/or-mwc-components/or-mwc-input";+import "@openremote/or-vaadin-components/or-vaadin-input";import {JsonFormsStateContext} from "./index";import {getCombinatorInfos,diff --git a/ui/component/or-json-forms/src/util.ts b/ui/component/or-json-forms/src/util.tsindex 554505005..4ff21613b 100644--- a/ui/component/or-json-forms/src/util.ts+++ b/ui/component/or-json-forms/src/util.ts@@ -21,7 +21,6 @@ import {StatePropsOfCombinator,} from "@jsonforms/core";import {DefaultColor5, Util} from "@openremote/core";-import { InputType, OrInputChangedEvent, OrMwcInput } from "@openremote/or-mwc-components/or-mwc-input";import { i18next } from "@openremote/or-translate";import "@openremote/or-components/or-ace-editor";import {OrAceEditor, OrAceEditorChangedEvent} from "@openremote/or-components/or-ace-editor";@@ -29,6 +28,11 @@ import {html, TemplateResult, unsafeCSS} from "lit";import {createRef, Ref, ref} from 'lit/directives/ref.js';import {unknownTemplate} from "./standard-renderers";import {OrMwcDialog, showDialog } from "@openremote/or-mwc-components/or-mwc-dialog";+import {OrVaadinSelect, SelectItem} from "@openremote/or-vaadin-components/or-vaadin-select";+import {OrVaadinButton} from "@openremote/or-vaadin-components/or-vaadin-button";+import "@openremote/or-vaadin-components/or-vaadin-select";+import "@openremote/or-vaadin-components/or-vaadin-button";+export function getTemplateFromProps<T extends OwnPropsOfRenderer>(state: JsonFormsSubStates | undefined, props: T | undefined): TemplateResult | undefined {if (!state || !props) {@@ -132,14 +136,16 @@ export function getSchemaConst(schema: JsonSchema): any {export function getSchemaPicker(rootSchema: JsonSchema, resolvedSchemas: JsonSchema[], label: string, selectedCallback: (selectedSchema: CombinatorInfo) => void): TemplateResult {const combinatorInfos = getCombinatorInfos(resolvedSchemas, rootSchema);- const options: [string, string][] = combinatorInfos.map((combinatorInfo, index) => [index+"", combinatorInfo.title || i18next.t("schema.title.indexedItem", {index: index})]);+ const options: SelectItem[] = combinatorInfos.map((combinatorInfo, index) => ({value: index+"", label: combinatorInfo.title || i18next.t("schema.title.indexedItem", {index: index})}));const pickerUpdater = (index: number) => {const matchedInfo = combinatorInfos[index];selectedCallback(matchedInfo);};const pickerLabel = label ? i18next.t("schema.anyOfPickerLabel", {label: label}) : i18next.t("type");- return html`- <or-mwc-input class="any-of-picker" .label="${pickerLabel}" .type="${InputType.SELECT}" .options="${options}" @or-mwc-input-changed="${(ev: OrInputChangedEvent) => pickerUpdater(Number(ev.detail.value))}"></or-mwc-input>+ return html`+ <or-vaadin-select class="any-of-picker" .items=${options} @change=${(ev: Event) => pickerUpdater(Number((ev.currentTarget as OrVaadinSelect).value))}>+ <span slot="label">${pickerLabel}</span>+ </or-vaadin-select>`;}@@ -341,7 +347,7 @@ export const controlWithoutLabel = (scope: string): ControlElement => ({export const showJsonEditor = (title: string, value: any, updateCallback: (newValue: string) => void): void => {const editorRef: Ref<OrAceEditor> = createRef();- const updateBtnRef: Ref<OrMwcInput> = createRef();+ const updateBtnRef: Ref<OrVaadinButton> = createRef();const onEditorEdit = () => {// Disable update button whilst edit in progressupdateBtnRef.value!.disabled = true;@@ -370,7 +376,11 @@ export const showJsonEditor = (title: string, value: any, updateCallback: (newVaupdateCallback(data);}},- content: html`<or-mwc-input ${ref(updateBtnRef)} disabled .type="${InputType.BUTTON}" label="update"></or-mwc-input>`+ content: html`+ <or-vaadin-button ${ref(updateBtnRef)} disabled>+ <or-translate value="update"></or-translate>+ </or-vaadin-button>+ `}]).setHeading(title)diff --git a/ui/component/or-log-viewer/package.json b/ui/component/or-log-viewer/package.jsonindex 1aad482dd..37e49717c 100644--- a/ui/component/or-log-viewer/package.json+++ b/ui/component/or-log-viewer/package.json@@ -28,6 +28,7 @@"@openremote/or-components": "workspace:*","@openremote/or-mwc-components": "workspace:*","@openremote/or-translate": "workspace:*",+ "@openremote/or-vaadin-components": "workspace:*","axios": "1.16.1","http-link-header": "^1.1.3","lit": "^3.3.1",diff --git a/ui/component/or-log-viewer/src/index.ts b/ui/component/or-log-viewer/src/index.tsindex f22c0feef..d0d4f28ea 100644--- a/ui/component/or-log-viewer/src/index.ts+++ b/ui/component/or-log-viewer/src/index.ts@@ -9,19 +9,22 @@ import {import {customElement, property, query} from "lit/decorators.js";import {i18next, translate} from "@openremote/or-translate"import * as Model from "@openremote/model";-import manager, {DefaultColor2, DefaultColor3, DefaultColor4, DefaultColor5, Util} from "@openremote/core";+import manager, {DefaultColor2, DefaultColor3, Util} from "@openremote/core";import "@openremote/or-mwc-components/or-mwc-input";import "@openremote/or-components/or-panel";import "@openremote/or-translate";-import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import {MDCDataTable} from "@material/data-table";import moment from "moment";import "@openremote/or-mwc-components/or-mwc-menu";-import {getContentWithMenuTemplate} from "@openremote/or-mwc-components/or-mwc-menu";-import {ListItem} from "@openremote/or-mwc-components/or-mwc-list";import type { GenericAxiosResponse } from "axios";import {showSnackbar} from "@openremote/or-mwc-components/or-mwc-snackbar";+import {OrVaadinSelect} from "@openremote/or-vaadin-components/or-vaadin-select";+import {OrVaadinMultiSelectComboBox} from "@openremote/or-vaadin-components/or-vaadin-multi-select-combo-box";+import {OrVaadinDateTimePicker} from "@openremote/or-vaadin-components/or-vaadin-date-time-picker";+import {OrVaadinCheckbox} from "@openremote/or-vaadin-components/or-vaadin-checkbox";import { when } from "lit/directives/when.js";+import {DatapointInterval, SyslogLevel} from "@openremote/model";+import { ifDefined } from "lit/directives/if-defined.js";import { parse } from "http-link-header";// TODO: Add webpack/rollup to build so consumers aren't forced to use the same tooling@@ -63,7 +66,7 @@ const style = css`height: 100%;width: 100%;justify-content: center;- align-items: center;+ align-items: baseline;text-align: center;}@@ -76,6 +79,7 @@ const style = css`display: flex;flex-wrap: wrap;justify-content: space-between;+ align-items: baseline;margin: var(--internal-or-log-viewer-controls-margin);padding: 0 20px 20px 20px;}@@ -86,35 +90,20 @@ const style = css`#time-controls {display: flex;- align-items: center;+ align-items: baseline;}#live-button {margin-right: 40px;}-/* min-width of selects is 200px somehow- #period-select {- width: 90px;- }-- #level-select {- width: 120px;- }-- #limit-select {- width: 80px;- }-*/-#log-controls, #ending-controls, #page-controls {display: flex;max-width: 100%;- align-items: center;+ align-items: baseline;}#ending-controls {- float: right;margin: 0 10px;}@@ -149,14 +138,6 @@ const style = css`word-wrap: break-word;white-space: pre-wrap;}-- .copy-button {- --or-mwc-input-color: var(--or-app-color5, ${unsafeCSS(DefaultColor5)});- }-- .copy-button:hover {- --or-mwc-input-color: var(--or-app-color4, ${unsafeCSS(DefaultColor4)});- }`;@customElement("or-log-viewer")@@ -211,7 +192,6 @@ export class OrLogViewer extends translate(i18next)(LitElement) {protected _refresh?: number;protected _pageCount?: number;protected _currentPage: number = 1;- protected _pendingCategories?: Model.SyslogCategory[];connectedCallback() {super.connectedCallback();@@ -289,35 +269,81 @@ export class OrLogViewer extends translate(i18next)(LitElement) {const hideFilter = this.config && this.config.hideFilter;const hideLevel = this.config && this.config.hideLevel;+ const categoryItems = this._getCategoryMenuItems();+ const selectedItems = categoryItems.filter(i => this.categories?.includes(i.value));+return html`<div id="container"><div id="controls"><div id="log-controls">- ${hideCategories ? `` : getContentWithMenuTemplate(- html`<or-mwc-input .type=${InputType.BUTTON} raised ?disabled="${disabled}" .label="${i18next.t("categories")}" icontrailing="chevron-down"></or-mwc-input>`,- this._getCategoryMenuItems(),- this.categories,- (v) => this._onCategoriesChanged(v as Model.SyslogCategory[]),- () => this._onCategoriesClosed(),- true- )}- <or-mwc-input ?hidden="${hideFilter}" .type="${InputType.TEXT}" outlined ?disabled="${disabled}" icontrailing="magnify" .label="${i18next.t("subCategoryFilters")}" .value="${this.filter}" @or-mwc-input-changed="${(evt: OrInputChangedEvent) => this._onFilterChanged(evt.detail.value)}"></or-mwc-input>- <or-mwc-input ?hidden="${hideLevel}" .type="${InputType.SELECT}" id="level-select" ?disabled="${disabled}" .label="${i18next.t("level")}" @or-mwc-input-changed="${(evt: OrInputChangedEvent) => this._onLevelChanged(evt.detail.value)}" .value="${this.level}" .options="${this._getLevelOptions()}"></or-mwc-input>- <or-mwc-input .type="${ InputType.SELECT}" id="limit-select" ?disabled="${disabled}" .label="${i18next.t("limit")}" @or-mwc-input-changed="${(evt: OrInputChangedEvent) => this._onLimitChanged(evt.detail.value)}" .value="${"" + this.getLimit()}" .options="${this._getLimitOptions()}"></or-mwc-input>+ ${when(!hideCategories, () => html`+ <or-vaadin-multi-select-combo-box .items=${categoryItems} .selectedItems=${selectedItems} style="width: 240px;"+ @change=${(ev: Event) => {+ const elem = ev.currentTarget as OrVaadinMultiSelectComboBox;+ this._onCategoriesChanged(elem.selectedItems.map(i => i.value));+ }}>+ <or-translate slot="label" value="categories"></or-translate>+ </or-vaadin-multi-select-combo-box>+ `)}+ <!-- Filter by subcategory string -->+ <or-vaadin-text-field id="subcategory-field" ?hidden=${hideFilter} ?disabled=${disabled} value=${this.filter} style="width: 200px;"+ @change=${(ev: Event) => this._onFilterChanged(ev)}>+ <or-translate slot="label" value="subCategoryFilters"></or-translate>+ <or-icon slot="suffix" icon="magnify"></or-icon>+ </or-vaadin-text-field>++ <!-- Filter by log level -->+ <or-vaadin-select id="level-select" ?hidden=${hideLevel} ?disabled=${disabled} value=${this.level} .items=${this._getLevelOptions()} style="width: 120px;"+ @change=${(ev: Event) => this._onLevelChanged((ev.currentTarget as OrVaadinSelect).value as SyslogLevel)}>+ <or-translate slot="label" value="level"></or-translate>+ </or-vaadin-select>++ <!-- Limit select -->+ <or-vaadin-select id="limit-select" ?disabled=${disabled} value=${this.getLimit().toString()} .items=${this._getLimitOptions()} style="width: 80px;"+ @change=${(ev: Event) => this._onLimitChanged((ev.currentTarget as OrVaadinSelect).value)}>+ <or-translate slot="label" value="limit"></or-translate>+ </or-vaadin-select></div>+<div id="page-controls" ?hidden="${isLive || !this._pageCount || !this._data || this._data.length === 0}">- <or-mwc-input class="button" .type="${InputType.BUTTON}" ?disabled="${disabled || isLive || this._currentPage === 1}" icon="chevron-left" @or-mwc-input-changed="${() => this._updatePage(false)}"></or-mwc-input>+ <or-vaadin-button theme="icon" ?disabled=${disabled || isLive || this._currentPage === 1}+ @click=${() => this._updatePage(false)}>+ <or-icon icon="chevron-left"></or-icon>+ </or-vaadin-button><span>${this._currentPage}</span><or-translate value="of"></or-translate><span>${this._pageCount}</span>- <or-mwc-input class="button" .type="${InputType.BUTTON}" ?disabled="${disabled || isLive || this._currentPage === this._pageCount || (this._data && this._data.length < this.getLimit())}" icon="chevron-right" @or-mwc-input-changed="${() => this._updatePage(true)}"></or-mwc-input>+ <or-vaadin-button theme="icon" ?disabled=${disabled || isLive || this._currentPage === this._pageCount || (this._data && this._data.length < this.getLimit())}+ @click=${() => this._updatePage(true)}>+ <or-icon icon="chevron-right"></or-icon>+ </or-vaadin-button></div>+<div id="time-controls">- <or-mwc-input id="live-button" .type="${InputType.CHECKBOX}" ?disabled="${disabled}" .label="${i18next.t("live")}" @or-mwc-input-changed="${(evt: OrInputChangedEvent) => this._onLiveChanged(evt.detail.value)}" .value="${this.live}"></or-mwc-input>- <or-mwc-input .type="${InputType.SELECT}" id="period-select" ?disabled="${disabled || isLive}" .label="${i18next.t("period")}" @or-mwc-input-changed="${(evt: OrInputChangedEvent) => this.interval = evt.detail.value}" .value="${this.interval}" .options="${this._getIntervalOptions()}"></or-mwc-input>+ <!-- Live logging on/off toggle -->+ <or-vaadin-checkbox id="live-button" ?disabled=${disabled} ?checked=${this.live}+ @change=${(ev: Event) => this._onLiveChanged((ev.currentTarget as OrVaadinCheckbox).checked)}>+ <label slot="label"><or-translate value="live"></or-translate></label>+ </or-vaadin-checkbox>+ <!-- Period select -->+ <or-vaadin-select id="period-select" ?disabled=${disabled || isLive} value=${this.interval} .items=${this._getIntervalOptions()} style="min-width: 120px;"+ @change=${(ev: Event) => this.interval = (ev.currentTarget as OrVaadinSelect).value as DatapointInterval}>+ <or-translate slot="label" value="period"></or-translate>+ </or-vaadin-select>+<div id="ending-controls">- <or-mwc-input class="button" .type="${InputType.BUTTON}" ?disabled="${disabled || isLive}" icon="chevron-left" @or-mwc-input-changed="${() => this.timestamp = this._calculateTimestamp(this.timestamp!, false)}"></or-mwc-input>- <or-mwc-input id="ending-date" .type="${InputType.DATETIME}" ?disabled="${disabled || isLive}" label="${i18next.t("ending")}" .value="${this.timestamp}" @or-mwc-input-changed="${(evt: OrInputChangedEvent) => this.timestamp = this._calculateTimestamp(moment(evt.detail.value as string).toDate())}"></or-mwc-input>- <or-mwc-input class="button" .type="${InputType.BUTTON}" ?disabled="${disabled || isLive}" icon="chevron-right" @or-mwc-input-changed="${() => this.timestamp = this._calculateTimestamp(this.timestamp!, true)}"></or-mwc-input>- <or-mwc-input class="button" .type="${InputType.BUTTON}" ?disabled="${disabled || isLive}" icon="chevron-double-right" @or-mwc-input-changed="${() => this.timestamp = this._calculateTimestamp(new Date())}"></or-mwc-input>+ <or-vaadin-button theme="icon" ?disabled=${disabled || isLive} @click=${() => this.timestamp = this._calculateTimestamp(this.timestamp!, false)}>+ <or-icon icon="chevron-left"></or-icon>+ </or-vaadin-button>+ <or-vaadin-date-time-picker id="ending-date" ?disabled=${disabled || isLive} style="width: 280px; align-items: end;"+ value=${ifDefined(OrVaadinDateTimePicker.getLocalizedISOString(this.timestamp))}+ @change=${(ev: CustomEvent) => this.timestamp = this._calculateTimestamp(moment((ev.currentTarget as OrVaadinDateTimePicker).value).toDate())}>+ <or-translate slot="label" value="ending"></or-translate>+ </or-vaadin-date-time-picker>+ <or-vaadin-button theme="icon" ?disabled=${disabled || isLive}@click=${() => this.timestamp = this._calculateTimestamp(this.timestamp!, true)}>+ <or-icon icon="chevron-right"></or-icon>+ </or-vaadin-button>+ <or-vaadin-button theme="icon" ?disabled=${disabled || isLive} @click=${() => this.timestamp = this._calculateTimestamp(new Date())}>+ <or-icon icon="chevron-double-right"></or-icon>+ </or-vaadin-button></div></div></div>@@ -330,22 +356,20 @@ export class OrLogViewer extends translate(i18next)(LitElement) {`;}- protected _getLimitOptions() {- return ["25", "50", "100", "200"];+ protected _getLimitOptions(): {value: any, label: string}[] {+ return ["25", "50", "100", "200"].map(o => ({value: o, label: o}));}- protected _getLevelOptions() {- return Object.keys((Model as any)["SyslogLevel"]).map((key) => [key, i18next.t(key.toLocaleLowerCase())]);+ protected _getLevelOptions(): {value: any, label: string}[] {+ return Object.keys((Model as any)["SyslogLevel"]).map(key => ({value: key, label: i18next.t(key.toLocaleLowerCase())}));}- protected _getCategoryMenuItems(): ListItem[] {+ protected _getCategoryMenuItems(): {value: any, label: string}[] {const categories = this.config && this.config.allowedCategories ? this.config.allowedCategories : Object.keys((Model as any)["SyslogCategory"]) as Model.SyslogCategory[];- return categories.map((cat) => {- return {- text: i18next.t("logCategory." + cat, {defaultValue: Util.capitaliseFirstLetter(cat.toLowerCase().replace(/_/g, " "))}),- value: cat- } as ListItem;- });+ return categories.map(cat => ({+ value: cat,+ label: i18next.t("logCategory." + cat, {defaultValue: Util.capitaliseFirstLetter(cat.toLowerCase().replace(/_/g, " "))})+ }));}protected getLimit() {@@ -353,21 +377,10 @@ export class OrLogViewer extends translate(i18next)(LitElement) {}protected _onCategoriesChanged(values: Model.SyslogCategory[]) {- this._pendingCategories = values;- }-- protected _onCategoriesClosed() {- if (!this._pendingCategories) {- return;- }-- this.categories = [...this._pendingCategories];-+ this.categories = values;if (this.categories && this.live) {this._data = this._data!.filter((e) => this.categories!.find((c) => c === e.category));}-- this._pendingCategories = undefined;}protected _onLiveChanged(live: boolean) {@@ -393,8 +406,12 @@ export class OrLogViewer extends translate(i18next)(LitElement) {}}- protected _onFilterChanged(filter: string) {- this.filter = filter;+ protected _onFilterChanged(ev: Event) {+ const elem = ev.currentTarget as HTMLInputElement;+ if(!elem.checkValidity()) {+ return;+ }+ this.filter = elem.value;if (!this.filter) {return;@@ -443,7 +460,9 @@ export class OrLogViewer extends translate(i18next)(LitElement) {<td class="mdc-data-table__cell">${ev.message}</td><td class="mdc-data-table__cell icon-cell">${when(window.isSecureContext, () => html`- <or-mwc-input type="${InputType.BUTTON}" class="copy-button" icon="content-copy" @or-mwc-input-changed=${() => this._copyRow(ev)}></or-mwc-input>+ <or-vaadin-button class="copy-button" theme="icon" @click=${() => this._copyRow(ev)}>+ <or-icon icon="content-copy"></or-icon>+ </or-vaadin-button>`)}</td></tr>@@ -466,7 +485,7 @@ export class OrLogViewer extends translate(i18next)(LitElement) {}}- protected _getIntervalOptions(): [string, string][] {+ protected _getIntervalOptions(): {value: string, label: string}[] {return [Model.DatapointInterval.HOUR,Model.DatapointInterval.DAY,@@ -474,7 +493,7 @@ export class OrLogViewer extends translate(i18next)(LitElement) {Model.DatapointInterval.MONTH,Model.DatapointInterval.YEAR].map((interval) => {- return [interval, i18next.t(interval.toLowerCase())];+ return ({value: interval, label: i18next.t(interval.toLowerCase())});});}diff --git a/ui/component/or-map/package.json b/ui/component/or-map/package.jsonindex be2acf79e..e252f31f7 100644--- a/ui/component/or-map/package.json+++ b/ui/component/or-map/package.json@@ -29,6 +29,7 @@"@openremote/or-icon": "workspace:*","@openremote/or-mwc-components": "workspace:*","@openremote/or-translate": "workspace:*",+ "@openremote/or-vaadin-components": "workspace:*","lit": "^3.3.1","lit-html": "^3.3.1","lodash.debounce": "^4.0.8",diff --git a/ui/component/or-map/src/index.ts b/ui/component/or-map/src/index.tsindex b508b9f30..abebdd017 100644--- a/ui/component/or-map/src/index.ts+++ b/ui/component/or-map/src/index.ts@@ -5,6 +5,7 @@ import {IControl, LngLat, LngLatLike, GeolocateControl} from "maplibre-gl";import {style} from "./style";import "./markers/or-map-marker";import "./markers/or-map-marker-asset";+import "@openremote/or-vaadin-components/or-vaadin-text-field"import {OrMapMarker, OrMapMarkerChangedEvent} from "./markers/or-map-marker";import * as Util from "./util";import {@@ -20,6 +21,7 @@ import { AttributeEvent, GeoJsonConfig } from "@openremote/model";import { CoordinatesControl, CoordinatesRegexPattern, getCoordinatesInputKeyHandler } from "./controls/coordinates";import { AssetMap } from "./asset-map";import { CenterControl } from "./controls/center";+import { ifDefined } from "lit-html/directives/if-defined.js";import type { AssetWithLocation, ClusterConfig, ControlPosition, MapEventDetail, MapGeocoderEventDetail } from "./types";// Re-exports@@ -260,10 +262,16 @@ export const geoJsonPointInputTemplateProvider: ValueInputProviderGenerator = (a}</style><div id="geo-json-point-input-compact-wrapper">- <div style="display: flex">+ <or-vaadin-text-field style="width: auto;" value=${ifDefined(centerStr)} pattern=${CoordinatesRegexPattern}+ @keyup="${(e: KeyboardEvent) => getCoordinatesInputKeyHandler(valueChangeHandler)(e)}">+ </or-vaadin-text-field>+ <or-vaadin-button theme="icon" @click=${onClick}>+ <or-icon icon="crosshairs-gps"></or-icon>+ </or-vaadin-button>+ <!--<div style="display: flex"><or-mwc-input .comfortable="${comfortable}" .type="${InputType.TEXT}" .value="${centerStr}" .pattern="${CoordinatesRegexPattern}" @keyup="${(e: KeyboardEvent) => getCoordinatesInputKeyHandler(valueChangeHandler)(e)}"></or-mwc-input><or-mwc-input style="width: unset" .type="${InputType.BUTTON}" compact icon="crosshairs-gps" @or-mwc-input-changed="${onClick}"></or-mwc-input>- </div>+ </div>--></div>`;}diff --git a/ui/component/or-map/src/or-map-asset-card.ts b/ui/component/or-map/src/or-map-asset-card.tsindex 40a71385d..c252a8d5b 100644--- a/ui/component/or-map/src/or-map-asset-card.ts+++ b/ui/component/or-map/src/or-map-asset-card.ts@@ -1,10 +1,4 @@-import {- CSSResultGroup,- html,- LitElement,- PropertyValues,- TemplateResult-} from "lit";+import {CSSResultGroup, html, LitElement, PropertyValues, TemplateResult} from "lit";import {customElement, property} from "lit/decorators.js";import { classMap } from 'lit-html/directives/class-map.js';import {@@ -20,7 +14,6 @@ import {import manager, {subscribe, Util} from "@openremote/core";import "@openremote/or-icon";import {mapAssetCardStyle} from "./style";-import { InputType } from "@openremote/or-mwc-components/or-mwc-input";import { getMarkerIconAndColorFromAssetType } from "./util";import {getMarkerConfigAttributeName, MapMarkerAssetConfig} from "./markers/or-map-marker-asset";@@ -177,7 +170,10 @@ export class OrMapAssetCard extends subscribe(manager)(LitElement) {</div>${cardConfig && cardConfig.hideViewAsset ? html`` : html`<div id="footer">- <or-mwc-input .type="${InputType.BUTTON}" label="viewAsset" @or-mwc-input-changed="${(e: MouseEvent) => {e.preventDefault(); this._loadAsset(this.asset!.id!);}}"></or-mwc-input>+ <or-vaadin-button style="--lumo-primary-text-color: var(--internal-or-map-asset-card-header-color);"+ @click=${() => this._loadAsset(this.asset!.id!)}>+ <or-translate value="viewAsset"></or-translate>+ </or-vaadin-button></div>`}</div>diff --git a/ui/component/or-map/tsconfig.json b/ui/component/or-map/tsconfig.jsonindex 104c7eef3..e9bfba522 100644--- a/ui/component/or-map/tsconfig.json+++ b/ui/component/or-map/tsconfig.json@@ -14,6 +14,7 @@{ "path": "../model" },{ "path": "../or-translate" },{ "path": "../or-mwc-components" },- { "path": "../or-icon" }+ { "path": "../or-icon" },+ { "path": "../or-vaadin-components" }]}diff --git a/ui/component/or-mwc-components/src/or-mwc-dialog.ts b/ui/component/or-mwc-components/src/or-mwc-dialog.tsindex 4bc99f7b7..3a91921b6 100644--- a/ui/component/or-mwc-components/src/or-mwc-dialog.ts+++ b/ui/component/or-mwc-components/src/or-mwc-dialog.ts@@ -157,6 +157,7 @@ const style = css`}.dialog-container {+ font-family: inherit; /* Disables Material UI font family, and prioritizes our own */display: flex;flex-direction: row;}diff --git a/ui/component/or-mwc-components/src/or-mwc-input.ts b/ui/component/or-mwc-components/src/or-mwc-input.tsindex d672231a4..4fd2bf76a 100644--- a/ui/component/or-mwc-components/src/or-mwc-input.ts+++ b/ui/component/or-mwc-components/src/or-mwc-input.ts@@ -1,6 +1,5 @@import {css, html, LitElement, PropertyValues, TemplateResult, unsafeCSS} from "lit";import {customElement, property, state} from "lit/decorators.js";-import {Ref, ref, createRef} from "lit/directives/ref.js";import {classMap} from "lit/directives/class-map.js";import {ifDefined} from "lit/directives/if-defined.js";import {when} from 'lit/directives/when.js';@@ -20,36 +19,23 @@ import {DefaultColor4, DefaultColor5, DefaultColor8, Util} from "@openremote/corimport "@openremote/or-icon";import {OrIcon} from "@openremote/or-icon";import {- AssetDescriptor,- Attribute,- AttributeDescriptor,- MetaHolder,- NameHolder,- NameValueHolder,- ValueConstraint,+ Attribute, AttributeDescriptor,+ MetaHolder, NameValueHolder,ValueConstraintAllowedValues,ValueConstraintFuture,- ValueConstraintFutureOrPresent,- ValueConstraintMax,- ValueConstraintMin,+ ValueConstraintFutureOrPresent, ValueConstraintMax, ValueConstraintMin,ValueConstraintNotBlank,ValueConstraintNotEmpty,- ValueConstraintNotNull,- ValueConstraintPast,- ValueConstraintPastOrPresent,- ValueConstraintPattern,+ ValueConstraintNotNull, ValueConstraintPast, ValueConstraintPastOrPresent, ValueConstraintPattern,ValueConstraintSize,- ValueDescriptor,- ValueDescriptorHolder,- ValueFormat,- ValueFormatStyleRepresentation,- ValueHolder,- WellknownMetaItems,- WellknownValueTypes+ ValueFormatStyleRepresentation, WellknownMetaItems, WellknownValueTypes} from "@openremote/model";+import type {AssetDescriptor, NameHolder,+ ValueConstraint, ValueDescriptor, ValueDescriptorHolder, ValueFormat, ValueHolder} from "@openremote/model";import {getItemTemplate, getListTemplate, ListItem, ListType} from "./or-mwc-list";import { i18next } from "@openremote/or-translate";-import { styleMap } from "lit/directives/style-map.js";+import {styleMap} from "lit/directives/style-map.js";+import {createRef, Ref, ref} from "lit/directives/ref.js";// TODO: Add webpack/rollup to build so consumers aren't forced to use the same toolingconst buttonStyle = require("@material/button/dist/mdc.button.css");@@ -69,6 +55,7 @@ const menuSurfaceStyle = require("@material/menu-surface/dist/mdc.menu-surface.cconst menuStyle = require("@material/menu/dist/mdc.menu.css");const sliderStyle = require("@material/slider/dist/mdc.slider.css");+/** @deprecated Please use `or-vaadin-input` instead. */export class OrInputChangedEvent extends CustomEvent<OrInputChangedEventDetail> {public static readonly NAME = "or-mwc-input-changed";@@ -86,6 +73,7 @@ export class OrInputChangedEvent extends CustomEvent<OrInputChangedEventDetail>}}+/** @deprecated Please use `or-vaadin-input` instead. */export interface OrInputChangedEventDetail {value?: any;previousValue?: any;@@ -98,6 +86,7 @@ declare global {}}+/** @deprecated Please use `or-vaadin-input` instead. */export enum InputType {BUTTON = "button",BUTTON_TOGGLE = "button-toggle",@@ -131,6 +120,7 @@ export enum InputType {DURATION_PERIOD = "duration-period"}+/** @deprecated Please use `or-vaadin-input` instead. */export interface ValueInputProviderOptions {label?: string;required?: boolean;@@ -144,6 +134,7 @@ export interface ValueInputProviderOptions {inputType?: InputType;}+/** @deprecated Please use `or-vaadin-input` instead. */export interface ValueInputProvider {templateFunction: ValueInputTemplateFunction;supportsHelperText: boolean;@@ -152,8 +143,10 @@ export interface ValueInputProvider {validator?: () => boolean;}+/** @deprecated Please use `or-vaadin-input` instead. */export type ValueInputTemplateFunction = ((value: any, focused: boolean, loading: boolean, sending: boolean, error: boolean, helperText: string | undefined) => TemplateResult | PromiseLike<TemplateResult>) | undefined;+/** @deprecated Please use `or-vaadin-input` instead */export type ValueInputProviderGenerator = (assetDescriptor: AssetDescriptor | string, valueHolder: NameHolder & ValueHolder<any> | undefined, valueHolderDescriptor: ValueDescriptorHolder | undefined, valueDescriptor: ValueDescriptor, valueChangeNotifier: (value: OrInputChangedEventDetail & { errors?: boolean } | undefined) => void, options: ValueInputProviderOptions) => ValueInputProvider;function inputTypeSupportsButton(inputType: InputType): boolean {@@ -214,263 +207,6 @@ export const SUPPORTED_WELLKNOWN_VALUE_TYPES = [export type SupportedWellknownValueTypes = typeof SUPPORTED_WELLKNOWN_VALUE_TYPES[number];-export const getValueHolderInputTemplateProvider: ValueInputProviderGenerator = (assetDescriptor, valueHolder, valueHolderDescriptor, valueDescriptor, valueChangeNotifier, options) => {-- let inputType: InputType | undefined = options.inputType;- let step: number | undefined;- let pattern: string | undefined;- let min: any;- let max: any;- let multiple: any;- let required: boolean | undefined;- let selectOptions: [string, string][] | undefined;- let valueConverter: (v: any) => any | undefined;- const styles = {} as any;-- const assetType = typeof assetDescriptor === "string" ? assetDescriptor : assetDescriptor.name;- const constraints: ValueConstraint[] = (valueHolder && ((valueHolder as MetaHolder).meta) || (valueDescriptor && (valueDescriptor as MetaHolder).meta) ? Util.getAttributeValueConstraints(valueHolder as Attribute<any>, valueHolderDescriptor as AttributeDescriptor, assetType) : Util.getMetaValueConstraints(valueHolder as NameValueHolder<any>, valueHolderDescriptor as AttributeDescriptor, assetType)) || [];- const format: ValueFormat | undefined = (valueHolder && ((valueHolder as MetaHolder).meta) || (valueDescriptor && (valueDescriptor as MetaHolder).meta) ? Util.getAttributeValueFormat(valueHolder as Attribute<any>, valueHolderDescriptor as AttributeDescriptor, assetType) : Util.getMetaValueFormat(valueHolder as Attribute<any>, valueHolderDescriptor as AttributeDescriptor, assetType));-- // Enforces which value types are supported making SUPPORTED_WELLKNOWN_VALUE_TYPES the single source of truth through type checking- let _exhaustiveTypeCheck: never- const valueType = valueDescriptor.name as SupportedWellknownValueTypes;-- // Determine input type- if (!inputType) {- switch (valueType) {- case WellknownValueTypes.TEXT:- case WellknownValueTypes.EMAIL:- case WellknownValueTypes.UUID:- case WellknownValueTypes.ASSETID:- case WellknownValueTypes.HOSTORIPADDRESS:- case WellknownValueTypes.IPADDRESS:- inputType = Util.getMetaValue(WellknownMetaItems.MULTILINE, valueHolder, valueHolderDescriptor) === true ? InputType.TEXTAREA : InputType.TEXT;- break;- case WellknownValueTypes.BOOLEAN:- if (format && format.asNumber) {- inputType = InputType.NUMBER;- step = 1;- min = 0;- max = 1;- valueConverter = (v) => !!v;- break;- }- if (format && (format.asOnOff || format.asOpenClosed)) {- inputType = InputType.SWITCH;- } else {- inputType = InputType.CHECKBOX;- }-- if (format && format.asMomentary || (Util.getMetaValue(WellknownMetaItems.MOMENTARY, valueHolder, valueHolderDescriptor) === true) ) {- inputType = InputType.BUTTON_MOMENTARY;- }- break;- case WellknownValueTypes.BIGNUMBER:- case WellknownValueTypes.NUMBER:- case WellknownValueTypes.POSITIVEINTEGER:- case WellknownValueTypes.POSITIVENUMBER:- case WellknownValueTypes.LONG:- case WellknownValueTypes.INTEGER:- case WellknownValueTypes.BYTE:- case WellknownValueTypes.INTEGERBYTE:- case WellknownValueTypes.DIRECTION:- case WellknownValueTypes.TCPIPPORTNUMBER:- if (valueDescriptor.name === WellknownValueTypes.BYTE || valueDescriptor.name === WellknownValueTypes.INTEGERBYTE) {- min = 0;- max = 255;- step = 1;- } else if (valueDescriptor.name === WellknownValueTypes.INTEGER || valueDescriptor.name === WellknownValueTypes.LONG) {- step = 1;- }- if (format && format.asDate) {- inputType = InputType.DATETIME;- } else if (format && format.asBoolean) {- inputType = InputType.CHECKBOX;- valueConverter = (v) => v ? 1 : 0;- } else if (format && format.asSlider) {- inputType = InputType.RANGE;- } else {- inputType = InputType.NUMBER;- }- break;- case WellknownValueTypes.BIGINTEGER:- inputType = InputType.BIG_INT;- step = 1;- break;- case WellknownValueTypes.COLOURRGB:- inputType = InputType.COLOUR;- break;- case WellknownValueTypes.DATEANDTIME:- case WellknownValueTypes.TIMESTAMP:- case WellknownValueTypes.TIMESTAMPISO8601:- inputType = InputType.DATETIME;- break;- case WellknownValueTypes.CRONEXPRESSION:- inputType = InputType.CRON;- break;- case WellknownValueTypes.TIMEDURATIONISO8601:- inputType = InputType.DURATION_TIME;- break;- case WellknownValueTypes.PERIODDURATIONISO8601:- inputType = InputType.DURATION_PERIOD;- break;- case WellknownValueTypes.TIMEANDPERIODDURATIONISO8601:- inputType = InputType.DURATION;- break;- case WellknownValueTypes.JSONOBJECT:- inputType = InputType.JSON_OBJECT;- break;- default: _exhaustiveTypeCheck = valueType;- }-- if (valueDescriptor.arrayDimensions && valueDescriptor.arrayDimensions > 0) {- inputType = InputType.JSON;- }- }-- if (!inputType) {- switch (valueDescriptor.jsonType) {- case "number":- case "bigint":- inputType = InputType.NUMBER;- break;- case "boolean":- inputType = InputType.CHECKBOX;- break;- case "string":- inputType = InputType.TEXT;- break;- case "date":- inputType = InputType.DATETIME;- break;- }- }-- if (!inputType) {- inputType = InputType.JSON;- }-- // Apply any constraints- const sizeConstraint = constraints && constraints.find(c => c.type === "size") as ValueConstraintSize;- const patternConstraint = constraints && constraints.find(c => c.type === "pattern") as ValueConstraintPattern;- const minConstraint = constraints && constraints.find(c => c.type === "min") as ValueConstraintMin;- const maxConstraint = constraints && constraints.find(c => c.type === "max") as ValueConstraintMax;- const allowedValuesConstraint = constraints && constraints.find(c => c.type === "allowedValues") as ValueConstraintAllowedValues;- const pastConstraint = constraints && constraints.find(c => c.type === "past") as ValueConstraintPast;- const pastOrPresentConstraint = constraints && constraints.find(c => c.type === "pastOrPresent") as ValueConstraintPastOrPresent;- const futureConstraint = constraints && constraints.find(c => c.type === "future") as ValueConstraintFuture;- const futureOrPresentConstraint = constraints && constraints.find(c => c.type === "futureOrPresent") as ValueConstraintFutureOrPresent;- const notEmptyConstraint = constraints && constraints.find(c => c.type === "notEmpty") as ValueConstraintNotEmpty;- const notBlankConstraint = constraints && constraints.find(c => c.type === "notBlank") as ValueConstraintNotBlank;- const notNullConstraint = constraints && constraints.find(c => c.type === "notNull") as ValueConstraintNotNull;-- if (sizeConstraint) {- min = sizeConstraint.min;- max = sizeConstraint.max;- }- if (sizeConstraint) {- min = sizeConstraint.min;- max = sizeConstraint.max;- }- if (minConstraint) {- min = minConstraint.min;- }- if (maxConstraint) {- max = maxConstraint.max;- }- if (patternConstraint) {- pattern = patternConstraint.regexp;- }- if (notNullConstraint) {- required = true;- }- if (notBlankConstraint && !pattern) {- pattern = "\\S+";- } else if (notEmptyConstraint && !pattern) {- pattern = ".+";- }- if (allowedValuesConstraint && allowedValuesConstraint.allowedValues) {- const allowedLabels = allowedValuesConstraint.allowedValueNames && allowedValuesConstraint.allowedValueNames.length === allowedValuesConstraint.allowedValues.length ? allowedValuesConstraint.allowedValueNames : undefined;- selectOptions = allowedValuesConstraint.allowedValues.map((v, i) => {- let label = allowedLabels ? allowedLabels[i] : "" + v;- label = Util.getAllowedValueLabel(label)!;- return [v, label || "" + v];- });- inputType = InputType.SELECT;-- if (valueDescriptor.arrayDimensions && valueDescriptor.arrayDimensions > 0) {- multiple = true;- }- }-- if (inputType === InputType.DATETIME) {- if (pastConstraint || pastOrPresentConstraint) {- min = undefined;- max = new Date();- } else if (futureConstraint || futureOrPresentConstraint) {- min = new Date();- max = undefined;- }-- // Refine the input type based on formatting- if (format) {- if (format.timeStyle && !format.dateStyle) {- inputType = InputType.TIME;- } else if (format.dateStyle && !format.timeStyle) {- inputType = InputType.DATE;- }- }- }-- if (inputType === InputType.NUMBER && format && format.resolution) {- step = format.resolution;- }-- if (inputType === InputType.COLOUR) {- styles.marginLeft = "24px"- }-- const supportsHelperText = inputTypeSupportsHelperText(inputType);- const supportsLabel = inputTypeSupportsLabel(inputType);- const supportsSendButton = inputTypeSupportsButton(inputType);- const readonly = options.readonly;- required = required || options.required;- const comfortable = options.comfortable;- const resizeVertical = options.resizeVertical;- const inputRef: Ref<OrMwcInput> = createRef();-- const templateFunction: ValueInputTemplateFunction = (value, focused, loading, sending, error, helperText) => {-- const disabled = options.disabled || loading || sending;- const label = supportsLabel ? options.label : undefined;-- return html`<or-mwc-input ${ref(inputRef)} id="input" style="${styleMap(styles)}" .type="${inputType}" .label="${label}" .value="${value}" .pattern="${pattern}"- .min="${min}" .max="${max}" .format="${format}" .focused="${focused}" .required="${required}" .multiple="${multiple}"- .options="${selectOptions}" .comfortable="${comfortable}" .readonly="${readonly}" .disabled="${disabled}" .step="${step}"- .helperText="${helperText}" .helperPersistent="${true}" .resizeVertical="${resizeVertical}"- .rounded="${options.rounded}"- .outlined="${options.outlined}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- e.stopPropagation();- e.detail.value = valueConverter ? valueConverter(e.detail.value) : e.detail.value;- valueChangeNotifier(e.detail);- }}"></or-mwc-input>`- };-- return {- templateFunction: templateFunction,- supportsHelperText: supportsHelperText,- supportsSendButton: supportsSendButton,- supportsLabel: supportsLabel,- validator: () => {- if (!inputRef.value) {- return false;- }- return inputRef.value.checkValidity();- }- };-}-// language=CSSconst style = css`@@ -675,6 +411,9 @@ const style = css`}`;+/**+ * @deprecated Not actively maintained anymore. We're slowly migrating towards `or-vaadin-input` instead.+ */@customElement("or-mwc-input")export class OrMwcInput extends LitElement {diff --git a/ui/component/or-mwc-components/test/or-mwc-input.test.ts b/ui/component/or-mwc-components/test/or-mwc-input.test.tsindex 5f40e3359..9fcbbfcf9 100644--- a/ui/component/or-mwc-components/test/or-mwc-input.test.ts+++ b/ui/component/or-mwc-components/test/or-mwc-input.test.ts@@ -28,7 +28,7 @@ ct("Switch should switch", async ({ mount }) => {});const locator = component.getByRole("switch", { name: "switch" });await expect(locator).not.toBeChecked();- await component.click();+ await component.getByText("switch").click();await expect(locator).toBeChecked();});diff --git a/ui/component/or-rules/package.json b/ui/component/or-rules/package.jsonindex 555f5d76e..4f7f25d79 100644--- a/ui/component/or-rules/package.json+++ b/ui/component/or-rules/package.json@@ -33,6 +33,7 @@"@openremote/or-scheduler": "workspace:*","@openremote/or-translate": "workspace:*","@openremote/or-tree-menu": "workspace:*",+ "@openremote/or-vaadin-components": "workspace:*","@openremote/rest": "workspace:*","ace-builds": "^1.41.0","iso-639-1": "^3.1.3",diff --git a/ui/component/or-rules/src/index.ts b/ui/component/or-rules/src/index.tsindex 069df146f..57510f2d8 100644--- a/ui/component/or-rules/src/index.ts+++ b/ui/component/or-rules/src/index.ts@@ -17,7 +17,7 @@* You should have received a copy of the GNU Affero General Public License* along with this program. If not, see <http://www.gnu.org/licenses/>.*/-import {css, html, LitElement, PropertyValues, TemplateResult, unsafeCSS} from "lit";+import {css, html, LitElement, TemplateResult, unsafeCSS} from "lit";import {customElement, property, query, state} from "lit/decorators.js";import manager, {DefaultBoxShadow,@@ -58,7 +58,7 @@ import "./or-rule-tree";import "./flow-viewer/flow-viewer";import {OrRuleViewer} from "./or-rule-viewer";import {RecurrenceOption} from "./json-viewer/or-rule-then-otherwise";-import {ValueInputProviderGenerator} from "@openremote/or-mwc-components/or-mwc-input";+import type {ValueInputProviderGenerator} from "@openremote/or-mwc-components/or-mwc-input";import {showOkCancelDialog} from "@openremote/or-mwc-components/or-mwc-dialog";import {showSnackbar} from "@openremote/or-mwc-components/or-mwc-snackbar";import {OrRuleTree, RuleTreeNode} from "./or-rule-tree";diff --git a/ui/component/or-rules/src/json-viewer/forms/or-rule-form-alarm.ts b/ui/component/or-rules/src/json-viewer/forms/or-rule-form-alarm.tsindex b26541877..5901e23fe 100644--- a/ui/component/or-rules/src/json-viewer/forms/or-rule-form-alarm.ts+++ b/ui/component/or-rules/src/json-viewer/forms/or-rule-form-alarm.ts@@ -20,7 +20,6 @@import {html, LitElement, css} from "lit";import {customElement, property} from "lit/decorators.js";import "@openremote/or-mwc-components/or-mwc-input";-import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import {RuleActionAlarm,Alarm,@@ -28,6 +27,7 @@ import {} from "@openremote/model";import { OrRulesJsonRuleChangedEvent } from "../or-rule-json-viewer";import {i18next} from "@openremote/or-translate";+import {OrVaadinSelect} from "@openremote/or-vaadin-components/or-vaadin-select";@customElement("or-rule-form-alarm")export class OrRuleFormAlarm extends LitElement {@@ -40,7 +40,10 @@ export class OrRuleFormAlarm extends LitElement {static get styles() {return css`- or-mwc-input {+ #form-container {+ display: flex;+ flex-direction: column;+ gap: 8px;margin-bottom: 20px;min-width: 420px;width: 100%;@@ -56,19 +59,24 @@ export class OrRuleFormAlarm extends LitElement {options.unshift({value: undefined, label: i18next.t("none")})return html`- <form style="display:grid">- <or-mwc-input value="${alarm && alarm.title ? alarm.title : ""}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.setActionAlarmName(e.detail.value, "title")}" .label="title" type="${InputType.TEXT}" required placeholder=" "></or-mwc-input>- <or-mwc-input value="${alarm && alarm.content ? alarm.content : ""}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.setActionAlarmName(e.detail.value, "content")}" .label=content" type="${InputType.TEXTAREA}" required placeholder=" " ></or-mwc-input>- <or-mwc-input .label="${i18next.t("alarm.assignee")}"- .type="${InputType.SELECT}"- .options="${options.map((obj) => obj.label)}"- .value="${this.action.assigneeId ? options.filter((obj) => obj.value === this.action.assigneeId).map((obj) => obj.label)[0] : ""}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- this.action.assigneeId = options.filter((obj) => obj.label === e.detail.value).map((obj) => obj.value)[0];- this.setActionAlarmName(e.detail.value, undefined);- }}"- ></or-mwc-input>- </form>+ <div id="form-container">+ <or-vaadin-text-field value=${alarm?.title} required+ @change=${(ev: Event) => this.setActionAlarmName((ev.currentTarget as HTMLInputElement).value, "title")}>+ <or-translate slot="label" value="alarm.title"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-text-area value=${alarm?.content} required style="min-height: 200px;"+ @change=${(ev: Event) => this.setActionAlarmName((ev.currentTarget as HTMLInputElement).value, "content")}>+ <or-translate slot="label" value="alarm.content"></or-translate>+ </or-vaadin-text-area>+ <or-vaadin-select value=${this.action.assigneeId} required .items=${options}+ @change=${(ev: Event) => {+ const value = (ev.currentTarget as OrVaadinSelect).value;+ this.action.assigneeId = value;+ this.setActionAlarmName(value, undefined);+ }}>+ <or-translate slot="label" value="alarm.assignee"></or-translate>+ </or-vaadin-select>+ </div>`}diff --git a/ui/component/or-rules/src/json-viewer/forms/or-rule-form-email-message.ts b/ui/component/or-rules/src/json-viewer/forms/or-rule-form-email-message.tsindex ea1cd1647..f8c7a00ac 100644--- a/ui/component/or-rules/src/json-viewer/forms/or-rule-form-email-message.ts+++ b/ui/component/or-rules/src/json-viewer/forms/or-rule-form-email-message.ts@@ -1,10 +1,29 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */import {html, LitElement, css} from "lit";import {customElement, property} from "lit/decorators.js";import {i18next, translate} from "@openremote/or-translate"-import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import {EmailNotificationMessage} from "@openremote/model";import { OrRulesJsonRuleChangedEvent } from "../or-rule-json-viewer";import "@openremote/or-mwc-components/or-mwc-input";+import {OrVaadinTextField} from "@openremote/or-vaadin-components/or-vaadin-text-field";@customElement("or-rule-form-email-message")export class OrRuleFormEmailMessage extends translate(i18next)(LitElement) {@@ -14,7 +33,10 @@ export class OrRuleFormEmailMessage extends translate(i18next)(LitElement) {static get styles() {return css`- or-mwc-input {+ #form-container {+ display: flex;+ flex-direction: column;+ gap: 8px;margin-bottom: 20px;min-width: 420px;width: 100%;@@ -28,10 +50,16 @@ export class OrRuleFormEmailMessage extends translate(i18next)(LitElement) {}return html`- <form style="display:grid">- <or-mwc-input value="${this.message.subject || ''}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.setActionNotificationName(e.detail.value, "subject")}" .label="${i18next.t("subject")}" type="${InputType.TEXT}" required placeholder=" "></or-mwc-input>- <or-mwc-input value="${this.message.html || ""}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.setActionNotificationName(e.detail.value, "html")}" .label="${i18next.t("message")}" type="${InputType.TEXTAREA}" required placeholder=" " ></or-mwc-input>- </form>+ <div id="form-container">+ <or-vaadin-text-field value=${this.message?.subject} required+ @change=${(ev: Event) => this.setActionNotificationName((ev.currentTarget as HTMLInputElement).value, "subject")}>+ <or-translate slot="label" value="subject"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-text-area value=${this.message?.html} required style="min-height: 200px;"+ @change=${(ev: Event) => this.setActionNotificationName((ev.currentTarget as HTMLInputElement).value, "html")}>+ <or-translate slot="label" value="message"></or-translate>+ </or-vaadin-text-area>+ </div>`}diff --git a/ui/component/or-rules/src/json-viewer/forms/or-rule-form-localized.ts b/ui/component/or-rules/src/json-viewer/forms/or-rule-form-localized.tsindex 35a43d776..bcf7b1ca5 100644--- a/ui/component/or-rules/src/json-viewer/forms/or-rule-form-localized.ts+++ b/ui/component/or-rules/src/json-viewer/forms/or-rule-form-localized.ts@@ -1,8 +1,7 @@import {i18next, translate} from "@openremote/or-translate";-import {LitElement, PropertyValues, TemplateResult, css, html} from "lit";+import {LitElement, TemplateResult, css, html} from "lit";import {customElement, property, state} from "lit/decorators.js";import {AbstractNotificationMessageUnion, LocalizedNotificationMessage} from "@openremote/model";-import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import {showSnackbar} from "@openremote/or-mwc-components/or-mwc-snackbar";import {OrRulesJsonRuleChangedEvent} from "../or-rule-json-viewer";import {when} from "lit/directives/when.js";@@ -12,6 +11,7 @@ import "./or-rule-form-email-message";import "./or-rule-form-push-notification";import ISO6391 from "iso-639-1";import {DefaultColor6} from "@openremote/core";+import { SelectItem } from "@openremote/or-vaadin-components/or-vaadin-select";@customElement("or-rule-form-localized")export class OrRuleFormLocalized extends translate(i18next)(LitElement) {@@ -39,7 +39,7 @@ export class OrRuleFormLocalized extends translate(i18next)(LitElement) {static get styles() {return css`- or-mwc-input {+ or-vaadin-select {margin-bottom: 20px;min-width: 420px;width: 100%;@@ -81,10 +81,9 @@ export class OrRuleFormLocalized extends translate(i18next)(LitElement) {*/protected async _getWrongLanguageTemplate(): Promise<TemplateResult> {return html`- <or-mwc-input .type="${InputType.BUTTON}" fullWidth outlined- label="defaultLanguageChangedError" style="margin-top: 10px;"- @or-mwc-input-changed="${this._fixDefaultLanguage}"- ></or-mwc-input>+ <or-vaadin-button style="width: 100%; margin: 10px 0;" @click=${() => this._fixDefaultLanguage()}>+ <or-translate value="defaultLanguageChangedError"></or-translate>+ </or-vaadin-button>`;}@@ -110,12 +109,12 @@ export class OrRuleFormLocalized extends translate(i18next)(LitElement) {* Based on {@link languageCodes}, it lists all languages of the ISO6391 specification.*/protected async _getLanguageSelectForm(selected: string, languageCodes: string[] = [this._selectedLanguage], divider = true): Promise<TemplateResult> {- const languages = languageCodes.map(key => [key, ISO6391.getName(key)]);+ const languages: SelectItem[] = languageCodes.map(key => ({value: key, label: ISO6391.getName(key)}));return html`<div style="display: flex; justify-content: space-between;">- <or-mwc-input .type="${InputType.SELECT}" .options="${languages}" .value="${selected}"- @or-mwc-input-changed="${this._onLanguageChange}"- ></or-mwc-input>+ <or-vaadin-select value=${selected} .items=${languages}+ @change=${(ev: Event) => this._onLanguageChange(ev)}+ ></or-vaadin-select></div>${when(divider, () => html`<div class="divider"></div>`)}@@ -125,8 +124,11 @@ export class OrRuleFormLocalized extends translate(i18next)(LitElement) {/*** HTML callback for when the selected language changes.*/- protected _onLanguageChange(ev: OrInputChangedEvent) {- this._selectedLanguage = ev.detail.value;+ protected _onLanguageChange(ev: Event) {+ const elem = ev.currentTarget as HTMLInputElement;+ if(elem.checkValidity()) {+ this._selectedLanguage = elem.value;+ }}/**diff --git a/ui/component/or-rules/src/json-viewer/forms/or-rule-form-push-notification.ts b/ui/component/or-rules/src/json-viewer/forms/or-rule-form-push-notification.tsindex 641a37ecf..e0b17f621 100644--- a/ui/component/or-rules/src/json-viewer/forms/or-rule-form-push-notification.ts+++ b/ui/component/or-rules/src/json-viewer/forms/or-rule-form-push-notification.ts@@ -1,5 +1,5 @@import {html, LitElement, css, TemplateResult} from "lit";-import {customElement, property} from "lit/decorators.js";+import {customElement, property, query} from "lit/decorators.js";import "@openremote/or-mwc-components/or-mwc-input";import {i18next, translate} from "@openremote/or-translate"import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";@@ -14,13 +14,28 @@ export class OrRuleFormPushNotification extends translate(i18next)(LitElement) {@property({type: Object})public message?: PushNotificationMessage;+ @query("#push-title")+ protected _pushTitleElem?: HTMLInputElement;++ @query("#push-body")+ protected _pushBodyElem?: HTMLInputElement;++ @query("#push-url")+ protected _pushUrlElem?: HTMLInputElement;++ @query("#push-button1")+ protected _pushButton1Elem?: HTMLInputElement;++ @query("#push-button2")+ protected _pushButton2Elem?: HTMLInputElement;+static get styles() {return css`.input-small {min-width: auto;}- or-mwc-input {+ or-vaadin-text-field, or-vaadin-text-area {margin-bottom: 20px;min-width: 420px;width: 100%;@@ -46,28 +61,22 @@ export class OrRuleFormPushNotification extends translate(i18next)(LitElement) {* Internal function that returns a form for configuring a {@link PushNotificationMessage}.* {@link onchange} is a callback function can be used to process changes before they are applied.*/- protected async _getPushNotificationForm(message: PushNotificationMessage, onchange = async (_ev: OrInputChangedEvent, msg?: PushNotificationMessage) => msg!): Promise<TemplateResult> {+ protected async _getPushNotificationForm(message: PushNotificationMessage, onchange = async (ev: Event, msg?: PushNotificationMessage) => msg!): Promise<TemplateResult> {return html`<form style="display:grid">- <or-mwc-input .value="${message.title}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => onchange(ev, message).then(msg => this._onTitleChange(ev, msg))}"- .label="${i18next.t("subject")}"- type="${InputType.TEXT}"- required- placeholder=" "></or-mwc-input>-- <or-mwc-input .value="${message.body}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => onchange(ev, message).then(msg => this._onBodyChange(ev, msg))}"- .label="${i18next.t("message")}"- type="${InputType.TEXTAREA}"- required- placeholder=" "></or-mwc-input>- <or-mwc-input .value="${message.action?.url}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => onchange(ev, message).then(msg => this._onActionUrlChange(ev, msg))}"- .label="${i18next.t("openWebsiteUrl")}"- type="${InputType.TEXT}"- placeholder=" "></or-mwc-input>+ <or-vaadin-text-field id="push-title" value=${message.title} required+ @change=${(ev: Event) => onchange(ev, message).then(msg => this._onTitleChange(this._pushTitleElem!, msg))}>+ <or-translate slot="label" value="subject"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-text-area id="push-body" value=${message.body} required style="min-height: 200px;"+ @change=${(ev: Event) => onchange(ev, message).then(msg => this._onBodyChange(this._pushBodyElem!, msg))}>+ <or-translate slot="label" value="message"></or-translate>+ </or-vaadin-text-area>+ <or-vaadin-text-field id="push-url" value=${message.action?.url}+ @change=${(ev: Event) => onchange(ev, message).then(msg => this._onActionUrlChange(this._pushUrlElem!, msg))}>+ <or-translate slot="label" value="openWebsiteUrl"></or-translate>+ </or-vaadin-text-field><!-- Open in browser switch --><or-mwc-input .value="${message.action?.openInBrowser}"@@ -79,18 +88,14 @@ export class OrRuleFormPushNotification extends translate(i18next)(LitElement) {<!-- Button controls --><div style="display: flex; gap: 20px;">- <or-mwc-input .value="${message.buttons?.[0]?.title}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => onchange(ev, message).then(msg => this._onButtonTitleChange(ev, 0, msg))}"- .label="${i18next.t("buttonTextConfirm")}"- type="${InputType.TEXT}"- class="input-small"- placeholder=" "></or-mwc-input>- <or-mwc-input .value="${message.buttons?.[1]?.title}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => onchange(ev, message).then(msg => this._onButtonTitleChange(ev, 1, msg))}"- .label="${i18next.t("buttonTextDecline")}"- type="${InputType.TEXT}"- class="input-small"- placeholder=" "></or-mwc-input>+ <or-vaadin-text-field id="push-button1" value=${message.buttons?.[0]?.title} class="input-small"+ @change=${(ev: Event) => onchange(ev, message).then(msg => this._onButtonTitleChange(this._pushButton1Elem!, 0, msg))}>+ <or-translate slot="label" value="buttonTextConfirm"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-text-field id="push-button2" value=${message.buttons?.[1]?.title} class="input-small"+ @change=${(ev: Event) => onchange(ev, message).then(msg => this._onButtonTitleChange(this._pushButton2Elem!, 1, msg))}>+ <or-translate slot="label" value="buttonTextDecline"></or-translate>+ </or-vaadin-text-field></div></form>`;@@ -99,26 +104,32 @@ export class OrRuleFormPushNotification extends translate(i18next)(LitElement) {/*** HTML callback function when the subject of a notification message has changed.*/- protected _onTitleChange(ev: OrInputChangedEvent, message: PushNotificationMessage) {- message.title = ev.detail.value;- this.dispatchEvent(new OrRulesJsonRuleChangedEvent());+ protected _onTitleChange(elem: HTMLInputElement, message: PushNotificationMessage) {+ if(elem.checkValidity()) {+ message.title = elem.value;+ this.dispatchEvent(new OrRulesJsonRuleChangedEvent());+ }}/*** HTML callback function when the body of a notification message has changed.*/- protected _onBodyChange(ev: OrInputChangedEvent, message: PushNotificationMessage) {- message.body = ev.detail.value;- this.dispatchEvent(new OrRulesJsonRuleChangedEvent());+ protected _onBodyChange(elem: HTMLInputElement, message: PushNotificationMessage) {+ if(elem.checkValidity()) {+ message.body = elem.value;+ this.dispatchEvent(new OrRulesJsonRuleChangedEvent());+ }}/*** HTML callback function when the "click here to open URL" of a notification has changed.*/- protected _onActionUrlChange(ev: OrInputChangedEvent, message: PushNotificationMessage) {- message.action = message.action || {};- message.action.url = ev.detail.value;- this.dispatchEvent(new OrRulesJsonRuleChangedEvent());+ protected _onActionUrlChange(elem: HTMLInputElement, message: PushNotificationMessage) {+ if(elem.checkValidity()) {+ message.action = message.action || {};+ message.action.url = elem.value;+ this.dispatchEvent(new OrRulesJsonRuleChangedEvent());+ }}/**@@ -133,11 +144,13 @@ export class OrRuleFormPushNotification extends translate(i18next)(LitElement) {/*** HTML callback function when any button text of the notification has changed.*/- protected _onButtonTitleChange(ev: OrInputChangedEvent, key: number, message: PushNotificationMessage) {- message.buttons = message.buttons || [];- message.buttons[key] = {- title: ev.detail.value- } as PushNotificationButton;- this.dispatchEvent(new OrRulesJsonRuleChangedEvent());+ protected _onButtonTitleChange(elem: HTMLInputElement, key: number, message: PushNotificationMessage) {+ if(elem.checkValidity()) {+ message.buttons = message.buttons || [];+ message.buttons[key] = {+ title: elem.value+ } as PushNotificationButton;+ this.dispatchEvent(new OrRulesJsonRuleChangedEvent());+ }}}diff --git a/ui/component/or-rules/src/json-viewer/forms/or-rule-form-webhook.ts b/ui/component/or-rules/src/json-viewer/forms/or-rule-form-webhook.tsindex c48e1acc2..eab1790f9 100644--- a/ui/component/or-rules/src/json-viewer/forms/or-rule-form-webhook.ts+++ b/ui/component/or-rules/src/json-viewer/forms/or-rule-form-webhook.ts@@ -11,6 +11,8 @@ import {css, html, LitElement, TemplateResult} from "lit";import {customElement, property, state} from "lit/decorators.js";import {when} from 'lit/directives/when.js';import {OrRulesJsonRuleChangedEvent} from "../or-rule-json-viewer";+import {OrVaadinSelect, SelectItem} from "@openremote/or-vaadin-components/or-vaadin-select";+import {OrVaadinTextField} from "@openremote/or-vaadin-components/or-vaadin-text-field";//language=css@@ -57,14 +59,6 @@ export class OrRuleFormWebhook extends LitElement {// Util- getAuthMethod(webhook: Webhook): string | undefined {- if (webhook.oAuthGrant != undefined) {- return this.authMethodOptions.get(webhook.oAuthGrant.grant_type);- } else {- return this.authMethodOptions.get("username_password");- }- }-getOAuthGrant(authMethodKey: string): OAuthGrant | undefined {if (authMethodKey == 'client_credentials' || authMethodKey == 'password') {return {grant_type: authMethodKey} as OAuthGrant;@@ -95,20 +89,21 @@ export class OrRuleFormWebhook extends LitElement {`, () => html`<form style="display: flex; flex-direction: column; min-width: 520px;"><!-- HTTP Method & URL -->- <div style="display: flex; flex-direction: row; align-items: center; gap: 5px; margin-bottom: 28px;">- <or-mwc-input style="flex: 0;" type="${InputType.SELECT}" .value="${this.webhook.httpMethod}"- .options="${this.httpMethodOptions}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- this.webhook.httpMethod = ev.detail.value;- this.notifyWebhookUpdate();- }}"- ></or-mwc-input>- <or-mwc-input style="flex: 1;" type="${InputType.URL}" required label="${i18next.t('webUrl')}"- .value="${this.webhook.url}" helperPersistent- @or-mwc-input-changed="${(e: OrInputChangedEvent) => {- this.webhook.url = e.detail.value;- this.notifyWebhookUpdate();- }}"></or-mwc-input>+ <div style="display: flex; flex-direction: row; align-items: baseline; gap: 5px; margin-bottom: 28px;">+ <or-vaadin-select value=${this.webhook.httpMethod} .items=${this.httpMethodOptions.map(o => ({value: o, label: o}))} required style="flex: 0 0 100px;"+ @change=${(ev: Event) => {+ this.webhook.httpMethod = (ev.currentTarget as OrVaadinSelect).value as HTTPMethod;+ this.notifyWebhookUpdate()+ }}>+ <or-translate slot="label" value="method"></or-translate>+ </or-vaadin-select>+ <or-vaadin-text-field type="url" value=${this.webhook.url} required style="flex: 1;"+ @change=${(ev: Event) => {+ this.webhook.url = (ev.currentTarget as OrVaadinTextField).value;+ this.notifyWebhookUpdate();+ }}>+ <or-translate slot="label" value="webUrl"></or-translate>+ </or-vaadin-text-field></div><!-- Headers --><div style="display: flex; flex-direction: column; gap: 5px; margin-bottom: 28px;">@@ -118,15 +113,17 @@ export class OrRuleFormWebhook extends LitElement {`, () => html`${this.getHeadersTemplate(this.webhook.headers!, false)}`)}- <or-mwc-input type="${InputType.BUTTON}" icon="plus" label="addRequestHeader"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- if ((this.webhook.headers ? this.webhook.headers[''] : undefined) != undefined) {- this.webhook.headers![''].push('');- } else {- this.webhook.headers![''] = [''];- }- this.reloadHeaders();- }}"></or-mwc-input>+ <or-vaadin-button @click=${() => {+ if ((this.webhook.headers ? this.webhook.headers[''] : undefined) != undefined) {+ this.webhook.headers![''].push('');+ } else {+ this.webhook.headers![''] = [''];+ }+ this.reloadHeaders();+ }}>+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value="addRequestHeader"></or-translate>+ </or-vaadin-button></div><!-- Authorization --><div style="display: flex; flex-direction: column; gap: 10px; margin-bottom: ${this.webhook.oAuthGrant || this.webhook.usernamePassword ? '28px' : '0'};">@@ -140,16 +137,15 @@ export class OrRuleFormWebhook extends LitElement {this.notifyWebhookUpdate();}}"></or-mwc-input>${when(this.webhook.oAuthGrant || this.webhook.usernamePassword, () => {- const values: string[] = Array.from(this.authMethodOptions.values());+ const values: SelectItem[] = Array.from(this.authMethodOptions.entries()).map(([value, label]) => ({value, label}));return html`- <or-mwc-input type="${InputType.SELECT}" label="${i18next.t('method')}"- .value="${this.getAuthMethod(this.webhook)}"- .options="${values}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- const entry = [...this.authMethodOptions.entries()].find((entry) => entry[1] == ev.detail.value);- this.webhook.oAuthGrant = this.getOAuthGrant(entry![0]);- this.notifyWebhookUpdate();- }}"></or-mwc-input>+ <or-vaadin-select value=${this.webhook.oAuthGrant?.grant_type ?? values[0].value} .items=${values}+ @change=${(ev: Event) => {+ this.webhook.oAuthGrant = this.getOAuthGrant((ev.currentTarget as OrVaadinSelect).value);+ this.notifyWebhookUpdate();+ }}>+ <or-translate slot="label" value="method"></or-translate>+ </or-vaadin-select>${this.getAuthSettingsTemplate(this.webhook)}`})}@@ -169,11 +165,12 @@ export class OrRuleFormWebhook extends LitElement {></or-mwc-input>${when(this.webhook.payload != undefined, () => {return html`- <or-mwc-input type="${InputType.TEXTAREA}" .value="${this.webhook.payload}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- this.webhook.payload = ev.detail.value;- this.notifyWebhookUpdate();- }}"></or-mwc-input>+ <or-vaadin-text-area value=${this.webhook.payload} style="min-height: 200px;"+ @change=${(ev: Event) => {+ this.webhook.payload = (ev.currentTarget as HTMLInputElement).value;+ this.notifyWebhookUpdate();+ }}>+ </or-vaadin-text-area>`})}`)}@@ -188,32 +185,35 @@ export class OrRuleFormWebhook extends LitElement {.map((key, keyIndex, keys) => {const values: string[] = this.webhook.headers![key];return values.map((value, valueIndex) => html`- <div style="display: flex; gap: 5px;">- <or-mwc-input type="${InputType.TEXT}" label="${i18next.t('header')}" value="${key}"- style="flex: 1;" .disabled="${loading}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- values.length > 0 ? values.splice(valueIndex, 1) : delete this.webhook.headers![key];- const newValues = this.webhook.headers![ev.detail.value];- if (newValues && newValues.length > 0) {- newValues.push(value);- } else {- this.webhook.headers![ev.detail.value] = [value]- }- this.reloadHeaders();- }}"- ></or-mwc-input>- <or-mwc-input type="${InputType.TEXT}" label="${i18next.t('value')}" value="${value}"- style="flex: 1;" .disabled="${loading}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- this.webhook.headers![key][valueIndex] = ev.detail.value;- this.notifyWebhookUpdate();- }}"- ></or-mwc-input>- <or-mwc-input type="${InputType.BUTTON}" icon="delete" .disabled="${loading}"- @or-mwc-input-changed="${() => {- values.splice(valueIndex, 1);- this.reloadHeaders();- }}"></or-mwc-input>+ <div style="display: flex; align-items: baseline; gap: 5px;">+ <or-vaadin-text-field value=${key} ?disabled=${loading} style="flex: 1;"+ @change=${(ev: Event) => {+ const inputValue = (ev.currentTarget as HTMLInputElement).value;+ values.length > 0 ? values.splice(valueIndex, 1) : delete this.webhook.headers![key];+ const newValues = this.webhook.headers![inputValue];+ if (newValues && newValues.length > 0) {+ newValues.push(value);+ } else {+ this.webhook.headers![inputValue] = [value]+ }+ this.reloadHeaders();+ }}>+ <or-translate slot="label" value="header"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-text-field value=${value} ?disabled=${loading} style="flex: 1;"+ @change=${(ev: Event) => {+ this.webhook.headers![key][valueIndex] = (ev.currentTarget as HTMLInputElement).value;+ this.notifyWebhookUpdate();+ }}>+ <or-translate slot="label" value="value"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-button theme="icon" ?disabled=${loading}+ @click=${() => {+ values.splice(valueIndex, 1);+ this.reloadHeaders();+ }}>+ <or-icon icon="delete"></or-icon>+ </or-vaadin-button></div>`)})@@ -224,72 +224,75 @@ export class OrRuleFormWebhook extends LitElement {if (authGrant == undefined) {return html`<div style="display: flex; flex-direction: column; gap: 10px;">- <or-mwc-input type="${InputType.TEXT}" label="${i18next.t('username')}"- .value="${webhook.usernamePassword?.username}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- if (!this.webhook.usernamePassword) {- this.webhook.usernamePassword = {};- }- this.webhook.usernamePassword.username = ev.detail.value;- this.notifyWebhookUpdate();- }}"></or-mwc-input>- <or-mwc-input type="${InputType.TEXT}" label="${i18next.t('password')}"- .value="${this.webhook.usernamePassword?.password}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- if (!this.webhook.usernamePassword) {- this.webhook.usernamePassword = {};- }- this.webhook.usernamePassword.password = ev.detail.value;- this.notifyWebhookUpdate();- }}"></or-mwc-input>+ <or-vaadin-text-field value=${webhook.usernamePassword?.username}+ @change=${(ev: Event) => {+ this.webhook.usernamePassword ??= {};+ this.webhook.usernamePassword.username = (ev.currentTarget as HTMLInputElement).value;+ this.notifyWebhookUpdate();+ }}>+ <or-translate slot="label" value="username"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-password-field value=${webhook.usernamePassword?.password}+ @change=${(ev: Event) => {+ this.webhook.usernamePassword ??= {};+ this.webhook.usernamePassword.password = (ev.currentTarget as HTMLInputElement).value;+ this.notifyWebhookUpdate();+ }}>+ <or-translate slot="label" value="password"></or-translate>+ </or-vaadin-password-field></div>`} else {return html`<div style="display: flex; flex-direction: column; gap: 10px;"><div style="display: flex; flex-direction: row; align-items: center; gap: 5px;">- <or-mwc-input style="flex: 1;" type="${InputType.URL}" required- label="${i18next.t('tokenUrl')}" .value="${authGrant.tokenEndpointUri}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- authGrant.tokenEndpointUri = ev.detail.value;- this.notifyWebhookUpdate();- }}"></or-mwc-input>+ <or-vaadin-text-field type="url" value=${authGrant.tokenEndpointUri} required style="flex: 1;"+ @change=${(ev: Event) => {+ authGrant.tokenEndpointUri = (ev.currentTarget as HTMLInputElement).value;+ this.notifyWebhookUpdate();+ }}>+ <or-translate slot="label" value="tokenUrl"></or-translate>+ </or-vaadin-text-field></div>${when(authGrant.grant_type != undefined, () => {switch (authGrant.grant_type) {case "client_credentials": {const grant = authGrant as OAuthClientCredentialsGrant;return html`- <or-mwc-input type="${InputType.TEXT}" label="${i18next.t('clientId')}"- .value="${grant.client_id}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- grant.client_id = ev.detail.value;- this.notifyWebhookUpdate();- }}"></or-mwc-input>- <or-mwc-input type="${InputType.PASSWORD}" label="${i18next.t('clientSecret')}"- .value="${grant.client_secret}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- grant.client_secret = ev.detail.value;- this.notifyWebhookUpdate();- }}"></or-mwc-input>+ <or-vaadin-text-field value=${grant.client_id}+ @change=${(ev: Event) => {+ grant.client_id = (ev.currentTarget as HTMLInputElement).value;+ this.notifyWebhookUpdate();+ }}>+ <or-translate slot="label" value="clientId"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-password-field value=${grant.client_secret}+ @change=${(ev: Event) => {+ grant.client_secret = (ev.currentTarget as HTMLInputElement).value;+ this.notifyWebhookUpdate();+ }}>+ <or-translate slot="label" value="clientSecret"></or-translate>+ </or-vaadin-password-field>`;}case "password": {const grant = authGrant as OAuthPasswordGrant;return html`- <or-mwc-input type="${InputType.TEXT}" label="${i18next.t('username')}"- .value="${grant.username}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- grant.username = ev.detail.value;- this.notifyWebhookUpdate();- }}"></or-mwc-input>- <or-mwc-input type="${InputType.TEXT}" label="${i18next.t('password')}"- .value="${grant.password}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- grant.password = ev.detail.value;- this.notifyWebhookUpdate();- }}"></or-mwc-input>- `+ <or-vaadin-text-field value=${grant.username}+ @change=${(ev: Event) => {+ grant.username = (ev.currentTarget as HTMLInputElement).value;+ this.notifyWebhookUpdate();+ }}>+ <or-translate slot="label" value="username"></or-translate>+ </or-vaadin-text-field>+ <or-vaadin-password-field value=${grant.password}+ @change=${(ev: Event) => {+ grant.password = (ev.currentTarget as HTMLInputElement).value;+ this.notifyWebhookUpdate();+ }}>+ <or-translate slot="label" value="password"></or-translate>+ </or-vaadin-password-field>+ `;}default:return html`${i18next.t('errorOccurred')}`diff --git a/ui/component/or-rules/src/json-viewer/modals/or-rule-alarm-modal.ts b/ui/component/or-rules/src/json-viewer/modals/or-rule-alarm-modal.tsindex 71e950fb7..aaf62af13 100644--- a/ui/component/or-rules/src/json-viewer/modals/or-rule-alarm-modal.ts+++ b/ui/component/or-rules/src/json-viewer/modals/or-rule-alarm-modal.ts@@ -28,9 +28,10 @@ import {import "@openremote/or-mwc-components/or-mwc-input";import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import {i18next, translate} from "@openremote/or-translate"-import {DialogAction, OrMwcDialog, OrMwcDialogOpenedEvent} from "@openremote/or-mwc-components/or-mwc-dialog";import {OrRulesJsonRuleChangedEvent} from "../or-rule-json-viewer";+import {OrVaadinSelect, SelectItem} from "@openremote/or-vaadin-components/or-vaadin-select";+const checkValidity = (form:HTMLElement | null, dialog:OrMwcDialog) => {if(form) {const inputs = form.querySelectorAll('or-mwc-input');@@ -66,13 +67,13 @@ const checkValidity = (form:HTMLElement | null, dialog:OrMwcDialog) => {const style = css`:host {display: flex;- align-items: center;+ align-items: baseline;}:host > * {margin: 0 3px 6px;}.min-width {- min-width: 200px;+ flex: 0 0 240px;}`;@@ -164,9 +165,20 @@ export class OrRuleAlarmModal extends translate(i18next)(LitElement) {}};+ const severityOptions: SelectItem[] = [+ {value: AlarmSeverity.LOW, label: i18next.t("alarm.severity_LOW")},+ {value: AlarmSeverity.MEDIUM, label: i18next.t("alarm.severity_MEDIUM")},+ {value: AlarmSeverity.HIGH, label: i18next.t("alarm.severity_HIGH")}+ ]+return html`- <or-mwc-input style="width: 200px" .type="${InputType.SELECT}" .value="${this.action.alarm?.severity}" .label="${i18next.t("alarm.severity")}" .options="${[[AlarmSeverity.LOW, i18next.t("alarm.severity_LOW")], [AlarmSeverity.MEDIUM, i18next.t("alarm.severity_MEDIUM")], [AlarmSeverity.HIGH, i18next.t("alarm.severity_HIGH")]]}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.setActionAlarmSeverity(e.detail.value)}"></or-mwc-input>- <or-mwc-input .type="${InputType.BUTTON}" .label="${i18next.t("settings")}" @or-mwc-input-changed="${alarmPickerModalOpen}"></or-mwc-input>+ <or-vaadin-select value=${this.action.alarm?.severity} .items=${severityOptions} style="width: 240px;"+ @change=${(ev: Event) => this.setActionAlarmSeverity((ev.currentTarget as OrVaadinSelect).value)}>+ <or-translate slot="label" value="alarm.severity"></or-translate>+ </or-vaadin-select>+ <or-vaadin-button @click=${() => alarmPickerModalOpen()}>+ <or-translate value="settings"></or-translate>+ </or-vaadin-button><or-mwc-dialog id="alarm-modal" heading="${this.title}" .actions="${alarmPickerModalActions}"></or-mwc-dialog><slot class="alarm-form-slot"></slot>`diff --git a/ui/component/or-rules/src/json-viewer/modals/or-rule-notification-modal.ts b/ui/component/or-rules/src/json-viewer/modals/or-rule-notification-modal.tsindex a3eaa924b..1d09f1752 100644--- a/ui/component/or-rules/src/json-viewer/modals/or-rule-notification-modal.ts+++ b/ui/component/or-rules/src/json-viewer/modals/or-rule-notification-modal.ts@@ -75,6 +75,9 @@ export class OrRuleNotificationModal extends translate(i18next)(LitElement) {@property({type: Object})public query?: AssetQuery;+ @property({type: Boolean})+ public readonly = false;+@query("#notification-modal")protected _orMwcDialog?: OrMwcDialog;@@ -211,7 +214,9 @@ export class OrRuleNotificationModal extends translate(i18next)(LitElement) {};return html`- <or-mwc-input .type="${InputType.BUTTON}" label="message" @or-mwc-input-changed="${notificationPickerModalOpen}"></or-mwc-input>+ <or-vaadin-button ?disabled=${this.readonly} @click=${() => notificationPickerModalOpen()}>+ <or-translate value="message"></or-translate>+ </or-vaadin-button><or-mwc-dialog id="notification-modal" .heading="${this.title}" .dismissAction="${dismissAction}" .actions="${actions}" .styles="${styles}"></or-mwc-dialog><slot class="notification-form-slot"></slot>`;diff --git a/ui/component/or-rules/src/json-viewer/modals/or-rule-radial-modal.ts b/ui/component/or-rules/src/json-viewer/modals/or-rule-radial-modal.tsindex fff992c50..0ffff51bb 100644--- a/ui/component/or-rules/src/json-viewer/modals/or-rule-radial-modal.ts+++ b/ui/component/or-rules/src/json-viewer/modals/or-rule-radial-modal.ts@@ -27,6 +27,8 @@ export class OrRuleRadialModal extends translate(i18next)(LitElement) {@property({type: Object})public attributePredicate?: AttributePredicate;+ @property({type: Boolean})+ public readonly = false;@property({type: Object})public query?: AssetQuery;@@ -149,7 +151,9 @@ export class OrRuleRadialModal extends translate(i18next)(LitElement) {this.renderDialogHTML(value);return html`- <or-mwc-input .type="${InputType.BUTTON}" label="area" @or-mwc-input-changed="${radialPickerModalOpen}"></or-mwc-input>+ <or-vaadin-button ?disabled=${this.readonly} @click=${() => radialPickerModalOpen()}>+ <or-translate value="area"></or-translate>+ </or-vaadin-button><or-mwc-dialog id="radial-modal" heading="area" .actions="${radiusPickerModalActions}"></or-mwc-dialog>`}diff --git a/ui/component/or-rules/src/json-viewer/modals/or-rule-webhook-modal.ts b/ui/component/or-rules/src/json-viewer/modals/or-rule-webhook-modal.tsindex 460bbcbae..a169a9bdc 100644--- a/ui/component/or-rules/src/json-viewer/modals/or-rule-webhook-modal.ts+++ b/ui/component/or-rules/src/json-viewer/modals/or-rule-webhook-modal.ts@@ -67,8 +67,9 @@ export class OrRuleWebhookModal extends LitElement {}};return html`- <or-mwc-input type="${InputType.BUTTON}" label="message"- @or-mwc-input-changed="${webhookModalOpen}"></or-mwc-input>+ <or-vaadin-button @click=${() => webhookModalOpen()}>+ <or-translate value="message"></or-translate>+ </or-vaadin-button><or-mwc-dialog id="webhook-modal" heading="${this.title}" .actions="${webhookModalActions}"></or-mwc-dialog><slot class="webhook-form-slot"></slot>`diff --git a/ui/component/or-rules/src/json-viewer/or-rule-action-attribute.ts b/ui/component/or-rules/src/json-viewer/or-rule-action-attribute.tsindex 3d085b320..814cdfc4c 100644--- a/ui/component/or-rules/src/json-viewer/or-rule-action-attribute.ts+++ b/ui/component/or-rules/src/json-viewer/or-rule-action-attribute.ts@@ -11,12 +11,13 @@ import {} from "@openremote/model";import {Util} from "@openremote/core";import "@openremote/or-attribute-input";-import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";+import {InputType} from "@openremote/or-mwc-components/or-mwc-input";import {i18next, translate} from "@openremote/or-translate";import {OrRulesJsonRuleChangedEvent} from "./or-rule-json-viewer";import {OrAttributeInputChangedEvent} from "@openremote/or-attribute-input";import {ifDefined} from "lit/directives/if-defined.js";import {when} from "lit/directives/when.js";+import {OrVaadinComboBox} from "@openremote/or-vaadin-components/or-vaadin-combo-box";// language=CSSconst style = css`@@ -32,7 +33,7 @@ const style = css`}.min-width {- min-width: 200px;+ flex: 0 0 240px;}`;@@ -114,59 +115,32 @@ export class OrRuleActionAttribute extends translate(i18next)(LitElement) {// TODO: Add multiselect supportconst ids = getAssetIdsFromQuery(query);const idValue = ids && ids.length > 0 ? ids[0] : "*";- const idOptions: Map<string, string> = new Map([- ["*", i18next.t("matched")]- ]);-- // Set list of displayed assets, and filtering assets out if needed.- // If <= 25 assets: display everything- // If between 25 and 100 assets: display everything with search functionality- // If >= 100 assets: only display if in line with search input+ const idOptions: {value: any, label: string}[] = [+ {value: "*", label: i18next.t("matched")}+ ];const assets: Asset[] = this._cache ? this._cache.assets : [];- const searchable = assets.length > 25;- if (searchable && this._selected) {- idOptions.set(this._selected.id!, this._selected.name!);- }-- let searchProvider: (search?: string) => Promise<[any, string][]>;return html`<!-- Show SELECT input with 'loading' until the assets are retrieved -->${when((!this._cache || this._loading), () => html`- <or-mwc-input id="matchSelect" class="min-width" type="${InputType.SELECT}" .readonly="${true}" .label="${i18next.t("loading")}"></or-mwc-input>+ <or-vaadin-combo-box id="matchSelect" class="min-width" readonly>+ <or-translate slot="label" value="loading"></or-translate>+ </or-vaadin-combo-box>`, () => {- if (!searchable) {- assets.forEach(a => idOptions.set(a.id!, a.name!));- } else {- searchProvider = async (search?: string) => {- await this.loadAssets(assetType, search, idValue); // Wait for asset retrieval based on search- if (search) {- return assets.filter(a => a.name?.toLowerCase().includes(search.toLowerCase())).map(a => [a.id!, a.name!] as [string, string]);- } else if (assets.length <= 100) {- assets.forEach(a => idOptions.set(a.id!, a.name!));- return [...idOptions];- } else {- const selected = assets.find(a => a.id === idValue);- if (selected && !Array.from(idOptions.keys()).includes(selected.id!)) {- idOptions.set(selected.id!, selected.name!); // add selected asset if there is one.- }- return [...idOptions];- }- };- }+ assets.forEach(a => idOptions.push({value: a.id!, label: a.name!}));// Get selected asset and its descriptorsconst asset = idValue && idValue !== "*" ? this._cache!.assets.find(a => a.id === idValue) : undefined;const descriptors = AssetModelUtil.getAttributeAndValueDescriptors(assetType, this.action.attributeName, asset && asset.attributes && this.action.attributeName ? asset.attributes[this.action.attributeName] : undefined);// Only RW attributes can be used in actions- let attributes: [string, string][] = [];+ let attributes: {value: any, label: string}[] = [];if (asset && asset.attributes) {attributes = Object.values(asset.attributes).map((attr) => {const label = Util.getAttributeLabel(attr, descriptors[0], assetType, false);- return [attr.name!, label];+ return {value: attr.name!, label};});} else if (assetDescriptor) {const assetTypeInfo = AssetModelUtil.getAssetTypeInfo(assetDescriptor);@@ -176,11 +150,11 @@ export class OrRuleActionAttribute extends translate(i18next)(LitElement) {? []: assetTypeInfo.attributeDescriptors.map((ad) => {const label = Util.getAttributeLabel(ad, descriptors[0], assetType, false);- return [ad.name!, label];+ return {value: ad.name!, label};});}- attributes.sort(Util.sortByString((attr) => attr[1]));+ attributes.sort(Util.sortByString((attr) => attr.label));let attributeInput: TemplateResult | undefined;if (this.action.attributeName) {const label = descriptors[1] && (descriptors[1].name === WellknownValueTypes.BOOLEAN) ? "" : i18next.t("value");@@ -190,16 +164,21 @@ export class OrRuleActionAttribute extends translate(i18next)(LitElement) {}return html`- <or-mwc-input id="matchSelect" class="min-width" .label="${i18next.t("asset")}" .type="${InputType.SELECT}"- .options="${[...idOptions]}" .searchProvider="${searchProvider}" .value="${idValue}" .readonly="${this.readonly || false}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => { this._assetId = (e.detail.value); }}"- ></or-mwc-input>- ${attributes.length > 0 ? html`- <or-mwc-input id="attributeSelect" class="min-width" .label="${i18next.t("attribute")}" .type="${InputType.SELECT}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.setActionAttributeName(e.detail.value)}" .readonly="${this.readonly || false}" ?searchable="${(attributes.length >= 25)}" .options="${attributes}" .value="${this.action.attributeName}"></or-mwc-input>+ <or-vaadin-combo-box id="matchSelect" class="min-width"+ .items=${idOptions} value=${idValue} ?readonly=${this.readonly}+ @change=${(ev: Event) => this._assetId = (ev.currentTarget as OrVaadinComboBox).value}>+ <or-translate slot="label" value="asset"></or-translate>+ </or-vaadin-combo-box>+ ${when(attributes.length > 0, () => html`+ <or-vaadin-combo-box id="attributeSelect" class="min-width" ?readonly=${this.readonly}+ .items=${attributes} value=${this.action.attributeName}+ @change=${(ev: Event) => this.setActionAttributeName((ev.currentTarget as OrVaadinComboBox).value)}>+ <or-translate slot="label" value="attribute"></or-translate>+ </or-vaadin-combo-box>${attributeInput}- ` : html`+ `, () => html`<or-translate value="No attributes with write permission"></or-translate>- `}+ `)}`;})}`;diff --git a/ui/component/or-rules/src/json-viewer/or-rule-action-notification.ts b/ui/component/or-rules/src/json-viewer/or-rule-action-notification.tsindex acb91bfa9..516fd075c 100644--- a/ui/component/or-rules/src/json-viewer/or-rule-action-notification.ts+++ b/ui/component/or-rules/src/json-viewer/or-rule-action-notification.ts@@ -13,7 +13,6 @@ import {WellknownAssets,NotificationTargetType, PushNotificationMessage, EmailNotificationMessage, LocalizedNotificationMessage} from "@openremote/model";-import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import {getTargetTypeMap, OrRulesJsonRuleChangedEvent} from "./or-rule-json-viewer";import "./modals/or-rule-notification-modal";import "./forms/or-rule-form-email-message";@@ -23,12 +22,13 @@ import "./or-rule-action-attribute";import {i18next} from "@openremote/or-translate";import manager, {Util} from "@openremote/core";import {OrRulesNotificationModalCancelEvent, OrRulesNotificationModalOkEvent} from "./modals/or-rule-notification-modal";+import {OrVaadinComboBox} from "@openremote/or-vaadin-components/or-vaadin-combo-box";// language=CSSconst style = css`:host {display: flex;- align-items: center;+ align-items: baseline;}:host > * {@@ -36,7 +36,7 @@ const style = css`}.min-width {- min-width: 200px;+ flex: 0 0 240px;}`;@@ -113,11 +113,11 @@ export class OrRuleActionNotification extends LitElement {protected static getActionTargetTemplate(targetTypeMap: [string, string?][], action: RuleAction, actionType: ActionType, readonly: boolean, config: RulesConfig | undefined, baseAssetQuery: AssetQuery | undefined, onTargetTypeChangedCallback: (type: NotificationTargetType) => void, onTargetChangedCallback: (type: NotificationTargetType, value: string | undefined) => void): PromiseLike<TemplateResult> | undefined {- let allowedTargetTypes: [NotificationTargetType, string][] = [- [NotificationTargetType.USER, i18next.t("user_plural")],- [NotificationTargetType.ASSET, i18next.t("asset_plural")],- [NotificationTargetType.REALM, i18next.t("realm_plural")],- [NotificationTargetType.CUSTOM, i18next.t("custom")]+ let allowedTargetTypes: {value: any, label: string}[] = [+ {value: NotificationTargetType.USER, label: i18next.t("user_plural")},+ {value: NotificationTargetType.ASSET, label: i18next.t("asset_plural")},+ {value: NotificationTargetType.REALM, label: i18next.t("realm_plural")},+ {value: NotificationTargetType.CUSTOM, label: i18next.t("custom")}];if (config && config.controls && config.controls.allowedActionTargetTypes) {@@ -130,7 +130,7 @@ export class OrRuleActionNotification extends LitElement {}if (configTypes) {- allowedTargetTypes = allowedTargetTypes.filter((allowedType) => configTypes?.includes(allowedType[0]));+ allowedTargetTypes = allowedTargetTypes.filter((allowedType) => configTypes?.includes(allowedType.value));}}@@ -153,20 +153,22 @@ export class OrRuleActionNotification extends LitElement {let targetValueTemplate: PromiseLike<TemplateResult>;- if (!allowedTargetTypes.find((allowedTargetType) => allowedTargetType[0] === targetType)) {+ if (!allowedTargetTypes.find((allowedTargetType) => allowedTargetType.value === targetType)) {targetType = undefined;}if (targetType === NotificationTargetType.CUSTOM) {const template = html`- <or-mwc-input class="min-width" .type="${InputType.TEXT}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => onTargetChangedCallback(targetType!, e.detail.value)}" ?readonly="${readonly}" .value="${action.target!.custom}" ></or-mwc-input>+ <or-vaadin-text-field class="min-width" ?readonly=${readonly} value=${action.target!.custom}+ @change=${(ev: Event) => onTargetChangedCallback(targetType, (ev.currentTarget as HTMLInputElement).value)}>+ </or-vaadin-text-field>`;targetValueTemplate = Promise.resolve(template);} else {- let targetValuesGenerator: PromiseLike<[string, string][]>;+ let targetValuesGenerator: PromiseLike<{value: any, label: string}[]>;let label: string | undefined;let value: string | undefined;@@ -184,9 +186,13 @@ export class OrRuleActionNotification extends LitElement {// Get realm roles and add as optionsconst realm = await manager.rest.api.RealmResource.get(manager.displayRealm);- let realmRoleOpts: [string, string][] = realm.data.realmRoles!.map(r => ["linked-" + r.name!, linkedLabel + ": " + i18next.t("realmRole." + r.name, Util.camelCaseToSentenceCase(r.name!.replace("_", " ").replace("-", " ")))]);- let values: [string, string][] = usersResponse.data.map((user) => [user.id!, user.username!]);- return [["linkedUsers", linkedLabel], ...realmRoleOpts, ...values.sort(Util.sortByString(user => user[1]))];+ let realmRoleOpts: {value: any, label: string}[] = realm.data.realmRoles!.map(r =>+ ({value: `linked-${r.name!}`, label: linkedLabel + ": " + i18next.t("realmRole." + r.name, Util.camelCaseToSentenceCase(r.name!.replace("_", " ").replace("-", " ")))})+ );+ let values: {value: any, label: string}[] = usersResponse.data.map((user) =>+ ({value: user.id!, label: user.username! })+ );+ return [{value: "linkedUsers", label: linkedLabel}, ...realmRoleOpts, ...values.sort(Util.sortByString(user => user.label))];});label = i18next.t("user_plural");@@ -229,14 +235,14 @@ export class OrRuleActionNotification extends LitElement {targetValuesGenerator = manager.rest.api.AssetResource.queryAssets(assetQuery).then((response) => {- let values: [string, string][] = response.data.map((asset) => [asset.id!, asset.name! + " (" + asset.id! + ")"]);+ let values: {value: any, label: string}[] = response.data.map((asset) => ({value: asset.id!, label: asset.name! + " (" + asset.id! + ")"}));// Add additional options for assets- const additionalValues: [string, string][] = [["allMatched", i18next.t("matched")]];+ const additionalValues: {value: any, label: string}[] = [{value: "allMatched", label: i18next.t("matched")}];if (targetTypeMap && targetTypeMap.length > 1) {targetTypeMap.forEach((typeAndTag) => {- if (!additionalValues.find((av) => av[0] === typeAndTag[0])) {- additionalValues.push([typeAndTag[0], i18next.t("matchedOfType", {type: Util.getAssetTypeLabel(typeAndTag[0])})]);+ if (!additionalValues.find((av) => av.value === typeAndTag[0])) {+ additionalValues.push({value: typeAndTag[0], label: i18next.t("matchedOfType", {type: Util.getAssetTypeLabel(typeAndTag[0])})});}});}@@ -274,26 +280,20 @@ export class OrRuleActionNotification extends LitElement {targetValueTemplate = targetValuesGenerator.then((values) => {return html`- <or-mwc-input type="${InputType.SELECT}"- class="min-width"- .options="${values}"- .label="${label}"- .value="${value}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => onTargetChangedCallback(targetType!, e.detail.value)}"- ?readonly="${readonly}"></or-mwc-input>+ <or-vaadin-combo-box class="min-width" .items=${values} value=${value} ?readonly=${readonly}+ @change=${(ev: Event) => onTargetChangedCallback(targetType!, (ev.currentTarget as OrVaadinComboBox).value)}>+ <or-translate slot="label" value=${label}></or-translate>+ </or-vaadin-combo-box>`;});}targetValueTemplate = targetValueTemplate.then((valueTemplate) => {return html`- <or-mwc-input type="${InputType.SELECT}"- class="min-width"- .options="${allowedTargetTypes}"- .value="${targetType}"- .label="${i18next.t("recipients")}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => onTargetTypeChangedCallback(e.detail.value as NotificationTargetType)}"- ?readonly="${readonly}"></or-mwc-input>+ <or-vaadin-combo-box class="min-width" .items=${allowedTargetTypes} value=${targetType} ?readonly=${readonly}+ @change=${(ev: Event) => onTargetTypeChangedCallback((ev.currentTarget as OrVaadinComboBox).value as NotificationTargetType)}>+ <or-translate slot="label" value="recipients"></or-translate>+ </or-vaadin-combo-box>${valueTemplate}`;});@@ -364,7 +364,7 @@ export class OrRuleActionNotification extends LitElement {if (message) {if (messageType === "push") {modalTemplate = html`- <or-rule-notification-modal title="push-notification" .action="${this.action}"+ <or-rule-notification-modal title="push-notification" .action="${this.action}" ?readonly=${this.readonly}@or-rules-notification-modal-cancel="${onModalCancel}"@or-rules-notification-modal-ok="${onModalOk}"><or-rule-form-push-notification .message="${message as PushNotificationMessage}"></or-rule-form-push-notification>@@ -374,7 +374,7 @@ export class OrRuleActionNotification extends LitElement {else if (messageType === "email") {modalTemplate = html`- <or-rule-notification-modal title="email" .action="${this.action}"+ <or-rule-notification-modal title="email" .action="${this.action}" ?readonly=${this.readonly}@or-rules-notification-modal-cancel="${onModalCancel}"@or-rules-notification-modal-ok="${onModalOk}"><or-rule-form-email-message .message="${message as EmailNotificationMessage}"></or-rule-form-email-message>@@ -396,7 +396,7 @@ export class OrRuleActionNotification extends LitElement {const type = this.actionType === ActionType.EMAIL_LOCALIZED ? "email" : "push";const title = this.actionType === ActionType.EMAIL_LOCALIZED ? "email" : "push-notification";modalTemplate = html`- <or-rule-notification-modal title="${title}" .action="${this.action}"+ <or-rule-notification-modal title="${title}" .action="${this.action}" ?readonly=${this.readonly}@or-rules-notification-modal-cancel="${onModalCancel}"@or-rules-notification-modal-ok="${onModalOk}"><or-rule-form-localized .message="${message}" .type="${type}" .languages="${languages}" .defaultLang="${defaultLang}"diff --git a/ui/component/or-rules/src/json-viewer/or-rule-action-webhook.ts b/ui/component/or-rules/src/json-viewer/or-rule-action-webhook.tsindex d77fff7dc..804269172 100644--- a/ui/component/or-rules/src/json-viewer/or-rule-action-webhook.ts+++ b/ui/component/or-rules/src/json-viewer/or-rule-action-webhook.ts@@ -16,7 +16,7 @@ const style = css`}.min-width {- min-width: 200px;+ flex: 0 0 240px;}`;diff --git a/ui/component/or-rules/src/json-viewer/or-rule-asset-query.ts b/ui/component/or-rules/src/json-viewer/or-rule-asset-query.tsindex 3d28a2359..6e7c794a3 100644--- a/ui/component/or-rules/src/json-viewer/or-rule-asset-query.ts+++ b/ui/component/or-rules/src/json-viewer/or-rule-asset-query.ts@@ -19,8 +19,6 @@ import {AssetModelUtil, AssetQuery} from "@openremote/model";import {AssetQueryOperator, getAssetIdsFromQuery, getAssetTypeFromQuery, RulesConfig} from "../index";-import "@openremote/or-mwc-components/or-mwc-input";-import {InputType, OrInputChangedEvent} from "@openremote/or-mwc-components/or-mwc-input";import "@openremote/or-attribute-input";import {Util} from "@openremote/core";import {i18next, translate} from "@openremote/or-translate";@@ -31,6 +29,9 @@ import "./modals/or-rule-radial-modal";import { ifDefined } from "lit/directives/if-defined.js";import {when} from "lit/directives/when.js";import moment from "moment";+import {OrVaadinComboBox} from "@openremote/or-vaadin-components/or-vaadin-combo-box";+import {OrVaadinNumberField} from "@openremote/or-vaadin-components/or-vaadin-number-field";+import {InputType} from "@openremote/or-vaadin-components/util";// language=CSSconst style = css`@@ -50,7 +51,7 @@ const style = css`}.min-width {- min-width: 200px;+ flex: 0 0 200px;}.attribute-group > * {@@ -68,22 +69,22 @@ const style = css`}.attribute {display: flex;- align-items: center;+ align-items: baseline;}.attribute > div {display: flex;flex-direction: row;flex-wrap: wrap;- align-items: center;+ align-items: baseline;gap: 6px;}.attribute > div > or-rule-radial-modal {min-width: auto;}- .attribute > div > or-mwc-input[type="button"] {+ .attribute > div > or-vaadin-button {min-width: auto;}- .attribute > div > or-mwc-input:not([type="button"]) {+ .attribute > div > :is(or-vaadin-combo-box, or-vaadin-number-field) {width: 200px;}.attribute > div > or-attribute-input {@@ -101,8 +102,7 @@ const style = css`.invalidLabel {display: flex;- align-items: center;- margin: 14px 3px auto 0;+ align-items: baseline;height: 48px; /* Same as the icon size */}`;@@ -217,7 +217,7 @@ export class OrRuleAssetQuery extends translate(i18next)(LitElement) {const operator = this.getOperator(attributePredicate);const attributeName = this.getAttributeName(attributePredicate);const attribute = asset && asset.attributes && attributeName ? asset.attributes[attributeName] : undefined;- let attributes: [string, string][] = [];+ let attributes: {value: any, label: string}[] = [];const descriptors = AssetModelUtil.getAttributeAndValueDescriptors(asset ? asset.type : assetDescriptor.name, attribute || attributeName, attribute);if (asset && asset.attributes) {@@ -226,7 +226,7 @@ export class OrRuleAssetQuery extends translate(i18next)(LitElement) {.map(attr => {const descriptors = AssetModelUtil.getAttributeAndValueDescriptors(asset.type, attr.name, attr);const label = Util.getAttributeLabel(attr, descriptors[0], asset.type, false);- return [attr.name!, label];+ return {value: attr.name!, label: label};});} else {attributes = !assetTypeInfo || !assetTypeInfo.attributeDescriptors ? [] :@@ -234,18 +234,26 @@ export class OrRuleAssetQuery extends translate(i18next)(LitElement) {.map(ad => {const descriptors = AssetModelUtil.getAttributeAndValueDescriptors(assetDescriptor.name, ad);const label = Util.getAttributeLabel(undefined, descriptors ? descriptors[0] : undefined, assetDescriptor.name, false);- return [ad.name!, label];+ return {value: ad.name!, label: label};});}- attributes.sort(Util.sortByString(attr => attr[1]));+ attributes.sort(Util.sortByString(attr => attr.label));- const operators = attributeName ? this.getOperators(assetDescriptor, descriptors ? descriptors[0] : undefined, descriptors ? descriptors[1] : undefined, attribute, attributeName) : [];+ const operators: {value: any, label: string}[] = attributeName ? this.getOperators(assetDescriptor, descriptors ? descriptors[0] : undefined, descriptors ? descriptors[1] : undefined, attribute, attributeName) : [];return html`- <or-mwc-input type="${InputType.SELECT}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.setAttributeName(attributePredicate, e.detail.value)}" .readonly="${this.readonly || false}" .options="${attributes}" .value="${attributeName}" .label="${i18next.t("attribute")}"></or-mwc-input>- ${attributeName ? html`<or-mwc-input type="${InputType.SELECT}" @or-mwc-input-changed="${(e: OrInputChangedEvent) => this.setOperator(assetDescriptor, attribute, attributeName, attributePredicate, e.detail.value)}" .readonly="${this.readonly || false}" .options="${operators}" .value="${operator}" .label="${i18next.t("operator")}"></or-mwc-input>` : ``}- ${attributePredicate ? this.attributePredicateValueEditorTemplate(assetDescriptor, asset, attributePredicate) : ``}+ <or-vaadin-combo-box ?readonly=${this.readonly} .items=${attributes} value=${attributeName}+ @change=${(ev: Event) => this.setAttributeName(attributePredicate, (ev.currentTarget as OrVaadinComboBox).value)}>+ <or-translate slot="label" value="attribute"></or-translate>+ </or-vaadin-combo-box>+ ${when(attributeName, () => html`+ <or-vaadin-combo-box ?readonly=${this.readonly} .items=${operators} value="${operator}"+ @change=${(ev: Event) => this.setOperator(assetDescriptor, attribute, attributeName!, attributePredicate, (ev.currentTarget as OrVaadinComboBox).value)}>]+ <or-translate slot="label" value="operator"></or-translate>+ </or-vaadin-combo-box>+ `)}+ ${when(attributePredicate, () => this.attributePredicateValueEditorTemplate(assetDescriptor, asset, attributePredicate))}`;}@@ -256,18 +264,20 @@ export class OrRuleAssetQuery extends translate(i18next)(LitElement) {const duration = attributePredicate.timestampOlderThan ?moment.duration(attributePredicate.timestampOlderThan) : undefined;return html`- <or-mwc-input type="${InputType.NUMBER}"- min="0"- .value="${duration?.asMinutes()}"- label="${i18next.t("rulesEditorDuration")}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- const minutes = ev.detail.value;- const newDuration = moment.duration(minutes, "minutes");- attributePredicate.timestampOlderThan = minutes > 0 ?- newDuration.toISOString() : undefined;- this.dispatchEvent(new OrRulesJsonRuleChangedEvent());- }}">- </or-mwc-input>`;+ <or-vaadin-number-field min="0" value=${duration?.asMinutes()}+ @change=${(ev: Event) => {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if(elem.checkValidity()) {+ const minutes = Number(elem.value);+ const newDuration = moment.duration(minutes, "minutes");+ attributePredicate.timestampOlderThan = minutes > 0 ?+ newDuration.toISOString() : undefined;+ this.dispatchEvent(new OrRulesJsonRuleChangedEvent());+ }+ }}>+ <or-translate slot="label" value="rulesEditorDuration"></or-translate>+ </or-vaadin-number-field>+ `;}const valuePredicate = attributePredicate.value;@@ -303,7 +313,7 @@ export class OrRuleAssetQuery extends translate(i18next)(LitElement) {if(descriptors[0]?.format?.asSlider) inputType = InputType.NUMBER;return html`<or-attribute-input .inputType="${ifDefined(inputType)}" @or-attribute-input-changed="${(ev: OrAttributeInputChangedEvent) => this.setValuePredicateProperty(valuePredicate, "value", ev.detail.value)}" .customProvider="${this.config?.inputProvider}" .label="" .assetType="${assetType}" .attributeDescriptor="${descriptors[0]}" .attributeValueDescriptor="${descriptors[1]}" .value="${value}" .readonly="${this.readonly || false}" .fullWidth="${true}"></or-attribute-input>`;case "radial":- return html`<or-rule-radial-modal .query="${this.query}" .assetDescriptor="${assetDescriptor}" .attributePredicate="${attributePredicate}"></or-rule-radial-modal>`;+ return html`<or-rule-radial-modal .query="${this.query}" .assetDescriptor="${assetDescriptor}" .attributePredicate="${attributePredicate}" ?readonly=${this.readonly}></or-rule-radial-modal>`;case "rect":return html `<span>NOT IMPLEMENTED</span>`;case "geojson":@@ -341,23 +351,27 @@ export class OrRuleAssetQuery extends translate(i18next)(LitElement) {const isoDuration = durationMap.get(index);const duration = isoDuration ? moment.duration(isoDuration) : undefined;return html`- <or-mwc-input type="${InputType.NUMBER}" min="0" .readonly="${this.readonly || false}"- .value="${duration?.asMinutes()}" label="${i18next.t("rulesEditorDuration")}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => {- const newDuration = moment.duration(ev.detail.value, "minutes");- if(newDuration.asMinutes() > 0) {- onChange(index, newDuration.toISOString());- } else {- onChange(index, undefined);- }- }}"- ></or-mwc-input>+ <or-vaadin-number-field min="0" ?readonly=${this.readonly} value=${duration?.asMinutes()}+ @change=${(ev: Event) => {+ const elem = ev.currentTarget as OrVaadinNumberField;+ if(elem.checkValidity()) {+ const newDuration = moment.duration(elem.value, "minutes");+ if(newDuration.asMinutes() > 0) {+ onChange(index, newDuration.toISOString());+ } else {+ onChange(index, undefined);+ }+ }+ }}>+ <or-translate slot="label" value="rulesEditorDuration"></or-translate>+ </or-vaadin-number-field>`;} else {return html`- <or-mwc-input type="${InputType.BUTTON}" .readonly="${this.readonly || false}" icon="clock-plus-outline"- title="${i18next.t("rulesEditorAddDuration")}" @or-mwc-input-changed="${() => onAdd(index)}"- ></or-mwc-input>+ <or-vaadin-button theme="icon" ?disabled=${this.readonly} title=${i18next.t("rulesEditorAddDuration")}+ @click=${() => onAdd(index)}>+ <or-icon icon="clock-plus-outline"></or-icon>+ </or-vaadin-button>`;}}@@ -432,19 +446,15 @@ export class OrRuleAssetQuery extends translate(i18next)(LitElement) {// TODO: Add multiselect supportconst ids = getAssetIdsFromQuery(this.query);const idValue = ids && ids.length > 0 ? ids[0] : "*";- const idOptions: Map<string, string> = new Map([- ["*", i18next.t("anyOfThisType")]- ]);+ const idOptions: {value: any, label: string}[] = [+ {value: "*", label: i18next.t("anyOfThisType")}+ ];// Set list of displayed assets, and filtering assets out if needed.// If <= 25 assets: display everything// If between 25 and 100 assets: display everything with search functionality// If >= 100 assets: only display if in line with search inputconst assets: Asset[] = this._cache ? this._cache.assets : [];- const searchable = assets.length > 25;- if (searchable && this._selected) {- idOptions.set(this._selected.id!, this._selected.name!);- }let searchProvider: (search?: string) => Promise<[any, string][]>;@@ -453,27 +463,11 @@ export class OrRuleAssetQuery extends translate(i18next)(LitElement) {<!-- Show SELECT input with 'loading' until the assets are retrieved -->${when((!this._cache || this._loading), () => html`- <or-mwc-input id="idSelect" class="min-width" type="${InputType.SELECT}" .readonly="${true}" .label="${i18next.t("loading")}"></or-mwc-input>+ <or-vaadin-combo-box id="idSelect" class="min-width" readonly>+ <or-translate slot="label" value="loading"></or-translate>+ </or-vaadin-combo-box>`, () => {- if (!searchable) {- assets.forEach(a => idOptions.set(a.id!, a.name!));- } else {- searchProvider = async (search?: string) => {- await this.loadAssets(assetType, search, idValue); // Wait for asset retrieval based on search- if (search) {- return assets.filter(a => a.name?.toLowerCase().includes(search.toLowerCase())).map(a => [a.id!, a.name!] as [string, string]);- } else if (assets.length <= 100) {- assets.forEach(a => idOptions.set(a.id!, a.name!));- return [...idOptions];- } else {- const asset = assets.find(a => a.id === idValue);- if (asset && !Array.from(idOptions.keys()).includes(asset.id!)) {- idOptions.set(asset.id!, asset.name!); // add selected asset if there is one.- }- return [...idOptions];- }- };- }+ assets.forEach(a => idOptions.push({value: a.id!, label: a.name!}));const showAddAttribute = !this.readonly && (!this.config || !this.config.controls || this.config.controls.hideWhenAddAttribute !== true);@@ -489,10 +483,10 @@ export class OrRuleAssetQuery extends translate(i18next)(LitElement) {};return html`- <or-mwc-input id="idSelect" class="min-width filledSelect" type="${InputType.SELECT}" .readonly="${this.readonly || false}" .label="${i18next.t("asset")}"- .options="${[...idOptions]}" .value="${idValue}" .searchProvider="${searchProvider}"- @or-mwc-input-changed="${(e: OrInputChangedEvent) => { this._assetId = (e.detail.value); }}"- ></or-mwc-input>+ <or-vaadin-combo-box id="idSelect" class="min-width" ?readonly=${this.readonly} .items=${idOptions} value=${idValue}+ @change=${(ev: Event) => this._assetId = (ev.currentTarget as OrVaadinComboBox).value}>+ <or-translate slot="label" value="asset"></or-translate>+ </or-vaadin-combo-box><div class="attributes">${this.query.attributes && this.query.attributes.items ? this.query.attributes.items.map((attributePredicate, index) => {return html`@@ -507,10 +501,12 @@ export class OrRuleAssetQuery extends translate(i18next)(LitElement) {</div>` : ``}`;}) : ``}- ${showAddAttribute ? html`- <or-mwc-input class="plus-button" type="${InputType.BUTTON}" icon="plus"- label="rulesEditorAddAttribute" @or-mwc-input-changed="${(_ev: OrInputChangedEvent) => this.addAttributePredicate(this.query!.attributes!)}"></or-mwc-input>- `: ``}+ ${when(showAddAttribute, () => html`+ <or-vaadin-button class="plus-button" @click=${() => this.addAttributePredicate(this.query!.attributes!)}>+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value="rulesEditorAddAttribute"></or-translate>+ </or-vaadin-button>+ `)}</div>`;})}@@ -572,7 +568,7 @@ export class OrRuleAssetQuery extends translate(i18next)(LitElement) {}}- protected getOperators(_assetDescriptor: AssetDescriptor, attributeDescriptor: AttributeDescriptor | undefined, valueDescriptor: ValueDescriptor | undefined, _attribute: Attribute<any> | undefined, attributeName: string): [string, string][] {+ protected getOperators(_assetDescriptor: AssetDescriptor, attributeDescriptor: AttributeDescriptor | undefined, valueDescriptor: ValueDescriptor | undefined, _attribute: Attribute<any> | undefined, attributeName: string): {value: any, label: string}[] {let operators: AssetQueryOperator[] | undefined;@@ -584,7 +580,7 @@ export class OrRuleAssetQuery extends translate(i18next)(LitElement) {operators = this.getOperatorMapValue(this._queryOperatorsMap, getAssetTypeFromQuery(this.query), attributeName, attributeDescriptor, valueDescriptor);}- return operators ? operators.map(v => [v, i18next.t(v)]) : [];+ return operators ? operators.map(v => ({value: v, label: i18next.t(v) })) : [];}protected getOperator(attributePredicate: AttributePredicate): string | undefined {diff --git a/ui/component/or-rules/src/json-viewer/or-rule-condition.ts b/ui/component/or-rules/src/json-viewer/or-rule-condition.tsindex 860e8ef56..5650936c8 100644--- a/ui/component/or-rules/src/json-viewer/or-rule-condition.ts+++ b/ui/component/or-rules/src/json-viewer/or-rule-condition.ts@@ -9,7 +9,6 @@ import {getContentWithMenuTemplate} from "@openremote/or-mwc-components/or-mwc-mimport {ListItem} from "@openremote/or-mwc-components/or-mwc-list";import "@openremote/or-icon";import "@openremote/or-translate";-import {InputType} from "@openremote/or-mwc-components/or-mwc-input";import {Util} from "@openremote/core";import {i18next, translate} from "@openremote/or-translate";import {OrRulesJsonRuleChangedEvent} from "./or-rule-json-viewer";@@ -115,6 +114,7 @@ const style = css`:host {display: flex;flex-direction: row;+ align-items: baseline;}or-rule-asset-query {@@ -124,7 +124,6 @@ const style = css`#type {white-space: nowrap;text-transform: capitalize;- margin: 14px 3px auto 0;}`;@@ -184,15 +183,17 @@ class OrRuleCondition extends translate(i18next)(LitElement) {}if(this.readonly) {typeTemplate = html`- <div id="type" style="--or-mwc-input-color: #${buttonColor}">- <or-mwc-input readonly type="${InputType.BUTTON}" .icon="${buttonIcon || ""}"></or-mwc-input>+ <div id="type" style="--or-icon-fill: #${buttonColor}">+ <or-vaadin-button disabled theme="icon tertiary">+ <or-icon icon=${buttonIcon ?? ""}></or-icon>+ </or-vaadin-button></div>`;} else {typeTemplate = html`- <div id="type" style="--or-mwc-input-color: #${buttonColor}">+ <div id="type" style="--or-icon-fill: #${buttonColor}">${getContentWithMenuTemplate(- html`<or-mwc-input type="${InputType.BUTTON}" .icon="${buttonIcon || ""}"></or-mwc-input>`,+ html`<or-vaadin-button theme="icon tertiary"><or-icon icon=${buttonIcon ?? ""}></or-icon></or-vaadin-button>`,getWhenTypesMenu(this.config, this.assetInfos),type,(value) => this.type = value as ConditionType)}diff --git a/ui/component/or-rules/src/json-viewer/or-rule-then-otherwise.ts b/ui/component/or-rules/src/json-viewer/or-rule-then-otherwise.tsindex 44c92fefa..e630b6ffe 100644--- a/ui/component/or-rules/src/json-viewer/or-rule-then-otherwise.ts+++ b/ui/component/or-rules/src/json-viewer/or-rule-then-otherwise.ts@@ -21,7 +21,6 @@ import {WellknownAssets} from "@openremote/model";import {i18next, translate} from "@openremote/or-translate"-import {InputType} from "@openremote/or-mwc-components/or-mwc-input";import {getContentWithMenuTemplate} from "@openremote/or-mwc-components/or-mwc-menu";import {ListItem} from "@openremote/or-mwc-components/or-mwc-list";import {manager, Util} from "@openremote/core";@@ -223,7 +222,6 @@ const style = css`#type {white-space: nowrap;- margin: 4px 3px auto 0;text-transform: capitalize;}@@ -265,7 +263,6 @@ class OrRuleThenOtherwise extends translate(i18next)(LitElement) {protected ruleRecurrenceTemplate(reset: RuleRecurrence | undefined, readonly?: boolean) {let recurrenceTemplate: TemplateResult | string = ``;- const buttonColor = "inherit";let value = RecurrenceOption.ONCE;if (reset) {@@ -283,15 +280,17 @@ class OrRuleThenOtherwise extends translate(i18next)(LitElement) {}if(readonly) {recurrenceTemplate = html`- <div style="--or-mwc-input-color: ${buttonColor}; margin-right: 6px;">- <or-mwc-input .type="${InputType.BUTTON}" label="${value}"></or-mwc-input>+ <div style="margin-right: 6px;">+ <or-vaadin-button disabled>+ <or-translate value=${value}></or-translate>+ </or-vaadin-button></div>`;} else {recurrenceTemplate = html`- <div style="--or-mwc-input-color: ${buttonColor}; margin-right: 6px;">+ <div style="margin-right: 6px;">${getContentWithMenuTemplate(- html`<or-mwc-input .type="${InputType.BUTTON}" label="${value}"></or-mwc-input>`,+ html`<or-vaadin-button><or-translate value="${value}"></or-translate></or-vaadin-button>`,getRecurrenceMenu(this.config),value,(value) => this.setRecurrenceOption(value as RecurrenceOption))}@@ -357,15 +356,17 @@ class OrRuleThenOtherwise extends translate(i18next)(LitElement) {if (readonly) {typeTemplate = html`- <div id="type" style="--or-mwc-input-color: #${buttonColor}">- <or-mwc-input type="${InputType.BUTTON}" .icon="${buttonIcon || ""}"></or-mwc-input>+ <div id="type" style="--or-icon-fill: #${buttonColor}">+ <or-vaadin-button theme="icon tertiary" disabled>+ <or-icon icon=${buttonIcon ?? ""}></or-icon>+ </or-vaadin-button></div>`;} else {typeTemplate = html`- <div id="type" style="--or-mwc-input-color: #${buttonColor}">+ <div id="type" style="--or-icon-fill: #${buttonColor}">${getContentWithMenuTemplate(- html`<or-mwc-input type="${InputType.BUTTON}" .icon="${buttonIcon || ""}"></or-mwc-input>`,+ html`<or-vaadin-button theme="icon tertiary"><or-icon icon=${buttonIcon ?? ""}></or-icon></or-vaadin-button>`,getActionTypesMenu(this.config, this.assetInfos),action.action,(value) => this.setActionType(actions, action, value as string))}@@ -423,9 +424,11 @@ class OrRuleThenOtherwise extends translate(i18next)(LitElement) {${!this.rule.then ? `` : this.rule.then.map((action: RuleActionUnion) => this.ruleActionTemplate(this.rule.then!, action, this.readonly))}${thenAllowAdd ? html`<span class="add-button-wrapper">- ${getContentWithMenuTemplate(- html`<or-mwc-input class="plus-button" type="${InputType.BUTTON}" icon="plus"- .label="${i18next.t("rulesEditorAddAction")}"></or-mwc-input>`,+ ${getContentWithMenuTemplate(html`+ <or-vaadin-button theme="tertiary">+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value="rulesEditorAddAction"></or-translate>+ </or-vaadin-button>`,getActionTypesMenu(this.config, this.assetInfos),undefined,(value) => this.addAction(value as string))}diff --git a/ui/component/or-rules/src/json-viewer/or-rule-trigger-query.ts b/ui/component/or-rules/src/json-viewer/or-rule-trigger-query.tsindex c18f76b86..6739176db 100644--- a/ui/component/or-rules/src/json-viewer/or-rule-trigger-query.ts+++ b/ui/component/or-rules/src/json-viewer/or-rule-trigger-query.ts@@ -10,6 +10,10 @@ import {Util} from "@openremote/core";import {DialogAction, OrMwcDialog, OrMwcDialogOpenedEvent} from "@openremote/or-mwc-components/or-mwc-dialog";import {OrMap, OrMapClickedEvent} from "@openremote/or-map";import {i18next} from "@openremote/or-translate";+import {OrVaadinSelect} from "@openremote/or-vaadin-components/or-vaadin-select";+import { when } from "lit/directives/when.js";+import { ifDefined } from "lit/directives/if-defined.js";+import {OrVaadinTimePicker} from "@openremote/or-vaadin-components/or-vaadin-time-picker";// language=CSSconst style = css`@@ -23,12 +27,12 @@ const style = css`.trigger-group {flex-grow: 1;display: flex;- align-items: center;+ align-items: baseline;flex-direction: row;flex-wrap: wrap;}.min-width {- min-width: 200px;+ flex: 0 0 200px;}.width {width: 200px;@@ -141,22 +145,34 @@ export class OrRuleTriggerQuery extends LitElement {return html`<div class="trigger-group">- <or-mwc-input class="min-width" type="${InputType.SELECT}" .options="${this.triggerOptions.map((t) => t.value)}" .value="${this.selectedTrigger.value}" label="${i18next.t('triggerType')}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => { this.setTrigger(this.triggerOptions.find((t) => t.value == ev.detail.value)!); }}">- </or-mwc-input>- ${this.selectedTrigger ? html`+ <or-vaadin-select class="min-width" value=${this.selectedTrigger.key}+ .items=${this.triggerOptions.map(t => ({value: t.key, label: t.value}))}+ @change=${(ev: Event) => this.setTrigger(this.triggerOptions.find(o => o.key === ((ev.currentTarget as OrVaadinSelect).value))!)}>+ <or-translate slot="label" value="triggerType"></or-translate>+ </or-vaadin-select>+ ${when(this.selectedTrigger, () => html`${this.selectedTrigger.key == this.triggerOptions[0].key ? html`- <or-mwc-input class="min-width" type="${InputType.TIME}" .value="${(this.condition.cron ? moment(Util.cronStringToISOString(this.condition.cron, true)).format('HH:mm') : undefined)}" label="${i18next.t('timeOfDay')}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => { this.setTime(ev.detail.value) }}">- </or-mwc-input>+ <!-- Time picker -->+ <or-vaadin-time-picker class="min-width" step="900" auto-open-disabled+ value=${ifDefined(this.condition.cron ? moment(Util.cronStringToISOString(this.condition.cron, true)).format("HH:mm:ss") : undefined)}+ @change=${(ev: Event) => this.setTime((ev.currentTarget as OrVaadinTimePicker).value)}>+ <or-translate slot="label" value="timeOfDay"></or-translate>+ </or-vaadin-time-picker>` : html`- <or-mwc-input class="min-width width" type="${InputType.NUMBER}" .value="${this.condition.sun?.offsetMins}" label="${i18next.t('offsetInMinutes')}"- @or-mwc-input-changed="${(ev: OrInputChangedEvent) => { this.setOffset(ev.detail.value) }}">- </or-mwc-input>- <or-mwc-input type="${InputType.BUTTON}" class="min-width" @or-mwc-input-changed="${onMapModalOpen}" label="location"></or-mwc-input>+ <!-- Sun position selection -->+ <or-vaadin-number-field class="min-width width" value=${this.condition.sun?.offsetMins} min="0"+ @change=${(ev: Event) => {+ const elem = ev.currentTarget as HTMLInputElement;+ if(elem.checkValidity()) this.setOffset(Number(elem.value))+ }}>+ <or-translate slot="label" value="offsetInMinutes"></or-translate>+ </or-vaadin-number-field>+ <or-vaadin-button class="min-width" @click=${() => onMapModalOpen()}>+ <or-translate value="location"></or-translate>+ </or-vaadin-button><or-mwc-dialog id="map-modal" heading="${i18next.t('pickLocation')}" .actions="${modalActions}"></or-mwc-dialog>`}- ` : undefined}+ `)}</div>`}diff --git a/ui/component/or-rules/src/json-viewer/or-rule-when.ts b/ui/component/or-rules/src/json-viewer/or-rule-when.tsindex 25e9a833a..733631117 100644--- a/ui/component/or-rules/src/json-viewer/or-rule-when.ts+++ b/ui/component/or-rules/src/json-viewer/or-rule-when.ts@@ -5,7 +5,6 @@ import {OrRulesRuleUnsupportedEvent, RulesConfig} from "../index";import {buttonStyle} from "../style";import "./or-rule-condition";import {i18next, translate} from "@openremote/or-translate"-import {InputType} from "@openremote/or-mwc-components/or-mwc-input";import {OrRulesJsonRuleChangedEvent} from "./or-rule-json-viewer";import {getWhenTypesMenu, updateRuleConditionType} from "./or-rule-condition";import {getContentWithMenuTemplate} from "@openremote/or-mwc-components/or-mwc-menu";@@ -201,8 +200,12 @@ class OrRuleWhen extends translate(i18next)(LitElement) {addTemplate = html`<span class="add-button-wrapper">${getContentWithMenuTemplate(- html`<or-mwc-input class="plus-button" type="${InputType.BUTTON}" icon="plus"- .label="${i18next.t("rulesEditorAddCondition")}"></or-mwc-input>`,+ html`+ <or-vaadin-button theme="tertiary">+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value="rulesEditorAddCondition"></or-translate>+ </or-vaadin-button>+ `,getWhenTypesMenu(this.config, this.assetInfos),undefined,(value) => this.addCondition(group, value as string))}@@ -257,7 +260,12 @@ class OrRuleWhen extends translate(i18next)(LitElement) {<strong>${i18next.t(!this.rule.when.groups || this.rule.when.groups.length === 0 ? "when" : "orWhen")}...</strong><span class="add-button-wrapper">${getContentWithMenuTemplate(- html`<or-mwc-input class="plus-button" type="${InputType.BUTTON}" icon="plus"></or-mwc-input>`,+ html`+ <or-vaadin-button theme="tertiary">+ <or-icon slot="prefix" icon="plus"></or-icon>+ <or-translate value="rulesEditorAddCondition"></or-translate>+ </or-vaadin-button>+ `,getWhenTypesMenu(this.config, this.assetInfos),undefined,(value) => this.addGroup(this.rule!.when!, value as string))}diff --git a/ui/component/or-rules/src/or-rule-group-viewer.ts b/ui/component/or-rules/src/or-rule-group-viewer.tsindex ae9496316..78537d025 100644--- a/ui/component/or-rules/src/or-rule-group-viewer.ts+++ b/ui/component/or-rules/src/or-rule-group-viewer.ts@@ -21,7 +21,6 @@ import {i18next, translate} from "@openremote/or-translate";import {html, LitElement, PropertyValues } from "lit";import { customElement, property, query, state } from "lit/decorators.js";import {style} from "./or-rule-viewer";-import { InputType, OrMwcInput } from "@openremote/or-mwc-components/or-mwc-input";import {OrRulesGroupNameChangeEvent} from "./index";import { showSnackbar } from "@openremote/or-mwc-components/or-mwc-snackbar";@@ -41,7 +40,7 @@ export class OrRuleGroupViewer extends translate(i18next)(LitElement) {protected _lastSaved?: string;@query("#rule-name")- protected _groupNameInput?: OrMwcInput;+ protected _groupNameInput?: HTMLInputElement;static get styles() {return [style];@@ -58,31 +57,30 @@ export class OrRuleGroupViewer extends translate(i18next)(LitElement) {return html`<div id="main-wrapper" class="wrapper"><div id="rule-header">- <or-mwc-input id="rule-name" outlined .type="${InputType.TEXT}" .label="${i18next.t("ruleGroupName")}" focused- .value="${this.group}" ?disabled="${this.readonly}" required minlength="1" maxlength="255" @input="${this._onGroupNameInput}"- ></or-mwc-input>+ <or-vaadin-text-field id="rule-name" value=${this.group} ?readonly=${this.readonly} required minlength="1" maxlength="255" autofocus+ @input=${(ev: Event) => this._onGroupNameChange(ev)}>+ <or-translate slot="label" value="ruleGroupName"></or-translate>+ </or-vaadin-text-field><div id="rule-header-controls">- <or-mwc-input .type="${InputType.BUTTON}" id="save-btn" label="save" raised ?disabled="${this._cannotSave()}" @or-mwc-input-changed="${this._onSaveClicked}"></or-mwc-input>+ <or-vaadin-button id="save-btn" theme="primary" ?disabled=${this._cannotSave()}+ @click=${() => this._onSaveClicked()}>+ <or-translate value="save"></or-translate>+ </or-vaadin-button></div></div></div>`}- protected _onGroupNameInput(ev: InputEvent) {- const value = this._groupNameInput?.nativeValue;- if(value) this._changeName(value);- this.requestUpdate();- }-- protected _changeName(name: string) {- if(name.length >= 3 && name.length <= 255) {- this.group = name;+ protected _onGroupNameChange(ev: Event) {+ const elem = ev.currentTarget as HTMLInputElement;+ if(elem.checkValidity()) {+ this.group = elem.value;}}protected _cannotSave() {- return this.readonly || !this._groupNameInput?.nativeValue || !this._groupNameInput?.valid || (this._groupNameInput?.nativeValue || "") === this._lastSaved;+ return this.readonly || !this._groupNameInput?.checkValidity() || (this._groupNameInput?.value ?? "") === this._lastSaved;}protected _onSaveClicked(): void {diff --git a/ui/component/or-rules/src/or-rule-tree.ts b/ui/component/or-rules/src/or-rule-tree.tsindex 6a9e8a30a..a1a1ff422 100644--- a/ui/component/or-rules/src/or-rule-tree.ts+++ b/ui/component/or-rules/src/or-rule-tree.ts@@ -198,12 +198,18 @@ export class OrRuleTree extends OrTreeMenu {<div id="tree-header-actions">${when((this._selectedTypes.size === 1 && this._selectedTypes.has('ruleset')) && !this.readonly, () => html`${when(this._findSelectedTreeNodes().length === 1 && !this._isSelectedLegacyJavascriptRuleset(), () => html`- <or-mwc-input type=${InputType.BUTTON} icon="content-copy" @or-mwc-input-changed=${this._onCopyClicked}></or-mwc-input>+ <or-vaadin-button theme="icon" @click=${(ev: Event) => this._onCopyClicked(ev)}>+ <or-icon icon="content-copy"></or-icon>+ </or-vaadin-button>`)}- <or-mwc-input type=${InputType.BUTTON} icon="delete" @or-mwc-input-changed=${this._onDeleteClicked}></or-mwc-input>+ <or-vaadin-button theme="icon" @click=${(ev: Event) => this._onDeleteClicked(ev)}>+ <or-icon icon="delete"></or-icon>+ </or-vaadin-button>`)}${when((this._selectedTypes.size === 1 && this._selectedTypes.has('group')) && !this.readonly, () => html`- <or-mwc-input type=${InputType.BUTTON} icon="delete" @or-mwc-input-changed=${this._onDeleteClicked}></or-mwc-input>+ <or-vaadin-button theme="icon" @click=${(ev: Event) => this._onDeleteClicked(ev)}>+ <or-icon icon="delete"></or-icon>+ </or-vaadin-button>`)}${this._getAddActionTemplate()}${this._getSortActionTemplate(this.sortBy, this.sortOptions)}@@ -225,7 +231,7 @@ export class OrRuleTree extends OrTreeMenu {* HTML callback on when the 'copy' menu option is pressed.* The function duplicates the current selected rule, and shows it inside the viewer window.*/- protected _onCopyClicked(_ev: OrInputChangedEvent) {+ protected _onCopyClicked(_ev: Event) {const selected = this._findSelectedTreeNodes() as RuleTreeNode[];if (selected.length !== 1) {return;@@ -263,7 +269,7 @@ export class OrRuleTree extends OrTreeMenu {* The function deletes the rule that is affiliated with selected tree node,* after prompting a modal that the user confirms this action.*/- protected _onDeleteClicked(_ev: OrInputChangedEvent) {+ protected _onDeleteClicked(_ev: Event) {const selected = this._findSelectedTreeNodes() as RuleTreeNode[];if (selected.length > 0) {const selectedRules = selected.map(node => node.ruleset).filter(x => x) as RulesetUnion[];@@ -454,7 +460,10 @@ export class OrRuleTree extends OrTreeMenu {return getContentWithMenuTemplate(html`- <or-mwc-input type=${InputType.BUTTON} icon="plus" title="${i18next.t("addRule")}"></or-mwc-input>`,+ <or-vaadin-button theme="icon" title=${i18next.t("addRule")}>+ <or-icon icon="plus"></or-icon>+ </or-vaadin-button>+ `,menuOptions,undefined,value => onValueChange(String(value))diff --git a/ui/component/or-rules/src/or-rule-viewer.ts b/ui/component/or-rules/src/or-rule-viewer.tsindex 8bca8e970..f1427dfb0 100644--- a/ui/component/or-rules/src/or-rule-viewer.ts+++ b/ui/component/or-rules/src/or-rule-viewer.ts@@ -34,14 +34,13 @@ import "./json-viewer/or-rule-json-viewer";import "./or-rule-text-viewer";import "./flow-viewer/components/flow-editor";import "@openremote/or-scheduler";-import "@openremote/or-mwc-components/or-mwc-input";-import {InputType, OrInputChangedEvent, OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";import {i18next, translate} from "@openremote/or-translate"import {GenericAxiosResponse} from "@openremote/rest";import {showErrorDialog} from "@openremote/or-mwc-components/or-mwc-dialog";import {project} from "./flow-viewer/components/flow-editor";import { INTUITIVE_NOT_APPLICABLE, OrSchedulerChangedEvent, RRulePartKeys } from "@openremote/or-scheduler";import {when} from "lit/directives/when.js";+import {OrVaadinButton} from "@openremote/or-vaadin-components/or-vaadin-button";const DISABLED_RRULE_PARTS = ["interval",@@ -90,7 +89,7 @@ export const style = css`#rule-header {display: flex;- align-items: center;+ align-items: baseline;width: 100%;box-sizing: border-box;min-height: var(--internal-or-rules-header-height);@@ -179,7 +178,7 @@ export class OrRuleViewer extends translate(i18next)(LitElement) {protected wrapperElem!: HTMLDivElement;@query("#save-btn")- protected saveBtnElem!: OrMwcInput;+ protected saveBtnElem!: OrVaadinButton;protected _focusName = false;@@ -264,13 +263,23 @@ export class OrRuleViewer extends translate(i18next)(LitElement) {return html`<div id="main-wrapper" class="wrapper"><div id="rule-header">- <or-mwc-input id="rule-name" outlined .type="${InputType.TEXT}" .label="${i18next.t("ruleName")}" ?focused="${this._focusName}" .value="${this.ruleset ? this.ruleset.name : null}" ?disabled="${readonly}" required minlength="1" maxlength="255" @or-mwc-input-changed="${(e: OrInputChangedEvent) => this._changeName(e.detail.value)}"></or-mwc-input>- <or-icon class="${statusClass}" title="${i18next.t("rulesetStatus." + statusText)}" icon="${statusIcon}"></or-icon>- <span id="rule-id">${this.ruleset.id ? "ID: " + this.ruleset.id : ""}</span>+ <or-vaadin-text-field id="rule-name" value=${this.ruleset?.name} required+ ?focused=${this._focusName} ?readonly=${readonly}+ minlength="1" maxlength="255"+ @change=${(ev: Event) => {+ const elem = ev.currentTarget as HTMLInputElement;+ if(elem?.checkValidity()) this._changeName((ev.currentTarget as HTMLInputElement).value)+ }}>+ <or-translate slot="label" value="ruleName"></or-translate>+ </or-vaadin-text-field>+ <div style="display: flex; align-items: center;">+ <or-icon class="${statusClass}" title="${i18next.t("rulesetStatus." + statusText)}" icon="${statusIcon}"></or-icon>+ <span id="rule-id">${this.ruleset.id ? "ID: " + this.ruleset.id : ""}</span>+ </div><div id="rule-header-controls"><span id="active-wrapper">- <or-translate value="enabled"></or-translate>- <or-mwc-input .type="${InputType.CHECKBOX}" .value="${this.ruleset && this.ruleset.enabled}" ?disabled="${readonly || !this.ruleset.id}" @or-mwc-input-changed="${this._toggleEnabled}"></or-mwc-input>+ <span style="margin-right: 4px;"><or-translate value="enabled"></or-translate></span>+ <or-vaadin-checkbox ?checked=${this.ruleset?.enabled} ?disabled=${readonly || !this.ruleset.id} @change=${() => this._toggleEnabled()}></or-vaadin-checkbox></span>${when(!readonly, () => html`<or-scheduler@@ -284,7 +293,9 @@ export class OrRuleViewer extends translate(i18next)(LitElement) {@or-scheduler-changed="${this._onSchedulerChanged}"></or-scheduler>`)}- <or-mwc-input .type="${InputType.BUTTON}" id="save-btn" label="save" raised ?disabled="${this._cannotSave()}" @or-mwc-input-changed="${this._onSaveClicked}"></or-mwc-input>+ <or-vaadin-button id="save-btn" theme="primary" ?disabled=${this._cannotSave()} @click=${() => this._onSaveClicked()}>+ <or-translate value="save"></or-translate>+ </or-vaadin-button></div></div>diff --git a/ui/component/or-rules/src/style.ts b/ui/component/or-rules/src/style.tsindex 137cbcaa3..ea2b52fa6 100644--- a/ui/component/or-rules/src/style.ts+++ b/ui/component/or-rules/src/style.ts@@ -53,7 +53,7 @@ export const buttonStyle = css`}.plus-button {- --or-icon-fill: var(--internal-or-rules-button-color);+ width: 200px;}.add-button {diff --git a/ui/component/or-vaadin-components/package.json b/ui/component/or-vaadin-components/package.jsonindex 8d09ea3a0..50213aae9 100644--- a/ui/component/or-vaadin-components/package.json+++ b/ui/component/or-vaadin-components/package.json@@ -31,22 +31,27 @@"dependencies": {"@openremote/core": "workspace:*","@openremote/model": "workspace:*",- "@vaadin/button": "~25.0.3",- "@vaadin/checkbox": "~25.0.3",- "@vaadin/checkbox-group": "~25.0.3",- "@vaadin/date-picker": "~25.0.3",- "@vaadin/date-time-picker": "~25.0.3",- "@vaadin/dialog": "~25.0.3",- "@vaadin/icon": "~25.0.3",- "@vaadin/icons": "~25.0.3",- "@vaadin/multi-select-combo-box": "~25.0.3",- "@vaadin/number-field": "~25.0.3",- "@vaadin/password-field": "~25.0.3",- "@vaadin/radio-group": "~25.0.3",- "@vaadin/select": "~25.0.3",- "@vaadin/text-area": "~25.0.3",- "@vaadin/text-field": "~25.0.3",- "@vaadin/time-picker": "~25.0.3",+ "@vaadin/button": "~25.1.3",+ "@vaadin/checkbox": "~25.1.3",+ "@vaadin/checkbox-group": "~25.1.3",+ "@vaadin/combo-box": "~25.1.3",+ "@vaadin/date-picker": "~25.1.3",+ "@vaadin/date-time-picker": "~25.1.3",+ "@vaadin/dialog": "~25.1.3",+ "@vaadin/icon": "~25.1.3",+ "@vaadin/icons": "~25.1.3",+ "@vaadin/item": "~25.1.3",+ "@vaadin/list-box": "~25.1.3",+ "@vaadin/menu-bar": "~25.1.3",+ "@vaadin/multi-select-combo-box": "~25.1.3",+ "@vaadin/number-field": "~25.1.3",+ "@vaadin/password-field": "~25.1.3",+ "@vaadin/radio-group": "~25.1.3",+ "@vaadin/select": "~25.1.3",+ "@vaadin/slider": "~25.1.3",+ "@vaadin/text-area": "~25.1.3",+ "@vaadin/text-field": "~25.1.3",+ "@vaadin/time-picker": "~25.1.3","lit": "^3.3.1"},"publishConfig": {diff --git a/ui/component/or-vaadin-components/src/or-vaadin-combo-box.ts b/ui/component/or-vaadin-components/src/or-vaadin-combo-box.tsnew file mode 100644index 000000000..be04eb7a9--- /dev/null+++ b/ui/component/or-vaadin-components/src/or-vaadin-combo-box.ts@@ -0,0 +1,42 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+import {customElement} from "lit/decorators.js";+import {ComboBox} from "@vaadin/combo-box";+import {OrVaadinComponent} from "./util";+import {PropertyValues, type LitElement} from "lit";++/**+ * Vaadin uses custom directives for rendering the dialog content.+ * https://lit.dev/docs/templates/custom-directives/+ * https://vaadin.com/docs/latest/components/combo-box/+ */+export {comboBoxRenderer, ComboBoxLitRenderer} from "@vaadin/combo-box/lit";++@customElement("or-vaadin-combo-box")+export class OrVaadinComboBox extends (ComboBox as new () => ComboBox & LitElement) implements OrVaadinComponent {++ override shouldUpdate(changedProps: PropertyValues) {+ if(changedProps.has("items")) {+ // To prevent unnecessary component updates, we do a strict JSON check on the list of items.+ return JSON.stringify(this.items) !== JSON.stringify(changedProps.get("items")) && super.shouldUpdate(changedProps);+ }+ return super.shouldUpdate(changedProps);+ }+}diff --git a/ui/component/or-vaadin-components/src/or-vaadin-date-time-picker.ts b/ui/component/or-vaadin-components/src/or-vaadin-date-time-picker.tsindex 3425e6bc7..a9c533449 100644--- a/ui/component/or-vaadin-components/src/or-vaadin-date-time-picker.ts+++ b/ui/component/or-vaadin-components/src/or-vaadin-date-time-picker.ts@@ -22,4 +22,9 @@ import { DateTimePicker } from "@vaadin/date-time-picker";import { OrVaadinComponent } from "./util";@customElement("or-vaadin-date-time-picker")-export class OrVaadinDateTimePicker extends DateTimePicker implements OrVaadinComponent {}+export class OrVaadinDateTimePicker extends DateTimePicker implements OrVaadinComponent {++ public static getLocalizedISOString(d?: Date) {+ return d && new Date(d.getTime() - d.getTimezoneOffset() * 60000).toISOString().slice(0, 16);+ }+}diff --git a/ui/component/or-vaadin-components/src/or-vaadin-dialog.ts b/ui/component/or-vaadin-components/src/or-vaadin-dialog.tsindex 8dd0e287f..e0d4b4e3a 100644--- a/ui/component/or-vaadin-components/src/or-vaadin-dialog.ts+++ b/ui/component/or-vaadin-components/src/or-vaadin-dialog.ts@@ -34,7 +34,7 @@ export {DialogRendererDirective,dialogFooterRenderer,DialogFooterRendererDirective,-} from "@vaadin/dialog/lit.js";+} from "@vaadin/dialog/lit";type WithLit<T> = T & typeof LitElement;diff --git a/ui/component/or-vaadin-components/src/or-vaadin-email-field.ts b/ui/component/or-vaadin-components/src/or-vaadin-email-field.tsnew file mode 100644index 000000000..c558aff05--- /dev/null+++ b/ui/component/or-vaadin-components/src/or-vaadin-email-field.ts@@ -0,0 +1,42 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+import {customElement} from "lit/decorators.js";+import {TextField} from "@vaadin/text-field";+import {OrVaadinComponent} from "./util";+import {type LitElement} from "lit";++@customElement("or-vaadin-email-field")+export class OrVaadinEmailField extends (TextField as new () => TextField & LitElement) implements OrVaadinComponent {++ override _onEnter(ev: KeyboardEvent) {+ this.dispatchEvent(new CustomEvent("submit", {bubbles: true, composed: true}));+ return super._onEnter(ev);+ }++ constructor() {+ super();++ // Instead of using the `@vaadin/email-field` package, we use this _setType() method.+ // This is because Vaadin their package, directly inherits TextField, causing the component to break.+ // Therefore, we manually set the input type and pattern, which is not any different from the Web API specification.+ (this as any)._setType('email');+ this.pattern = '^[a-zA-Z0-9_\\-+]+(?:\\.[a-zA-Z0-9_\\-+]+)*@[a-zA-Z0-9\\-.]+\\.[a-zA-Z0-9\\-]{2,}$';+ }+}diff --git a/ui/component/or-vaadin-components/src/or-vaadin-input.ts b/ui/component/or-vaadin-components/src/or-vaadin-input.tsindex 7b7abd23b..b72bd51e6 100644--- a/ui/component/or-vaadin-components/src/or-vaadin-input.ts+++ b/ui/component/or-vaadin-components/src/or-vaadin-input.ts@@ -21,8 +21,11 @@ import {css, html, LitElement, PropertyValues, TemplateResult} from "lit";import {customElement, property, query} from "lit/decorators.js";import {InputType} from "./util";import "./or-vaadin-checkbox";+import "./or-vaadin-email-field";import "./or-vaadin-number-field";import "./or-vaadin-password-field";+import "./or-vaadin-select";+import "./or-vaadin-slider";import "./or-vaadin-text-field";import "./or-vaadin-text-area";@@ -58,6 +61,7 @@ export class OrVaadinInput extends LitElement {customElements.get("or-vaadin-number-field"),customElements.get("or-vaadin-password-field"),customElements.get("or-vaadin-select"),+ customElements.get("or-vaadin-slider"),customElements.get("or-vaadin-text-area"),customElements.get("or-vaadin-text-field")];@@ -72,9 +76,10 @@ export class OrVaadinInput extends LitElement {[InputType.CHECKBOX, OrVaadinInput.getCheckboxTemplate],[InputType.NUMBER, OrVaadinInput.getNumberFieldTemplate],[InputType.PASSWORD, OrVaadinInput.getPasswordFieldTemplate],+ [InputType.RANGE, OrVaadinInput.getSliderTemplate],[InputType.SELECT, OrVaadinInput.getSelectTemplate],[InputType.TEXT, OrVaadinInput.getTextFieldTemplate],- [InputType.TEXTAREA, OrVaadinInput.getTextAreaTemplate],+ [InputType.TEXTAREA, OrVaadinInput.getTextAreaTemplate]]);/**@@ -133,12 +138,13 @@ export class OrVaadinInput extends LitElement {}updated(changedProps: PropertyValues) {- changedProps.forEach((_, key) => this._onPropertyChange(String(key)));+ changedProps.forEach((_, key) => this._onPropertyChange(String(key), this[String(key) as keyof OrVaadinInput]));return super.updated(changedProps);}firstUpdated(_changedProps: PropertyValues) {for (const name of this.getAttributeNames()) {+ // console.debug(this._getLoggingPrefix() + `firstUpdated for ${name} (${typeof this.getAttribute(name)}) to`, this.getAttribute(name));this._applyAttribute(name, this.getAttribute(name), this._elem);}return super.firstUpdated(_changedProps);@@ -188,6 +194,7 @@ export class OrVaadinInput extends LitElement {mutations.filter(mutation => mutation.type === "attributes" && mutation.attributeName).forEach(mutation => {+ // console.debug(this._getLoggingPrefix() + `_onAttributeChange for ${mutation.attributeName} (${typeof this.getAttribute(mutation.attributeName!)})`, this.getAttribute(mutation.attributeName!));this._applyAttribute(mutation.attributeName!, this.getAttribute(mutation.attributeName!), this._elem);});});@@ -200,6 +207,7 @@ export class OrVaadinInput extends LitElement {* @protected*/protected _onPropertyChange(name: string, newValue?: any) {+ // console.debug(this._getLoggingPrefix() + `_onPropertyChange for ${name} (${typeof newValue}) to`, newValue);newValue ??= (this as Record<string, unknown>)[String(name)];this._applyAttribute(name, JSON.stringify(newValue), this._elem);}@@ -258,6 +266,10 @@ export class OrVaadinInput extends LitElement {return html`<or-vaadin-select id="elem" @change=${onChange}></or-vaadin-select>`;}+ public static getSliderTemplate(onChange?: (e: Event) => void) {+ return html`<or-vaadin-slider id="elem" @change=${onChange}></or-vaadin-slider>`+ }+public static getTextAreaTemplate(onChange?: (e: Event) => void) {return html`<or-vaadin-text-area id="elem" @change=${onChange}></or-vaadin-text-area>`;}@@ -265,6 +277,10 @@ export class OrVaadinInput extends LitElement {public static getTextFieldTemplate(onChange?: (e: Event) => void) {return html`<or-vaadin-text-field id="elem" @change=${onChange}></or-vaadin-text-field>`;}++ protected _getLoggingPrefix(): string {+ return `[${this.getAttribute("label")} ${this.type}] `;+ }}// Before the class is initialized, register the property fields of the underlying Vaadin classesdiff --git a/ui/component/or-vaadin-components/src/or-vaadin-item.ts b/ui/component/or-vaadin-components/src/or-vaadin-item.tsnew file mode 100644index 000000000..dfd017b01--- /dev/null+++ b/ui/component/or-vaadin-components/src/or-vaadin-item.ts@@ -0,0 +1,27 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+import {customElement} from "lit/decorators.js";+import {Item} from "@vaadin/item";+import {OrVaadinComponent} from "./util";+import {type LitElement} from "lit";++@customElement("or-vaadin-item")+export class OrVaadinItem extends (Item as new () => Item & LitElement) implements OrVaadinComponent {+}diff --git a/ui/component/or-vaadin-components/src/or-vaadin-list-box.ts b/ui/component/or-vaadin-components/src/or-vaadin-list-box.tsnew file mode 100644index 000000000..6556b8bb3--- /dev/null+++ b/ui/component/or-vaadin-components/src/or-vaadin-list-box.ts@@ -0,0 +1,38 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+import {customElement} from "lit/decorators.js";+import {ListBox} from "@vaadin/list-box";+import {OrVaadinComponent} from "./util";+import {type LitElement} from "lit";++export interface ListItem {+ icon?: string;+ trailingIcon?: string;+ text?: string;+ translate?: boolean;+ secondaryText?: string;+ value: any;+ data?: any;+ styleMap?: {[style: string]: string};+}++@customElement("or-vaadin-list-box")+export class OrVaadinListBox extends (ListBox as new () => ListBox & LitElement) implements OrVaadinComponent {+}diff --git a/ui/component/or-vaadin-components/src/or-vaadin-menu-bar.ts b/ui/component/or-vaadin-components/src/or-vaadin-menu-bar.tsnew file mode 100644index 000000000..0e2f1d494--- /dev/null+++ b/ui/component/or-vaadin-components/src/or-vaadin-menu-bar.ts@@ -0,0 +1,37 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+import {MenuBar} from "@vaadin/menu-bar";+import {LitElement, render, TemplateResult} from "lit";+import {customElement} from "lit/decorators.js";+import {OrVaadinComponent} from "./util";+import "@vaadin/menu-bar";++export {MenuBarItem} from "@vaadin/menu-bar";++export function createMenuBarItem(content: TemplateResult) {+ const item = document.createElement("vaadin-menu-bar-item");+ render(content, item);+ return item;+}++@customElement("or-vaadin-menu-bar")+export class OrVaadinMenuBar extends (MenuBar as new () => MenuBar & LitElement) implements OrVaadinComponent {++}diff --git a/ui/component/or-vaadin-components/src/or-vaadin-multi-select-combo-box.ts b/ui/component/or-vaadin-components/src/or-vaadin-multi-select-combo-box.tsindex f29993d9f..1a906b413 100644--- a/ui/component/or-vaadin-components/src/or-vaadin-multi-select-combo-box.ts+++ b/ui/component/or-vaadin-components/src/or-vaadin-multi-select-combo-box.ts@@ -20,7 +20,8 @@import { customElement } from "lit/decorators.js";import { MultiSelectComboBox } from "@vaadin/multi-select-combo-box";import { OrVaadinComponent } from "./util";+import { LitElement, PropertyValues } from "lit";@customElement("or-vaadin-multi-select-combo-box")-export class OrVaadinMultiSelectComboBox extends MultiSelectComboBox implements OrVaadinComponent {+export class OrVaadinMultiSelectComboBox extends (MultiSelectComboBox as new () => MultiSelectComboBox & LitElement) implements OrVaadinComponent {}diff --git a/ui/component/or-vaadin-components/src/or-vaadin-select.ts b/ui/component/or-vaadin-components/src/or-vaadin-select.tsindex 96ff172f2..e410cd1d2 100644--- a/ui/component/or-vaadin-components/src/or-vaadin-select.ts+++ b/ui/component/or-vaadin-components/src/or-vaadin-select.ts@@ -22,6 +22,11 @@ import {customElement} from "lit/decorators.js";import {OrVaadinComponent} from "./util";import {type LitElement} from "lit";+export {SelectItem} from "@vaadin/select";++/**+ * @slot label - The label element+ */@customElement("or-vaadin-select")export class OrVaadinSelect extends (Select as new () => Select & LitElement) implements OrVaadinComponent {diff --git a/ui/component/or-vaadin-components/src/or-vaadin-slider.ts b/ui/component/or-vaadin-components/src/or-vaadin-slider.tsnew file mode 100644index 000000000..1779d6a9b--- /dev/null+++ b/ui/component/or-vaadin-components/src/or-vaadin-slider.ts@@ -0,0 +1,28 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+import {Slider} from "@vaadin/slider";+import {customElement} from "lit/decorators.js";+import {OrVaadinComponent} from "./util";+import {type LitElement} from "lit";++@customElement("or-vaadin-slider")+export class OrVaadinSlider extends (Slider as new () => Slider & LitElement) implements OrVaadinComponent {++}diff --git a/ui/component/or-vaadin-components/src/or-vaadin-text-field.ts b/ui/component/or-vaadin-components/src/or-vaadin-text-field.tsindex 78ded62a7..87436686a 100644--- a/ui/component/or-vaadin-components/src/or-vaadin-text-field.ts+++ b/ui/component/or-vaadin-components/src/or-vaadin-text-field.ts@@ -17,14 +17,29 @@* You should have received a copy of the GNU Affero General Public License* along with this program. If not, see <http://www.gnu.org/licenses/>.*/-import {customElement} from "lit/decorators.js";+import {customElement, property} from "lit/decorators.js";import {TextField} from "@vaadin/text-field";-import {type LitElement} from "lit";+import {PropertyValues, type LitElement} from "lit";import {OrVaadinComponent} from "./util";@customElement("or-vaadin-text-field")export class OrVaadinTextField extends (TextField as new () => TextField & LitElement) implements OrVaadinComponent {+ /**+ * Custom `type` attribute that echoes to the input element.+ * This is useful for types like 'url' and 'email'.+ * Use with caution: using unknown types, or mismatched types like 'number' could potentially break the component.+ */+ @property({type: String})+ public type?: string;++ override willUpdate(changedProps: PropertyValues) {+ super.willUpdate(changedProps);+ if(changedProps.has("type") && this.type !== undefined) {+ (this as any)._setType(this.type);+ }+ }+override _onEnter(ev: KeyboardEvent) {this.dispatchEvent(new CustomEvent("submit", {bubbles: true, composed: true}));return super._onEnter(ev);diff --git a/ui/component/or-vaadin-components/src/util.ts b/ui/component/or-vaadin-components/src/util.tsindex f2b6ecf5a..2da2584a1 100644--- a/ui/component/or-vaadin-components/src/util.ts+++ b/ui/component/or-vaadin-components/src/util.ts@@ -17,6 +17,8 @@* You should have received a copy of the GNU Affero General Public License* along with this program. If not, see <http://www.gnu.org/licenses/>.*/+import {WellknownValueTypes} from "@openremote/model";+export enum InputType {BUTTON = "button",BUTTON_TOGGLE = "button-toggle",@@ -50,6 +52,38 @@ export enum InputType {DURATION_PERIOD = "duration-period"}+export const SUPPORTED_WELLKNOWN_VALUE_TYPES = [+ WellknownValueTypes.TEXT,+ WellknownValueTypes.EMAIL,+ WellknownValueTypes.UUID,+ WellknownValueTypes.ASSETID,+ WellknownValueTypes.HOSTORIPADDRESS,+ WellknownValueTypes.IPADDRESS,+ WellknownValueTypes.BOOLEAN,+ WellknownValueTypes.BIGNUMBER,+ WellknownValueTypes.NUMBER,+ WellknownValueTypes.POSITIVEINTEGER,+ WellknownValueTypes.POSITIVENUMBER,+ WellknownValueTypes.LONG,+ WellknownValueTypes.INTEGER,+ WellknownValueTypes.BYTE,+ WellknownValueTypes.INTEGERBYTE,+ WellknownValueTypes.DIRECTION,+ WellknownValueTypes.TCPIPPORTNUMBER,+ WellknownValueTypes.BIGINTEGER,+ WellknownValueTypes.COLOURRGB,+ WellknownValueTypes.DATEANDTIME,+ WellknownValueTypes.TIMESTAMP,+ WellknownValueTypes.TIMESTAMPISO8601,+ WellknownValueTypes.CRONEXPRESSION,+ WellknownValueTypes.TIMEDURATIONISO8601,+ WellknownValueTypes.PERIODDURATIONISO8601,+ WellknownValueTypes.TIMEANDPERIODDURATIONISO8601,+ WellknownValueTypes.JSONOBJECT+] as const;++export type SupportedWellknownValueTypes = typeof SUPPORTED_WELLKNOWN_VALUE_TYPES[number];+export interface OrVaadinComponent {getAttributeNames(): string[];}@@ -78,7 +112,7 @@ export function inputTypeSupportsSendButton(inputType: InputType): boolean {}export function inputTypeSupportsHelperText(inputType: InputType) {- return inputTypeSupportsSendButton(inputType) || inputType === InputType.SELECT;+ return inputTypeSupportsSendButton(inputType) || inputType === InputType.SELECT || inputType === InputType.RANGE;}export function inputTypeSupportsLabel(inputType: InputType) {diff --git a/ui/component/or-vaadin-components/src/value-input-provider.ts b/ui/component/or-vaadin-components/src/value-input-provider.tsindex ab9ec41b1..c3cc4e2aa 100644--- a/ui/component/or-vaadin-components/src/value-input-provider.ts+++ b/ui/component/or-vaadin-components/src/value-input-provider.ts@@ -48,7 +48,10 @@ import {html, TemplateResult} from "lit";import {Ref, ref, createRef} from "lit/directives/ref.js";import {ifDefined} from "lit/directives/if-defined.js";import {styleMap} from "lit/directives/style-map.js";-import {InputType, inputTypeSupportsHelperText, inputTypeSupportsLabel, inputTypeSupportsSendButton} from "./util";+import {+ InputType, inputTypeSupportsHelperText, inputTypeSupportsLabel, inputTypeSupportsSendButton,+ SupportedWellknownValueTypes+} from "./util";import {OrVaadinInput} from "./or-vaadin-input";export interface ValueInputProviderOptions {@@ -102,11 +105,15 @@ export const getValueHolderInputTemplateProvider: ValueInputProviderGenerator =const constraints: ValueConstraint[] = (valueHolder && ((valueHolder as MetaHolder).meta) || (valueDescriptor && (valueDescriptor as MetaHolder).meta) ? Util.getAttributeValueConstraints(valueHolder as Attribute<any>, valueHolderDescriptor as AttributeDescriptor, assetType) : Util.getMetaValueConstraints(valueHolder as NameValueHolder<any>, valueHolderDescriptor as AttributeDescriptor, assetType)) || [];const format: ValueFormat | undefined = (valueHolder && ((valueHolder as MetaHolder).meta) || (valueDescriptor && (valueDescriptor as MetaHolder).meta) ? Util.getAttributeValueFormat(valueHolder as Attribute<any>, valueHolderDescriptor as AttributeDescriptor, assetType) : Util.getMetaValueFormat(valueHolder as Attribute<any>, valueHolderDescriptor as AttributeDescriptor, assetType));- const supportsVaadinInput = (type: InputType) => (OrVaadinInput.TEMPLATES.has(type) && !format?.asSlider && !format?.asOnOff);+ const supportsVaadinInput = (type: InputType) => (OrVaadinInput.TEMPLATES.has(type) && !format?.asOnOff);++ // Enforces which value types are supported making SUPPORTED_WELLKNOWN_VALUE_TYPES the single source of truth through type checking+ let _exhaustiveTypeCheck: never+ const valueType = valueDescriptor.name as SupportedWellknownValueTypes;// Determine input typeif (!inputType) {- switch (valueDescriptor.name) {+ switch (valueType) {case WellknownValueTypes.TEXT:case WellknownValueTypes.EMAIL:case WellknownValueTypes.UUID:@@ -189,6 +196,7 @@ export const getValueHolderInputTemplateProvider: ValueInputProviderGenerator =case WellknownValueTypes.JSONOBJECT:inputType = InputType.JSON_OBJECT;break;+ default: _exhaustiveTypeCheck = valueType;}if (valueDescriptor.arrayDimensions && valueDescriptor.arrayDimensions > 0) {diff --git a/ui/component/or-vaadin-components/stories/or-vaadin-combo-box.stories.ts b/ui/component/or-vaadin-components/stories/or-vaadin-combo-box.stories.tsnew file mode 100644index 000000000..f3cd361ce--- /dev/null+++ b/ui/component/or-vaadin-components/stories/or-vaadin-combo-box.stories.ts@@ -0,0 +1,59 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+import {setCustomElementsManifest, type Meta, type StoryObj} from "@storybook/web-components";+import {getORStorybookHelpers} from "../../storybook-utils";+import customElements from "../custom-elements.json" with {type: "json"};+import packageJson from "../package.json" with {type: "json"};+import "../src/or-vaadin-combo-box";++const tagName = "or-vaadin-combo-box";+type Story = StoryObj;+setCustomElementsManifest(customElements);++const { events, args, argTypes, template } = getORStorybookHelpers(tagName);++const meta: Meta = {+ title: "Playground/or-vaadin-components/combo-box",+ component: tagName,+ args: args,+ argTypes: argTypes,+ render: storyArgs => template(storyArgs),+ excludeStories: /^[a-z].*/,+ parameters: {+ actions: {+ handles: events+ },+ docs: {+ subtitle: `<${tagName}>`,+ description: "Combo Box allows the user to choose a value from a filterable list of options presented in an overlay."+ }+ }+};++export const Primary: Story = {+ args: {+ label: "Combo Box"+ }+};++export {customElements, packageJson};+++export default meta;diff --git a/ui/component/or-vaadin-components/stories/or-vaadin-date-time-picker.stories.ts b/ui/component/or-vaadin-components/stories/or-vaadin-date-time-picker.stories.tsnew file mode 100644index 000000000..0f0bebef5--- /dev/null+++ b/ui/component/or-vaadin-components/stories/or-vaadin-date-time-picker.stories.ts@@ -0,0 +1,61 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+import {setCustomElementsManifest, type Meta, type StoryObj} from "@storybook/web-components";+import {getORStorybookHelpers} from "../../storybook-utils";+import customElements from "../custom-elements.json" with {type: "json"};+import packageJson from "../package.json" with {type: "json"};+import "../src/or-vaadin-date-time-picker";+import { html } from "lit";++const tagName = "or-vaadin-date-time-picker";+type Story = StoryObj;+setCustomElementsManifest(customElements);++const { events, args, argTypes, template } = getORStorybookHelpers(tagName);++const meta: Meta = {+ title: "Playground/or-vaadin-components/date-time-picker",+ component: tagName,+ args: args,+ argTypes: argTypes,+ render: storyArgs => template(storyArgs),+ excludeStories: /^[a-z].*/,+ parameters: {+ actions: {+ handles: events+ },+ docs: {+ subtitle: `<${tagName}>`,+ description: "Date Time Picker is an input field for selecting both a date and a time.",+ story: {+ height: "370px"+ }+ }+ }+};++export const Primary: Story = {+ render: args => template(args, html`<span slot="label">Select time</span>`)+};++export {customElements, packageJson};+++export default meta;diff --git a/ui/component/or-vaadin-components/stories/or-vaadin-list-box.stories.ts b/ui/component/or-vaadin-components/stories/or-vaadin-list-box.stories.tsnew file mode 100644index 000000000..14f285b5c--- /dev/null+++ b/ui/component/or-vaadin-components/stories/or-vaadin-list-box.stories.ts@@ -0,0 +1,64 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+import {setCustomElementsManifest, type Meta, type StoryObj } from "@storybook/web-components";+import {getORStorybookHelpers} from "../../storybook-utils";+import customElements from "../custom-elements.json" with { type: "json" };+import packageJson from "../package.json" with { type: "json" };+import "../src/or-vaadin-list-box";+import "../src/or-vaadin-item";+import { html } from "lit";++const tagName = "or-vaadin-list-box";+type Story = StoryObj;+setCustomElementsManifest(customElements);++const { events, args, argTypes, template } = getORStorybookHelpers(tagName);++const meta: Meta = {+ title: "Playground/or-vaadin-components/list-box",+ component: tagName,+ args: args,+ argTypes: argTypes,+ render: storyArgs => template(storyArgs),+ excludeStories: /^[a-z].*/,+ parameters: {+ actions: {+ handles: events+ },+ docs: {+ subtitle: `<${tagName}>`,+ description: "List Box allows the user to select one or more values from a scrollable list of items."+ }+ }+};++export const Primary: Story = {+ render: args => template(args, html`+ <or-vaadin-item>Item 1</or-vaadin-item>+ <or-vaadin-item>Item 2</or-vaadin-item>+ <or-vaadin-item>Item 3</or-vaadin-item>+ `)+};++export const examples: Story[] = [];++export {customElements, packageJson};++export default meta;diff --git a/ui/component/or-vaadin-components/stories/or-vaadin-select.stories.ts b/ui/component/or-vaadin-components/stories/or-vaadin-select.stories.tsnew file mode 100644index 000000000..9ee5c4689--- /dev/null+++ b/ui/component/or-vaadin-components/stories/or-vaadin-select.stories.ts@@ -0,0 +1,58 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+import {setCustomElementsManifest, type Meta, type StoryObj} from "@storybook/web-components";+import {getORStorybookHelpers} from "../../storybook-utils";+import customElements from "../custom-elements.json" with {type: "json"};+import packageJson from "../package.json" with {type: "json"};+import {html} from "lit";+import "../src/or-vaadin-select";++const tagName = "or-vaadin-select";+type Story = StoryObj;+setCustomElementsManifest(customElements);++const { events, args, argTypes, template } = getORStorybookHelpers(tagName);++const meta: Meta = {+ title: "Playground/or-vaadin-components/select",+ component: tagName,+ args: args,+ argTypes: argTypes,+ render: storyArgs => template(storyArgs),+ excludeStories: /^[a-z].*/,+ parameters: {+ actions: {+ handles: events+ },+ docs: {+ subtitle: `<${tagName}>`,+ description: "A select allows users to choose a single value from a list of options presented in an overlay."+ }+ }+};++export const Primary: Story = {+ render: args => template(args, html`<span slot="label">Select your option</span>`)+};++export {customElements, packageJson};+++export default meta;diff --git a/ui/component/theme/package.json b/ui/component/theme/package.jsonindex 835a91b16..023b3be8c 100644--- a/ui/component/theme/package.json+++ b/ui/component/theme/package.json@@ -19,7 +19,8 @@"repository": "https://github.com/openremote/openremote","license": "AGPL-3.0-or-later","dependencies": {- "@vaadin/vaadin-lumo-styles": "~25.0.3"+ "@vaadin/vaadin-lumo-styles": "~25.1.3",+ "inter-ui": "^4.1.1"},"devDependencies": {"@openremote/util": "workspace:*"diff --git a/ui/component/theme/src/components/index.css b/ui/component/theme/src/components/index.cssindex fab9484d8..bbc6f6735 100644--- a/ui/component/theme/src/components/index.css+++ b/ui/component/theme/src/components/index.css@@ -25,15 +25,20 @@@import "./or-vaadin-button.css";@import "./or-vaadin-checkbox-group.css";@import "./or-vaadin-checkbox.css"; /* Must be after the checkbox-group */+@import "./or-vaadin-combo-box.css";@import "./or-vaadin-date-time-picker.css";@import "./or-vaadin-date-picker.css"; /* Must be after the date-time-picker */@import "./or-vaadin-dialog.css";@import "./or-vaadin-icon.css";+@import "./or-vaadin-item.css";+@import "./or-vaadin-list-box.css";+@import "./or-vaadin-menu-bar.css";@import "./or-vaadin-multi-select-combo-box.css";@import "./or-vaadin-number-field.css";@import "./or-vaadin-password-field.css";@import "./or-vaadin-radio-group.css";@import "./or-vaadin-select.css";+@import "./or-vaadin-slider.css";@import "./or-vaadin-text-area.css";@import "./or-vaadin-text-field.css";@import "./or-vaadin-time-picker.css"; /* Must be after the date-time-picker */diff --git a/ui/component/theme/src/components/or-vaadin-checkbox.css b/ui/component/theme/src/components/or-vaadin-checkbox.cssindex 4e6afac82..811fa4fbb 100644--- a/ui/component/theme/src/components/or-vaadin-checkbox.css+++ b/ui/component/theme/src/components/or-vaadin-checkbox.css@@ -20,6 +20,12 @@@import "@vaadin/vaadin-lumo-styles/components/checkbox.css";@media lumo_checkbox_toggle_button {++ /* Fix for label padding in Vaadin source code, where it's only applied on <label>, not on <span> or <or-translate> */+ :host([has-label]) ::slotted([slot="label"]) {+ padding: var(--vaadin-checkbox-label-padding, var(--lumo-space-xs) var(--lumo-space-s) var(--lumo-space-xs) var(--lumo-space-xs));+ }+:host([theme~='button']) {&::part(checkbox),&::part(required-indicator) {diff --git a/ui/component/theme/src/components/or-vaadin-combo-box.css b/ui/component/theme/src/components/or-vaadin-combo-box.cssnew file mode 100644index 000000000..3e1c975a2--- /dev/null+++ b/ui/component/theme/src/components/or-vaadin-combo-box.css@@ -0,0 +1,48 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+@import "@vaadin/vaadin-lumo-styles/components/combo-box.css";++:root::before,+:host::before {+ --_lumo-vaadin-combo-box-inject: 1;+ --_lumo-vaadin-combo-box-inject-modules:+ lumo_mixins_field-label,+ lumo_mixins_field-required,+ lumo_mixins_field-error-message,+ lumo_mixins_field-button,+ lumo_mixins_field-helper,+ lumo_mixins_field-base,+ lumo_components_combo-box,+ lumo_mixins_field-internal;++ --_lumo-vaadin-combo-box-item-inject: 1;+ --_lumo-vaadin-combo-box-item-inject-modules:+ lumo_components_item,+ lumo_components_combo-box-item;++ --_lumo-vaadin-combo-box-overlay-inject: 1;+ --_lumo-vaadin-combo-box-overlay-inject-modules:+ lumo_mixins_loader,+ lumo_mixins_combo-box-loader,+ lumo_mixins_overlay,+ lumo_mixins_menu-overlay-core,+ lumo_mixins_combo-box-overlay,+ lumo_components_combo-box-overlay;+}diff --git a/ui/component/theme/src/components/or-vaadin-item.css b/ui/component/theme/src/components/or-vaadin-item.cssnew file mode 100644index 000000000..07755c67f--- /dev/null+++ b/ui/component/theme/src/components/or-vaadin-item.css@@ -0,0 +1,34 @@+/*+ * Copyright 2025, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+@import "@vaadin/vaadin-lumo-styles/components/item.css";++@media lumo_components_item-internal {+ :host {+ [part="content"] {+ overflow: hidden;+ }+ }+}++:root::before,+:host::before {+ --_lumo-vaadin-item-inject: 1;+ --_lumo-vaadin-item-inject-modules: lumo_components_item, lumo_components_item-internal;+}diff --git a/ui/component/theme/src/components/or-vaadin-list-box.css b/ui/component/theme/src/components/or-vaadin-list-box.cssnew file mode 100644index 000000000..927c6ce0c--- /dev/null+++ b/ui/component/theme/src/components/or-vaadin-list-box.css@@ -0,0 +1,26 @@+/*+ * Copyright 2025, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+@import "@vaadin/vaadin-lumo-styles/components/list-box.css";++:root::before,+:host::before {+ --_lumo-vaadin-list-box-inject: 1;+ --_lumo-vaadin-list-box-inject-modules: lumo_components_list-box;+}diff --git a/ui/component/theme/src/components/or-vaadin-menu-bar.css b/ui/component/theme/src/components/or-vaadin-menu-bar.cssnew file mode 100644index 000000000..85af4ae11--- /dev/null+++ b/ui/component/theme/src/components/or-vaadin-menu-bar.css@@ -0,0 +1,50 @@+/*+ * Copyright 2026, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+@import "@vaadin/vaadin-lumo-styles/components/menu-bar.css";++:root::before,+:host::before {+ --_lumo-vaadin-menu-bar-inject: 1;+ --_lumo-vaadin-menu-bar-inject-modules: lumo_components_menu-bar;++ --_lumo-vaadin-menu-bar-overlay-inject: 1;+ --_lumo-vaadin-menu-bar-overlay-inject-modules:+ lumo_mixins_overlay,+ lumo_mixins_menu-overlay-core,+ lumo_mixins_menu-overlay-ext,+ lumo_components_context-menu-overlay,+ lumo_components_menu-bar-overlay;++ --_lumo-vaadin-menu-bar-list-box-inject: 1;+ --_lumo-vaadin-menu-bar-list-box-inject-modules:+ lumo_components_list-box,+ lumo_components_context-menu-list-box;++ --_lumo-vaadin-menu-bar-item-inject: 1;+ --_lumo-vaadin-menu-bar-item-inject-modules:+ lumo_components_item,+ lumo_components_context-menu-item,+ lumo_components_menu-bar-item;++ --_lumo-vaadin-menu-bar-button-inject: 1;+ --_lumo-vaadin-menu-bar-button-inject-modules:+ lumo_components_button,+ lumo_components_menu-bar-button;+}diff --git a/ui/component/theme/src/components/or-vaadin-slider.css b/ui/component/theme/src/components/or-vaadin-slider.cssnew file mode 100644index 000000000..b7c698def--- /dev/null+++ b/ui/component/theme/src/components/or-vaadin-slider.css@@ -0,0 +1,37 @@+/*+ * Copyright 2025, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+@import "@vaadin/vaadin-lumo-styles/components/slider.css";++:root::before,+:host::before {+ --_lumo-vaadin-slider-inject: 1;+ --_lumo-vaadin-slider-inject-modules:+ lumo_mixins_field-label,+ lumo_mixins_field-required,+ lumo_mixins_field-error-message,+ lumo_mixins_field-helper,+ lumo_mixins_slider,+ lumo_components_slider;++ --_lumo-vaadin-slider-bubble-overlay-inject: 1;+ --_lumo-vaadin-slider-bubble-overlay-inject-modules:+ lumo_mixins_overlay,+ lumo_components_slider-bubble-overlay;+}diff --git a/ui/component/theme/src/default.css b/ui/component/theme/src/default.cssindex 2fd1231a8..404130001 100644--- a/ui/component/theme/src/default.css+++ b/ui/component/theme/src/default.css@@ -17,6 +17,7 @@* You should have received a copy of the GNU Affero General Public License* along with this program. If not, see <http://www.gnu.org/licenses/>.*/+@import "inter-ui/inter.css";@import "@vaadin/vaadin-lumo-styles/src/props/index.css";@import "@vaadin/vaadin-lumo-styles/src/global/index.css";@import "components/index.css";@@ -173,6 +174,7 @@--lumo-disabled-text-color: var(--or-color-text-disabled);/* OpenRemote */+ --lumo-font-family: "Inter", -apple-system, BlinkMacSystemFont, 'Roboto', 'Segoe UI', Helvetica, Arial, sans-serif;--lumo-border-radius-m: 0.5em;--lumo-border-radius-l: 0.75em;--vaadin-field-default-width: 100%;diff --git a/ui/knip.jsonc b/ui/knip.jsoncindex f8b7e0117..5fdd3b159 100644--- a/ui/knip.jsonc+++ b/ui/knip.jsonc@@ -5,6 +5,7 @@"@types/react", // Required by mdx which is used in Storybook"@webcomponents/webcomponentsjs", // Imported through index.html files for apps"@types/offscreencanvas", // Referenced in the tsconfig file+ "inter-ui", // Only imports CSS files"@vaadin/vaadin-lumo-styles", // Only imports CSS files"@openremote/theme", // Only imports CSS files// --- HOISTED UTIL PACKAGE TOOLING ---diff --git a/ui/test/app.config.cts b/ui/test/app.config.ctsindex 375ca714d..a6fd5f7fa 100644--- a/ui/test/app.config.cts+++ b/ui/test/app.config.cts@@ -67,7 +67,9 @@ export const defineAppConfig = (path: string) => {video: "on",},webServer: {- command: `node ${join(__dirname, "manager.cjs")}`+ command: `node ${join(__dirname, "manager.cjs")}`,+ url: 'http://localhost:8080',+ reuseExistingServer: !process.env.CI,},/* Configure projects */projects: [diff --git a/yarn.lock b/yarn.lockindex ecd943e8f..99516fb81 100644--- a/yarn.lock+++ b/yarn.lock@@ -1822,12 +1822,14 @@ __metadata:"@openremote/or-rules": "workspace:*""@openremote/or-services": "workspace:*""@openremote/or-translate": "workspace:*"+ "@openremote/or-vaadin-components": "workspace:*""@openremote/rest": "workspace:*"+ "@openremote/theme": "workspace:*""@openremote/util": "workspace:*""@reduxjs/toolkit": "npm:^1.8.1"+ "@rsbuild/core": "npm:~1.7.5""@rsdoctor/rspack-plugin": "npm:~1.4.0""@rspack/core": "npm:~1.7.10"- iso-639-1: "npm:^3.1.3"lit: "npm:^3.3.1"maplibre-gl: "npm:^5.12.0"moment: "npm:^2.29.4"@@ -1850,6 +1852,7 @@ __metadata:"@openremote/or-icon": "workspace:*""@openremote/or-mwc-components": "workspace:*""@openremote/or-translate": "workspace:*"+ "@openremote/or-vaadin-components": "workspace:*""@openremote/util": "workspace:*""@reduxjs/toolkit": "npm:^1.8.1""@webcomponents/webcomponentsjs": "npm:^2.6.0"@@ -1869,6 +1872,7 @@ __metadata:"@openremote/or-icon": "workspace:*""@openremote/or-mwc-components": "workspace:*""@openremote/or-translate": "workspace:*"+ "@openremote/or-vaadin-components": "workspace:*""@openremote/util": "workspace:*""@types/lodash.debounce": "npm:^4"lit: "npm:^3.3.1"@@ -1892,6 +1896,7 @@ __metadata:"@openremote/or-icon": "workspace:*""@openremote/or-mwc-components": "workspace:*""@openremote/or-translate": "workspace:*"+ "@openremote/or-vaadin-components": "workspace:*""@openremote/util": "workspace:*"axios: "npm:1.16.1"i18next: "npm:^21.5.3"@@ -1908,6 +1913,7 @@ __metadata:"@openremote/or-icon": "workspace:*""@openremote/or-mwc-components": "workspace:*""@openremote/or-translate": "workspace:*"+ "@openremote/or-vaadin-components": "workspace:*""@openremote/rest": "workspace:*""@openremote/util": "workspace:*"echarts: "npm:~6.0.0"@@ -1922,12 +1928,12 @@ __metadata:dependencies:"@openremote/core": "workspace:*""@openremote/model": "workspace:*"- "@openremote/or-asset-tree": "workspace:*""@openremote/or-attribute-picker": "workspace:*""@openremote/or-chart": "workspace:*""@openremote/or-icon": "workspace:*""@openremote/or-mwc-components": "workspace:*""@openremote/or-translate": "workspace:*"+ "@openremote/or-vaadin-components": "workspace:*""@openremote/rest": "workspace:*""@openremote/util": "workspace:*""@types/lodash.debounce": "npm:^4"@@ -1948,8 +1954,8 @@ __metadata:"@openremote/model": "workspace:*""@openremote/or-chart": "workspace:*""@openremote/or-components": "workspace:*"- "@openremote/or-mwc-components": "workspace:*""@openremote/or-translate": "workspace:*"+ "@openremote/or-vaadin-components": "workspace:*""@openremote/rest": "workspace:*""@openremote/util": "workspace:*""@types/lodash.debounce": "npm:^4"@@ -1968,11 +1974,13 @@ __metadata:"@openremote/core": "workspace:*""@openremote/model": "workspace:*""@openremote/or-components": "workspace:*"+ "@openremote/or-icon": "workspace:*""@openremote/or-json-forms": "workspace:*""@openremote/or-map": "workspace:*""@openremote/or-mwc-components": "workspace:*""@openremote/or-scheduler": "workspace:*""@openremote/or-translate": "workspace:*"+ "@openremote/or-vaadin-components": "workspace:*""@openremote/util": "workspace:*"lit: "npm:^3.3.1"languageName: unknown@@ -1987,6 +1995,7 @@ __metadata:"@openremote/or-asset-tree": "workspace:*""@openremote/or-mwc-components": "workspace:*""@openremote/or-translate": "workspace:*"+ "@openremote/or-vaadin-components": "workspace:*""@openremote/util": "workspace:*"lit: "npm:^3.3.1"languageName: unknown@@ -2006,6 +2015,7 @@ __metadata:"@openremote/or-icon": "workspace:*""@openremote/or-mwc-components": "workspace:*""@openremote/or-translate": "workspace:*"+ "@openremote/or-vaadin-components": "workspace:*""@openremote/rest": "workspace:*""@openremote/util": "workspace:*""@types/lodash.debounce": "npm:^4"@@ -2053,6 +2063,7 @@ __metadata:"@openremote/or-map": "workspace:*""@openremote/or-mwc-components": "workspace:*""@openremote/or-translate": "workspace:*"+ "@openremote/or-vaadin-components": "workspace:*""@openremote/rest": "workspace:*""@openremote/util": "workspace:*""@types/lodash.debounce": "npm:^4"@@ -2102,6 +2113,7 @@ __metadata:"@openremote/or-components": "workspace:*""@openremote/or-mwc-components": "workspace:*""@openremote/or-translate": "workspace:*"+ "@openremote/or-vaadin-components": "workspace:*""@openremote/util": "workspace:*"ajv: "npm:^8.8.2"lit: "npm:^3.3.1"@@ -2118,6 +2130,7 @@ __metadata:"@openremote/or-components": "workspace:*""@openremote/or-mwc-components": "workspace:*""@openremote/or-translate": "workspace:*"+ "@openremote/or-vaadin-components": "workspace:*""@openremote/util": "workspace:*""@types/http-link-header": "npm:1.0.7"axios: "npm:1.16.1"@@ -2137,6 +2150,7 @@ __metadata:"@openremote/or-icon": "workspace:*""@openremote/or-mwc-components": "workspace:*""@openremote/or-translate": "workspace:*"+ "@openremote/or-vaadin-components": "workspace:*""@openremote/util": "workspace:*""@types/geojson": "npm:^7946.0.7""@types/lodash.debounce": "npm:^4"@@ -2213,6 +2227,7 @@ __metadata:"@openremote/or-scheduler": "workspace:*""@openremote/or-translate": "workspace:*""@openremote/or-tree-menu": "workspace:*"+ "@openremote/or-vaadin-components": "workspace:*""@openremote/rest": "workspace:*""@openremote/util": "workspace:*""@types/shortid": "npm:^0.0.29"@@ -2285,22 +2300,27 @@ __metadata:dependencies:"@openremote/core": "workspace:*""@openremote/model": "workspace:*"- "@vaadin/button": "npm:~25.0.3"- "@vaadin/checkbox": "npm:~25.0.3"- "@vaadin/checkbox-group": "npm:~25.0.3"- "@vaadin/date-picker": "npm:~25.0.3"- "@vaadin/date-time-picker": "npm:~25.0.3"- "@vaadin/dialog": "npm:~25.0.3"- "@vaadin/icon": "npm:~25.0.3"- "@vaadin/icons": "npm:~25.0.3"- "@vaadin/multi-select-combo-box": "npm:~25.0.3"- "@vaadin/number-field": "npm:~25.0.3"- "@vaadin/password-field": "npm:~25.0.3"- "@vaadin/radio-group": "npm:~25.0.3"- "@vaadin/select": "npm:~25.0.3"- "@vaadin/text-area": "npm:~25.0.3"- "@vaadin/text-field": "npm:~25.0.3"- "@vaadin/time-picker": "npm:~25.0.3"+ "@vaadin/button": "npm:~25.1.3"+ "@vaadin/checkbox": "npm:~25.1.3"+ "@vaadin/checkbox-group": "npm:~25.1.3"+ "@vaadin/combo-box": "npm:~25.1.3"+ "@vaadin/date-picker": "npm:~25.1.3"+ "@vaadin/date-time-picker": "npm:~25.1.3"+ "@vaadin/dialog": "npm:~25.1.3"+ "@vaadin/icon": "npm:~25.1.3"+ "@vaadin/icons": "npm:~25.1.3"+ "@vaadin/item": "npm:~25.1.3"+ "@vaadin/list-box": "npm:~25.1.3"+ "@vaadin/menu-bar": "npm:~25.1.3"+ "@vaadin/multi-select-combo-box": "npm:~25.1.3"+ "@vaadin/number-field": "npm:~25.1.3"+ "@vaadin/password-field": "npm:~25.1.3"+ "@vaadin/radio-group": "npm:~25.1.3"+ "@vaadin/select": "npm:~25.1.3"+ "@vaadin/slider": "npm:~25.1.3"+ "@vaadin/text-area": "npm:~25.1.3"+ "@vaadin/text-field": "npm:~25.1.3"+ "@vaadin/time-picker": "npm:~25.1.3"lit: "npm:^3.3.1"languageName: unknownlinkType: soft@@ -2365,7 +2385,8 @@ __metadata:resolution: "@openremote/theme@workspace:ui/component/theme"dependencies:"@openremote/util": "workspace:*"- "@vaadin/vaadin-lumo-styles": "npm:~25.0.3"+ "@vaadin/vaadin-lumo-styles": "npm:~25.1.3"+ inter-ui: "npm:^4.1.1"languageName: unknownlinkType: soft@@ -2615,177 +2636,177 @@ __metadata:languageName: nodelinkType: hard-"@rollup/rollup-android-arm-eabi@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-android-arm-eabi@npm:4.61.1"+"@rollup/rollup-android-arm-eabi@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-android-arm-eabi@npm:4.61.0"conditions: os=android & cpu=armlanguageName: nodelinkType: hard-"@rollup/rollup-android-arm64@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-android-arm64@npm:4.61.1"+"@rollup/rollup-android-arm64@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-android-arm64@npm:4.61.0"conditions: os=android & cpu=arm64languageName: nodelinkType: hard-"@rollup/rollup-darwin-arm64@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-darwin-arm64@npm:4.61.1"+"@rollup/rollup-darwin-arm64@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-darwin-arm64@npm:4.61.0"conditions: os=darwin & cpu=arm64languageName: nodelinkType: hard-"@rollup/rollup-darwin-x64@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-darwin-x64@npm:4.61.1"+"@rollup/rollup-darwin-x64@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-darwin-x64@npm:4.61.0"conditions: os=darwin & cpu=x64languageName: nodelinkType: hard-"@rollup/rollup-freebsd-arm64@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-freebsd-arm64@npm:4.61.1"+"@rollup/rollup-freebsd-arm64@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-freebsd-arm64@npm:4.61.0"conditions: os=freebsd & cpu=arm64languageName: nodelinkType: hard-"@rollup/rollup-freebsd-x64@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-freebsd-x64@npm:4.61.1"+"@rollup/rollup-freebsd-x64@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-freebsd-x64@npm:4.61.0"conditions: os=freebsd & cpu=x64languageName: nodelinkType: hard-"@rollup/rollup-linux-arm-gnueabihf@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.61.1"+"@rollup/rollup-linux-arm-gnueabihf@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.61.0"conditions: os=linux & cpu=arm & libc=glibclanguageName: nodelinkType: hard-"@rollup/rollup-linux-arm-musleabihf@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.61.1"+"@rollup/rollup-linux-arm-musleabihf@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.61.0"conditions: os=linux & cpu=arm & libc=musllanguageName: nodelinkType: hard-"@rollup/rollup-linux-arm64-gnu@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.61.1"+"@rollup/rollup-linux-arm64-gnu@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.61.0"conditions: os=linux & cpu=arm64 & libc=glibclanguageName: nodelinkType: hard-"@rollup/rollup-linux-arm64-musl@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-linux-arm64-musl@npm:4.61.1"+"@rollup/rollup-linux-arm64-musl@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-linux-arm64-musl@npm:4.61.0"conditions: os=linux & cpu=arm64 & libc=musllanguageName: nodelinkType: hard-"@rollup/rollup-linux-loong64-gnu@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-linux-loong64-gnu@npm:4.61.1"+"@rollup/rollup-linux-loong64-gnu@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-linux-loong64-gnu@npm:4.61.0"conditions: os=linux & cpu=loong64 & libc=glibclanguageName: nodelinkType: hard-"@rollup/rollup-linux-loong64-musl@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-linux-loong64-musl@npm:4.61.1"+"@rollup/rollup-linux-loong64-musl@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-linux-loong64-musl@npm:4.61.0"conditions: os=linux & cpu=loong64 & libc=musllanguageName: nodelinkType: hard-"@rollup/rollup-linux-ppc64-gnu@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-linux-ppc64-gnu@npm:4.61.1"+"@rollup/rollup-linux-ppc64-gnu@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-linux-ppc64-gnu@npm:4.61.0"conditions: os=linux & cpu=ppc64 & libc=glibclanguageName: nodelinkType: hard-"@rollup/rollup-linux-ppc64-musl@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-linux-ppc64-musl@npm:4.61.1"+"@rollup/rollup-linux-ppc64-musl@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-linux-ppc64-musl@npm:4.61.0"conditions: os=linux & cpu=ppc64 & libc=musllanguageName: nodelinkType: hard-"@rollup/rollup-linux-riscv64-gnu@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.61.1"+"@rollup/rollup-linux-riscv64-gnu@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.61.0"conditions: os=linux & cpu=riscv64 & libc=glibclanguageName: nodelinkType: hard-"@rollup/rollup-linux-riscv64-musl@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.61.1"+"@rollup/rollup-linux-riscv64-musl@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.61.0"conditions: os=linux & cpu=riscv64 & libc=musllanguageName: nodelinkType: hard-"@rollup/rollup-linux-s390x-gnu@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.61.1"+"@rollup/rollup-linux-s390x-gnu@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.61.0"conditions: os=linux & cpu=s390x & libc=glibclanguageName: nodelinkType: hard-"@rollup/rollup-linux-x64-gnu@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-linux-x64-gnu@npm:4.61.1"+"@rollup/rollup-linux-x64-gnu@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-linux-x64-gnu@npm:4.61.0"conditions: os=linux & cpu=x64 & libc=glibclanguageName: nodelinkType: hard-"@rollup/rollup-linux-x64-musl@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-linux-x64-musl@npm:4.61.1"+"@rollup/rollup-linux-x64-musl@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-linux-x64-musl@npm:4.61.0"conditions: os=linux & cpu=x64 & libc=musllanguageName: nodelinkType: hard-"@rollup/rollup-openbsd-x64@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-openbsd-x64@npm:4.61.1"+"@rollup/rollup-openbsd-x64@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-openbsd-x64@npm:4.61.0"conditions: os=openbsd & cpu=x64languageName: nodelinkType: hard-"@rollup/rollup-openharmony-arm64@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-openharmony-arm64@npm:4.61.1"+"@rollup/rollup-openharmony-arm64@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-openharmony-arm64@npm:4.61.0"conditions: os=openharmony & cpu=arm64languageName: nodelinkType: hard-"@rollup/rollup-win32-arm64-msvc@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.61.1"+"@rollup/rollup-win32-arm64-msvc@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.61.0"conditions: os=win32 & cpu=arm64languageName: nodelinkType: hard-"@rollup/rollup-win32-ia32-msvc@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.61.1"+"@rollup/rollup-win32-ia32-msvc@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.61.0"conditions: os=win32 & cpu=ia32languageName: nodelinkType: hard-"@rollup/rollup-win32-x64-gnu@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-win32-x64-gnu@npm:4.61.1"+"@rollup/rollup-win32-x64-gnu@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-win32-x64-gnu@npm:4.61.0"conditions: os=win32 & cpu=x64languageName: nodelinkType: hard-"@rollup/rollup-win32-x64-msvc@npm:4.61.1":- version: 4.61.1- resolution: "@rollup/rollup-win32-x64-msvc@npm:4.61.1"+"@rollup/rollup-win32-x64-msvc@npm:4.61.0":+ version: 4.61.0+ resolution: "@rollup/rollup-win32-x64-msvc@npm:4.61.0"conditions: os=win32 & cpu=x64languageName: nodelinkType: hard@@ -3873,372 +3894,408 @@ __metadata:languageName: nodelinkType: hard-"@vaadin/a11y-base@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/a11y-base@npm:25.0.3"+"@vaadin/a11y-base@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/a11y-base@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/component-base": "npm:~25.0.3"+ "@vaadin/component-base": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/fcfe14ff89ffcf2c0d22a52470b3e42446be3e6c3fb75c078b01093425a4a6997b447ac3bb1367663e44a9767e11d86264c82a0afd1d4d851b6cf36a0b173464+ checksum: 10c0/56d61fdb4c73ad106d3b3f64ad8db49d317803336ea0844b972effc66af6c90432b06f9edec3fb0ba7f56cebcce23f26b418afde4eecac4b9f88f6984552d9belanguageName: nodelinkType: hard-"@vaadin/button@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/button@npm:25.0.3"+"@vaadin/button@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/button@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/f71a08da338d19a2b946a92b922418e8406dc3f29e36ff839a0cef0ce3238c2affab3ed428e42188a20b561a31806088b5b48461c8c214be98b7cdfa25c1bfd5+ checksum: 10c0/efeff84b28a5dbd7e2776ab7999f80b4071ce503e7f3ae4787f29877416bfbb1aa743b63fd0ce4a4366920c3abea2ccee149549ef6dff5aeede6e1269e10b604languageName: nodelinkType: hard-"@vaadin/checkbox-group@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/checkbox-group@npm:25.0.3"+"@vaadin/checkbox-group@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/checkbox-group@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/checkbox": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/field-base": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/checkbox": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/field-base": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/8f18a62f56610cdae707aacfb625c4189bf264ad48e699441b61a304d9931171133d993c92372c63cad4bc58428cefcf897ba87c5fbc3c6e44712644a7e6e80b+ checksum: 10c0/d02c46b49a2a74fe4cf47bf7a851552bcaa5dffdb680fac6da8f70d4cf23dc98ca6d034a241788ad34f6018e9ee80f14faa19a53f40e6c80a9e10a5654b638eclanguageName: nodelinkType: hard-"@vaadin/checkbox@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/checkbox@npm:25.0.3"+"@vaadin/checkbox@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/checkbox@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/field-base": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/field-base": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/94c042a00a969b0f1eb82414baf0f857c5d1c621d404ec63cf12e3fe15972d1576dc512d5e9535164995660fdec7ebb2d306de8c84dee004b6988da21f7549ca+ checksum: 10c0/15afb8c03bc51c1c781fb3594a699e34a2973861ebbfc8745f38a3a0dfd7b010349c3fd7d4f96414a1633c7092bb3fb52707647d2e04270cf59f735a07774f5alanguageName: nodelinkType: hard-"@vaadin/combo-box@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/combo-box@npm:25.0.3"+"@vaadin/combo-box@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/combo-box@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/field-base": "npm:~25.0.3"- "@vaadin/input-container": "npm:~25.0.3"- "@vaadin/item": "npm:~25.0.3"- "@vaadin/lit-renderer": "npm:~25.0.3"- "@vaadin/overlay": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/field-base": "npm:~25.1.3"+ "@vaadin/input-container": "npm:~25.1.3"+ "@vaadin/item": "npm:~25.1.3"+ "@vaadin/lit-renderer": "npm:~25.1.3"+ "@vaadin/overlay": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/e67d5b750b47524f0132d010f7d389c9f89b0bb06964facacfed2b6c8a3d9a03cafa120cf6a3a8c593e25de1c108ad38f9b41466c48d4ee2d3077f442d344215+ checksum: 10c0/60f91a199e80c8b5ae75227f1445c8c8dd32090c577934ef9d3b7539ae0751bc7b0d89b93919e7e8fbd0aa1a0774ffafcf3cc2df141d32fdb8658369eeae078flanguageName: nodelinkType: hard-"@vaadin/component-base@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/component-base@npm:25.0.3"+"@vaadin/component-base@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/component-base@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0""@vaadin/vaadin-development-mode-detector": "npm:^2.0.0""@vaadin/vaadin-usage-statistics": "npm:^2.1.0"lit: "npm:^3.0.0"- checksum: 10c0/ad4ebc30e0379f19989649af661b763531c4284ca51e57e270fe60cbbe6fd09e1d210eb5c90f973d0bda12f26243d72c02d24a6e4cfdd6edfd61ba6c4fffc1c8+ checksum: 10c0/9113c5e16210608de44fb3a0d0a4659d0e98d0c7dc78e4a5ed17d4884517a845df5968ba3e24b734e0ad558840eec3a8ab2011d0cc04b4c3966dad0dd3b98f4alanguageName: nodelinkType: hard-"@vaadin/custom-field@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/custom-field@npm:25.0.3"+"@vaadin/context-menu@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/context-menu@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/field-base": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/item": "npm:~25.1.3"+ "@vaadin/list-box": "npm:~25.1.3"+ "@vaadin/lit-renderer": "npm:~25.1.3"+ "@vaadin/overlay": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/e350f881049d47fdb95e0a7dc448da8329171cf7758a3b00e122979c54900dcdb589ac0cab8e063e2eb3c1a6d58708b4c6f06ca3f6289732fa0545b3f42a540c+ checksum: 10c0/3b17810b1b2fd7ee93ec0955def756837f37b28eff75c917f0b6431b500a6cb5f9e6f2bc61ac71e158048f732ef8445d4e053be74a4ec324669c1d9e4215a9dclanguageName: nodelinkType: hard-"@vaadin/date-picker@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/date-picker@npm:25.0.3"+"@vaadin/date-picker@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/date-picker@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/button": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/field-base": "npm:~25.0.3"- "@vaadin/input-container": "npm:~25.0.3"- "@vaadin/overlay": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/button": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/field-base": "npm:~25.1.3"+ "@vaadin/input-container": "npm:~25.1.3"+ "@vaadin/overlay": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/a5510509b848448e5f9657458d85cc6f227d91bfedb5f211276ad0695a7a2050c93b0def5903710c4c7c89f6dddf9e00c5da5e613525d84333191ef53165844a+ checksum: 10c0/c44bb2700e559365655806a89e1cb0195fdeb7be91232e6745c98746d7aceed20785f09f2b69183aaceab2295dedf59e75bd27bcb405c8d6c0e8b51de3f8111alanguageName: nodelinkType: hard-"@vaadin/date-time-picker@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/date-time-picker@npm:25.0.3"+"@vaadin/date-time-picker@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/date-time-picker@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/custom-field": "npm:~25.0.3"- "@vaadin/date-picker": "npm:~25.0.3"- "@vaadin/field-base": "npm:~25.0.3"- "@vaadin/time-picker": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/date-picker": "npm:~25.1.3"+ "@vaadin/field-base": "npm:~25.1.3"+ "@vaadin/time-picker": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/b154294e8ccc32e633fc3f2a3798b6c19f4e3a9beadedd33c9e96435a55da922c017547d4495d63b3596e9bad5c9f248bafd626faaaf600c02d90eb61bb9731a+ checksum: 10c0/ded7040f60c46587014c60dd5ec2e95bbe082ea84247242b45be0182f997aafdce75f5ff34c8859a88c89c3e7d498cc5dd497041e835622dedc2ca346a4e1596languageName: nodelinkType: hard-"@vaadin/dialog@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/dialog@npm:25.0.3"+"@vaadin/dialog@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/dialog@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/lit-renderer": "npm:~25.0.3"- "@vaadin/overlay": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/lit-renderer": "npm:~25.1.3"+ "@vaadin/overlay": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/db06fcc33eff89bf7449f6cd4e486737ed661f5b78433feff08ae11662bdc886e6449e58fc657b3890105139aabc1737fadcd7ec7b86f503049f2f3bb401dbc5+ checksum: 10c0/11e065587de21d7b4f38193c3a390b45128a208cb1a8a85d42e405f500bc25b0867e87d5e888e58960662f73ae254b12492dcc6be010da34e6857fa490dc6ea0languageName: nodelinkType: hard-"@vaadin/field-base@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/field-base@npm:25.0.3"+"@vaadin/field-base@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/field-base@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/5cde82446986f3923825257b2464f7ebf767ea4ef489b6136033f6a6f31349308e3f468ccd5020a2bca823c5ffb677ce68153d13b121379b723c2ddf73d04766+ checksum: 10c0/c521eb72d339719f5839f12d08943040da1671418e9cfbec405b579e0fb79e09c1355362391b5126574087eb83a0baecaa7f2571699552ce8f00621e05febc0flanguageName: nodelinkType: hard-"@vaadin/icon@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/icon@npm:25.0.3"+"@vaadin/icon@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/icon@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/3c2c9173757543e51751ad6104b66c5c4e7f24997e97101f7800b1d4bf916ce849dc99693619ddeb1d29e1446e751010e8dd95bd27b0216a1667f12fb3981f30+ checksum: 10c0/6e4bb1f4df376a8d2e52da1d26767669f2cc6d306436a984ccb21338e302c0e2034e21a19e3c745f2812722f3e768d82748289273bf5e1eb6219220622d10167languageName: nodelinkType: hard-"@vaadin/icons@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/icons@npm:25.0.3"+"@vaadin/icons@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/icons@npm:25.1.3"dependencies:- "@vaadin/icon": "npm:~25.0.3"- checksum: 10c0/e6471832a63cf0d445e99b5f7b183f7865eac5714bb9601231b0ee64e3f4e100cbcd566b0085c7f1884abbaecf03767e1998caa4807ede5cda78d6c6839127da+ "@vaadin/icon": "npm:~25.1.3"+ checksum: 10c0/2b4948dd53434a81fca212e015fc88095da58287ffd79fd1cc844cfd0f9432394fda807242365aa531a615264bc930ebf87099e9c112fff1b285ec373ffee8e9languageName: nodelinkType: hard-"@vaadin/input-container@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/input-container@npm:25.0.3"+"@vaadin/input-container@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/input-container@npm:25.1.3"dependencies:- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/ef71e888dcf7553474b9a34a9dee9ce8bcd884ce7374f61f36afd85c78b9e51eb70f212f31c8eb18dfb23faef047aae0e220ee1cd402e6c10053131bf6976f94+ checksum: 10c0/2aaed944088467fd5add874e39192ca6f66b9e48dfd8dd32004ffc103ffc47496beb62ef029d5dd1d02d0fe9b51ac49f4366090bb15d25b630c9a245b974e725languageName: nodelinkType: hard-"@vaadin/item@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/item@npm:25.0.3"+"@vaadin/item@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/item@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"+ lit: "npm:^3.0.0"+ checksum: 10c0/92dec8301f1674904a9bb1adf143665af861f12549f2d34436ebb1985af57f967eb07b98bad6fc98ae5119c905bc04c568ed6cb5e0d66fdd5ee57d86d1f1956f+ languageName: node+ linkType: hard++"@vaadin/list-box@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/list-box@npm:25.1.3"+ dependencies:+ "@open-wc/dedupe-mixin": "npm:^1.3.0"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/item": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"+ lit: "npm:^3.0.0"+ checksum: 10c0/d760a08a82bafc97393304443155e348ca8816b985111093dba9b98995af31fefccf6bf36011e22f50c1920271a532b214197e8abd3d2ea07fcc46640fb54bc1+ languageName: node+ linkType: hard++"@vaadin/lit-renderer@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/lit-renderer@npm:25.1.3"+ dependencies:lit: "npm:^3.0.0"- checksum: 10c0/4503266aeabdc99af91ff2c2d1c110ef7171e99c10c6ca9d2f1b11cd5a3b310e6e96a758dbac438f0b80c280a3f33608bf47dfdeddfc9be74816e7974ca70d24+ checksum: 10c0/8420cd930077f764ff9ced35ff578cc0ed49e1796a4f48a75849e245ed9604fc8ad5d5bf22ad8f37a1e0a0d8969a48035709798af2dacab537bd3d7ba090af20languageName: nodelinkType: hard-"@vaadin/list-box@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/list-box@npm:25.0.3"+"@vaadin/menu-bar@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/menu-bar@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/item": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/button": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/context-menu": "npm:~25.1.3"+ "@vaadin/item": "npm:~25.1.3"+ "@vaadin/list-box": "npm:~25.1.3"+ "@vaadin/overlay": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/b71547932501391598fb80e96a8199c9980a5be4dd37263b0bafb23b89b0c9d9c48fdbd00742d53471802a01ae9376ceeb228991ae69c9ee3b1579844d1bfd71+ checksum: 10c0/55fe8d2e93b445b29358f8b4448f00551047bf16297470a1d6026ca02b52691524a119977706ebbff5ebf48b77d589186cbd063b7d9b213a689b67920363e00blanguageName: nodelinkType: hard-"@vaadin/lit-renderer@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/lit-renderer@npm:25.0.3"+"@vaadin/multi-select-combo-box@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/multi-select-combo-box@npm:25.1.3"dependencies:+ "@open-wc/dedupe-mixin": "npm:^1.3.0"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/combo-box": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/field-base": "npm:~25.1.3"+ "@vaadin/input-container": "npm:~25.1.3"+ "@vaadin/item": "npm:~25.1.3"+ "@vaadin/lit-renderer": "npm:~25.1.3"+ "@vaadin/overlay": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/b020545f711c877ef94f01a2d58d324ec649b8d7c2ec6bd15274f42d206539f600834127284c4dc959c902d19bdaf8b15c5f88f60be8d88a86470306edeeb5db+ checksum: 10c0/770cacb82022b247977a72b669b83da24c46ef77f4e73c959e5c33a71eaad76b814a807ba0d5597ec7f5dcf0d71434cd223badc3f8599c2a87af4ec90cf80219languageName: nodelinkType: hard-"@vaadin/multi-select-combo-box@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/multi-select-combo-box@npm:25.0.3"+"@vaadin/number-field@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/number-field@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/combo-box": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/field-base": "npm:~25.0.3"- "@vaadin/input-container": "npm:~25.0.3"- "@vaadin/item": "npm:~25.0.3"- "@vaadin/lit-renderer": "npm:~25.0.3"- "@vaadin/overlay": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/field-base": "npm:~25.1.3"+ "@vaadin/input-container": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/232cec2d83c4d515b63e1c4164353405db8e9eed4bbfffb976f79e007c2e7cda17ba6a9fc908a05186dc6b0ab13839deb87f1d1420ee2c525b64e7a89c4d843e+ checksum: 10c0/a0c2ec0164991090edf2d56d838e0fd4eba106a11de20359a0357961711457c73cc47d687e019d24e7302355f9cb43de7b36660e118af28f699542420795641alanguageName: nodelinkType: hard-"@vaadin/number-field@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/number-field@npm:25.0.3"+"@vaadin/overlay@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/overlay@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/field-base": "npm:~25.0.3"- "@vaadin/input-container": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/271ea05517997c05de01cd825ba032536adf04a1141563b29ce216d7e503a4101bc9c97a61e93b6c76a67b228ec589ffa257d8fc8a995ccc5583de193fe42b5f+ checksum: 10c0/c5bb21ddbd3cd8582d8213a903cd03df0b60f47f5179c69ac7ad3f2aa9521a203d7c95f3a31ba947884d7626c54204bca96b61571ccfbe92897b213cb0ea292alanguageName: nodelinkType: hard-"@vaadin/overlay@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/overlay@npm:25.0.3"+"@vaadin/password-field@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/password-field@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/button": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/field-base": "npm:~25.1.3"+ "@vaadin/text-field": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/ff322c809e19c708eb4590ea6280f4e28c5b345a106559816bd8d73cf50a24e3f245aa2941260dae3cd6681e3865716b9f2bed0984f567d7e9455edca16c6ad8+ checksum: 10c0/20627f9375c7c503581712fff7809cbe474f16cf3fc08add19c0e5ddea836e013d98a01190eb967d1882ffeb09622e3a593208a27427f96e041c3273aa8b8f29languageName: nodelinkType: hard-"@vaadin/password-field@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/password-field@npm:25.0.3"+"@vaadin/radio-group@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/radio-group@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/button": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/field-base": "npm:~25.0.3"- "@vaadin/text-field": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/field-base": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/0acb2cd6535d9a4948100b5ea8d2dfb95ce951c21c354cc02f16c980e56ea4966136827bb071ec16d1009c1ec335b808cdee5450ce26801ae98cb54ed46739f9+ checksum: 10c0/3ac5cbc4228a27cb9f7aa8bd58e878aa8994659d94aff5d6a367ff9ab48e8ad0bd0f2de36f9c61a1ad8e0d362df5799e4946e9f4c8985251f2a50212b482a119languageName: nodelinkType: hard-"@vaadin/radio-group@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/radio-group@npm:25.0.3"+"@vaadin/select@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/select@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/field-base": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/button": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/field-base": "npm:~25.1.3"+ "@vaadin/input-container": "npm:~25.1.3"+ "@vaadin/item": "npm:~25.1.3"+ "@vaadin/list-box": "npm:~25.1.3"+ "@vaadin/lit-renderer": "npm:~25.1.3"+ "@vaadin/overlay": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/97e66e1fdf54ab931c42e26cd6ab26494dcf24ee1402e2d06164d9b363d521f644c1654c75e38ebfddf3c4d501915ecb460a309005156d0969a6359c17b52da7+ checksum: 10c0/d9813c462b111ee8b9e7b55dd697a6caa588e373a24266808b8877a21f1be633ce1c140d8b285610a90b228941c28dd26689fc83fefd9bf1987984d61cfc0fbelanguageName: nodelinkType: hard-"@vaadin/select@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/select@npm:25.0.3"+"@vaadin/slider@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/slider@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/button": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/field-base": "npm:~25.0.3"- "@vaadin/input-container": "npm:~25.0.3"- "@vaadin/item": "npm:~25.0.3"- "@vaadin/list-box": "npm:~25.0.3"- "@vaadin/lit-renderer": "npm:~25.0.3"- "@vaadin/overlay": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/field-base": "npm:~25.1.3"+ "@vaadin/overlay": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/1fa853bb7136759b8ff9bdbc245baeea15b2bb1829b1a9d17d9f8a3c9d14d886ae198d962b4ffeab7f2e3d6422d53dee6da5dcfcf1bde653848d84eaad50b172+ checksum: 10c0/d44cf66009d2a85a354421fff203596151375a7cd4335fc8f91b1e2ce378574eee425974eef93c1d357e3a0fa271f6e337577bead371750b8acab599b8cbedbclanguageName: nodelinkType: hard-"@vaadin/text-area@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/text-area@npm:25.0.3"+"@vaadin/text-area@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/text-area@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/field-base": "npm:~25.0.3"- "@vaadin/input-container": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/field-base": "npm:~25.1.3"+ "@vaadin/input-container": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/c14b2fc69a35b91e4ec3bab735c295d948defce5ee362cff9af9fb38ff0f1f56fdd5e242f02258e922962e43d0da17474ca74d2e9584a44ff593a1243ff28dce+ checksum: 10c0/1b9e2886707771fb5e6ff521de7a7657b14949d2a8f844ead742e6560ab776b4750a15cbe908d15f9dd53582961344ac16c8a9268be73b6bf12ec236341c6bb0languageName: nodelinkType: hard-"@vaadin/text-field@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/text-field@npm:25.0.3"+"@vaadin/text-field@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/text-field@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/a11y-base": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/field-base": "npm:~25.0.3"- "@vaadin/input-container": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/field-base": "npm:~25.1.3"+ "@vaadin/input-container": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/193260b49939a9292da7014a0c4712e6bb20aecb082184ef5852fb1d4ff7c5e6360abb8bba27fa18ff7894a6187d1e6f2ec80750fc860c4974afcc5d202f1d88+ checksum: 10c0/90f637447965a9cfea6d552aa94df45cbef3bf6838f9b95d9a3e97e856ff00aed1c07c5be96d8454d9a5f22688cf1b395cf88b681b6b814bb6d258dbbc44f6cdlanguageName: nodelinkType: hard-"@vaadin/time-picker@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/time-picker@npm:25.0.3"+"@vaadin/time-picker@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/time-picker@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/combo-box": "npm:~25.0.3"- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/field-base": "npm:~25.0.3"- "@vaadin/input-container": "npm:~25.0.3"- "@vaadin/item": "npm:~25.0.3"- "@vaadin/overlay": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"+ "@vaadin/a11y-base": "npm:~25.1.3"+ "@vaadin/combo-box": "npm:~25.1.3"+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/field-base": "npm:~25.1.3"+ "@vaadin/input-container": "npm:~25.1.3"+ "@vaadin/item": "npm:~25.1.3"+ "@vaadin/overlay": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/ee1656153ce8692ded9a000d508f6da2a6c19000f589cd12fc9b0ad1a747d6248e0b4965824d00eafb22d1b3e89ea09be58fa26bac85f1bad6f9b0ac477627d0+ checksum: 10c0/597d4b9369693650d6c4a4b3bb5b6fcffd7917c15fa65df86f4ae22655e44198d4577a093557bfb23039c4c345df52cacedfb273088b79376d7cd2ccf16d36aclanguageName: nodelinkType: hard@@ -4249,25 +4306,25 @@ __metadata:languageName: nodelinkType: hard-"@vaadin/vaadin-lumo-styles@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/vaadin-lumo-styles@npm:25.0.3"+"@vaadin/vaadin-lumo-styles@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/vaadin-lumo-styles@npm:25.1.3"dependencies:- "@vaadin/component-base": "npm:~25.0.3"- "@vaadin/icon": "npm:~25.0.3"- "@vaadin/vaadin-themable-mixin": "npm:~25.0.3"- checksum: 10c0/be792133987a84d9b2562e47f22a4bdec4415e8f9db1ec1c01c2d98ae9f43b8c766316d5960b53fec14b80a09af96cd913b9c65895378aa44cd922bf0c6e5367+ "@vaadin/component-base": "npm:~25.1.3"+ "@vaadin/icon": "npm:~25.1.3"+ "@vaadin/vaadin-themable-mixin": "npm:~25.1.3"+ checksum: 10c0/46da92700721872ce93bbf0df3798ae85683637faa934b5fe17727bdd72cb75f423927c0b3f6843921ea178f49a51630b0c9485e7de81d77d492f151baa9fd0alanguageName: nodelinkType: hard-"@vaadin/vaadin-themable-mixin@npm:~25.0.3":- version: 25.0.3- resolution: "@vaadin/vaadin-themable-mixin@npm:25.0.3"+"@vaadin/vaadin-themable-mixin@npm:~25.1.3":+ version: 25.1.3+ resolution: "@vaadin/vaadin-themable-mixin@npm:25.1.3"dependencies:"@open-wc/dedupe-mixin": "npm:^1.3.0"- "@vaadin/component-base": "npm:~25.0.3"+ "@vaadin/component-base": "npm:~25.1.3"lit: "npm:^3.0.0"- checksum: 10c0/87101f06828f9a85d1a46fb247d8f79bc3fe0d53ef4e7976562546cf5db4da3a9b01e1bf4c739e2f619585d669b433ddc6a0758d487c171747a40ffe688f1bf0+ checksum: 10c0/2a61202f36ecef635ce5dc094d8efbdf237709db0f7977ded3027b30d84c6a2c85eb447f995fb06632c84a7d45dbb8a611fa20170c8fd591a1e0effc984d78f9languageName: nodelinkType: hard@@ -7987,6 +8044,13 @@ __metadata:languageName: nodelinkType: hard+"inter-ui@npm:^4.1.1":+ version: 4.1.1+ resolution: "inter-ui@npm:4.1.1"+ checksum: 10c0/fb809bead520fefdef61abfca8ff7865b697e0738d2341afd4faf0539536d45638ee7812533afe413cabe765faf7a20e8e22a34c3df7693839a3acd2be44d1a7+ languageName: node+ linkType: hard+"internal-slot@npm:^1.0.5":version: 1.0.7resolution: "internal-slot@npm:1.0.7"@@ -10277,34 +10341,34 @@ __metadata:linkType: hard"rollup@npm:^4.34.9":- version: 4.61.1- resolution: "rollup@npm:4.61.1"- dependencies:- "@rollup/rollup-android-arm-eabi": "npm:4.61.1"- "@rollup/rollup-android-arm64": "npm:4.61.1"- "@rollup/rollup-darwin-arm64": "npm:4.61.1"- "@rollup/rollup-darwin-x64": "npm:4.61.1"- "@rollup/rollup-freebsd-arm64": "npm:4.61.1"- "@rollup/rollup-freebsd-x64": "npm:4.61.1"- "@rollup/rollup-linux-arm-gnueabihf": "npm:4.61.1"- "@rollup/rollup-linux-arm-musleabihf": "npm:4.61.1"- "@rollup/rollup-linux-arm64-gnu": "npm:4.61.1"- "@rollup/rollup-linux-arm64-musl": "npm:4.61.1"- "@rollup/rollup-linux-loong64-gnu": "npm:4.61.1"- "@rollup/rollup-linux-loong64-musl": "npm:4.61.1"- "@rollup/rollup-linux-ppc64-gnu": "npm:4.61.1"- "@rollup/rollup-linux-ppc64-musl": "npm:4.61.1"- "@rollup/rollup-linux-riscv64-gnu": "npm:4.61.1"- "@rollup/rollup-linux-riscv64-musl": "npm:4.61.1"- "@rollup/rollup-linux-s390x-gnu": "npm:4.61.1"- "@rollup/rollup-linux-x64-gnu": "npm:4.61.1"- "@rollup/rollup-linux-x64-musl": "npm:4.61.1"- "@rollup/rollup-openbsd-x64": "npm:4.61.1"- "@rollup/rollup-openharmony-arm64": "npm:4.61.1"- "@rollup/rollup-win32-arm64-msvc": "npm:4.61.1"- "@rollup/rollup-win32-ia32-msvc": "npm:4.61.1"- "@rollup/rollup-win32-x64-gnu": "npm:4.61.1"- "@rollup/rollup-win32-x64-msvc": "npm:4.61.1"+ version: 4.61.0+ resolution: "rollup@npm:4.61.0"+ dependencies:+ "@rollup/rollup-android-arm-eabi": "npm:4.61.0"+ "@rollup/rollup-android-arm64": "npm:4.61.0"+ "@rollup/rollup-darwin-arm64": "npm:4.61.0"+ "@rollup/rollup-darwin-x64": "npm:4.61.0"+ "@rollup/rollup-freebsd-arm64": "npm:4.61.0"+ "@rollup/rollup-freebsd-x64": "npm:4.61.0"+ "@rollup/rollup-linux-arm-gnueabihf": "npm:4.61.0"+ "@rollup/rollup-linux-arm-musleabihf": "npm:4.61.0"+ "@rollup/rollup-linux-arm64-gnu": "npm:4.61.0"+ "@rollup/rollup-linux-arm64-musl": "npm:4.61.0"+ "@rollup/rollup-linux-loong64-gnu": "npm:4.61.0"+ "@rollup/rollup-linux-loong64-musl": "npm:4.61.0"+ "@rollup/rollup-linux-ppc64-gnu": "npm:4.61.0"+ "@rollup/rollup-linux-ppc64-musl": "npm:4.61.0"+ "@rollup/rollup-linux-riscv64-gnu": "npm:4.61.0"+ "@rollup/rollup-linux-riscv64-musl": "npm:4.61.0"+ "@rollup/rollup-linux-s390x-gnu": "npm:4.61.0"+ "@rollup/rollup-linux-x64-gnu": "npm:4.61.0"+ "@rollup/rollup-linux-x64-musl": "npm:4.61.0"+ "@rollup/rollup-openbsd-x64": "npm:4.61.0"+ "@rollup/rollup-openharmony-arm64": "npm:4.61.0"+ "@rollup/rollup-win32-arm64-msvc": "npm:4.61.0"+ "@rollup/rollup-win32-ia32-msvc": "npm:4.61.0"+ "@rollup/rollup-win32-x64-gnu": "npm:4.61.0"+ "@rollup/rollup-win32-x64-msvc": "npm:4.61.0""@types/estree": "npm:1.0.9"fsevents: "npm:~2.3.2"dependenciesMeta:@@ -10362,7 +10426,7 @@ __metadata:optional: truebin:rollup: dist/bin/rollup- checksum: 10c0/6f35736125f3c28c5d8ce1c89c9653b282833b93f60fe29fcc20169bac46579b4d4bcfcb2bfb7e36dcfd4a7bbd6d84e4adf58c2bf9e6dbb4a3c1ed5c932ba8c6+ checksum: 10c0/55d70077c608e4979a4a9aaa83231e29f77f26014930a812cc17142d5aea1b2b81883cd2c43cd2a23fbf8eebc70a9b0683e4c982c385b8830a4b9a0e45f6e59dlanguageName: nodelinkType: hard