Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

UI: Remove or-form component (#2467)

Martin Peetersbbdd20199a55
diff --git a/ui/component/or-components/package.json b/ui/component/or-components/package.json
index b1a5ced01..faf02bf16 100644
--- a/ui/component/or-components/package.json
+++ b/ui/component/or-components/package.json
@@ -32,7 +32,6 @@
"@openremote/core": "workspace:*",
"@openremote/model": "workspace:*",
"@openremote/or-icon": "workspace:*",
- "@openremote/or-mwc-components": "workspace:*",
"@openremote/or-translate": "workspace:*",
"ace-builds": "^1.41.0",
"lit": "^3.3.1",
diff --git a/ui/component/or-components/src/or-form.ts b/ui/component/or-components/src/or-form.ts
deleted file mode 100644
index 100827925..000000000
--- a/ui/component/or-components/src/or-form.ts
+++ /dev/null
@@ -1,84 +0,0 @@
-import {css, html, LitElement, PropertyValues, unsafeCSS} from "lit";
-import {customElement, property, query, queryAssignedElements} from "lit/decorators.js";
-import {DefaultColor2} from "@openremote/core";
-import {OrMwcInput} from "@openremote/or-mwc-components/or-mwc-input";
-
-// language=CSS
-const style = css`
-
- :host {
- display: block;
- }
-
- :host([hidden]) {
- display: none;
- }
-`;
-
-/**
- * This is a form element that supports any element that has a value property
- */
-// TODO: Support any form element
-@customElement("or-form")
-export class OrForm extends LitElement {
-
- @queryAssignedElements()
- protected formNodes!: Node[];
-
- protected firstUpdated(_changedProperties: PropertyValues): void {
- super.firstUpdated(_changedProperties);
-
-
-
- // if (this._panel) {
- // new SimpleBar(this._panel, {
- // autoHide: this.autoHide,
- // // @ts-ignore
- // forceVisible: this.forceVisible
- // });
- // }
- }
-
- render() {
-
- return html`
- <slot></slot>
- `;
- }
-
- public checkValidity(): boolean {
- let valid = false;
-
- this.formNodes.filter(node => node instanceof OrMwcInput && node.name).map(node => node as OrMwcInput).forEach(orMwcInput => {
- const inputValid = orMwcInput.checkValidity();
- valid = valid && inputValid;
- });
-
- return valid;
- }
-
- public reportValidity(): boolean {
- let valid = true;
-
- this.formNodes.filter(node => node instanceof OrMwcInput && node.name).map(node => node as OrMwcInput).forEach(orMwcInput => {
- const inputValid = orMwcInput.reportValidity();
- valid = valid && inputValid;
- });
-
- return valid;
- }
-
- public submit(): {[key: string]: any} {
- const data: {[key: string]: any} = {};
- this.formNodes.filter(node => node instanceof OrMwcInput && node.name).map(node => node as OrMwcInput).forEach(orMwcInput => {
- data[orMwcInput.name! as string] = orMwcInput.value;
- });
- return data;
- }
-
- public reset() {
- this.formNodes.filter(node => node instanceof OrMwcInput && node.name).map(node => node as OrMwcInput).forEach(orMwcInput => {
- orMwcInput.value = undefined;
- });
- }
-}
diff --git a/yarn.lock b/yarn.lock
index cadeb2e75..6b360a299 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1920,7 +1920,6 @@ __metadata:
"@openremote/core": "workspace:*"
"@openremote/model": "workspace:*"
"@openremote/or-icon": "workspace:*"
- "@openremote/or-mwc-components": "workspace:*"
"@openremote/or-translate": "workspace:*"
ace-builds: "npm:^1.41.0"
lit: "npm:^3.3.1"