iobroker.mywebui 1.38.13 → 1.38.15
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/io-package.json
CHANGED
package/package.json
CHANGED
|
@@ -9,6 +9,25 @@ export class IobrokerWebuiPropertyGrid extends VisualizationPropertyGrid {
|
|
|
9
9
|
constructor() {
|
|
10
10
|
super();
|
|
11
11
|
this._setupScreenVisibilityObserver();
|
|
12
|
+
setTimeout(() => this._injectGroupHeaderStyle(), 600);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
_injectGroupHeaderStyle() {
|
|
16
|
+
const inject = (root) => {
|
|
17
|
+
if (!root) return;
|
|
18
|
+
for (const el of root.querySelectorAll('*')) {
|
|
19
|
+
if (el.tagName?.toLowerCase() === 'node-projects-property-grid-property-list' && el.shadowRoot) {
|
|
20
|
+
if (!el.shadowRoot.querySelector('#gokturk-group-style')) {
|
|
21
|
+
const s = document.createElement('style');
|
|
22
|
+
s.id = 'gokturk-group-style';
|
|
23
|
+
s.textContent = '.group-header { font-size: 14px !important; font-family: sans-serif !important; }';
|
|
24
|
+
el.shadowRoot.appendChild(s);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (el.shadowRoot) inject(el.shadowRoot);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
inject(this.shadowRoot);
|
|
12
31
|
}
|
|
13
32
|
|
|
14
33
|
_setupScreenVisibilityObserver() {
|
|
@@ -52,7 +52,22 @@ export class IobrokerWebuiPropertiesService extends BaseCustomWebComponentProper
|
|
|
52
52
|
if (group) property.group = group;
|
|
53
53
|
properties.push(property);
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
const groupMap = new Map();
|
|
56
|
+
const ungrouped = [];
|
|
57
|
+
for (const prop of properties) {
|
|
58
|
+
if (prop.group) {
|
|
59
|
+
if (!groupMap.has(prop.group)) groupMap.set(prop.group, []);
|
|
60
|
+
groupMap.get(prop.group).push(prop);
|
|
61
|
+
delete prop.group;
|
|
62
|
+
} else {
|
|
63
|
+
ungrouped.push(prop);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const result = [...ungrouped];
|
|
67
|
+
for (const [groupName, groupProps] of groupMap) {
|
|
68
|
+
result.push({ name: groupName, description: '', properties: groupProps });
|
|
69
|
+
}
|
|
70
|
+
return result;
|
|
56
71
|
}
|
|
57
72
|
else {
|
|
58
73
|
const screens = await iobrokerHandler.getAllNames('screen');
|