-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Added Connection Center example
- Loading branch information
1 parent
134c099
commit 0fce509
Showing
8 changed files
with
122 additions
and
3 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
projects/f-examples/connections/connection-center/connection-center.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,24 @@ | ||
<f-flow fDraggable (fLoaded)="onLoaded()"> | ||
<f-canvas> | ||
<f-connection [fReassignDisabled]="true" | ||
fOutputId="1" fInputId="2" fBehavior="fixed" fType="segment"> | ||
<div fConnectionCenter> | ||
Connection Center | ||
<mat-form-field appearance="fill" class="f-form-field"> | ||
<mat-label>Select</mat-label> | ||
<mat-select panelClass="f-select-panel" [(value)]="value"> | ||
@for (option of options; track option) { | ||
<mat-option [value]="option">{{ option }}</mat-option> | ||
} | ||
</mat-select> | ||
</mat-form-field> | ||
</div> | ||
</f-connection> | ||
<div fNode fDragHandle [fNodePosition]="{ x: 0, y: 0 }" fNodeOutput fOutputId="1" fOutputConnectableSide="bottom"> | ||
I'm a node | ||
</div> | ||
<div fNode fDragHandle [fNodePosition]="{ x: 400, y: 100 }" fNodeInput fInputId="2" fInputConnectableSide="top"> | ||
I'm a node | ||
</div> | ||
</f-canvas> | ||
</f-flow> |
20 changes: 20 additions & 0 deletions
20
projects/f-examples/connections/connection-center/connection-center.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,20 @@ | ||
@use "../../flow-common"; | ||
|
||
::ng-deep connection-center { | ||
@include flow-common.connection; | ||
|
||
.f-connection-center { | ||
padding: 12px; | ||
background: var(--node-background-color); | ||
border-radius: var(--node-border-radius); | ||
border: 0.2px solid var(--node-border-color); | ||
} | ||
} | ||
|
||
.f-node { | ||
@include flow-common.node; | ||
} | ||
|
||
.toolbar { | ||
@include flow-common.toolbar; | ||
} |
36 changes: 36 additions & 0 deletions
36
projects/f-examples/connections/connection-center/connection-center.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,36 @@ | ||
import { ChangeDetectionStrategy, Component, ViewChild } from '@angular/core'; | ||
import { FCanvasComponent, FFlowModule } from '@foblex/flow'; | ||
import { MatFormField, MatLabel } from '@angular/material/form-field'; | ||
import { MatOption } from '@angular/material/core'; | ||
import { MatSelect } from '@angular/material/select'; | ||
|
||
@Component({ | ||
selector: 'connection-center', | ||
styleUrls: [ | ||
'../../_mdc-controls.scss', | ||
'./connection-center.component.scss' | ||
], | ||
templateUrl: './connection-center.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
standalone: true, | ||
imports: [ | ||
FFlowModule, | ||
MatFormField, | ||
MatLabel, | ||
MatOption, | ||
MatSelect | ||
] | ||
}) | ||
export class ConnectionCenterComponent { | ||
|
||
protected options: string[] = [ 'Option 1', 'Option 2', 'Option 3', 'Option 4', 'Option 5' ]; | ||
|
||
protected value: string = 'Option 3'; | ||
|
||
@ViewChild(FCanvasComponent, { static: true }) | ||
protected fCanvas!: FCanvasComponent; | ||
|
||
protected onLoaded(): void { | ||
this.fCanvas.resetScaleAndCenter(false); | ||
} | ||
} |
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,21 @@ | ||
# Connection Center | ||
|
||
## Description | ||
|
||
This page explains the `fConnectionCenter` directive in Foblex Flow for Angular. The `fConnectionCenter` directive allows you to insert any custom content inside a block, which will be positioned relative to the center of the connection line. This is useful for adding labels, icons, or other elements that need to be dynamically displayed at the center of a connection. | ||
The directive provides flexible styling and positioning, allowing you to fully customize the appearance and behavior of the centered content. | ||
|
||
|
||
## Example | ||
|
||
::: ng-component <connection-center></connection-center> [height]="600" | ||
[component.html] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/connections/connection-center/connection-center.component.html | ||
[component.ts] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/connections/connection-center/connection-center.component.ts | ||
[component.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/connections/connection-center/connection-center.component.scss | ||
[common.scss] <<< https://raw.githubusercontent.com/Foblex/f-flow/main/projects/f-examples/_flow-common.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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<router-outlet></router-outlet> | ||
<button class="take-screenshot" (click)="takeScreenshot()"> | ||
Take Screenshot | ||
</button> | ||
<!--<button class="take-screenshot" (click)="takeScreenshot()">--> | ||
<!-- Take Screenshot--> | ||
<!--</button>--> | ||
@defer (when isBrowser) { | ||
<f-cookie-popup/> | ||
} |