-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Foblex/f-flow
- Loading branch information
Showing
67 changed files
with
1,243 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
|
||
.f-node { | ||
width: 100px; | ||
height: 100px; | ||
padding: 12px; | ||
color: #585858; | ||
cursor: move; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/f-examples/custom-connection-type/custom-connection-type.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
projects/f-examples/drag-to-reassign/drag-to-reassign.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<f-flow fDraggable (fReassignConnection)="reassignConnection($event)"> | ||
<f-canvas> | ||
@for (connection of connections;track connection.inputId) { | ||
<f-connection fBehavior="floating" | ||
[fOutputId]="connection.outputId" [fInputId]="connection.inputId"> | ||
</f-connection> | ||
} | ||
|
||
<div fNode fDragHandle [fNodePosition]="{ x: 24, y: 24 }" fNodeOutput fOutputId="1">Output</div> | ||
<div fNode fDragHandle [fNodePosition]="{ x: 224, y: 24 }" fNodeInput fInputId="2">Input</div> | ||
<div fNode fDragHandle [fNodePosition]="{ x: 224, y: 124 }" fNodeInput>Input</div> | ||
</f-canvas> | ||
</f-flow> |
41 changes: 41 additions & 0 deletions
41
projects/f-examples/drag-to-reassign/drag-to-reassign.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
:host ::ng-deep { | ||
|
||
.f-connection { | ||
.f-connection-drag-handle { | ||
fill: #585858; | ||
} | ||
|
||
.f-connection-selection { | ||
fill: none; | ||
} | ||
|
||
.f-connection-path { | ||
fill: none; | ||
stroke: #585858; | ||
stroke-width: 2; | ||
} | ||
|
||
.f-connection-text { | ||
fill: #585858; | ||
} | ||
} | ||
} | ||
|
||
.f-node { | ||
width: 100px; | ||
padding: 12px; | ||
color: #585858; | ||
cursor: move; | ||
display: inline-flex; | ||
justify-content: center; | ||
align-items: center; | ||
text-align: center; | ||
background: #FCFDFE; | ||
border-radius: 4px; | ||
box-shadow: 0 0 1px 1px #E4E3E6; | ||
|
||
&:active { | ||
box-shadow: 0 0 2px 2px #E4E3E6; | ||
} | ||
} | ||
|
29 changes: 29 additions & 0 deletions
29
projects/f-examples/drag-to-reassign/drag-to-reassign.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component } from '@angular/core'; | ||
import { FFlowModule, FReassignConnectionEvent } from '@foblex/flow'; | ||
|
||
@Component({ | ||
selector: 'drag-to-reassign', | ||
styleUrls: [ './drag-to-reassign.component.scss' ], | ||
templateUrl: './drag-to-reassign.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
standalone: true, | ||
imports: [ | ||
FFlowModule | ||
] | ||
}) | ||
export class DragToReassignComponent { | ||
|
||
public connections: { outputId: string, inputId: string }[] = [ | ||
{ outputId: '1', inputId: '2' }, | ||
]; | ||
|
||
constructor( | ||
private changeDetectorRef: ChangeDetectorRef | ||
) { | ||
} | ||
|
||
public reassignConnection(event: FReassignConnectionEvent): void { | ||
this.connections = [ { outputId: event.fOutputId, inputId: event.newFInputId } ]; | ||
this.changeDetectorRef.detectChanges(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
|
||
.f-node { | ||
width: 100px; | ||
height: 100px; | ||
padding: 12px; | ||
color: #585858; | ||
cursor: move; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,6 @@ | |
|
||
.f-node { | ||
width: 100px; | ||
height: 100px; | ||
padding: 12px; | ||
color: #585858; | ||
cursor: move; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
|
||
.f-node { | ||
width: 100px; | ||
height: 100px; | ||
padding: 12px; | ||
color: #585858; | ||
display: inline-flex; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
|
||
.f-node { | ||
width: 100px; | ||
height: 100px; | ||
padding: 12px; | ||
color: #585858; | ||
display: inline-flex; | ||
|
31 changes: 31 additions & 0 deletions
31
projects/f-flow/src/domain/get-external-nodes-rect/get-external-nodes-rect.execution.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { IRect, RectExtensions } from '@foblex/core'; | ||
import { GetExternalNodesRectRequest } from './get-external-nodes-rect.request'; | ||
import { Injectable } from '@angular/core'; | ||
import { FComponentsStore } from '../../f-storage'; | ||
import { FExecutionRegister, IExecution } from '../../infrastructure'; | ||
import { FNodeBase } from '../../f-node'; | ||
|
||
@Injectable() | ||
@FExecutionRegister(GetExternalNodesRectRequest) | ||
export class GetExternalNodesRectExecution implements IExecution<GetExternalNodesRectRequest, IRect> { | ||
|
||
constructor( | ||
private fComponentsStore: FComponentsStore, | ||
) { | ||
} | ||
|
||
public handle(request: GetExternalNodesRectRequest): IRect { | ||
return RectExtensions.union(this.getNodesRects()); | ||
} | ||
|
||
private getNodesRects(): IRect[] { | ||
return this.getNodes().map((x) => { | ||
const rect = RectExtensions.fromElement(x.hostElement); | ||
return RectExtensions.initialize(x.position.x, x.position.y, rect.width, rect.height); | ||
}) | ||
} | ||
|
||
private getNodes(): FNodeBase[] { | ||
return this.fComponentsStore.fNodes; | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
projects/f-flow/src/domain/get-external-nodes-rect/get-external-nodes-rect.request.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export class GetExternalNodesRectRequest { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './get-external-nodes-rect.execution'; | ||
|
||
export * from './get-external-nodes-rect.request'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.