@openremote/or-components 1.8.0-snapshot.20250725074716 → 1.8.0-snapshot.20250725120001

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +1,77 @@
1
- var __decorate=this&&this.__decorate||function(e,t,o,r){var a,i=arguments.length,d=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(e,t,o,r);else for(var p=e.length-1;p>=0;p--)(a=e[p])&&(d=(i<3?a(d):i>3?a(t,o,d):a(t,o))||d);return i>3&&d&&Object.defineProperty(t,o,d),d};import{css as e,html as t,LitElement as o}from"lit";import{customElement as r,property as a}from"lit/decorators.js";let OrLoadingWrapper=class extends o{constructor(){super(...arguments),this.loadDom=!0,this.fadeContent=!1,this.loading=!1}static get styles(){return e`
2
- :host {
3
- display: block;
4
- }
5
-
6
- .hidden {
7
- display: none;
8
- }
9
-
10
- .faded {
11
- opacity: 0.5;
12
- }
13
-
14
- #wrapper {
15
- position: relative;
16
- }
17
-
18
- #loader {
19
- position: absolute;
20
- width: 100%;
21
- height: 100%;
22
- }
23
- `}render(){return t`
24
- <div id="wrapper">
25
- ${this.loading?t`<div id="loader">LOADING</div>`:""}
26
- ${this.loadDom||!this.loading?t`
27
- <div id="content-wrapper" class="${this.loading?this.fadeContent?"faded":"hidden":""}">
28
- <slot></slot>
29
- ${this.content||""}
30
- </div>`:""}
31
- </div>
32
- `}};__decorate([a({type:Number})],OrLoadingWrapper.prototype,"loadingHeight",void 0),__decorate([a({type:Boolean})],OrLoadingWrapper.prototype,"loadDom",void 0),__decorate([a({type:Boolean})],OrLoadingWrapper.prototype,"fadeContent",void 0),__decorate([a({type:Boolean})],OrLoadingWrapper.prototype,"loading",void 0),__decorate([a({type:Object,attribute:!1})],OrLoadingWrapper.prototype,"content",void 0),OrLoadingWrapper=__decorate([r("or-loading-wrapper")],OrLoadingWrapper);export{OrLoadingWrapper};
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { css, html, LitElement } from "lit";
8
+ import { customElement, property } from "lit/decorators.js";
9
+ /**
10
+ * A simple loading wrapper around some other content that will hide the content whilst loading property is true
11
+ */
12
+ let OrLoadingWrapper = class OrLoadingWrapper extends LitElement {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.loadDom = true;
16
+ this.fadeContent = false;
17
+ this.loading = false;
18
+ }
19
+ // language=CSS
20
+ static get styles() {
21
+ return css `
22
+ :host {
23
+ display: block;
24
+ }
25
+
26
+ .hidden {
27
+ display: none;
28
+ }
29
+
30
+ .faded {
31
+ opacity: 0.5;
32
+ }
33
+
34
+ #wrapper {
35
+ position: relative;
36
+ }
37
+
38
+ #loader {
39
+ position: absolute;
40
+ width: 100%;
41
+ height: 100%;
42
+ }
43
+ `;
44
+ }
45
+ render() {
46
+ return html `
47
+ <div id="wrapper">
48
+ ${this.loading ? html `<div id="loader">LOADING</div>` : ``}
49
+ ${this.loadDom || !this.loading ? html `
50
+ <div id="content-wrapper" class="${this.loading ? this.fadeContent ? "faded" : "hidden" : ""}">
51
+ <slot></slot>
52
+ ${this.content || ``}
53
+ </div>` : ``}
54
+ </div>
55
+ `;
56
+ }
57
+ };
58
+ __decorate([
59
+ property({ type: Number })
60
+ ], OrLoadingWrapper.prototype, "loadingHeight", void 0);
61
+ __decorate([
62
+ property({ type: Boolean })
63
+ ], OrLoadingWrapper.prototype, "loadDom", void 0);
64
+ __decorate([
65
+ property({ type: Boolean })
66
+ ], OrLoadingWrapper.prototype, "fadeContent", void 0);
67
+ __decorate([
68
+ property({ type: Boolean })
69
+ ], OrLoadingWrapper.prototype, "loading", void 0);
70
+ __decorate([
71
+ property({ type: Object, attribute: false })
72
+ ], OrLoadingWrapper.prototype, "content", void 0);
73
+ OrLoadingWrapper = __decorate([
74
+ customElement("or-loading-wrapper")
75
+ ], OrLoadingWrapper);
76
+ export { OrLoadingWrapper };
77
+ //# sourceMappingURL=or-loading-wrapper.js.map
package/lib/or-panel.js CHANGED
@@ -1,58 +1,98 @@
1
- var __decorate=this&&this.__decorate||function(e,r,n,a){var o,t=arguments.length,i=t<3?r:null===a?a=Object.getOwnPropertyDescriptor(r,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,r,n,a);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(t<3?o(i):t>3?o(r,n,i):o(r,n))||i);return t>3&&i&&Object.defineProperty(r,n,i),i};import{css as e,html as r,LitElement as n,unsafeCSS as a}from"lit";import{customElement as o,property as t,query as i}from"lit/decorators.js";import{DefaultColor2 as l,DefaultColor3 as d}from"@openremote/core";import{when as p}from"lit/directives/when.js";let simpleBarStyle=require("simplebar/dist/simplebar.css"),elevationStyle=require("@material/elevation/dist/mdc.elevation.css"),style=e`
2
-
3
- :host {
4
- --internal-or-panel-background-color: var(--or-panel-background-color, var(--or-app-color2, ${a(l)}));
5
- --internal-or-panel-padding: var(--or-panel-padding, 10px);
6
- --internal-or-panel-border: var(--or-panel-border, 1px solid #e5e5e5);
7
- --internal-or-panel-border-radius: var(--or-panel-border-radius, 5px);
8
- --internal-or-panel-heading-margin: var(--or-panel-heading-margin, 0 0 10px 7px);
9
- --internal-or-panel-heading-min-height: var(--or-panel-heading-min-height, 36px);
10
- --internal-or-panel-heading-color: var(--or-panel-heading-color, var(--or-app-color3, ${a(d)}));
11
- --internal-or-panel-heading-font-size: var(--or-panel-heading-font-size, larger);
12
- --internal-or-panel-heading-font-weight: var(--or-panel-heading-font-weight, bolder);
13
- --internal-or-panel-heading-text-transform: var(--or-panel-heading-text-transform, unset);
14
- display: block;
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { css, html, LitElement, unsafeCSS } from "lit";
8
+ import { customElement, property, query } from "lit/decorators.js";
9
+ import { DefaultColor2, DefaultColor3 } from "@openremote/core";
10
+ import { when } from "lit/directives/when.js";
11
+ // TODO: Add webpack/rollup to build so consumers aren't forced to use the same tooling
12
+ const simpleBarStyle = require("simplebar/dist/simplebar.css");
13
+ const elevationStyle = require("@material/elevation/dist/mdc.elevation.css");
14
+ // language=CSS
15
+ const style = css `
16
+
17
+ :host {
18
+ --internal-or-panel-background-color: var(--or-panel-background-color, var(--or-app-color2, ${unsafeCSS(DefaultColor2)}));
19
+ --internal-or-panel-padding: var(--or-panel-padding, 10px);
20
+ --internal-or-panel-border: var(--or-panel-border, 1px solid #e5e5e5);
21
+ --internal-or-panel-border-radius: var(--or-panel-border-radius, 5px);
22
+ --internal-or-panel-heading-margin: var(--or-panel-heading-margin, 0 0 10px 7px);
23
+ --internal-or-panel-heading-min-height: var(--or-panel-heading-min-height, 36px);
24
+ --internal-or-panel-heading-color: var(--or-panel-heading-color, var(--or-app-color3, ${unsafeCSS(DefaultColor3)}));
25
+ --internal-or-panel-heading-font-size: var(--or-panel-heading-font-size, larger);
26
+ --internal-or-panel-heading-font-weight: var(--or-panel-heading-font-weight, bolder);
27
+ --internal-or-panel-heading-text-transform: var(--or-panel-heading-text-transform, unset);
28
+ display: block;
29
+ }
30
+
31
+ :host([hidden]) {
32
+ display: none;
33
+ }
34
+
35
+ #wrapper {
36
+ height: 100%;
37
+ flex: 1;
38
+ }
39
+
40
+ #panel {
41
+ padding: var(--internal-or-panel-padding);
42
+ background-color: var(--internal-or-panel-background-color);
43
+ border: var(--internal-or-panel-border);
44
+ border-radius: var(--internal-or-panel-border-radius);
45
+ }
46
+
47
+ #heading {
48
+ display: flex;
49
+ align-items: center;
50
+ margin: var(--internal-or-panel-heading-margin);
51
+ min-height: var(--internal-or-panel-heading-min-height);
52
+ font-size: var(--internal-or-panel-heading-font-size);
53
+ font-weight: var(--internal-or-panel-heading-font-weight);
54
+ color: var(--internal-or-panel-heading-color);
55
+ text-transform: var(--internal-or-panel-heading-text-transform);
56
+ }
57
+ `;
58
+ let OrPanel = class OrPanel extends LitElement {
59
+ static get styles() {
60
+ return [
61
+ css `${unsafeCSS(elevationStyle)}`,
62
+ css `${unsafeCSS(simpleBarStyle)}`,
63
+ style
64
+ ];
15
65
  }
16
-
17
- :host([hidden]) {
18
- display: none;
66
+ render() {
67
+ return html `
68
+ <div id="wrapper">
69
+ <div id="panel">
70
+ ${this.heading ? html `
71
+ ${when(!(typeof this.heading === 'string'), () => html `
72
+ ${this.heading}
73
+ `, () => html `
74
+ <div id="heading">
75
+ <span>${this.heading}</span>
76
+ </div>
77
+ `)}
78
+ ` : ``}
79
+ <slot></slot>
80
+ </div>
81
+ </div>
82
+ `;
19
83
  }
20
-
21
- #wrapper {
22
- height: 100%;
23
- flex: 1;
24
- }
25
-
26
- #panel {
27
- padding: var(--internal-or-panel-padding);
28
- background-color: var(--internal-or-panel-background-color);
29
- border: var(--internal-or-panel-border);
30
- border-radius: var(--internal-or-panel-border-radius);
31
- }
32
-
33
- #heading {
34
- display: flex;
35
- align-items: center;
36
- margin: var(--internal-or-panel-heading-margin);
37
- min-height: var(--internal-or-panel-heading-min-height);
38
- font-size: var(--internal-or-panel-heading-font-size);
39
- font-weight: var(--internal-or-panel-heading-font-weight);
40
- color: var(--internal-or-panel-heading-color);
41
- text-transform: var(--internal-or-panel-heading-text-transform);
42
- }
43
- `,OrPanel=class extends n{static get styles(){return[e`${a(elevationStyle)}`,e`${a(simpleBarStyle)}`,style]}render(){return r`
44
- <div id="wrapper">
45
- <div id="panel">
46
- ${this.heading?r`
47
- ${p("string"!=typeof this.heading,()=>r`
48
- ${this.heading}
49
- `,()=>r`
50
- <div id="heading">
51
- <span>${this.heading}</span>
52
- </div>
53
- `)}
54
- `:""}
55
- <slot></slot>
56
- </div>
57
- </div>
58
- `}};__decorate([t({type:Number})],OrPanel.prototype,"zLevel",void 0),__decorate([t({type:String})],OrPanel.prototype,"heading",void 0),__decorate([i("#panel")],OrPanel.prototype,"_panel",void 0),OrPanel=__decorate([o("or-panel")],OrPanel);export{OrPanel};
84
+ };
85
+ __decorate([
86
+ property({ type: Number })
87
+ ], OrPanel.prototype, "zLevel", void 0);
88
+ __decorate([
89
+ property({ type: String })
90
+ ], OrPanel.prototype, "heading", void 0);
91
+ __decorate([
92
+ query("#panel")
93
+ ], OrPanel.prototype, "_panel", void 0);
94
+ OrPanel = __decorate([
95
+ customElement("or-panel")
96
+ ], OrPanel);
97
+ export { OrPanel };
98
+ //# sourceMappingURL=or-panel.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openremote/or-components",
3
- "version": "1.8.0-snapshot.20250725074716",
3
+ "version": "1.8.0-snapshot.20250725120001",
4
4
  "description": "OpenRemote basic UI components",
5
5
  "customElements": "custom-elements.json",
6
6
  "main": "dist/umd/index.bundle.js",
@@ -26,14 +26,14 @@
26
26
  "license": "AGPL-3.0-or-later",
27
27
  "dependencies": {
28
28
  "@material/elevation": "^9.0.0",
29
- "@openremote/core": "1.8.0-snapshot.20250725074716",
30
- "@openremote/or-mwc-components": "1.8.0-snapshot.20250725074716",
29
+ "@openremote/core": "1.8.0-snapshot.20250725120001",
30
+ "@openremote/or-mwc-components": "1.8.0-snapshot.20250725120001",
31
31
  "ace-builds": "^1.41.0",
32
32
  "lit": "^2.0.2",
33
33
  "simplebar": "^5.3.6"
34
34
  },
35
35
  "devDependencies": {
36
- "@openremote/util": "1.8.0-snapshot.20250725074716"
36
+ "@openremote/util": "1.8.0-snapshot.20250725120001"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"