iobroker.mywebui 1.42.40 → 1.42.42
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 +15 -1
- package/package.json +1 -1
- package/www/dist/frontend/config/ConfigureWebcomponentDesigner.js +2 -0
- package/www/dist/frontend/config/IobrokerWebuiSolutionExplorer.js +3 -0
- package/www/dist/frontend/runtime/CustomControls.js +5 -44
- package/www/dist/frontend/runtime/DynamicElementProperties.js +97 -0
- package/www/dist/frontend/runtime/ScreenViewer.js +3 -0
- package/www/dist/frontend/services/IobrokerWebuiCustomControlEventsService.js +8 -3
- package/www/dist/frontend/services/IobrokerWebuiDynamicPropertiesService.js +36 -0
- package/www/dist/frontend/services/IobrokerWebuiLitPropertiesService.js +1 -2
- package/www/dist/frontend/services/IobrokerWebuiPropertiesService.js +0 -2
- package/www/dist/frontend/services/IobrokerWebuiPropertyGroupsService.js +13 -0
package/io-package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "mywebui",
|
|
4
|
-
"version": "1.42.
|
|
4
|
+
"version": "1.42.42",
|
|
5
5
|
"titleLang": {
|
|
6
6
|
"en": "mywebui",
|
|
7
7
|
"de": "mywebui",
|
|
@@ -29,6 +29,20 @@
|
|
|
29
29
|
"zh-cn": "使用万维网传送器的高锰用户接口"
|
|
30
30
|
},
|
|
31
31
|
"news": {
|
|
32
|
+
"1.42.42": {
|
|
33
|
+
"en": "feature: 'dynamic' tab in property grid for every element (works also with npm manifest widgets) - per-instance dynamic properties with two-way binding; fix: solution explorer drag crash on nodes without data",
|
|
34
|
+
"az": "yenilik: property grid-də hər element üçün 'dynamic' tabı (npm manifest widget-ləri ilə də işləyir) - instance-əsaslı dinamik property-lər iki-tərəfli binding ilə; düzəliş: solution explorer-də data-sız node-ları drag edəndə çökmə",
|
|
35
|
+
"tr": "yenilik: property grid'de her element için 'dynamic' sekmesi (npm manifest widget'larıyla da çalışır) - instance bazlı dinamik property'ler çift yönlü binding ile; düzeltme: solution explorer'da data'sız node sürüklemede çökme",
|
|
36
|
+
"ru": "новое: вкладка 'dynamic' в property grid для каждого элемента (работает и с npm manifest виджетами) - динамические свойства экземпляра с двусторонней привязкой; исправление: падение drag в solution explorer на узлах без data",
|
|
37
|
+
"de": "Neu: 'dynamic'-Tab im Property-Grid für jedes Element (funktioniert auch mit npm-Manifest-Widgets) - instanzbasierte dynamische Properties mit Zwei-Wege-Binding; Fix: Drag-Absturz im Solution Explorer bei Knoten ohne Daten"
|
|
38
|
+
},
|
|
39
|
+
"1.42.41": {
|
|
40
|
+
"en": "improvement: dynamic properties now work on Lit/package widgets at runtime too (accessors + -changed events applied by ScreenViewer); events tab lists -changed events of dynamic properties; added webui-demo-widget sample package",
|
|
41
|
+
"az": "təkmilləşdirmə: dinamik property-lər artıq runtime-da Lit/package widget-lərdə də işləyir (accessor-lar + -changed event-ləri ScreenViewer tərəfindən tətbiq olunur); events tabı dinamik property-lərin -changed event-lərini göstərir; webui-demo-widget nümunə paketi əlavə olundu",
|
|
42
|
+
"tr": "iyileştirme: dinamik property'ler artık runtime'da Lit/package widget'larda da çalışıyor (accessor'lar + -changed event'leri ScreenViewer tarafından uygulanıyor); events sekmesi dinamik property'lerin -changed event'lerini listeliyor; webui-demo-widget örnek paketi eklendi",
|
|
43
|
+
"ru": "улучшение: динамические свойства теперь работают и на Lit/package виджетах во время выполнения (аксессоры + события -changed применяются ScreenViewer); вкладка events показывает события -changed динамических свойств; добавлен пример пакета webui-demo-widget",
|
|
44
|
+
"de": "Verbesserung: dynamische Properties funktionieren zur Laufzeit jetzt auch bei Lit/Package-Widgets (Accessoren + -changed-Events durch ScreenViewer); Events-Tab listet -changed-Events dynamischer Properties; webui-demo-widget Beispielpaket hinzugefügt"
|
|
45
|
+
},
|
|
32
46
|
"1.42.40": {
|
|
33
47
|
"en": "feature: per-instance dynamic properties for custom controls (add/edit name, type, default via properties tab) and extended Lit widget property support (Array/Object/converter types, webuiProperties metadata for signal/color/screen/enum editors)",
|
|
34
48
|
"az": "yenilik: custom control-lar üçün instance-əsaslı dinamik property-lər (properties tabından ad, tip, default əlavə/redaktə) və Lit widget-lər üçün genişləndirilmiş property dəstəyi (Array/Object/converter tipləri, signal/color/screen/enum editorları üçün webuiProperties metadata)",
|
package/package.json
CHANGED
|
@@ -15,6 +15,7 @@ import { IobrokerWebuiCustomElementContextMenu } from "../services/IobrokerWebui
|
|
|
15
15
|
import { IobrokerWebuiRefactorService } from "../services/IobrokerWebuiRefactorService.js";
|
|
16
16
|
import { IobrokerWebuiSpecialPropertiesService } from "../services/IobrokerWebuiSpecialPropertiesService.js";
|
|
17
17
|
import { IobrokerWebuiLitPropertiesService } from "../services/IobrokerWebuiLitPropertiesService.js";
|
|
18
|
+
import { IobrokerWebuiPropertyGroupsService } from "../services/IobrokerWebuiPropertyGroupsService.js";
|
|
18
19
|
// import { IobrokerWebuiVisibilityPropertiesService } from "../services/IobrokerWebuiVisibilityPropertiesService.js";
|
|
19
20
|
import { iobrokerHandler } from "../common/IobrokerHandler.js";
|
|
20
21
|
import { ExpandCollapseContextMenu } from "@gokturk413/web-component-designer-widgets-wunderbaum";
|
|
@@ -51,6 +52,7 @@ export function configureDesigner(bindingsHelper) {
|
|
|
51
52
|
serviceContainer.register('propertyService', new IobrokerWebuiPropertiesService());
|
|
52
53
|
serviceContainer.register('propertyService', new IobrokerWebuiSpecialPropertiesService());
|
|
53
54
|
serviceContainer.register('propertyService', new IobrokerWebuiLitPropertiesService());
|
|
55
|
+
serviceContainer.register('propertyGroupsService', new IobrokerWebuiPropertyGroupsService());
|
|
54
56
|
// Visibility is now handled directly in PropertyGrid
|
|
55
57
|
// serviceContainer.register('propertyService', new IobrokerWebuiVisibilityPropertiesService());
|
|
56
58
|
serviceContainer.designViewConfigButtons.push(new IobrokerWebuiConfigButtonProvider());
|
|
@@ -1086,6 +1086,9 @@ export class IobrokerWebuiSolutionExplorer extends BaseCustomWebComponentConstru
|
|
|
1086
1086
|
dndSourceNode = e.node;
|
|
1087
1087
|
//@ts-ignore
|
|
1088
1088
|
e.event.target.style.opacity = '0.4';
|
|
1089
|
+
if (!e.node.data?.data) {
|
|
1090
|
+
return false;
|
|
1091
|
+
}
|
|
1089
1092
|
if (e.node.data.data.type == 'screen') {
|
|
1090
1093
|
const screen = e.node.data.data.name;
|
|
1091
1094
|
const elementDef = { tag: "iobroker-webui-screen-viewer", defaultAttributes: { 'screen-name': screen }, defaultWidth: '300px', defaultHeight: '200px' };
|
|
@@ -3,6 +3,7 @@ import { iobrokerHandler } from "../common/IobrokerHandler.js";
|
|
|
3
3
|
import { PropertiesHelper } from "@gokturk413/web-component-designer/dist/elements/services/propertiesService/services/PropertiesHelper.js";
|
|
4
4
|
import { visibilityService } from "./VisibilityService.js";
|
|
5
5
|
import { scanAndApplyAnimations, scanAndApplyEffects, cleanupAnimations, cleanupEffects } from "./AnimationService.js";
|
|
6
|
+
import { applyDynamicProperties, applyDynamicPropertiesToTree } from "./DynamicElementProperties.js";
|
|
6
7
|
export const webuiCustomControlPrefix = 'webui-';
|
|
7
8
|
export const webuiCustomControlSymbol = Symbol('webuiCustomControlSymbol');
|
|
8
9
|
export class BaseCustomControl extends BaseCustomWebComponentConstructorAppend {
|
|
@@ -109,51 +110,11 @@ export class BaseCustomControl extends BaseCustomWebComponentConstructorAppend {
|
|
|
109
110
|
}
|
|
110
111
|
// defines accessors for the per-instance dynamic properties declared in the
|
|
111
112
|
// 'dynamic-property-defs' attribute: [ { "name": "kamran", "type": "string", "default": "x" }, ... ]
|
|
112
|
-
// so they behave like normal control properties (bindings refresh + changed events)
|
|
113
|
+
// so they behave like normal control properties (bindings refresh + changed events).
|
|
114
|
+
// also applies dynamic properties to elements inside the control template (e.g. Lit widgets)
|
|
113
115
|
_setupDynamicProperties() {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const v = this.getAttribute('dynamic-property-defs');
|
|
117
|
-
if (!v)
|
|
118
|
-
return;
|
|
119
|
-
defs = JSON.parse(v);
|
|
120
|
-
}
|
|
121
|
-
catch (e) {
|
|
122
|
-
console.warn('invalid dynamic-property-defs attribute', e);
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
if (!Array.isArray(defs))
|
|
126
|
-
return;
|
|
127
|
-
for (const def of defs) {
|
|
128
|
-
const name = def?.name;
|
|
129
|
-
if (!name)
|
|
130
|
-
continue;
|
|
131
|
-
if (!Object.getOwnPropertyDescriptor(this, name)) {
|
|
132
|
-
Object.defineProperty(this, name, {
|
|
133
|
-
get() {
|
|
134
|
-
return this['_' + name];
|
|
135
|
-
},
|
|
136
|
-
set(newValue) {
|
|
137
|
-
if (this['_' + name] !== newValue && (!Number.isNaN(this['_' + name]) || !Number.isNaN(newValue))) {
|
|
138
|
-
this['_' + name] = newValue;
|
|
139
|
-
this._bindingsRefresh(name);
|
|
140
|
-
this.dispatchEvent(new CustomEvent(PropertiesHelper.camelToDashCase(name) + '-changed', { detail: { newValue } }));
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
enumerable: true,
|
|
144
|
-
configurable: true,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
const attr = this.getAttribute(PropertiesHelper.camelToDashCase(name));
|
|
148
|
-
let value = attr ?? def.default;
|
|
149
|
-
if (value != null) {
|
|
150
|
-
if (def.type === 'number')
|
|
151
|
-
value = parseFloat(value);
|
|
152
|
-
else if (def.type === 'boolean')
|
|
153
|
-
value = value === '' || value === true || value === 'true';
|
|
154
|
-
this['_' + name] = value;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
116
|
+
applyDynamicProperties(this);
|
|
117
|
+
applyDynamicPropertiesToTree(this.shadowRoot);
|
|
157
118
|
}
|
|
158
119
|
_assignEvent(event, callback) {
|
|
159
120
|
const arrayEl = [event, callback];
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { PropertiesHelper } from "@gokturk413/web-component-designer/dist/elements/services/propertiesService/services/PropertiesHelper.js";
|
|
2
|
+
|
|
3
|
+
// runtime support for per-instance dynamic properties (any element, incl. Lit/package widgets):
|
|
4
|
+
// reads the 'dynamic-property-defs' attribute and defines accessors on the instance so the
|
|
5
|
+
// properties dispatch '<name>-changed' events and refresh webui bindings on change.
|
|
6
|
+
export const dynamicDefsAttributeName = 'dynamic-property-defs';
|
|
7
|
+
|
|
8
|
+
export function parseDynamicDefs(element) {
|
|
9
|
+
try {
|
|
10
|
+
const v = element.getAttribute(dynamicDefsAttributeName);
|
|
11
|
+
if (v) {
|
|
12
|
+
const parsed = JSON.parse(v);
|
|
13
|
+
if (Array.isArray(parsed))
|
|
14
|
+
return parsed.filter(x => x && x.name);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
console.warn('invalid ' + dynamicDefsAttributeName + ' attribute', e, element);
|
|
19
|
+
}
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function findPrototypeAccessor(element, name) {
|
|
24
|
+
let proto = Object.getPrototypeOf(element);
|
|
25
|
+
while (proto && proto !== HTMLElement.prototype) {
|
|
26
|
+
const desc = Object.getOwnPropertyDescriptor(proto, name);
|
|
27
|
+
if (desc)
|
|
28
|
+
return desc;
|
|
29
|
+
proto = Object.getPrototypeOf(proto);
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function applyDynamicProperties(element) {
|
|
35
|
+
const defs = parseDynamicDefs(element);
|
|
36
|
+
for (const def of defs) {
|
|
37
|
+
const name = def.name;
|
|
38
|
+
if (Object.getOwnPropertyDescriptor(element, name))
|
|
39
|
+
continue;
|
|
40
|
+
// if the element already has an accessor for this name (e.g. a Lit reactive
|
|
41
|
+
// property), route values through it so the widget keeps reacting, but still
|
|
42
|
+
// dispatch the '-changed' event webui bindings listen to
|
|
43
|
+
const protoDesc = findPrototypeAccessor(element, name);
|
|
44
|
+
if (protoDesc && (protoDesc.get || protoDesc.set)) {
|
|
45
|
+
Object.defineProperty(element, name, {
|
|
46
|
+
get() {
|
|
47
|
+
return protoDesc.get ? protoDesc.get.call(this) : undefined;
|
|
48
|
+
},
|
|
49
|
+
set(newValue) {
|
|
50
|
+
const oldValue = protoDesc.get ? protoDesc.get.call(this) : undefined;
|
|
51
|
+
if (oldValue !== newValue) {
|
|
52
|
+
protoDesc.set?.call(this, newValue);
|
|
53
|
+
this._bindingsRefresh?.(name);
|
|
54
|
+
this.dispatchEvent(new CustomEvent(PropertiesHelper.camelToDashCase(name) + '-changed', { detail: { newValue } }));
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
enumerable: true,
|
|
58
|
+
configurable: true,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
Object.defineProperty(element, name, {
|
|
63
|
+
get() {
|
|
64
|
+
return this['_' + name];
|
|
65
|
+
},
|
|
66
|
+
set(newValue) {
|
|
67
|
+
if (this['_' + name] !== newValue && (!Number.isNaN(this['_' + name]) || !Number.isNaN(newValue))) {
|
|
68
|
+
this['_' + name] = newValue;
|
|
69
|
+
this._bindingsRefresh?.(name);
|
|
70
|
+
this.dispatchEvent(new CustomEvent(PropertiesHelper.camelToDashCase(name) + '-changed', { detail: { newValue } }));
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
enumerable: true,
|
|
74
|
+
configurable: true,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
const attr = element.getAttribute(PropertiesHelper.camelToDashCase(name));
|
|
78
|
+
let value = attr ?? def.default;
|
|
79
|
+
if (value != null) {
|
|
80
|
+
if (def.type === 'number')
|
|
81
|
+
value = parseFloat(value);
|
|
82
|
+
else if (def.type === 'boolean')
|
|
83
|
+
value = value === '' || value === true || value === 'true';
|
|
84
|
+
if (protoDesc)
|
|
85
|
+
element[name] = value;
|
|
86
|
+
else
|
|
87
|
+
element['_' + name] = value;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function applyDynamicPropertiesToTree(root) {
|
|
93
|
+
if (root instanceof Element && root.hasAttribute(dynamicDefsAttributeName))
|
|
94
|
+
applyDynamicProperties(root);
|
|
95
|
+
for (const el of root.querySelectorAll('[' + dynamicDefsAttributeName + ']'))
|
|
96
|
+
applyDynamicProperties(el);
|
|
97
|
+
}
|
|
@@ -7,6 +7,7 @@ import { isFirefox } from "@gokturk413/web-component-designer/dist/elements/help
|
|
|
7
7
|
import { PropertiesHelper } from "@gokturk413/web-component-designer/dist/elements/services/propertiesService/services/PropertiesHelper.js";
|
|
8
8
|
import { visibilityService } from "./VisibilityService.js";
|
|
9
9
|
import { scanAndApplyAnimations, scanAndApplyEffects, cleanupAnimations, cleanupEffects, ensureGSAP } from "./AnimationService.js";
|
|
10
|
+
import { applyDynamicPropertiesToTree } from "./DynamicElementProperties.js";
|
|
10
11
|
window.ensureGSAP = ensureGSAP;
|
|
11
12
|
let ScreenViewer = class ScreenViewer extends BaseCustomWebComponentConstructorAppend {
|
|
12
13
|
static { ScreenViewer_1 = this; }
|
|
@@ -313,6 +314,8 @@ let ScreenViewer = class ScreenViewer extends BaseCustomWebComponentConstructorA
|
|
|
313
314
|
get() { return el.style.pointerEvents === 'none'; }
|
|
314
315
|
});
|
|
315
316
|
}
|
|
317
|
+
// dynamic per-instance properties (incl. Lit/package widgets) must exist before bindings
|
|
318
|
+
applyDynamicPropertiesToTree(this._rootShadow);
|
|
316
319
|
const res = window.appShell.bindingsHelper.applyAllBindings(this._rootShadow, this.relativeSignalsPath, this);
|
|
317
320
|
if (this._iobBindings)
|
|
318
321
|
this._iobBindings.push(...res);
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { EventsService, PropertiesHelper } from "@gokturk413/web-component-designer";
|
|
2
2
|
import { BaseCustomControl, webuiCustomControlSymbol } from "../runtime/CustomControls.js";
|
|
3
|
+
import { readDynamicDefs } from "./DynamicPropertiesHelper.js";
|
|
3
4
|
export class IobrokerWebuiCustomControlEventsService {
|
|
4
5
|
isHandledElementFromEventsService(designItem) {
|
|
5
|
-
return designItem.element instanceof BaseCustomControl;
|
|
6
|
+
return designItem.element instanceof BaseCustomControl || designItem.element.hasAttribute?.('dynamic-property-defs');
|
|
6
7
|
}
|
|
7
8
|
getPossibleEvents(designItem) {
|
|
8
9
|
const evt = [];
|
|
9
|
-
let control = designItem.element.constructor[webuiCustomControlSymbol]
|
|
10
|
-
for (const pname in control
|
|
10
|
+
let control = designItem.element.constructor[webuiCustomControlSymbol]?.control;
|
|
11
|
+
for (const pname in control?.properties) {
|
|
11
12
|
if (control.properties[pname].internal)
|
|
12
13
|
continue;
|
|
13
14
|
evt.push({ name: PropertiesHelper.camelToDashCase(pname) + '-changed' });
|
|
14
15
|
}
|
|
16
|
+
// changed events of the per-instance dynamic properties (dynamic-property-defs attribute)
|
|
17
|
+
for (const def of readDynamicDefs(designItem.element)) {
|
|
18
|
+
evt.push({ name: PropertiesHelper.camelToDashCase(def.name) + '-changed' });
|
|
19
|
+
}
|
|
15
20
|
return [...evt, ...EventsService._simpleMouseEvents, ...EventsService._pointerEvents, ...EventsService._allElements, ...EventsService._focusableEvents];
|
|
16
21
|
}
|
|
17
22
|
getEvent(designItem, name) {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AbstractPropertiesService, PropertyType, RefreshMode } from "@gokturk413/web-component-designer";
|
|
2
|
+
import { readDynamicDefs, createWebuiTypedProperty, dynamicDefsAttributeName } from "./DynamicPropertiesHelper.js";
|
|
3
|
+
import { IobrokerWebuiDynamicPropsEditor } from "../config/IobrokerWebuiDynamicPropsEditor.js";
|
|
4
|
+
|
|
5
|
+
// serves the 'dynamic' tab of the property grid for EVERY element
|
|
6
|
+
// (independent of which properties service handles the 'properties' tab,
|
|
7
|
+
// e.g. WebcomponentManifestPropertiesService for installed npm widgets)
|
|
8
|
+
export class IobrokerWebuiDynamicPropertiesService extends AbstractPropertiesService {
|
|
9
|
+
name = "webuiDynamic";
|
|
10
|
+
|
|
11
|
+
getRefreshMode(designItem) {
|
|
12
|
+
return RefreshMode.fullOnValueChange;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
isHandledElement(designItem) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async getProperties(designItem) {
|
|
20
|
+
if (!designItem?.element?.getAttribute)
|
|
21
|
+
return null;
|
|
22
|
+
const defs = readDynamicDefs(designItem.element);
|
|
23
|
+
const properties = [];
|
|
24
|
+
for (const d of defs)
|
|
25
|
+
properties.push(await createWebuiTypedProperty(d.name, d, this));
|
|
26
|
+
properties.push({
|
|
27
|
+
name: 'dynamicPropertyDefs',
|
|
28
|
+
type: 'string',
|
|
29
|
+
attributeName: dynamicDefsAttributeName,
|
|
30
|
+
service: this,
|
|
31
|
+
propertyType: PropertyType.attribute,
|
|
32
|
+
createEditor: p => new IobrokerWebuiDynamicPropsEditor(p)
|
|
33
|
+
});
|
|
34
|
+
return properties;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Lit2PropertiesService, PropertiesHelper, PropertyType, RefreshMode } from "@gokturk413/web-component-designer";
|
|
2
|
-
import {
|
|
2
|
+
import { createWebuiTypedProperty } from "./DynamicPropertiesHelper.js";
|
|
3
3
|
|
|
4
4
|
// extended properties service for Lit (2/3) widgets:
|
|
5
5
|
// - supports Array & custom converter properties (edited as string/JSON) which Lit2PropertiesService skips
|
|
@@ -47,7 +47,6 @@ export class IobrokerWebuiLitPropertiesService extends Lit2PropertiesService {
|
|
|
47
47
|
if (!handled.has(name))
|
|
48
48
|
properties.push(await createWebuiTypedProperty(name, meta[name], this));
|
|
49
49
|
}
|
|
50
|
-
properties.push(await buildDynamicPropertiesGroup(designItem, this));
|
|
51
50
|
return properties;
|
|
52
51
|
}
|
|
53
52
|
}
|
|
@@ -3,7 +3,6 @@ import { BaseCustomControl, webuiCustomControlSymbol } from "../runtime/CustomCo
|
|
|
3
3
|
import { iobrokerHandler } from "../common/IobrokerHandler.js";
|
|
4
4
|
import { ScreenViewer } from "../runtime/ScreenViewer.js";
|
|
5
5
|
import { IobrokerWebuiSignalPropertyEditor } from "../config/IobrokerWebuiSignalPropertyEditor.js";
|
|
6
|
-
import { buildDynamicPropertiesGroup } from "./DynamicPropertiesHelper.js";
|
|
7
6
|
export class IobrokerWebuiPropertiesService extends BaseCustomWebComponentPropertiesService {
|
|
8
7
|
isHandledElement(designItem) {
|
|
9
8
|
return designItem.element instanceof BaseCustomControl || designItem.element instanceof ScreenViewer;
|
|
@@ -72,7 +71,6 @@ export class IobrokerWebuiPropertiesService extends BaseCustomWebComponentProper
|
|
|
72
71
|
for (const [groupName, groupProps] of groupMap) {
|
|
73
72
|
result.push({ name: groupName, description: '', properties: groupProps });
|
|
74
73
|
}
|
|
75
|
-
result.push(await buildDynamicPropertiesGroup(designItem, this));
|
|
76
74
|
return result;
|
|
77
75
|
}
|
|
78
76
|
else {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PropertyGroupsService } from "@gokturk413/web-component-designer";
|
|
2
|
+
import { IobrokerWebuiDynamicPropertiesService } from "./IobrokerWebuiDynamicPropertiesService.js";
|
|
3
|
+
|
|
4
|
+
// adds a 'dynamic' tab (per-instance dynamic properties) to the property grid for all elements
|
|
5
|
+
export class IobrokerWebuiPropertyGroupsService extends PropertyGroupsService {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
const dynamicEntry = { name: 'dynamic', propertiesService: new IobrokerWebuiDynamicPropertiesService() };
|
|
9
|
+
this._pgList.splice(1, 0, dynamicEntry);
|
|
10
|
+
this._svgPgList.splice(1, 0, dynamicEntry);
|
|
11
|
+
this._svgChildPgList.splice(1, 0, dynamicEntry);
|
|
12
|
+
}
|
|
13
|
+
}
|