@node-projects/web-component-designer-visualization-addons 0.1.77 → 0.1.79

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,5 +1,5 @@
1
1
  import { BaseCustomWebComponentConstructorAppend } from '@node-projects/base-custom-webcomponent';
2
- import { BindingTarget, IBinding, IProperty, ServiceContainer } from '@node-projects/web-component-designer';
2
+ import { BindingTarget, IBinding, InstanceServiceContainer, IProperty, ServiceContainer } from '@node-projects/web-component-designer';
3
3
  import { VisualizationShell } from '../interfaces/VisualizationShell.js';
4
4
  export declare class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
5
5
  static readonly template: HTMLTemplateElement;
@@ -33,12 +33,13 @@ export declare class BindingsEditor extends BaseCustomWebComponentConstructorApp
33
33
  private _binding;
34
34
  private _bindingTarget;
35
35
  private _serviceContainer;
36
+ private _instanceServiceContainer;
36
37
  private _shell;
37
38
  private _activeRow;
38
39
  private _objNmInput;
39
40
  constructor(property: IProperty, binding: IBinding & {
40
41
  converter: Record<string, any>;
41
- }, bindingTarget: BindingTarget, serviceContainer: ServiceContainer, shell: VisualizationShell);
42
+ }, bindingTarget: BindingTarget, serviceContainer: ServiceContainer, instanceServiceContainer: InstanceServiceContainer, shell: VisualizationShell);
42
43
  ready(): void;
43
44
  _focusRow(index: number): void;
44
45
  _updatefocusedRow(): void;
@@ -187,10 +187,11 @@ export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
187
187
  _binding;
188
188
  _bindingTarget;
189
189
  _serviceContainer;
190
+ _instanceServiceContainer;
190
191
  _shell;
191
192
  _activeRow = -1;
192
193
  _objNmInput;
193
- constructor(property, binding, bindingTarget, serviceContainer, shell) {
194
+ constructor(property, binding, bindingTarget, serviceContainer, instanceServiceContainer, shell) {
194
195
  super();
195
196
  super._restoreCachedInititalValues();
196
197
  this._objNmInput = this._getDomElement('objnm');
@@ -198,6 +199,7 @@ export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
198
199
  this._binding = binding;
199
200
  this._bindingTarget = bindingTarget;
200
201
  this._serviceContainer = serviceContainer;
202
+ this._instanceServiceContainer = instanceServiceContainer;
201
203
  this._shell = shell;
202
204
  }
203
205
  ready() {
@@ -260,13 +262,19 @@ export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
260
262
  }
261
263
  async _select() {
262
264
  let b = new BindableObjectsBrowser();
263
- b.initialize(this._serviceContainer);
265
+ b.initialize(this._serviceContainer, this._instanceServiceContainer);
264
266
  b.title = 'select signal...';
265
267
  const abortController = new AbortController();
266
268
  b.objectDoubleclicked.on(() => {
267
269
  abortController.abort();
268
270
  if (this.objectNames != '')
269
271
  this.objectNames += ';';
272
+ if (b.selectedObject.specialType == 'signalProperty') {
273
+ this.objectNames += '?';
274
+ }
275
+ else if (b.selectedObject.bindabletype === 'property') {
276
+ this.objectNames += '??';
277
+ }
270
278
  this.objectNames += b.selectedObject.fullName;
271
279
  this._bindingsRefresh();
272
280
  });
@@ -349,6 +349,7 @@ export class EventAssignment extends BaseCustomWebComponentConstructorAppend {
349
349
  }
350
350
  let sc = new SimpleScriptEditor();
351
351
  sc.serviceContainer = selectedItem.serviceContainer;
352
+ sc.instanceServiceContainer = selectedItem.instanceServiceContainer;
352
353
  sc.scriptCommandsTypeInfo = this._scriptCommandsTypeInfo;
353
354
  sc.propertiesTypeInfo = this._propertiesTypeInfo;
354
355
  sc.visualizationShell = this._visualizationShell;
@@ -1,6 +1,6 @@
1
1
  import { BaseCustomWebComponentConstructorAppend } from "@node-projects/base-custom-webcomponent";
2
2
  import { Script } from "../scripting/Script.js";
3
- import { ServiceContainer } from "@node-projects/web-component-designer";
3
+ import { InstanceServiceContainer, ServiceContainer } from "@node-projects/web-component-designer";
4
4
  import { VisualizationHandler } from "../interfaces/VisualizationHandler.js";
5
5
  import { VisualizationShell } from "../interfaces/VisualizationShell.js";
6
6
  import '@node-projects/splitview.webcomponent';
@@ -9,6 +9,7 @@ export declare class SimpleScriptEditor extends BaseCustomWebComponentConstructo
9
9
  static readonly template: HTMLTemplateElement;
10
10
  static readonly is = "node-projects-visualization-simple-script-editor";
11
11
  serviceContainer: ServiceContainer;
12
+ instanceServiceContainer: InstanceServiceContainer;
12
13
  visualizationHandler: VisualizationHandler;
13
14
  visualizationShell: VisualizationShell;
14
15
  scriptCommandsTypeInfo: any;
@@ -55,6 +55,7 @@ export class SimpleScriptEditor extends BaseCustomWebComponentConstructorAppend
55
55
  `;
56
56
  static is = 'node-projects-visualization-simple-script-editor';
57
57
  serviceContainer;
58
+ instanceServiceContainer;
58
59
  visualizationHandler;
59
60
  visualizationShell;
60
61
  scriptCommandsTypeInfo;
@@ -82,6 +83,7 @@ export class SimpleScriptEditor extends BaseCustomWebComponentConstructorAppend
82
83
  pg.visualizationHandler = this.visualizationHandler;
83
84
  pg.visualizationShell = this.visualizationShell;
84
85
  pg.serviceContainer = this.serviceContainer;
86
+ pg.instanceServiceContainer = this.instanceServiceContainer;
85
87
  pg.getTypeInfo = (obj, type) => typeInfoFromJsonSchema(this.propertiesTypeInfo, obj, type);
86
88
  pg.showHead = false;
87
89
  pg.typeName = 'IScriptMultiplexValue';
@@ -90,6 +92,14 @@ export class SimpleScriptEditor extends BaseCustomWebComponentConstructorAppend
90
92
  pg.selectedObject = data.value ?? {};
91
93
  else
92
94
  pg.selectedObject = {};
95
+ pg.bindingDoubleClicked = (b) => {
96
+ if (b.bindabletype == 'property') {
97
+ this._propertygrid.setPropertyValue('source', 'property');
98
+ }
99
+ else {
100
+ this._propertygrid.setPropertyValue('source', 'signal');
101
+ }
102
+ };
93
103
  let res = await this.visualizationShell.openConfirmation(pg, { x: 100, y: 100, width: 400, height: 400, parent: this });
94
104
  if (res) {
95
105
  this._propertygrid.setPropertyValue(data.propertyPath, pg.selectedObject);
@@ -99,6 +109,7 @@ export class SimpleScriptEditor extends BaseCustomWebComponentConstructorAppend
99
109
  this._propertygrid.visualizationHandler = this.visualizationHandler;
100
110
  this._propertygrid.visualizationShell = this.visualizationShell;
101
111
  this._propertygrid.serviceContainer = this.serviceContainer;
112
+ this._propertygrid.instanceServiceContainer = this.instanceServiceContainer;
102
113
  this._propertygrid.getTypeInfo = (obj, type) => typeInfoFromJsonSchema(this.scriptCommandsTypeInfo, obj, type);
103
114
  this._propertygrid.getSpecialEditorForType = async (property, currentValue, propertyPath, wbRender, additionalInfo) => {
104
115
  //@ts-ignore
@@ -2,10 +2,13 @@ import { IProperty, PropertyGrid } from '@node-projects/propertygrid.webcomponen
2
2
  import { WbRenderEventType } from "types";
3
3
  import { VisualizationHandler } from '../interfaces/VisualizationHandler';
4
4
  import { VisualizationShell } from '../interfaces/VisualizationShell';
5
- import { ServiceContainer } from '@node-projects/web-component-designer';
5
+ import { IBindableObject, InstanceServiceContainer, ServiceContainer } from '@node-projects/web-component-designer';
6
6
  export declare class VisualizationPropertyGrid extends PropertyGrid {
7
7
  serviceContainer: ServiceContainer;
8
+ instanceServiceContainer: InstanceServiceContainer;
8
9
  visualizationHandler: VisualizationHandler;
9
10
  visualizationShell: VisualizationShell;
11
+ constructor();
12
+ bindingDoubleClicked: (bindableObject: IBindableObject<any>) => void;
10
13
  getEditorForType(property: IProperty, currentValue: any, propertyPath: string, wbRender: WbRenderEventType, additionalInfo?: any): Promise<HTMLElement>;
11
14
  }
@@ -3,8 +3,13 @@ import { BindableObjectsBrowser } from '@node-projects/web-component-designer-wi
3
3
  import { CodeViewMonaco } from '@node-projects/web-component-designer-codeview-monaco';
4
4
  export class VisualizationPropertyGrid extends PropertyGrid {
5
5
  serviceContainer;
6
+ instanceServiceContainer;
6
7
  visualizationHandler;
7
8
  visualizationShell;
9
+ constructor() {
10
+ super();
11
+ }
12
+ bindingDoubleClicked;
8
13
  async getEditorForType(property, currentValue, propertyPath, wbRender, additionalInfo) {
9
14
  if (this.getSpecialEditorForType) {
10
15
  let edt = await this.getSpecialEditorForType(property, currentValue, propertyPath, wbRender, additionalInfo);
@@ -44,7 +49,7 @@ export class VisualizationPropertyGrid extends PropertyGrid {
44
49
  btn.textContent = '...';
45
50
  btn.onclick = async () => {
46
51
  let b = new BindableObjectsBrowser();
47
- b.initialize(this.serviceContainer);
52
+ b.initialize(this.serviceContainer, this.instanceServiceContainer);
48
53
  b.title = 'select signal...';
49
54
  const abortController = new AbortController();
50
55
  b.objectDoubleclicked.on(() => {
@@ -1,5 +1,5 @@
1
1
  import { ScriptCommands, SetElementProperty } from "./ScriptCommands";
2
2
  export declare class ScriptUpgrades {
3
- static upgradeScriptCommand(scriptCommand: ScriptCommands): SetElementProperty | import("./ScriptCommands").Comment | import("./ScriptCommands").OpenScreen | import("./ScriptCommands").OpenUrl | import("./ScriptCommands").OpenDialog | import("./ScriptCommands").CloseDialog | import("./ScriptCommands").ToggleSignalValue | import("./ScriptCommands").SetSignalValue | import("./ScriptCommands").IncrementSignalValue | import("./ScriptCommands").DecrementSignalValue | import("./ScriptCommands").SetBitInSignal | import("./ScriptCommands").ClearBitInSignal | import("./ScriptCommands").ToggleBitInSignal | import("./ScriptCommands").Console | import("./ScriptCommands").CalculateSignalValue | import("./ScriptCommands").Javascript | import("./ScriptCommands").Delay | import("./ScriptCommands").SwitchLanguage | import("./ScriptCommands").Login | import("./ScriptCommands").Logout | import("./ScriptCommands").SubscribeSignal | import("./ScriptCommands").UnsubscribeSignal | import("./ScriptCommands").WriteSignalsInGroup | import("./ScriptCommands").ClearSiganlsInGroup | import("./ScriptCommands").Condition | import("./ScriptCommands").Exit | import("./ScriptCommands").Label | import("./ScriptCommands").RunScript | import("./ScriptCommands").Goto | import("./ScriptCommands").CopySignalValuesFromFolder | import("./ScriptCommands").ShowMessageBox | import("./ScriptCommands").ExportSignalValuesAsJson | import("./ScriptCommands").ImportSignalValuesFromJson;
3
+ static upgradeScriptCommand(scriptCommand: ScriptCommands): import("./ScriptCommands").Comment | import("./ScriptCommands").OpenScreen | import("./ScriptCommands").OpenUrl | import("./ScriptCommands").OpenDialog | import("./ScriptCommands").CloseDialog | import("./ScriptCommands").ToggleSignalValue | import("./ScriptCommands").SetSignalValue | import("./ScriptCommands").IncrementSignalValue | import("./ScriptCommands").DecrementSignalValue | import("./ScriptCommands").SetBitInSignal | import("./ScriptCommands").ClearBitInSignal | import("./ScriptCommands").ToggleBitInSignal | import("./ScriptCommands").Console | import("./ScriptCommands").CalculateSignalValue | import("./ScriptCommands").Javascript | SetElementProperty | import("./ScriptCommands").Delay | import("./ScriptCommands").SwitchLanguage | import("./ScriptCommands").Login | import("./ScriptCommands").Logout | import("./ScriptCommands").SubscribeSignal | import("./ScriptCommands").UnsubscribeSignal | import("./ScriptCommands").WriteSignalsInGroup | import("./ScriptCommands").ClearSiganlsInGroup | import("./ScriptCommands").Condition | import("./ScriptCommands").Exit | import("./ScriptCommands").Label | import("./ScriptCommands").RunScript | import("./ScriptCommands").Goto | import("./ScriptCommands").CopySignalValuesFromFolder | import("./ScriptCommands").ShowMessageBox | import("./ScriptCommands").ExportSignalValuesAsJson | import("./ScriptCommands").ImportSignalValuesFromJson;
4
4
  static upgradeSetElementProperty(scriptCommand: SetElementProperty): SetElementProperty;
5
5
  }
@@ -2,6 +2,6 @@ import { BasePropertyEditor, IProperty, ValueType } from "@node-projects/web-com
2
2
  import { VisualizationShell } from "../interfaces/VisualizationShell.js";
3
3
  export declare class SignalPropertyEditor extends BasePropertyEditor<HTMLElement> {
4
4
  _ip: HTMLInputElement;
5
- constructor(property: IProperty, shell: VisualizationShell);
5
+ constructor(property: IProperty, shell: VisualizationShell, context: any);
6
6
  refreshValue(valueType: ValueType, value: any): void;
7
7
  }
@@ -2,7 +2,7 @@ import { BasePropertyEditor } from "@node-projects/web-component-designer";
2
2
  import { BindableObjectsBrowser } from "@node-projects/web-component-designer-widgets-wunderbaum";
3
3
  export class SignalPropertyEditor extends BasePropertyEditor {
4
4
  _ip;
5
- constructor(property, shell) {
5
+ constructor(property, shell, context) {
6
6
  super(property);
7
7
  let cnt = document.createElement('div');
8
8
  cnt.style.display = 'flex';
@@ -17,7 +17,7 @@ export class SignalPropertyEditor extends BasePropertyEditor {
17
17
  btn.textContent = '...';
18
18
  btn.onclick = async () => {
19
19
  let b = new BindableObjectsBrowser();
20
- b.initialize(this.designItems[0].serviceContainer);
20
+ b.initialize(this.designItems[0].serviceContainer, context);
21
21
  b.title = 'select signal...';
22
22
  const abortController = new AbortController();
23
23
  b.objectDoubleclicked.on(() => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "description": "web-component-designer addon for visualizations",
3
3
  "name": "@node-projects/web-component-designer-visualization-addons",
4
- "version": "0.1.77",
4
+ "version": "0.1.79",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "author": "jochen.kuehner@gmx.de",
@@ -14,13 +14,13 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@adobe/css-tools": "^4.4.0",
17
- "@blockly/zoom-to-fit": "^6.0.7",
18
- "@node-projects/base-custom-webcomponent": ">=0.19.0",
19
- "@node-projects/propertygrid.webcomponent": ">=1.1.1",
17
+ "@blockly/zoom-to-fit": "^6.0.9",
18
+ "@node-projects/base-custom-webcomponent": ">=0.27.8",
19
+ "@node-projects/propertygrid.webcomponent": ">=1.2.3",
20
20
  "@node-projects/splitview.webcomponent": ">=1.0.1",
21
- "@node-projects/web-component-designer": ">=0.1.215",
22
- "@node-projects/web-component-designer-codeview-monaco": ">=0.1.27",
23
- "@node-projects/web-component-designer-widgets-wunderbaum": ">=0.1.27",
21
+ "@node-projects/web-component-designer": ">=0.1.224",
22
+ "@node-projects/web-component-designer-codeview-monaco": ">=0.1.32",
23
+ "@node-projects/web-component-designer-widgets-wunderbaum": ">=0.1.29",
24
24
  "blockly": "^11.1.1",
25
25
  "long": "^5.2.3"
26
26
  },