Skip to content

armgit / core

Public Imported from GitHub
0

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

add or-table component and import

Vincentf7f3ab30a02e
diff --git a/ui/component/or-asset-viewer/src/index.ts b/ui/component/or-asset-viewer/src/index.ts
index 2a3e16e62..292e10661 100644
--- a/ui/component/or-asset-viewer/src/index.ts
+++ b/ui/component/or-asset-viewer/src/index.ts
@@ -10,6 +10,7 @@ import {InputType, OrInput, OrInputChangedEvent} from "@openremote/or-input";
import "@openremote/or-map";
import manager, {AssetModelUtil, subscribe, Util} from "@openremote/core";
import "@openremote/or-panel";
+import "@openremote/or-table";
import {OrChartConfig, OrChartEvent} from "@openremote/or-chart";
import {HistoryConfig, OrAttributeHistory, OrAttributeHistoryEvent} from "@openremote/or-attribute-history";
import {Type as MapType, Util as MapUtil} from "@openremote/or-map";
@@ -522,6 +523,7 @@ export class OrAssetViewer extends subscribe(manager)(translate(i18next)(LitElem
content = html`
test
+ <or-table></or-table>
`;
} else {
content = html`
diff --git a/ui/component/or-table/.npmignore b/ui/component/or-table/.npmignore
new file mode 100644
index 000000000..17e64b1ad
--- /dev/null
+++ b/ui/component/or-table/.npmignore
@@ -0,0 +1,8 @@
+build/
+build.gradle
+test/
+src/
+webpack.config.js
+tsconfig.json
+dist/*.map
+.tsbuildinfo
\ No newline at end of file
diff --git a/ui/component/or-table/README.md b/ui/component/or-table/README.md
new file mode 100644
index 000000000..ff8d337f1
--- /dev/null
+++ b/ui/component/or-table/README.md
@@ -0,0 +1,31 @@
+# @openremote/or-table \<or-table\>
+[![NPM Version][npm-image]][npm-url]
+[![Linux Build][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Web Component for displaying an input control.
+
+## Install
+```bash
+npm i @openremote/or-table
+yarn add @openremote/or-table
+```
+
+## Usage
+For a full list of properties, methods and options refer to the TypeDoc generated [documentation]().
+
+
+## Supported Browsers
+The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
+Internet Explorer 11 is also supported.
+
+
+## License
+[GNU AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html)
+
+[npm-image]: https://img.shields.io/npm/v/live-xxx.svg
+[npm-url]: https://npmjs.org/package/@openremote/or-input
+[travis-image]: https://img.shields.io/travis/live-js/live-xxx/master.svg
+[travis-url]: https://travis-ci.org/live-js/live-xxx
+[coveralls-image]: https://img.shields.io/coveralls/live-js/live-xxx/master.svg
+[coveralls-url]: https://coveralls.io/r/live-js/live-xxx?branch=master
diff --git a/ui/component/or-table/build.gradle b/ui/component/or-table/build.gradle
new file mode 100644
index 000000000..98cdcb8e2
--- /dev/null
+++ b/ui/component/or-table/build.gradle
@@ -0,0 +1,15 @@
+buildDir = "dist"
+
+task clean() {
+ doLast {
+ delete "dist"
+ }
+}
+
+task prepareUi() {
+ dependsOn clean, npmPrepare
+}
+
+task publishUi() {
+ dependsOn clean, npmPublish
+}
\ No newline at end of file
diff --git a/ui/component/or-table/package-lock.json b/ui/component/or-table/package-lock.json
new file mode 100644
index 000000000..0969fd1de
--- /dev/null
+++ b/ui/component/or-table/package-lock.json
@@ -0,0 +1,148 @@
+{
+ "name": "@openremote/or-table",
+ "version": "1.0.0",
+ "lockfileVersion": 1,
+ "requires": true,
+ "dependencies": {
+ "@material/animation": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@material/animation/-/animation-5.1.0.tgz",
+ "integrity": "sha512-qZuPCZkTsCQCzx5EtY2eNBcmYOMGMbFVq6VTmvQztDCYDykT8JfP8Hpk55Y5bGORHvBbIasUXzoAhfQs6w/Bdg==",
+ "requires": {
+ "tslib": "^1.9.3"
+ }
+ },
+ "@material/base": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@material/base/-/base-5.1.0.tgz",
+ "integrity": "sha512-UxVFKpSNaoKqd7hHxy9hrvwANp0WJy/BZqu8Rj/aRvKnBZnuHehFuOysI9WqdeTqgveJaQoj6EEkVEqLurR5Sg==",
+ "requires": {
+ "tslib": "^1.9.3"
+ }
+ },
+ "@material/data-table": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@material/data-table/-/data-table-5.1.0.tgz",
+ "integrity": "sha512-vjijTvCHM7sfyPzQ05026nSWT1Bn/3lfj1u0oeYRnym6Ke6Os36x+IF/jFhjsraXKb2we6cof7OdoMFHCU8cqQ==",
+ "requires": {
+ "@material/animation": "^5.1.0",
+ "@material/base": "^5.1.0",
+ "@material/checkbox": "^5.1.0",
+ "@material/density": "^5.1.0",
+ "@material/dom": "^5.1.0",
+ "@material/elevation": "^5.1.0",
+ "@material/feature-targeting": "^5.1.0",
+ "@material/rtl": "^5.1.0",
+ "@material/shape": "^5.1.0",
+ "@material/theme": "^5.1.0",
+ "@material/typography": "^5.1.0",
+ "tslib": "^1.10.0"
+ },
+ "dependencies": {
+ "@material/checkbox": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@material/checkbox/-/checkbox-5.1.0.tgz",
+ "integrity": "sha512-NwpWxFdWrZNlSjcSEEcGz8UN7ZQ5k8VthExclJnawpYGPUnCPLTXWogREnA2Tyl22PJ6jOy8Ejb8tnpu2rSiaw==",
+ "requires": {
+ "@material/animation": "^5.1.0",
+ "@material/base": "^5.1.0",
+ "@material/density": "^5.1.0",
+ "@material/dom": "^5.1.0",
+ "@material/feature-targeting": "^5.1.0",
+ "@material/ripple": "^5.1.0",
+ "@material/theme": "^5.1.0",
+ "@material/touch-target": "^5.1.0",
+ "tslib": "^1.9.3"
+ }
+ },
+ "@material/ripple": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@material/ripple/-/ripple-5.1.0.tgz",
+ "integrity": "sha512-mluIf+HaaCplszp9/MAl178FpfIJWi5hSyQOpF7w8RTzRSaH8J0uwgmn8VeNnwe1TAWio0vQzHrz4iEg2r7Ngw==",
+ "requires": {
+ "@material/animation": "^5.1.0",
+ "@material/base": "^5.1.0",
+ "@material/dom": "^5.1.0",
+ "@material/feature-targeting": "^5.1.0",
+ "@material/theme": "^5.1.0",
+ "tslib": "^1.9.3"
+ }
+ }
+ }
+ },
+ "@material/density": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@material/density/-/density-5.1.0.tgz",
+ "integrity": "sha512-jmp6AgiNYosl+HicxWCa8vib9pg9tNxRcf+6f9LDkDYJ9jtO90PXuypyd0hO64JZ9Df7BywFj5hTWPERG1FBbw=="
+ },
+ "@material/dom": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@material/dom/-/dom-5.1.0.tgz",
+ "integrity": "sha512-tBbl3hG34Auv+2sboWhtstXeZ9rx3G7hb/jEXs5xZ5KIfZHwY4mbo0KqR/fSJZKaUsvk2Nc/UEOVcUx2mTNmYg==",
+ "requires": {
+ "tslib": "^1.9.3"
+ }
+ },
+ "@material/elevation": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@material/elevation/-/elevation-5.1.0.tgz",
+ "integrity": "sha512-NsWIT+L6x3BLouCOh3H8x885/nCrNNmzCwHEodz/0PcYQsxx9RiIVFkagmJWw/w//jej/D4NotD0xHGKOWTrFA==",
+ "requires": {
+ "@material/animation": "^5.1.0",
+ "@material/base": "^5.1.0",
+ "@material/feature-targeting": "^5.1.0",
+ "@material/theme": "^5.1.0"
+ }
+ },
+ "@material/feature-targeting": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@material/feature-targeting/-/feature-targeting-5.1.0.tgz",
+ "integrity": "sha512-z3JNWF7lP9WOzw1xBwul/HAOu4qC6EpK/8MkhjLNI9APvdYML82PWS1V0k0MiqA6Jk6uxm8DiVAk9VUqBa9/YA=="
+ },
+ "@material/rtl": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@material/rtl/-/rtl-5.1.0.tgz",
+ "integrity": "sha512-Hij4KJIfjK63HArdQ3K1INMo0MbigDgL0JhjO1VDk5c+iYmYpjDI7wgPLmV5ISCBtenXRWpo1xbBO3uEmtCd4Q=="
+ },
+ "@material/shape": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@material/shape/-/shape-5.1.0.tgz",
+ "integrity": "sha512-/k27T9fhQ1zj7VCsS26nv0TzsOi142ncik2mycEXq8753PDBotob7Y19pbwivwt9QxkglhMGH0EaWdZPzBoQXw==",
+ "requires": {
+ "@material/feature-targeting": "^5.1.0",
+ "@material/rtl": "^5.1.0"
+ }
+ },
+ "@material/theme": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@material/theme/-/theme-5.1.0.tgz",
+ "integrity": "sha512-VoaCYAubn/oEG1/fu/yP4nxAw8sLEphFOGGBJxcPGQoLgQ9qcvibsV3G5H9S6AtmhJxgSGU0JnO9TaiuhQq5zA==",
+ "requires": {
+ "@material/feature-targeting": "^5.1.0"
+ }
+ },
+ "@material/touch-target": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@material/touch-target/-/touch-target-5.1.0.tgz",
+ "integrity": "sha512-lR3eoL1D0I/hyEK6I7bMFDBy/pE0yYvjYUZtL1vC7+2i54A4FgQ2hwnpQJVaZQXzrHdj6xsXmODphmUsH5gqPA==",
+ "requires": {
+ "@material/base": "^5.1.0",
+ "@material/feature-targeting": "^5.1.0"
+ }
+ },
+ "@material/typography": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@material/typography/-/typography-5.1.0.tgz",
+ "integrity": "sha512-yh02koa6JLyPT5u7Zb31kyqhoZoppL0n9FmZK+eHXZcfeDF7ROL0UmtRsEjQxfnCNZRR+FIhAgrzdYxClwH05g==",
+ "requires": {
+ "@material/feature-targeting": "^5.1.0",
+ "@material/theme": "^5.1.0"
+ }
+ },
+ "tslib": {
+ "version": "1.11.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz",
+ "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA=="
+ }
+ }
+}
diff --git a/ui/component/or-table/package.json b/ui/component/or-table/package.json
new file mode 100644
index 000000000..0fd0913af
--- /dev/null
+++ b/ui/component/or-table/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "@openremote/or-table",
+ "version": "1.0.0",
+ "description": "OpenRemote table",
+ "main": "dist/umd/index.bundle.js",
+ "module": "dist/index.js",
+ "types": "dist/index.d.ts",
+ "scripts": {
+ "build": "npx tsc -b",
+ "test": "echo \"No tests\" && exit 0",
+ "prepublishOnly": "npx tsc -b && npx webpack"
+ },
+ "author": "OpenRemote",
+ "license": "AGPL-3.0-or-later",
+ "dependencies": {
+ "@material/data-table": "^5.1.0",
+ "lit-element": "^2.2.1"
+ },
+ "devDependencies": {
+ "tslint": ">=5.11.0",
+ "typescript": ">=3.4.5",
+ "webpack": "^4.41.2",
+ "webpack-cli": "^3.3.9"
+ }
+}
diff --git a/ui/component/or-table/src/index.ts b/ui/component/or-table/src/index.ts
new file mode 100644
index 000000000..f07f6cdcd
--- /dev/null
+++ b/ui/component/or-table/src/index.ts
@@ -0,0 +1,168 @@
+import {css, customElement, html, LitElement, property, PropertyValues, TemplateResult, unsafeCSS, query} from "lit-element";
+import {classMap} from "lit-html/directives/class-map";
+import {ifDefined} from "lit-html/directives/if-defined";
+import {MDCComponent} from "@material/base";
+import {MDCDataTable } from "@material/data-table";
+
+import {DefaultColor1, DefaultColor4, DefaultColor8} from "@openremote/core";
+
+// language=CSS
+const style = css`
+
+ :host([hidden]) {
+ display: none;
+ }
+
+ #wrapper {
+ display: flex;
+ align-items: center;
+ }
+
+ #component {
+ max-width: 100%;
+ }
+`;
+
+@customElement("or-table")
+export class OrTable extends LitElement {
+
+ static get styles() {
+ return [
+ style
+ ];
+ }
+
+ // @property({type: Boolean})
+ // public focused?: boolean;
+ //
+ // @property()
+ // public value?: any;
+ //
+ // @property({type: String})
+ // public type?: InputType;
+ //
+ // @property({type: Boolean})
+ // public readonly: boolean = false;
+ //
+ // @property({type: Boolean})
+ // public disabled: boolean = false;
+ //
+ // @property({type: Boolean})
+ // public required: boolean = false;
+ //
+ // @property()
+ // public max?: any;
+ //
+ // @property()
+ // public min?: HTMLInputElement;
+ //
+ // @property({type: Number})
+ // public step?: number;
+ //
+ // @property({type: Boolean})
+ // public checked: boolean = false;
+ //
+ // @property({type: Number})
+ // public maxLength?: number;
+ //
+ // @property({type: Number})
+ // public minLength?: number;
+ //
+ // @property({type: Number})
+ // public rows?: number;
+ //
+ // @property({type: Number})
+ // public cols?: number;
+ //
+ // @property({type: Boolean})
+ // public multiple: boolean = false;
+ //
+ // @property({type: String})
+ // public pattern?: string;
+ //
+ // @property({type: String})
+ // public placeHolder?: string;
+ //
+ // @property({type: Array})
+ // public options?: string[] | [string, string][];
+ //
+ // @property({type: Boolean})
+ // public autoSelect?: boolean;
+ //
+ // /* STYLING PROPERTIES BELOW */
+ //
+ // @property({type: String})
+ // public icon?: string;
+ //
+ // @property({type: String})
+ // public iconOn?: string;
+ //
+ // @property({type: String})
+ // public iconTrailing?: string;
+ //
+ // @property({type: Boolean})
+ // public dense: boolean = false;
+ //
+ // /* BUTTON STYLES START */
+ //
+ // @property({type: Boolean})
+ // public raised: boolean = false;
+ //
+ // @property({type: Boolean})
+ // public action: boolean = false;
+ //
+ // @property({type: Boolean})
+ // public unElevated: boolean = false;
+ //
+ // @property({type: Boolean})
+ // public outlined: boolean = false;
+ //
+ // @property({type: Boolean})
+ // public rounded: boolean = false;
+ //
+ // /* BUTTON STYLES END */
+ //
+ // /* TEXT INPUT STYLES START */
+ //
+ // @property({type: Boolean})
+ // public fullWidth: boolean = false;
+ //
+ // @property({type: String})
+ // public helperText?: string;
+ //
+ // @property({type: Boolean})
+ // public helperPersistent: boolean = false;
+ //
+ // @property({type: String})
+ // public validationMessage = "";
+ //
+ // @property({type: Boolean})
+ // public charCounter: boolean = false;
+ //
+ // @property({type: String})
+ // public label?: string;
+
+ /* TEXT INPUT STYLES END */
+
+ protected _mdcComponent?: MDCComponent<any>;
+ protected _mdcField?: MDCComponent<any>;
+ protected _selectedIndex = -1;
+
+ disconnectedCallback(): void {
+ super.disconnectedCallback();
+ if (this._mdcComponent) {
+ this._mdcComponent.destroy();
+ this._mdcComponent = undefined;
+ }
+ if (this._mdcField) {
+ this._mdcField.destroy();
+ this._mdcField = undefined;
+ }
+ }
+
+ protected render() {
+
+ return html`<span>tabel</span>`;
+ }
+
+}
diff --git a/ui/component/or-table/tsconfig.json b/ui/component/or-table/tsconfig.json
new file mode 100644
index 000000000..2d31b45ae
--- /dev/null
+++ b/ui/component/or-table/tsconfig.json
@@ -0,0 +1,14 @@
+{
+ "extends": "../../tsconfig",
+ "compilerOptions": {
+ "outDir": "./dist",
+ "tsBuildInfoFile": "./dist/.tsbuildinfo",
+ "rootDir": "src"
+ },
+ "include": [
+ "./src"
+ ],
+ "references": [
+ { "path": "../core" }
+ ]
+}
\ No newline at end of file
diff --git a/ui/component/or-table/webpack.config.js b/ui/component/or-table/webpack.config.js
new file mode 100644
index 000000000..9fe13702d
--- /dev/null
+++ b/ui/component/or-table/webpack.config.js
@@ -0,0 +1,7 @@
+const util = require("../webpack.util");
+
+bundles = {
+ "index.bundle": undefined
+};
+
+module.exports = util.generateExports(__dirname);
\ No newline at end of file