-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from Foblex/f-zoom-triggers
F zoom triggers
- Loading branch information
Showing
126 changed files
with
1,729 additions
and
971 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
projects/f-examples/connectors/connectability-check/connectability-check.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,36 @@ | ||
<f-flow fDraggable (fLoaded)="onLoaded()" (fCreateConnection)="onCreateConnection($event)"> | ||
<f-canvas> | ||
<f-connection-for-create fBehavior="floating"></f-connection-for-create> | ||
|
||
@for (connection of connections; track connection.to) { | ||
<f-connection [fReassignDisabled]="true" | ||
[fOutputId]="connection.from" [fInputId]="connection.to" | ||
fBehavior="floating"> | ||
</f-connection> | ||
} | ||
|
||
<div fNode fDragHandle [fNodePosition]="{ x: 0, y: 75 }" > | ||
<div fNodeOutput fOutputId="1" [fOutputMultiple]="true" class="right" | ||
[fCanBeConnectedInputs]="['input1', 'input3']"> | ||
</div> | ||
I can only be connected to node 1 or 3 | ||
</div> | ||
|
||
<div fNode fDragHandle [fNodePosition]="{ x: 300, y: 0 }" > | ||
<div fNodeInput fInputId="input1" class="left"></div> | ||
I'm node 1 | ||
</div> | ||
<div fNode fDragHandle [fNodePosition]="{ x: 300, y: 150 }"> | ||
<div fNodeInput fInputId="input2" class="left"></div> | ||
I'm node 2 | ||
</div> | ||
<div fNode fDragHandle [fNodePosition]="{ x: 300, y: 300 }"> | ||
<div fNodeInput fInputId="input3" class="left"></div> | ||
I'm node 3 | ||
</div> | ||
|
||
</f-canvas> | ||
</f-flow> | ||
<div class="toolbar"> | ||
<button class="f-button" (click)="onDeleteConnections()">Delete Connections</button> | ||
</div> |
28 changes: 28 additions & 0 deletions
28
projects/f-examples/connectors/connectability-check/connectability-check.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,28 @@ | ||
@use "../../flow-common"; | ||
|
||
::ng-deep connectability-check { | ||
@include flow-common.connection; | ||
} | ||
|
||
.f-node { | ||
@include flow-common.node; | ||
width: 180px; | ||
} | ||
|
||
.f-node-input, .f-node-output { | ||
&:not(.f-node) { | ||
@include flow-common.connectors; | ||
} | ||
} | ||
|
||
.f-connections-dragging { | ||
.f-node-input { | ||
&:not(.f-node-input-can-be-connected-to) { | ||
background-color: var(--disabled-color); | ||
} | ||
} | ||
} | ||
|
||
.toolbar { | ||
@include flow-common.toolbar; | ||
} |
41 changes: 41 additions & 0 deletions
41
projects/f-examples/connectors/connectability-check/connectability-check.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,41 @@ | ||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ViewChild } from '@angular/core'; | ||
import { FCanvasComponent, FCreateConnectionEvent, FFlowModule } from '@foblex/flow'; | ||
|
||
@Component({ | ||
selector: 'connectability-check', | ||
styleUrls: [ './connectability-check.component.scss' ], | ||
templateUrl: './connectability-check.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
standalone: true, | ||
imports: [ | ||
FFlowModule, | ||
] | ||
}) | ||
export class ConnectabilityCheckComponent { | ||
|
||
@ViewChild(FCanvasComponent, { static: true }) | ||
public fCanvas!: FCanvasComponent; | ||
|
||
public connections: { from: string, to: string }[] = []; | ||
|
||
constructor( | ||
private changeDetectorRef: ChangeDetectorRef | ||
) { | ||
} | ||
|
||
public onLoaded(): void { | ||
this.fCanvas.resetScaleAndCenter(false); | ||
} | ||
|
||
public onCreateConnection(event: FCreateConnectionEvent): void { | ||
if (!event.fInputId) { | ||
return; | ||
} | ||
this.connections.push({ from: event.fOutputId, to: event.fInputId }); | ||
} | ||
|
||
public onDeleteConnections(): void { | ||
this.connections = []; | ||
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
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,22 @@ | ||
export const F_CSS_CLASS = { | ||
|
||
DRAG_AND_DROP: { | ||
|
||
DRAGGING: 'f-dragging', | ||
|
||
CONNECTIONS_DRAGGING: 'f-connections-dragging', | ||
}, | ||
|
||
CONNECTOR: { | ||
|
||
OUTPUT_CONNECTED: 'f-node-output-connected', | ||
|
||
OUTPUT_NOT_CONNECTABLE: 'f-node-output-not-connectable', | ||
|
||
INPUT_CONNECTED: 'f-node-input-connected', | ||
|
||
INPUT_NOT_CONNECTABLE: 'f-node-input-not-connectable', | ||
|
||
INPUT_CAN_BE_CONNECTED_TO: 'f-node-input-can-be-connected-to', | ||
} | ||
} |
45 changes: 0 additions & 45 deletions
45
projects/f-flow/src/domain/f-connection/find-closest-input/find-closest-input.execution.ts
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
projects/f-flow/src/domain/f-connection/find-closest-input/find-closest-input.request.ts
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
projects/f-flow/src/domain/f-connection/find-closest-input/index.ts
This file was deleted.
Oops, something went wrong.
59 changes: 0 additions & 59 deletions
59
...ll-can-be-connected-input-positions/get-all-can-be-connected-input-positions.execution.ts
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...-all-can-be-connected-input-positions/get-all-can-be-connected-input-positions.request.ts
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
projects/f-flow/src/domain/f-connection/get-all-can-be-connected-input-positions/index.ts
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
...flow/src/domain/f-connection/get-connector-with-rect/get-connector-with-rect.execution.ts
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
projects/f-flow/src/domain/f-connection/get-connector-with-rect/index.ts
This file was deleted.
Oops, something went wrong.
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.