refactor: Refactor some jsx files to vue files

feat: add global hooks to emulate sort of an event bus between components
* global hooks are not exposed to user but emit events upward from Revue-flow component, just more convenient
This commit is contained in:
Braks
2021-08-08 19:28:45 +02:00
parent ef9647ceb4
commit ffd41fb679
27 changed files with 1876 additions and 588 deletions
-39
View File
@@ -21,18 +21,6 @@ export default function configureStore(
state: () => preloadedState,
getters: {},
actions: {
setOnConnect(onConnect) {
this.onConnect = onConnect;
},
setOnConnectStart(onConnectStart) {
this.onConnectStart = onConnectStart;
},
setOnConnectEnd(onConnectEnd) {
this.onConnectEnd = onConnectEnd;
},
setOnConnectStop(onConnectStop) {
this.onConnectStop = onConnectStop;
},
setElements(elements) {
const propElements = elements;
const nextElements: NextElements = {
@@ -252,46 +240,19 @@ export default function configureStore(
unsetNodesSelection() {
this.nodesSelectionActive = false;
},
updateTransform(transform) {
this.transform = transform;
},
updateSize(size) {
this.height = size.height;
this.width = size.width;
},
setConnectionPosition(connectionPosition) {
this.connectionPosition = connectionPosition;
},
setConnectionNodeId(payload) {
this.connectionNodeId = payload.connectionNodeId;
this.connectionHandleId = payload.connectionHandleId;
this.connectionHandleType = payload.connectionHandleType;
},
setSnapToGrid(snapToGrid) {
this.snapToGrid = snapToGrid;
},
setSnapGrid(snapGrid) {
this.snapGrid = snapGrid;
},
setInteractive(isInteractive) {
this.nodesDraggable = isInteractive;
this.nodesConnectable = isInteractive;
this.elementsSelectable = isInteractive;
},
setNodesDraggable(nodesDraggable) {
this.nodesDraggable = nodesDraggable;
},
setNodesConnectable(nodesConnectable) {
this.nodesConnectable = nodesConnectable;
},
setElementsSelectable(elementsSelectable) {
this.elementsSelectable = elementsSelectable;
},
setMultiSelectionActive(multiSelectionActive) {
this.multiSelectionActive = multiSelectionActive;
},
setConnectionMode(connectionMode) {
this.connectionMode = connectionMode;
}
}
});