@node-projects/web-component-designer-visualization-addons 0.1.116 → 0.1.118
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.
|
@@ -2,7 +2,13 @@ import { VisualizationBinding } from "../interfaces/VisualizationBinding.js";
|
|
|
2
2
|
import { State, VisualizationHandler } from "../interfaces/VisualizationHandler.js";
|
|
3
3
|
import { BindingTarget } from "@node-projects/web-component-designer/dist/elements/item/BindingTarget.js";
|
|
4
4
|
export type SpecialValueHandler = {
|
|
5
|
-
valueProvider: (propertyName: string
|
|
5
|
+
valueProvider: (propertyName: string, context: {
|
|
6
|
+
element: Element;
|
|
7
|
+
binding: namedBinding;
|
|
8
|
+
relativeSignalPath: string;
|
|
9
|
+
root: HTMLElement;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}) => any;
|
|
6
12
|
valueChangedCallbacks: Map<string, (() => void)[]>;
|
|
7
13
|
};
|
|
8
14
|
export declare const bindingPrefixProperty = "bind-prop:";
|
|
@@ -62,11 +62,15 @@ export class IndirectSignal {
|
|
|
62
62
|
for (let i = 0; i < this.signals.length; i++) {
|
|
63
63
|
let nm = this.signals[i];
|
|
64
64
|
if (nm[0] === '?' && nm[1] === '?') {
|
|
65
|
+
//todo: maybe react to prop changes
|
|
65
66
|
this.handleValueChanged(root[nm.substring(2)], i);
|
|
67
|
+
this.unsubscribeList.push(null);
|
|
66
68
|
continue;
|
|
67
69
|
}
|
|
68
70
|
else if (nm[0] === '#' && nm[1] === '#') {
|
|
71
|
+
//todo: maybe react to prop changes
|
|
69
72
|
this.handleValueChanged(element[nm.substring(2)], i);
|
|
73
|
+
this.unsubscribeList.push(null);
|
|
70
74
|
continue;
|
|
71
75
|
}
|
|
72
76
|
else if (nm[0] === '?') {
|
|
@@ -117,7 +121,9 @@ export class IndirectSignal {
|
|
|
117
121
|
this.unsubscribeTargetValue = null;
|
|
118
122
|
}
|
|
119
123
|
for (let i = 0; i < this.signals.length; i++) {
|
|
120
|
-
|
|
124
|
+
if (this.unsubscribeList[i] != null) {
|
|
125
|
+
this.visualizationHandler.unsubscribeState(this.signals[i], this.unsubscribeList[i][0], this.unsubscribeList[i][1]);
|
|
126
|
+
}
|
|
121
127
|
}
|
|
122
128
|
}
|
|
123
129
|
setState(value) {
|
|
@@ -675,7 +681,7 @@ export class BindingsHelper {
|
|
|
675
681
|
}
|
|
676
682
|
else if (s[0] === '§') {
|
|
677
683
|
const mS = s.substring(1);
|
|
678
|
-
const value = specialValueHandler.valueProvider(mS);
|
|
684
|
+
const value = specialValueHandler.valueProvider(mS, { element, binding, relativeSignalPath, root });
|
|
679
685
|
this.handleValueChanged(element, binding, value, valuesObject, i, signalVars, true, relativeSignalPath);
|
|
680
686
|
if (!specialValueHandler.valueChangedCallbacks)
|
|
681
687
|
specialValueHandler.valueChangedCallbacks = new Map();
|
|
@@ -685,7 +691,7 @@ export class BindingsHelper {
|
|
|
685
691
|
specialValueHandler.valueChangedCallbacks.set(mS, changeList);
|
|
686
692
|
}
|
|
687
693
|
changeList.push(() => {
|
|
688
|
-
const value = specialValueHandler.valueProvider(mS);
|
|
694
|
+
const value = specialValueHandler.valueProvider(mS, { element, binding, relativeSignalPath, root });
|
|
689
695
|
this.handleValueChanged(element, binding, value, valuesObject, i, signalVars, true, relativeSignalPath);
|
|
690
696
|
});
|
|
691
697
|
}
|
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.118",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"author": "jochen.kuehner@gmx.de",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|