@openremote/or-mwc-components 1.8.0-snapshot.20250725120002 → 1.8.0-snapshot.20250728102340
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -32
- package/build.gradle +19 -19
- package/custom-elements.json +4 -4
- package/lib/or-mwc-dialog.js +76 -329
- package/lib/or-mwc-drawer.js +10 -114
- package/lib/or-mwc-input.js +439 -1760
- package/lib/or-mwc-list.js +71 -283
- package/lib/or-mwc-menu.js +45 -237
- package/lib/or-mwc-snackbar.js +17 -141
- package/lib/or-mwc-table.js +245 -685
- package/lib/or-mwc-tabs.js +53 -173
- package/lib/style.js +121 -125
- package/package.json +5 -5
- package/rspack.config.js +7 -7
- package/src/or-mwc-dialog.ts +374 -374
- package/src/or-mwc-drawer.ts +100 -100
- package/src/or-mwc-input.ts +1876 -1876
- package/src/or-mwc-list.ts +335 -335
- package/src/or-mwc-menu.ts +279 -279
- package/src/or-mwc-snackbar.ts +157 -157
- package/src/or-mwc-table.ts +712 -712
- package/src/or-mwc-tabs.ts +175 -175
- package/src/style.ts +125 -125
- package/tsconfig.json +15 -15
- package/tsconfig.tsbuildinfo +1 -1
package/src/or-mwc-drawer.ts
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
import { css, html, LitElement, TemplateResult, unsafeCSS} from "lit";
|
|
2
|
-
import {customElement, property, query} from "lit/decorators.js";
|
|
3
|
-
import { MDCDrawer } from "@material/drawer";
|
|
4
|
-
import { classMap } from "lit/directives/class-map.js";
|
|
5
|
-
|
|
6
|
-
const drawerStyle = require("@material/drawer/dist/mdc.drawer.css");
|
|
7
|
-
|
|
8
|
-
export class OrMwcDrawerChangedEvent extends CustomEvent<boolean> {
|
|
9
|
-
|
|
10
|
-
public static readonly NAME = "or-mwc-drawer-changed";
|
|
11
|
-
|
|
12
|
-
constructor(value: boolean) {
|
|
13
|
-
super(OrMwcDrawerChangedEvent.NAME, {
|
|
14
|
-
detail: value,
|
|
15
|
-
bubbles: true,
|
|
16
|
-
composed: true
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
@customElement("or-mwc-drawer")
|
|
22
|
-
export class OrMwcDrawer extends LitElement {
|
|
23
|
-
|
|
24
|
-
public static get styles() {
|
|
25
|
-
return [
|
|
26
|
-
css`${unsafeCSS(drawerStyle)}`,
|
|
27
|
-
css`
|
|
28
|
-
.transparent{
|
|
29
|
-
background: none;
|
|
30
|
-
}`
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@property({ attribute: false }) public header!: TemplateResult;
|
|
35
|
-
|
|
36
|
-
@property({ type: Boolean }) public dismissible: boolean = false;
|
|
37
|
-
@property({ type: Boolean }) public rightSided: boolean = false;
|
|
38
|
-
@property({ type: Boolean }) public transparent: boolean = false;
|
|
39
|
-
@property({ type: Boolean }) public open: boolean = false;
|
|
40
|
-
|
|
41
|
-
@property({ attribute: false }) public appContent!: HTMLElement;
|
|
42
|
-
@property({ attribute: false }) public topBar!: HTMLElement;
|
|
43
|
-
|
|
44
|
-
@query(".mdc-drawer")
|
|
45
|
-
protected drawerElement!: HTMLElement;
|
|
46
|
-
protected drawer?: MDCDrawer;
|
|
47
|
-
|
|
48
|
-
public toggle() {
|
|
49
|
-
this.open = !this.open;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
public disconnectedCallback(): void {
|
|
53
|
-
super.disconnectedCallback();
|
|
54
|
-
if (this.drawer) {
|
|
55
|
-
this.drawer.destroy();
|
|
56
|
-
this.drawer = undefined;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
protected render() {
|
|
61
|
-
const isModal = !this.dismissible;
|
|
62
|
-
const classes = {
|
|
63
|
-
"mdc-drawer--dismissible": this.dismissible,
|
|
64
|
-
"mdc-drawer--modal": isModal,
|
|
65
|
-
"transparent": this.transparent
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
return html`
|
|
69
|
-
<aside class="mdc-drawer ${classMap(classes)}" dir="${(this.rightSided ? "rtl" : "ltr")}">
|
|
70
|
-
${this.header}
|
|
71
|
-
<div class="mdc-drawer__content" dir="ltr">
|
|
72
|
-
<slot></slot>
|
|
73
|
-
</div>
|
|
74
|
-
</aside>`;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
protected updated() {
|
|
78
|
-
if (this.drawer!.open !== this.open) {
|
|
79
|
-
this.drawer!.open = this.open;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
protected dispatchChangedEvent(value: boolean) {
|
|
84
|
-
this.dispatchEvent(new OrMwcDrawerChangedEvent(value));
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
protected firstUpdated() {
|
|
88
|
-
this.drawer = MDCDrawer.attachTo(this.drawerElement);
|
|
89
|
-
const openHandler = () => { this.dispatchChangedEvent(true); };
|
|
90
|
-
const closeHandler = () => { this.dispatchChangedEvent(false); };
|
|
91
|
-
this.drawer!.listen("MDCDrawer:opened", openHandler);
|
|
92
|
-
this.drawer!.listen("MDCDrawer:closed", closeHandler);
|
|
93
|
-
if (this.appContent) {
|
|
94
|
-
this.appContent.classList.add("mdc-drawer-app-content");
|
|
95
|
-
}
|
|
96
|
-
if (this.topBar) {
|
|
97
|
-
this.topBar.classList.add("mdc-top-app-bar");
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
1
|
+
import { css, html, LitElement, TemplateResult, unsafeCSS} from "lit";
|
|
2
|
+
import {customElement, property, query} from "lit/decorators.js";
|
|
3
|
+
import { MDCDrawer } from "@material/drawer";
|
|
4
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
5
|
+
|
|
6
|
+
const drawerStyle = require("@material/drawer/dist/mdc.drawer.css");
|
|
7
|
+
|
|
8
|
+
export class OrMwcDrawerChangedEvent extends CustomEvent<boolean> {
|
|
9
|
+
|
|
10
|
+
public static readonly NAME = "or-mwc-drawer-changed";
|
|
11
|
+
|
|
12
|
+
constructor(value: boolean) {
|
|
13
|
+
super(OrMwcDrawerChangedEvent.NAME, {
|
|
14
|
+
detail: value,
|
|
15
|
+
bubbles: true,
|
|
16
|
+
composed: true
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@customElement("or-mwc-drawer")
|
|
22
|
+
export class OrMwcDrawer extends LitElement {
|
|
23
|
+
|
|
24
|
+
public static get styles() {
|
|
25
|
+
return [
|
|
26
|
+
css`${unsafeCSS(drawerStyle)}`,
|
|
27
|
+
css`
|
|
28
|
+
.transparent{
|
|
29
|
+
background: none;
|
|
30
|
+
}`
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@property({ attribute: false }) public header!: TemplateResult;
|
|
35
|
+
|
|
36
|
+
@property({ type: Boolean }) public dismissible: boolean = false;
|
|
37
|
+
@property({ type: Boolean }) public rightSided: boolean = false;
|
|
38
|
+
@property({ type: Boolean }) public transparent: boolean = false;
|
|
39
|
+
@property({ type: Boolean }) public open: boolean = false;
|
|
40
|
+
|
|
41
|
+
@property({ attribute: false }) public appContent!: HTMLElement;
|
|
42
|
+
@property({ attribute: false }) public topBar!: HTMLElement;
|
|
43
|
+
|
|
44
|
+
@query(".mdc-drawer")
|
|
45
|
+
protected drawerElement!: HTMLElement;
|
|
46
|
+
protected drawer?: MDCDrawer;
|
|
47
|
+
|
|
48
|
+
public toggle() {
|
|
49
|
+
this.open = !this.open;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public disconnectedCallback(): void {
|
|
53
|
+
super.disconnectedCallback();
|
|
54
|
+
if (this.drawer) {
|
|
55
|
+
this.drawer.destroy();
|
|
56
|
+
this.drawer = undefined;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
protected render() {
|
|
61
|
+
const isModal = !this.dismissible;
|
|
62
|
+
const classes = {
|
|
63
|
+
"mdc-drawer--dismissible": this.dismissible,
|
|
64
|
+
"mdc-drawer--modal": isModal,
|
|
65
|
+
"transparent": this.transparent
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return html`
|
|
69
|
+
<aside class="mdc-drawer ${classMap(classes)}" dir="${(this.rightSided ? "rtl" : "ltr")}">
|
|
70
|
+
${this.header}
|
|
71
|
+
<div class="mdc-drawer__content" dir="ltr">
|
|
72
|
+
<slot></slot>
|
|
73
|
+
</div>
|
|
74
|
+
</aside>`;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
protected updated() {
|
|
78
|
+
if (this.drawer!.open !== this.open) {
|
|
79
|
+
this.drawer!.open = this.open;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
protected dispatchChangedEvent(value: boolean) {
|
|
84
|
+
this.dispatchEvent(new OrMwcDrawerChangedEvent(value));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
protected firstUpdated() {
|
|
88
|
+
this.drawer = MDCDrawer.attachTo(this.drawerElement);
|
|
89
|
+
const openHandler = () => { this.dispatchChangedEvent(true); };
|
|
90
|
+
const closeHandler = () => { this.dispatchChangedEvent(false); };
|
|
91
|
+
this.drawer!.listen("MDCDrawer:opened", openHandler);
|
|
92
|
+
this.drawer!.listen("MDCDrawer:closed", closeHandler);
|
|
93
|
+
if (this.appContent) {
|
|
94
|
+
this.appContent.classList.add("mdc-drawer-app-content");
|
|
95
|
+
}
|
|
96
|
+
if (this.topBar) {
|
|
97
|
+
this.topBar.classList.add("mdc-top-app-bar");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|