ngx-vflow 0.2.1 → 0.2.2

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.
@@ -1,7 +1,8 @@
1
- import { OnInit } from '@angular/core';
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { Position } from '../../types/position.type';
3
+ import { HandleModel } from '../../models/handle.model';
3
4
  import * as i0 from "@angular/core";
4
- export declare class HandleComponent implements OnInit {
5
+ export declare class HandleComponent implements OnInit, OnDestroy {
5
6
  private handleService;
6
7
  private element;
7
8
  /**
@@ -16,7 +17,9 @@ export declare class HandleComponent implements OnInit {
16
17
  * Should be used if node has more than one source/target
17
18
  */
18
19
  id?: string;
20
+ model: HandleModel;
19
21
  ngOnInit(): void;
22
+ ngOnDestroy(): void;
20
23
  private parentRect;
21
24
  static ɵfac: i0.ɵɵFactoryDeclaration<HandleComponent, never>;
22
25
  static ɵcmp: i0.ɵɵComponentDeclaration<HandleComponent, "handle", never, { "position": { "alias": "position"; "required": true; }; "type": { "alias": "type"; "required": true; }; "id": { "alias": "id"; "required": false; }; }, {}, never, never, false, never>;
@@ -126,6 +126,10 @@ export declare class VflowComponent {
126
126
  * @param id node id
127
127
  */
128
128
  getNode<T = unknown>(id: string): Node<T> | undefined;
129
+ /**
130
+ * Sync method to get detached edges
131
+ */
132
+ getDetachedEdges(): Edge[];
129
133
  protected trackNodes(idx: number, { node }: NodeModel): string;
130
134
  protected trackEdges(idx: number, { edge }: EdgeModel): string;
131
135
  static ɵfac: i0.ɵɵFactoryDeclaration<VflowComponent, never>;
@@ -8,7 +8,25 @@ export declare class EdgeModel {
8
8
  target: NodeModel;
9
9
  curve: Curve;
10
10
  type: EdgeType;
11
- path: import("@angular/core").Signal<import("../interfaces/path-data.interface").PathData>;
11
+ detached: import("@angular/core").Signal<boolean>;
12
+ detached$: import("rxjs").Observable<boolean>;
13
+ path: import("@angular/core").Signal<{
14
+ path: string;
15
+ points: {
16
+ start: {
17
+ x: number;
18
+ y: number;
19
+ };
20
+ center: {
21
+ x: number;
22
+ y: number;
23
+ };
24
+ end: {
25
+ x: number;
26
+ y: number;
27
+ };
28
+ };
29
+ }>;
12
30
  edgeLabels: {
13
31
  [position in EdgeLabelPosition]?: EdgeLabelModel;
14
32
  };
@@ -20,5 +20,10 @@ export declare class HandleModel {
20
20
  x: number;
21
21
  y: number;
22
22
  }>;
23
+ parentSize: import("@angular/core").WritableSignal<{
24
+ width: number;
25
+ height: number;
26
+ }>;
27
+ parentPosition: import("@angular/core").WritableSignal<import("ngx-vflow").Point>;
23
28
  constructor(rawHandle: NodeHandle, parentNode: NodeModel);
24
29
  }
@@ -1,6 +1,5 @@
1
1
  import { Node } from '../interfaces/node.interface';
2
2
  import { FlowModel } from './flow.model';
3
- import { NodeHandle } from '../services/handle.service';
4
3
  import { HandleModel } from './handle.model';
5
4
  export declare class NodeModel<T = unknown> {
6
5
  node: Node<T>;
@@ -20,7 +19,7 @@ export declare class NodeModel<T = unknown> {
20
19
  sourcePosition: import("@angular/core").Signal<import("ngx-vflow").Position>;
21
20
  targetPosition: import("@angular/core").Signal<import("ngx-vflow").Position>;
22
21
  handles: import("@angular/core").Signal<HandleModel[]>;
23
- rawHandles: import("@angular/core").WritableSignal<NodeHandle[]>;
22
+ rawHandles: import("@angular/core").WritableSignal<HandleModel[]>;
24
23
  draggable: boolean;
25
24
  readonly magnetRadius = 20;
26
25
  private flow;
@@ -10,6 +10,7 @@ export declare class FlowEntitiesService {
10
10
  readonly markers: import("@angular/core").Signal<Map<number, Marker>>;
11
11
  readonly validEdges: import("@angular/core").Signal<EdgeModel[]>;
12
12
  getNode<T>(id: string): NodeModel<T> | undefined;
13
+ getDetachedEdges(): EdgeModel[];
13
14
  static ɵfac: i0.ɵɵFactoryDeclaration<FlowEntitiesService, never>;
14
15
  static ɵprov: i0.ɵɵInjectableDeclaration<FlowEntitiesService>;
15
16
  }
@@ -1,22 +1,23 @@
1
- import { Signal } from '@angular/core';
2
1
  import { Position } from '../types/position.type';
3
2
  import { HandleType } from '../types/handle-type.type';
4
3
  import { Point } from '../interfaces/point.interface';
4
+ import { NodeModel } from '../models/node.model';
5
+ import { HandleModel } from '../models/handle.model';
5
6
  import * as i0 from "@angular/core";
6
7
  export interface NodeHandle {
7
8
  position: Position;
8
9
  type: HandleType;
9
- parentPosition: Signal<Point>;
10
- parentSize: Signal<{
10
+ parentPosition: Point;
11
+ parentSize: {
11
12
  width: number;
12
13
  height: number;
13
- }>;
14
+ };
14
15
  id?: string;
15
16
  }
16
17
  export declare class HandleService {
17
- readonly handles: import("@angular/core").WritableSignal<NodeHandle[]>;
18
- createHandle(newHandle: NodeHandle): void;
19
- destroyHandle(handleToDestoy: NodeHandle): void;
18
+ readonly node: import("@angular/core").WritableSignal<NodeModel<unknown> | null>;
19
+ createHandle(newHandle: HandleModel): void;
20
+ destroyHandle(handleToDestoy: HandleModel): void;
20
21
  static ɵfac: i0.ɵɵFactoryDeclaration<HandleService, never>;
21
22
  static ɵprov: i0.ɵɵInjectableDeclaration<HandleService>;
22
23
  }
@@ -1,4 +1,7 @@
1
1
  export type EdgeChange = EdgeDetachedChange | EdgeAddChange | EdgeRemoveChange;
2
+ /**
3
+ * @experimental
4
+ */
2
5
  export interface EdgeDetachedChange extends EdgeChangeShared {
3
6
  type: 'detached';
4
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-vflow",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "license": "MIT",
5
5
  "homepage": "https://www.ngx-vflow.org/",
6
6
  "author": "Artem Mangilev",