@node-projects/web-component-designer-visualization-addons 0.1.121 → 0.1.122
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.
|
@@ -28,10 +28,11 @@ export declare class BindingsEditor extends BaseCustomWebComponentConstructorApp
|
|
|
28
28
|
key: string;
|
|
29
29
|
value: any;
|
|
30
30
|
}[];
|
|
31
|
+
convertersString: string;
|
|
31
32
|
objectValueType: string;
|
|
32
33
|
protected _property: IProperty;
|
|
33
34
|
protected _binding: IBinding & {
|
|
34
|
-
converter: Record<string, any
|
|
35
|
+
converter: Record<string, any> | string;
|
|
35
36
|
};
|
|
36
37
|
protected _bindingTarget: BindingTarget;
|
|
37
38
|
protected _serviceContainer: ServiceContainer;
|
|
@@ -41,7 +42,9 @@ export declare class BindingsEditor extends BaseCustomWebComponentConstructorApp
|
|
|
41
42
|
protected _objNmInput: HTMLInputElement;
|
|
42
43
|
constructor(property: IProperty, binding: IBinding & {
|
|
43
44
|
converter: Record<string, any>;
|
|
44
|
-
}, bindingTarget: BindingTarget, serviceContainer: ServiceContainer, instanceServiceContainer: InstanceServiceContainer, shell: VisualizationShell
|
|
45
|
+
}, bindingTarget: BindingTarget, serviceContainer: ServiceContainer, instanceServiceContainer: InstanceServiceContainer, shell: VisualizationShell, config?: {
|
|
46
|
+
namedConverters: boolean;
|
|
47
|
+
});
|
|
45
48
|
ready(): void;
|
|
46
49
|
_focusRow(index: number): void;
|
|
47
50
|
_updatefocusedRow(): void;
|
|
@@ -56,8 +56,8 @@ export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
|
|
|
56
56
|
</div>
|
|
57
57
|
<div class="vertical-grid" style="margin-top: 10px;">
|
|
58
58
|
<div>
|
|
59
|
-
<div class="input-headline">
|
|
60
|
-
<span>converter</span
|
|
59
|
+
<div class="input-headline" style="display: flex;align-items: center;">
|
|
60
|
+
<span>converter</span>:<input id="namedConverterInput" style="width: 100%; margin-left: 15px;" value="{{?this.convertersString::change}}">
|
|
61
61
|
</div>
|
|
62
62
|
</div>
|
|
63
63
|
</div>
|
|
@@ -181,6 +181,7 @@ export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
|
|
|
181
181
|
events = '';
|
|
182
182
|
invert = false;
|
|
183
183
|
converters = [];
|
|
184
|
+
convertersString;
|
|
184
185
|
objectValueType;
|
|
185
186
|
_property;
|
|
186
187
|
_binding;
|
|
@@ -190,7 +191,7 @@ export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
|
|
|
190
191
|
_shell;
|
|
191
192
|
_activeRow = -1;
|
|
192
193
|
_objNmInput;
|
|
193
|
-
constructor(property, binding, bindingTarget, serviceContainer, instanceServiceContainer, shell) {
|
|
194
|
+
constructor(property, binding, bindingTarget, serviceContainer, instanceServiceContainer, shell, config = { namedConverters: true }) {
|
|
194
195
|
super();
|
|
195
196
|
super._restoreCachedInititalValues();
|
|
196
197
|
this._objNmInput = this._getDomElement('objectName');
|
|
@@ -200,6 +201,9 @@ export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
|
|
|
200
201
|
this._serviceContainer = serviceContainer;
|
|
201
202
|
this._instanceServiceContainer = instanceServiceContainer;
|
|
202
203
|
this._shell = shell;
|
|
204
|
+
if (!config?.namedConverters) {
|
|
205
|
+
this._getDomElement('namedConverterInput').style.display = 'none';
|
|
206
|
+
}
|
|
203
207
|
}
|
|
204
208
|
ready() {
|
|
205
209
|
this._parseAttributesToProperties();
|
|
@@ -218,8 +222,13 @@ export class BindingsEditor extends BaseCustomWebComponentConstructorAppend {
|
|
|
218
222
|
if (this._binding.bindableObjectNames)
|
|
219
223
|
this.objectNames = this._binding.bindableObjectNames.join(';');
|
|
220
224
|
if (this._binding.converter) {
|
|
221
|
-
|
|
222
|
-
this.
|
|
225
|
+
if (typeof this._binding.converter === 'string') {
|
|
226
|
+
this.convertersString = this._binding.converter;
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
for (let c in this._binding.converter) {
|
|
230
|
+
this.converters.push({ key: c, value: this._binding.converter[c] });
|
|
231
|
+
}
|
|
223
232
|
}
|
|
224
233
|
}
|
|
225
234
|
if (this._binding.changedEvents && this._binding.changedEvents.length)
|
|
@@ -841,7 +841,7 @@ export class BindingsHelper {
|
|
|
841
841
|
valuesObject[signalVarNames.length - 1] = v;
|
|
842
842
|
}
|
|
843
843
|
if (binding[1].converter) {
|
|
844
|
-
if (binding[1].converter) {
|
|
844
|
+
if (typeof binding[1].converter === 'string') {
|
|
845
845
|
v = this.namedConverterCallback(binding[1].converter, v, element, binding);
|
|
846
846
|
}
|
|
847
847
|
else {
|
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.
|
|
4
|
+
"version": "0.1.122",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"author": "jochen.kuehner@gmx.de",
|