iobroker.webui 1.22.0 → 1.23.2
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 +11 -0
- package/binary/iobroker.iobroker-webcomponent-object-selector-0.0.1.tgz +0 -0
- package/dist/importmaps/importmap-config.d.ts +1 -0
- package/dist/importmaps/importmap-config.js +2 -1
- package/gulpfile.mjs +3 -8
- package/io-package.json +40 -40
- package/package.json +8 -6
- package/www/dist/frontend/config/ConfigureWebcomponentDesigner.js +3 -2
- package/www/dist/frontend/config/IobrokerWebuiAppShell.js +5 -0
- package/www/dist/frontend/config/IobrokerWebuiBindingsEditor.js +25 -0
- package/www/dist/frontend/config/IobrokerWebuiSignalPropertyEditor.js +18 -0
- package/www/dist/frontend/generated/Properties.json +6 -2
- package/www/dist/frontend/runtime/CustomControls.js +37 -6
- package/www/dist/frontend/runtime/ScreenViewer.js +2 -2
- package/www/dist/frontend/services/IobrokerWebuiPropertiesService.js +2 -2
- package/www/dist/importmaps/importmap-config.js +2 -1
- package/www/index.html +6 -1
- package/www/node_modules/@node-projects/web-component-designer/dist/elements/services/propertiesService/services/CssCurrentPropertiesService.js +10 -0
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/components/BindingsEditor.js +7 -8
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/components/EventAssignment.js +2 -2
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/components/VisualizationPropertyGrid.js +1 -2
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/helpers/BindingsHelper.js +36 -10
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/scripting/ScriptSystem.js +7 -3
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/services/SignalPropertyEditor.js +7 -7
- package/www/node_modules/@node-projects/web-component-designer-widgets-wunderbaum/dist/widgets/treeView/treeViewExtended.js +0 -1
- package/www/node_modules/blockly/blockly_compressed.js +14 -14
- package/www/node_modules/iobroker.iobroker-webcomponent-object-selector/dist/iobrokerSelectId.es.js +53339 -0
- package/www/node_modules/iobroker.iobroker-webcomponent-object-selector/dist/iobrokerSelectId.umd.js +305 -0
- package/www/node_modules/iobroker.iobroker-webcomponent-object-selector/dist/selectIdHelper.js +34 -0
- package/www/node_modules/iobroker.iobroker-webcomponent-object-selector/dist/socket.iob.js +441 -0
- package/www/node_modules/iobroker.iobroker-webcomponent-object-selector/dist/test.html +21 -0
- package/www/node_modules/iobroker.iobroker-webcomponent-object-selector/dist/vite.svg +1 -0
- package/www/node_modules/iobroker.iobroker-webcomponent-object-selector/node_modules/@iobroker/eslint-config/eslint.config.mjs +238 -0
- package/www/node_modules/iobroker.iobroker-webcomponent-object-selector/node_modules/@iobroker/eslint-config/prettier.config.mjs +13 -0
- package/www/node_modules/iobroker.iobroker-webcomponent-object-selector/node_modules/globals/globals.json +2998 -0
- package/www/node_modules/iobroker.iobroker-webcomponent-object-selector/node_modules/globals/index.js +2 -0
- package/www/node_modules/iobroker.iobroker-webcomponent-object-selector/node_modules/globals/license +9 -0
package/README.md
CHANGED
|
@@ -133,6 +133,17 @@ runtime.html?screenName=screen2
|
|
|
133
133
|
Placeholder for next versions:
|
|
134
134
|
### __WORK IN PROGRESS__
|
|
135
135
|
-->
|
|
136
|
+
### 1.23.2 (2025-01-19)
|
|
137
|
+
- one more fix in gulpfile
|
|
138
|
+
|
|
139
|
+
### 1.23.1 (2025-01-19)
|
|
140
|
+
- fix gulp should work again
|
|
141
|
+
|
|
142
|
+
### 1.23.0 (2025-01-19)
|
|
143
|
+
- fix paste in events assignment
|
|
144
|
+
- iobroker Signal Selector
|
|
145
|
+
- binding to width and height in custom controls
|
|
146
|
+
|
|
136
147
|
### 1.22.0 (2025-01-15)
|
|
137
148
|
- local signals browser
|
|
138
149
|
- style completition fixes
|
|
Binary file
|
|
@@ -31,7 +31,8 @@ const importMapConfig = {
|
|
|
31
31
|
"long": "./node_modules/long/index.js",
|
|
32
32
|
"wunderbaum": "./node_modules/wunderbaum/dist/wunderbaum.esm.min.js",
|
|
33
33
|
"wunderbaum/": "./node_modules/wunderbaum/",
|
|
34
|
-
"toastify-js": "./node_modules/toastify-js/src/toastify-es.js"
|
|
34
|
+
"toastify-js": "./node_modules/toastify-js/src/toastify-es.js",
|
|
35
|
+
"iobroker.iobroker-webcomponent-object-selector/": "./node_modules/iobroker.iobroker-webcomponent-object-selector/"
|
|
35
36
|
}
|
|
36
37
|
};
|
|
37
38
|
//@ts-ignore
|
package/gulpfile.mjs
CHANGED
|
@@ -47,14 +47,9 @@ function copyNodeModules() {
|
|
|
47
47
|
"monaco-editor",
|
|
48
48
|
//"tslib"
|
|
49
49
|
//"wunderbaum",
|
|
50
|
-
|
|
51
|
-
"/node_modules/blockly/blockly_compressed.js",
|
|
52
|
-
"/node_modules/blockly/blocks_compressed.js",
|
|
53
|
-
"/node_modules/blockly/javascript_compressed.js",
|
|
54
|
-
"/node_modules/blockly/msg/en.js",
|
|
55
|
-
"/node_modules/@blockly/zoom-to-fit/dist/index.js",
|
|
56
|
-
]
|
|
57
50
|
|
|
51
|
+
"iobroker.iobroker-webcomponent-object-selector"
|
|
52
|
+
]
|
|
58
53
|
runtimeModules = runtimeModules.map(x => './node_modules/' + x + '/**/*')
|
|
59
54
|
|
|
60
55
|
return src(runtimeModules, { base: './', encoding: false })
|
|
@@ -113,7 +108,7 @@ function cleanupNodeModules() {
|
|
|
113
108
|
|
|
114
109
|
function cleanupMonaco() {
|
|
115
110
|
return deleteAsync([
|
|
116
|
-
'./www/node_modules/monaco-editor/min/vs/basic-languages/**/*',
|
|
111
|
+
'./www/node_modules/monaco-editor/min/vs/basic-languages/**/*',
|
|
117
112
|
'!./www/node_modules/monaco-editor/min/vs/basic-languages/javascript',
|
|
118
113
|
'!./www/node_modules/monaco-editor/min/vs/basic-languages/typescript',
|
|
119
114
|
'!./www/node_modules/monaco-editor/min/vs/basic-languages/html',
|
package/io-package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "webui",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.23.2",
|
|
5
5
|
"titleLang": {
|
|
6
6
|
"en": "webui",
|
|
7
7
|
"de": "webui",
|
|
@@ -29,6 +29,45 @@
|
|
|
29
29
|
"zh-cn": "使用万维网传送器的高锰用户接口"
|
|
30
30
|
},
|
|
31
31
|
"news": {
|
|
32
|
+
"1.23.2": {
|
|
33
|
+
"en": "one more fix in gulpfile",
|
|
34
|
+
"de": "noch eine fix in gulpfile",
|
|
35
|
+
"ru": "еще одно исправление в gulpfile",
|
|
36
|
+
"pt": "mais uma correção no gulpfile",
|
|
37
|
+
"nl": "nog een fix in gulpfile",
|
|
38
|
+
"fr": "une autre correction dans gulpfile",
|
|
39
|
+
"it": "un altro fix in gulpfile",
|
|
40
|
+
"es": "uno más se fijan en el archivo del gulp",
|
|
41
|
+
"pl": "jeszcze jeden fix w gulpfile",
|
|
42
|
+
"uk": "ще одна фіксація в gulpfile",
|
|
43
|
+
"zh-cn": "再加一个固醇"
|
|
44
|
+
},
|
|
45
|
+
"1.23.1": {
|
|
46
|
+
"en": "fix gulp should work again",
|
|
47
|
+
"de": "gulp sollte wieder funktionieren",
|
|
48
|
+
"ru": "исправить gulp должно работать снова",
|
|
49
|
+
"pt": "corrigir gulp deve funcionar novamente",
|
|
50
|
+
"nl": "fix gulp moet weer werken",
|
|
51
|
+
"fr": "réparer gulp devrait fonctionner à nouveau",
|
|
52
|
+
"it": "fissare gulp dovrebbe funzionare di nuovo",
|
|
53
|
+
"es": "arreglar golp debe trabajar de nuevo",
|
|
54
|
+
"pl": "fix gulp powinien działać ponownie",
|
|
55
|
+
"uk": "закріпити гельпом потрібно знову",
|
|
56
|
+
"zh-cn": "修补 gulp 应再次工作"
|
|
57
|
+
},
|
|
58
|
+
"1.23.0": {
|
|
59
|
+
"en": "fix paste in events assignment\niobroker Signal Selector\nbinding to width and height in custom controls",
|
|
60
|
+
"de": "fixieren sie paste in der ereigniszuordnung\niobroker Signal Selektor\nbindung an breite und höhe in benutzerdefinierten steuerungen",
|
|
61
|
+
"ru": "фиксация пасты в присвоении событий\niobroker Signal Selector\nпривязки к ширине и высоте в пользовательском контроле",
|
|
62
|
+
"pt": "corrigir pasta na atribuição de eventos\nseletor de Sinal iobroker\nligação à largura e altura em controles personalizados",
|
|
63
|
+
"nl": "plak plakken in de opdracht van gebeurtenissen\niobroker-signaalkiezer\nbinding aan breedte en hoogte in aangepaste controles",
|
|
64
|
+
"fr": "fixer coller dans l'affectation des événements\nsélecteur de signal iobroker\nfixation à la largeur et à la hauteur dans les commandes personnalisées",
|
|
65
|
+
"it": "correzione della pasta nell'assegnazione degli eventi\niobroker Selettore Segnale\nlegare a larghezza e altezza nei controlli personalizzati",
|
|
66
|
+
"es": "arreglar pasta en la asignación de eventos\niobroker Signal Selector\nunión a ancho y altura en controles personalizados",
|
|
67
|
+
"pl": "fix pasta w przyporządkowaniu zdarzeń\niobroker Selektor sygnału\nwiązanie do szerokości i wysokości w sterowaniu własnym",
|
|
68
|
+
"uk": "фіксувати пасту в появі подій\niobroker Signal Вибратор\nобов'язковий для ширини і висоти в користувацьких управліннях",
|
|
69
|
+
"zh-cn": "在事件任务中固定粘贴\nio 经纪人信号选择器\n绑定自定义控件中的宽度和高度"
|
|
70
|
+
},
|
|
32
71
|
"1.22.0": {
|
|
33
72
|
"en": "local signals browser\nstyle completition fixes\nspecial bindings for \"ring\" cameras",
|
|
34
73
|
"de": "lokale signale browser\nstil completition fixes\nspezielle bindungen für \"ring\"-kameras",
|
|
@@ -80,45 +119,6 @@
|
|
|
80
119
|
"pl": "dodaj kilka pakietów\nuruchom prosty skrypt cmd i uaktualnij wyświetlacz macierzysty\naktualizacja pakietów, downgrade monaco\nnaprawić kopię zapasową",
|
|
81
120
|
"uk": "додати кілька пакетів\nзапустити простий скрипт cmd і оновлення отримати батьківський екран\nоновлення пакетів, град монако\nрезервне копіювання",
|
|
82
121
|
"zh-cn": "添加几个软件包\n运行简单的脚本 cmd 并更新父屏幕\n更新软件包, 降级\n修复备份"
|
|
83
|
-
},
|
|
84
|
-
"1.19.4": {
|
|
85
|
-
"en": "copy & paste events",
|
|
86
|
-
"de": "kopieren und einfügen von ereignissen",
|
|
87
|
-
"ru": "копировать события",
|
|
88
|
-
"pt": "copiar e colar eventos",
|
|
89
|
-
"nl": "gebeurtenissen kopiëren & plakken",
|
|
90
|
-
"fr": "copier & coller les événements",
|
|
91
|
-
"it": "copia & incolla eventi",
|
|
92
|
-
"es": "copy \" paste events",
|
|
93
|
-
"pl": "kopiowanie i wklejanie zdarzeń",
|
|
94
|
-
"uk": "скопіювати та вставляти події",
|
|
95
|
-
"zh-cn": "复制粘贴事件( p)"
|
|
96
|
-
},
|
|
97
|
-
"1.19.3": {
|
|
98
|
-
"en": "support null value",
|
|
99
|
-
"de": "unterstützungswert",
|
|
100
|
-
"ru": "нулевое значение",
|
|
101
|
-
"pt": "suporte valor nulo",
|
|
102
|
-
"nl": "steun nulwaarde",
|
|
103
|
-
"fr": "support valeur null",
|
|
104
|
-
"it": "supporto valore null",
|
|
105
|
-
"es": "valor nulo",
|
|
106
|
-
"pl": "wartość null wsparcia",
|
|
107
|
-
"uk": "підтримка значення null",
|
|
108
|
-
"zh-cn": "支持无效值"
|
|
109
|
-
},
|
|
110
|
-
"1.19.2": {
|
|
111
|
-
"en": "use name in classlist",
|
|
112
|
-
"de": "name in der klassenliste verwenden",
|
|
113
|
-
"ru": "имя в класслисте",
|
|
114
|
-
"pt": "use o nome na lista de classes",
|
|
115
|
-
"nl": "naam gebruiken in klasselijst",
|
|
116
|
-
"fr": "utiliser le nom dans la liste des classes",
|
|
117
|
-
"it": "usare il nome in classifica",
|
|
118
|
-
"es": "nombre de uso en la lista de clases",
|
|
119
|
-
"pl": "użyj nazwy na liście klas",
|
|
120
|
-
"uk": "ім'я користувача в класі",
|
|
121
|
-
"zh-cn": "使用分类列表中的名称"
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
"icon": "logo.png",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.webui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.2",
|
|
4
4
|
"description": "ioBroker webui",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/backend/main.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@iobroker/adapter-core": "^3.2.3",
|
|
47
|
-
"@types/node": "^22.10.
|
|
47
|
+
"@types/node": "^22.10.7"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@adobe/css-tools": "4.4.1",
|
|
@@ -59,15 +59,15 @@
|
|
|
59
59
|
"@node-projects/node-html-parser-esm": "^6.2.0",
|
|
60
60
|
"@node-projects/propertygrid.webcomponent": "^1.2.3",
|
|
61
61
|
"@node-projects/splitview.webcomponent": "^1.0.1",
|
|
62
|
-
"@node-projects/web-component-designer": "^0.1.
|
|
62
|
+
"@node-projects/web-component-designer": "^0.1.239",
|
|
63
63
|
"@node-projects/web-component-designer-codeview-monaco": "^0.1.32",
|
|
64
64
|
"@node-projects/web-component-designer-htmlparserservice-nodehtmlparser": "^0.1.11",
|
|
65
65
|
"@node-projects/web-component-designer-stylesheetservice-css-tools": "^0.1.10",
|
|
66
|
-
"@node-projects/web-component-designer-visualization-addons": "^0.1.
|
|
67
|
-
"@node-projects/web-component-designer-widgets-wunderbaum": "^0.1.
|
|
66
|
+
"@node-projects/web-component-designer-visualization-addons": "^0.1.112",
|
|
67
|
+
"@node-projects/web-component-designer-widgets-wunderbaum": "^0.1.32",
|
|
68
68
|
"@types/json-schema": "^7.0.15",
|
|
69
69
|
"@web/dev-server": "^0.4.6",
|
|
70
|
-
"blockly": "^11.2.
|
|
70
|
+
"blockly": "^11.2.1",
|
|
71
71
|
"chai": "^5.1.2",
|
|
72
72
|
"chai-as-promised": "^8.0.1",
|
|
73
73
|
"construct-style-sheets-polyfill": "^3.1.0",
|
|
@@ -78,9 +78,11 @@
|
|
|
78
78
|
"es-module-shims": "^2.0.3",
|
|
79
79
|
"eslint": "^9.18.0",
|
|
80
80
|
"esprima-next": "^6.0.3",
|
|
81
|
+
"glob-stream": "^8.0.2",
|
|
81
82
|
"gulp": "^5.0.0",
|
|
82
83
|
"gulp-git": "^2.11.0",
|
|
83
84
|
"gulp-replace": "^1.1.4",
|
|
85
|
+
"iobroker.iobroker-webcomponent-object-selector": "file:binary/iobroker.iobroker-webcomponent-object-selector-0.0.1.tgz",
|
|
84
86
|
"long": "^5.2.4",
|
|
85
87
|
"mobile-drag-drop": "^3.0.0-rc.0",
|
|
86
88
|
"mocha": "^11.0.1",
|
|
@@ -2,7 +2,7 @@ import { BaseCustomWebcomponentBindingsService, EventsService, JsonFileElementsS
|
|
|
2
2
|
import { NodeHtmlParserService } from '@node-projects/web-component-designer-htmlparserservice-nodehtmlparser';
|
|
3
3
|
import { CodeViewMonaco } from '@node-projects/web-component-designer-codeview-monaco';
|
|
4
4
|
import { CssToolsStylesheetService } from '@node-projects/web-component-designer-stylesheetservice-css-tools';
|
|
5
|
-
import {
|
|
5
|
+
import { VisualizationBindingsService, PropertyGridDragDropService, ScriptRefactorService, VisualizationBindingsRefactorService } from "@node-projects/web-component-designer-visualization-addons";
|
|
6
6
|
import { IobrokerWebuiBindableObjectsService } from "../services/IobrokerWebuiBindableObjectsService.js";
|
|
7
7
|
import { IobrokerWebuiDemoProviderService } from "../services/IobrokerWebuiDemoProviderService.js";
|
|
8
8
|
import { IobrokerWebuiConfirmationWrapper } from "./IobrokerWebuiConfirmationWrapper.js";
|
|
@@ -22,6 +22,7 @@ import { IobrokerWebuiCustomControlEventsService } from "../services/IobrokerWeb
|
|
|
22
22
|
import { IobrokerWebuiBindableObjectsForPropertiesService } from "../services/IobrokerWebuiBindableObjectsForPropertiesService.js";
|
|
23
23
|
import { IobrokerWebuiBindableLocalObjectsService } from "../services/IobrokerWebuiBindableLocalObjectsService.js";
|
|
24
24
|
import { IobrokerWebuiBindableObjectDragDropService } from "../services/IobrokerWebuiBindableObjectDragDropService.js";
|
|
25
|
+
import { IobrokerWebuiBindingsEditor } from "./IobrokerWebuiBindingsEditor.js";
|
|
25
26
|
export function configureDesigner(bindingsHelper) {
|
|
26
27
|
const serviceContainer = createDefaultServiceContainer();
|
|
27
28
|
serviceContainer.register("bindingService", new BaseCustomWebcomponentBindingsService());
|
|
@@ -63,7 +64,7 @@ export function configureDesigner(bindingsHelper) {
|
|
|
63
64
|
}
|
|
64
65
|
serviceContainer.config.openBindingsEditor = async (property, designItems, binding, target) => {
|
|
65
66
|
if (!binding || binding.service instanceof VisualizationBindingsService) {
|
|
66
|
-
let dynEdt = new
|
|
67
|
+
let dynEdt = new IobrokerWebuiBindingsEditor(property, binding, target, serviceContainer, designItems[0].instanceServiceContainer, window.appShell);
|
|
67
68
|
let cw = new IobrokerWebuiConfirmationWrapper();
|
|
68
69
|
cw.title = "Edit Binding of '" + property.name + "' - " + property.propertyType;
|
|
69
70
|
cw.appendChild(dynEdt);
|
|
@@ -8,6 +8,7 @@ const bindingsHelper = new BindingsHelper(iobrokerHandler);
|
|
|
8
8
|
LazyLoader.LoadJavascript('./node_modules/monaco-editor/min/vs/loader.js');
|
|
9
9
|
import '@node-projects/web-component-designer';
|
|
10
10
|
import { ValueType } from '@node-projects/web-component-designer';
|
|
11
|
+
import { BindableObjectsBrowser } from '@node-projects/web-component-designer-widgets-wunderbaum';
|
|
11
12
|
import { PanelContainer } from 'dock-spawn-ts/lib/js/PanelContainer.js';
|
|
12
13
|
import { PanelType } from 'dock-spawn-ts/lib/js/enums/PanelType.js';
|
|
13
14
|
import { configureDesigner } from './ConfigureWebcomponentDesigner.js';
|
|
@@ -124,6 +125,10 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
124
125
|
this.scriptSystem = scriptSystem;
|
|
125
126
|
this.bindingsHelper = bindingsHelper;
|
|
126
127
|
}
|
|
128
|
+
createBindableObjectBrowser() {
|
|
129
|
+
return new BindableObjectsBrowser();
|
|
130
|
+
}
|
|
131
|
+
;
|
|
127
132
|
async ready() {
|
|
128
133
|
this._dock = this._getDomElement('dock');
|
|
129
134
|
this._solutionExplorer = this._getDomElement('solutionExplorer');
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BindingsEditor } from "@node-projects/web-component-designer-visualization-addons";
|
|
2
|
+
import { openSelectIdDialog } from "iobroker.iobroker-webcomponent-object-selector/dist/selectIdHelper.js";
|
|
3
|
+
//@ts-ignore
|
|
4
|
+
export class IobrokerWebuiBindingsEditor extends BindingsEditor {
|
|
5
|
+
static is = 'iobroker-webui-bindings-editor';
|
|
6
|
+
constructor(property, binding, bindingTarget, serviceContainer, instanceServiceContainer, shell) {
|
|
7
|
+
super(property, binding, bindingTarget, serviceContainer, instanceServiceContainer, shell);
|
|
8
|
+
let groupObjectNameControl = this._getDomElement('groupObjectName');
|
|
9
|
+
let btn = document.createElement('button');
|
|
10
|
+
btn.textContent = 'IOB';
|
|
11
|
+
btn.title = "iobroker signal selector";
|
|
12
|
+
btn.style.height = '22px';
|
|
13
|
+
btn.onclick = async () => {
|
|
14
|
+
var res = await openSelectIdDialog({ host: window.iobrokerHost, port: window.iobrokerPort, protocol: window.location.protocol, language: 'en', selected: '', allowAll: true });
|
|
15
|
+
if (res) {
|
|
16
|
+
if (this.objectNames.length > 1)
|
|
17
|
+
this.objectNames += ";";
|
|
18
|
+
this.objectNames += res;
|
|
19
|
+
this._bindingsRefresh();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
groupObjectNameControl.appendChild(btn);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
customElements.define(IobrokerWebuiBindingsEditor.is, IobrokerWebuiBindingsEditor);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SignalPropertyEditor } from "@node-projects/web-component-designer-visualization-addons";
|
|
2
|
+
import { openSelectIdDialog } from "iobroker.iobroker-webcomponent-object-selector/dist/selectIdHelper.js";
|
|
3
|
+
export class IobrokerWebuiSignalPropertyEditor extends SignalPropertyEditor {
|
|
4
|
+
constructor(property, shell) {
|
|
5
|
+
super(property, shell);
|
|
6
|
+
let btn = document.createElement('button');
|
|
7
|
+
btn.textContent = 'IOB';
|
|
8
|
+
btn.title = "iobroker signal selector";
|
|
9
|
+
btn.onclick = async () => {
|
|
10
|
+
var res = await openSelectIdDialog({ host: window.iobrokerHost, port: window.iobrokerPort, protocol: window.location.protocol, language: 'en', selected: this._ip.value, allowAll: true });
|
|
11
|
+
if (res) {
|
|
12
|
+
this._ip.value = res;
|
|
13
|
+
this._valueChanged(this._ip.value);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
this._container.appendChild(btn);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"arguments",
|
|
40
40
|
"caller",
|
|
41
41
|
"name",
|
|
42
|
-
"__@hasInstance@
|
|
42
|
+
"__@hasInstance@5144"
|
|
43
43
|
],
|
|
44
44
|
"type": "object"
|
|
45
45
|
},
|
|
@@ -78,6 +78,9 @@
|
|
|
78
78
|
},
|
|
79
79
|
"type": "array"
|
|
80
80
|
},
|
|
81
|
+
"bindToSize": {
|
|
82
|
+
"type": "boolean"
|
|
83
|
+
},
|
|
81
84
|
"height": {
|
|
82
85
|
"type": "string"
|
|
83
86
|
},
|
|
@@ -93,7 +96,8 @@
|
|
|
93
96
|
"width",
|
|
94
97
|
"height",
|
|
95
98
|
"useGlobalStyle",
|
|
96
|
-
"addoptedStyles"
|
|
99
|
+
"addoptedStyles",
|
|
100
|
+
"bindToSize"
|
|
97
101
|
],
|
|
98
102
|
"type": "object"
|
|
99
103
|
},
|
|
@@ -8,30 +8,60 @@ export class BaseCustomControl extends BaseCustomWebComponentConstructorAppend {
|
|
|
8
8
|
#scriptObject;
|
|
9
9
|
#bindings;
|
|
10
10
|
#eventListeners = [];
|
|
11
|
+
#resizeObserver;
|
|
12
|
+
#specialValueHandler;
|
|
11
13
|
constructor() {
|
|
12
14
|
super();
|
|
13
15
|
this._bindingsParse(null, true);
|
|
14
16
|
if (this.constructor[webuiCustomControlSymbol].control.settings.useGlobalStyle)
|
|
15
17
|
this.shadowRoot.adoptedStyleSheets = [iobrokerHandler.globalStylesheet, ...this.shadowRoot.adoptedStyleSheets];
|
|
18
|
+
if (this.constructor[webuiCustomControlSymbol].control.settings.bindToSize) {
|
|
19
|
+
this.#resizeObserver = new ResizeObserver((entries) => {
|
|
20
|
+
let cbs = this.#specialValueHandler.valueChangedCallbacks.get('width');
|
|
21
|
+
if (cbs) {
|
|
22
|
+
for (const c of cbs)
|
|
23
|
+
c();
|
|
24
|
+
}
|
|
25
|
+
cbs = this.#specialValueHandler.valueChangedCallbacks.get('height');
|
|
26
|
+
if (cbs) {
|
|
27
|
+
for (const c of cbs)
|
|
28
|
+
c();
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
16
32
|
}
|
|
17
33
|
async connectedCallback() {
|
|
18
34
|
this._parseAttributesToProperties();
|
|
19
35
|
this._bindingsRefresh();
|
|
20
|
-
this.#
|
|
36
|
+
this.#specialValueHandler = {
|
|
37
|
+
valueProvider: (specialValueName) => {
|
|
38
|
+
switch (specialValueName) {
|
|
39
|
+
case 'width':
|
|
40
|
+
return this.getBoundingClientRect().width;
|
|
41
|
+
case 'height':
|
|
42
|
+
return this.getBoundingClientRect().height;
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
},
|
|
46
|
+
valueChangedCallbacks: new Map()
|
|
47
|
+
};
|
|
48
|
+
this.#bindings = window.appShell.bindingsHelper.applyAllBindings(this.shadowRoot, this._getRelativeSignalsPath(), this, this.#specialValueHandler);
|
|
21
49
|
this.#scriptObject = await window.appShell.scriptSystem.assignAllScripts('customControl ' + this.constructor[webuiCustomControlSymbol].name, this.constructor[webuiCustomControlSymbol].control.script, this.shadowRoot, this, iobrokerHandler);
|
|
22
|
-
this.#scriptObject?.connectedCallback?.(this);
|
|
50
|
+
this.#scriptObject?.connectedCallback?.(this, this.shadowRoot);
|
|
23
51
|
for (let e of this.#eventListeners) {
|
|
24
52
|
this.addEventListener(e[0], e[1]);
|
|
25
53
|
}
|
|
54
|
+
this.#resizeObserver.observe(this);
|
|
26
55
|
}
|
|
27
56
|
disconnectedCallback() {
|
|
28
57
|
for (let e of this.#eventListeners) {
|
|
29
58
|
this.removeEventListener(e[0], e[1]);
|
|
30
59
|
}
|
|
31
|
-
this.#scriptObject?.disconnectedCallback?.(this);
|
|
60
|
+
this.#scriptObject?.disconnectedCallback?.(this, this.shadowRoot);
|
|
32
61
|
for (const b of this.#bindings)
|
|
33
62
|
b();
|
|
34
63
|
this.#bindings = null;
|
|
64
|
+
this.#resizeObserver.unobserve(this);
|
|
35
65
|
}
|
|
36
66
|
_assignEvent(event, callback) {
|
|
37
67
|
const arrayEl = [event, callback];
|
|
@@ -101,7 +131,8 @@ export function generateCustomControl(name, control) {
|
|
|
101
131
|
window['IobrokerWebuiCustomControl' + name] = function () {
|
|
102
132
|
//@ts-ignore
|
|
103
133
|
let instance = Reflect.construct(BaseCustomControl, [], window['IobrokerWebuiCustomControl' + name]);
|
|
104
|
-
|
|
134
|
+
let currControl = window['IobrokerWebuiCustomControl' + name][webuiCustomControlSymbol].control;
|
|
135
|
+
for (let p in currControl.properties) {
|
|
105
136
|
Object.defineProperty(instance, p, {
|
|
106
137
|
get() {
|
|
107
138
|
return this['_' + p];
|
|
@@ -116,8 +147,8 @@ export function generateCustomControl(name, control) {
|
|
|
116
147
|
enumerable: true,
|
|
117
148
|
configurable: true,
|
|
118
149
|
});
|
|
119
|
-
if (
|
|
120
|
-
instance['_' + p] =
|
|
150
|
+
if (currControl.properties[p].default) {
|
|
151
|
+
instance['_' + p] = currControl.properties[p].default;
|
|
121
152
|
}
|
|
122
153
|
}
|
|
123
154
|
return instance;
|
|
@@ -268,7 +268,7 @@ let ScreenViewer = class ScreenViewer extends BaseCustomWebComponentConstructorA
|
|
|
268
268
|
if (this._screenName)
|
|
269
269
|
this._loadScreen();
|
|
270
270
|
});
|
|
271
|
-
this._scriptObject?.connectedCallback?.(this);
|
|
271
|
+
this._scriptObject?.connectedCallback?.(this, this._rootShadow);
|
|
272
272
|
for (let e of this.#eventListeners) {
|
|
273
273
|
this.addEventListener(e[0], e[1]);
|
|
274
274
|
}
|
|
@@ -281,7 +281,7 @@ let ScreenViewer = class ScreenViewer extends BaseCustomWebComponentConstructorA
|
|
|
281
281
|
}
|
|
282
282
|
this._refreshViewSubscription?.dispose();
|
|
283
283
|
this._screensChangedSubscription?.dispose();
|
|
284
|
-
this._scriptObject?.disconnectedCallback?.(this);
|
|
284
|
+
this._scriptObject?.disconnectedCallback?.(this, this._rootShadow);
|
|
285
285
|
if (this._resizeObserver)
|
|
286
286
|
this._resizeObserver.disconnect();
|
|
287
287
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseCustomWebComponentPropertiesService, PropertyType } from "@node-projects/web-component-designer";
|
|
2
2
|
import { BaseCustomControl, webuiCustomControlSymbol } from "../runtime/CustomControls.js";
|
|
3
3
|
import { iobrokerHandler } from "../common/IobrokerHandler.js";
|
|
4
|
-
import { SignalPropertyEditor } from "@node-projects/web-component-designer-visualization-addons";
|
|
5
4
|
import { ScreenViewer } from "../runtime/ScreenViewer.js";
|
|
5
|
+
import { IobrokerWebuiSignalPropertyEditor } from "../config/IobrokerWebuiSignalPropertyEditor.js";
|
|
6
6
|
export class IobrokerWebuiPropertiesService extends BaseCustomWebComponentPropertiesService {
|
|
7
7
|
isHandledElement(designItem) {
|
|
8
8
|
return designItem.element instanceof BaseCustomControl || designItem.element instanceof ScreenViewer;
|
|
@@ -47,7 +47,7 @@ export class IobrokerWebuiPropertiesService extends BaseCustomWebComponentProper
|
|
|
47
47
|
properties.push(property);
|
|
48
48
|
}
|
|
49
49
|
else if (prp.type == 'signal') {
|
|
50
|
-
let property = { name: name, type: "signal", service: this, propertyType: PropertyType.propertyAndAttribute, createEditor: p => new
|
|
50
|
+
let property = { name: name, type: "signal", service: this, propertyType: PropertyType.propertyAndAttribute, createEditor: p => new IobrokerWebuiSignalPropertyEditor(p, window.appShell) };
|
|
51
51
|
properties.push(property);
|
|
52
52
|
}
|
|
53
53
|
else if (prp.type == 'screen') {
|
|
@@ -31,7 +31,8 @@ const importMapConfig = {
|
|
|
31
31
|
"long": "./node_modules/long/index.js",
|
|
32
32
|
"wunderbaum": "./node_modules/wunderbaum/dist/wunderbaum.esm.min.js",
|
|
33
33
|
"wunderbaum/": "./node_modules/wunderbaum/",
|
|
34
|
-
"toastify-js": "./node_modules/toastify-js/src/toastify-es.js"
|
|
34
|
+
"toastify-js": "./node_modules/toastify-js/src/toastify-es.js",
|
|
35
|
+
"iobroker.iobroker-webcomponent-object-selector/": "./node_modules/iobroker.iobroker-webcomponent-object-selector/"
|
|
35
36
|
}
|
|
36
37
|
};
|
|
37
38
|
//@ts-ignore
|
package/www/index.html
CHANGED
|
@@ -197,6 +197,11 @@
|
|
|
197
197
|
nav button:not([disabled]) img:active {
|
|
198
198
|
filter: invert(41%) sepia(92%) saturate(1090%) hue-rotate(335deg) brightness(99%) contrast(93%);
|
|
199
199
|
}
|
|
200
|
+
|
|
201
|
+
/* iobroker select object dialog */
|
|
202
|
+
.MuiDialog-root {
|
|
203
|
+
z-index: 100000 !important;
|
|
204
|
+
}
|
|
200
205
|
</style>
|
|
201
206
|
</head>
|
|
202
207
|
|
|
@@ -213,7 +218,7 @@
|
|
|
213
218
|
</button>
|
|
214
219
|
<button data-command="save" title="save" disabled><img src="./node_modules/@node-projects/web-component-designer/assets/icons/save.svg"></button>
|
|
215
220
|
<div style="margin-left: 30px;">
|
|
216
|
-
webui - 1.
|
|
221
|
+
webui - 1.23.2 - 9dc5ced
|
|
217
222
|
</div>
|
|
218
223
|
<button style="margin-left: 30px;" data-command="paste" title="paste" disabled><img
|
|
219
224
|
src="./node_modules/@node-projects/web-component-designer/assets/icons/paste.svg"></button>
|
|
@@ -6,6 +6,7 @@ import cssProperties from "./CssProperties.json" with { type: 'json' };
|
|
|
6
6
|
import { BindingTarget } from '../../../item/BindingTarget.js';
|
|
7
7
|
import { AbstractCssPropertiesService } from './AbstractCssPropertiesService.js';
|
|
8
8
|
import { PropertiesHelper } from './PropertiesHelper.js';
|
|
9
|
+
import { AbstractPropertiesService } from './AbstractPropertiesService.js';
|
|
9
10
|
const localName = '<local>';
|
|
10
11
|
export class CssCurrentPropertiesService extends AbstractCssPropertiesService {
|
|
11
12
|
getRefreshMode(designItem) {
|
|
@@ -39,6 +40,15 @@ export class CssCurrentPropertiesService extends AbstractCssPropertiesService {
|
|
|
39
40
|
return 0;
|
|
40
41
|
return 1;
|
|
41
42
|
});
|
|
43
|
+
const bindings = AbstractPropertiesService.getOrBuildCachedBindings(designItem);
|
|
44
|
+
let localStyles = styles.find(x => x.selector === null);
|
|
45
|
+
for (const b of bindings) {
|
|
46
|
+
if (b.target === BindingTarget.css) {
|
|
47
|
+
if (!localStyles.declarations.find(x => x.name == b.targetName)) {
|
|
48
|
+
localStyles.declarations.push({ name: b.targetName, value: null, important: false, parent: null });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
42
52
|
let arr = styles.map(x => ({
|
|
43
53
|
name: (x.selector ?? localName) + (x.specificity ? ' (' + x.specificity.A + '-' + x.specificity.B + '-' + x.specificity.C + ')' : ''), description: x.stylesheetName ?? '', properties: [
|
|
44
54
|
...x.declarations.map(y => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BaseCustomWebComponentConstructorAppend, html, css } from '@node-projects/base-custom-webcomponent';
|
|
2
2
|
import { BindingMode, BindingTarget } from '@node-projects/web-component-designer';
|
|
3
|
-
import { BindableObjectsBrowser } from "@node-projects/web-component-designer-widgets-wunderbaum";
|
|
4
3
|
import { BindingsEditorHistoric } from './BindingsEditorHistoric.js';
|
|
5
4
|
export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
|
|
6
5
|
static template = html `
|
|
@@ -11,12 +10,12 @@ export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
|
|
|
11
10
|
<div class="row">
|
|
12
11
|
<span style="cursor: pointer;" title="to use multiple objects, seprate them with semicolon (;). access signal objects in properties via ?propertyName, access the propertyValue via ??propertyName. Bind to signal configurations via $objectId. You could also use signals inside of a Signal Name via {name}">objects</span>
|
|
13
12
|
</div>
|
|
14
|
-
<div style="display:flex;align-items: flex-end;">
|
|
15
|
-
<input id="
|
|
13
|
+
<div id="groupObjectName" style="display:flex;align-items: flex-end;">
|
|
14
|
+
<input id="objectName" class="row" value="{{?this.objectNames::change}}" style="flex-grow: 1;">
|
|
16
15
|
<button @click="_clear" style="height: 22px">X</button>
|
|
17
16
|
<button @click="_select" style="height: 22px">...</button>
|
|
18
17
|
</div>
|
|
19
|
-
<div class="row">
|
|
18
|
+
<div id="groupObjectType" class="row">
|
|
20
19
|
<label style="white-space: nowrap; margin-right: 4px;" title="if set, the value is converted to the type before binding is applied">type :</label>
|
|
21
20
|
<select class="row" value="{{?this.objectValueType}}">
|
|
22
21
|
<option selected value="">ignore</option>
|
|
@@ -25,13 +24,13 @@ export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
|
|
|
25
24
|
<option value="string">string</string>
|
|
26
25
|
</select>
|
|
27
26
|
</div>
|
|
28
|
-
<div class="row">
|
|
27
|
+
<div id="groupBindingMode" class="row">
|
|
29
28
|
<input type="checkbox" disabled="[[!this.twoWayPossible]]" checked="{{this.twoWay::change}}" @change="_refresh">
|
|
30
29
|
<span>two way binding</span>
|
|
31
30
|
<span css:display="[[this.twoWay ? 'inline' : 'none']]" style="margin-left: 15px">events: </span>
|
|
32
31
|
<input css:display="[[this.twoWay ? 'inline-block' : 'none']]" title="to use multiple events, seprate them with semicolon (;)" class="row" value="{{?this.events::change}}" style="flex-grow: 1;">
|
|
33
32
|
</div>
|
|
34
|
-
<div class="row" style="position: relative">
|
|
33
|
+
<div id="groupinvert" class="row" style="position: relative">
|
|
35
34
|
<input type="checkbox" checked="{{this.invert::change}}">
|
|
36
35
|
<span>invert logic</span>
|
|
37
36
|
<button css:border="[[this.historic ? 'solid lime 5px' : 'none']]" style="position: absolute; right: 1px; top: 5px; padding: 10px;" @click="showHistoric">historic</button>
|
|
@@ -194,7 +193,7 @@ export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
|
|
|
194
193
|
constructor(property, binding, bindingTarget, serviceContainer, instanceServiceContainer, shell) {
|
|
195
194
|
super();
|
|
196
195
|
super._restoreCachedInititalValues();
|
|
197
|
-
this._objNmInput = this._getDomElement('
|
|
196
|
+
this._objNmInput = this._getDomElement('objectName');
|
|
198
197
|
this._property = property;
|
|
199
198
|
this._binding = binding;
|
|
200
199
|
this._bindingTarget = bindingTarget;
|
|
@@ -261,7 +260,7 @@ export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
|
|
|
261
260
|
});
|
|
262
261
|
}
|
|
263
262
|
async _select() {
|
|
264
|
-
let b =
|
|
263
|
+
let b = this._shell.createBindableObjectBrowser();
|
|
265
264
|
b.initialize(this._serviceContainer, this._instanceServiceContainer, 'binding');
|
|
266
265
|
b.title = 'select signal...';
|
|
267
266
|
const abortController = new AbortController();
|
|
@@ -221,7 +221,7 @@ export class EventAssignment extends BaseCustomWebComponentConstructorAppend {
|
|
|
221
221
|
action: () => { copyTextToClipboard(this.selectedItems[0].getAttribute('@' + eventItem.name)); }
|
|
222
222
|
}, {
|
|
223
223
|
title: 'paste',
|
|
224
|
-
action: async () => { this.selectedItems[0].setAttribute('@' + eventItem.name, await getTextFromClipboard()); }
|
|
224
|
+
action: async () => { this.selectedItems[0].setAttribute('@' + eventItem.name, await getTextFromClipboard()); this._bindingsRefresh(); }
|
|
225
225
|
}
|
|
226
226
|
];
|
|
227
227
|
ContextMenu.show(ctxMenu, e);
|
|
@@ -282,7 +282,7 @@ export class EventAssignment extends BaseCustomWebComponentConstructorAppend {
|
|
|
282
282
|
action: () => { copyTextToClipboard(this.selectedItems[0].getAttribute('@' + eventItem.name)); }
|
|
283
283
|
}, {
|
|
284
284
|
title: 'paste',
|
|
285
|
-
action: async () => { this.selectedItems[0].setAttribute('@' + eventItem.name, await getTextFromClipboard()); }
|
|
285
|
+
action: async () => { this.selectedItems[0].setAttribute('@' + eventItem.name, await getTextFromClipboard()); this._bindingsRefresh(); }
|
|
286
286
|
});
|
|
287
287
|
}
|
|
288
288
|
return ctxMenu;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PropertyGrid } from '@node-projects/propertygrid.webcomponent';
|
|
2
|
-
import { BindableObjectsBrowser } from '@node-projects/web-component-designer-widgets-wunderbaum';
|
|
3
2
|
import { CodeViewMonaco } from '@node-projects/web-component-designer-codeview-monaco';
|
|
4
3
|
export class VisualizationPropertyGrid extends PropertyGrid {
|
|
5
4
|
serviceContainer;
|
|
@@ -49,7 +48,7 @@ export class VisualizationPropertyGrid extends PropertyGrid {
|
|
|
49
48
|
let btn = document.createElement('button');
|
|
50
49
|
btn.textContent = '...';
|
|
51
50
|
btn.onclick = async () => {
|
|
52
|
-
let b =
|
|
51
|
+
let b = this.visualizationShell.createBindableObjectBrowser();
|
|
53
52
|
b.initialize(this.serviceContainer, this.instanceServiceContainer, this.bindableObjectsTarget);
|
|
54
53
|
b.title = 'select signal...';
|
|
55
54
|
const abortController = new AbortController();
|