@foblex/flow 12.1.2 → 12.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.
- package/domain/index.d.ts +1 -2
- package/domain/providers.d.ts +2 -3
- package/domain/redraw-connections/redraw-connections-request.d.ts +0 -1
- package/domain/update-item-layer/index.d.ts +2 -0
- package/domain/update-item-layer/update-item-layer.handler.d.ts +8 -0
- package/domain/update-item-layer/update-item-layer.request.d.ts +6 -0
- package/esm2022/domain/get-element-rect-in-flow/get-element-rect-in-flow.handler.mjs +1 -1
- package/esm2022/domain/index.mjs +2 -3
- package/esm2022/domain/providers.mjs +6 -5
- package/esm2022/domain/redraw-connections/redraw-connections-request.mjs +1 -3
- package/esm2022/domain/redraw-connections/redraw-connections.handler.mjs +2 -2
- package/esm2022/domain/update-item-layer/index.mjs +3 -0
- package/esm2022/domain/update-item-layer/update-item-layer.handler.mjs +29 -0
- package/esm2022/domain/update-item-layer/update-item-layer.request.mjs +7 -0
- package/esm2022/f-components-store.mjs +10 -1
- package/esm2022/f-connection/common/domain/f-bezier.path-builder.mjs +4 -5
- package/esm2022/f-connection/common/domain/f-segment.path-builder.mjs +3 -4
- package/esm2022/f-connection/common/domain/f-straight.path-builder.mjs +4 -5
- package/esm2022/f-connection/common/domain/index.mjs +1 -5
- package/esm2022/f-connection/common/f-connection-base.mjs +16 -14
- package/esm2022/f-connection/common/mixins/change-connection-selection.mixin.mjs +2 -1
- package/esm2022/f-connection/f-connection/f-connection.component.mjs +17 -16
- package/esm2022/f-connection/f-connection-builder/f-connection-builders.mjs +3 -0
- package/esm2022/f-connection/f-connection-builder/f-connection-factory.mjs +34 -0
- package/esm2022/f-connection/f-connection-builder/i-f-connection-builder-request.mjs +2 -0
- package/esm2022/f-connection/f-connection-builder/i-f-connection-builder-response.mjs +2 -0
- package/esm2022/f-connection/f-connection-builder/i-f-connection-builder.mjs +2 -0
- package/esm2022/f-connection/f-connection-builder/i-f-connection-factory-request.mjs +2 -0
- package/esm2022/f-connection/f-connection-builder/index.mjs +7 -0
- package/esm2022/f-connection/f-connection-for-create/f-connection-for-create.component.mjs +16 -15
- package/esm2022/f-connection/index.mjs +2 -1
- package/esm2022/f-draggable/connections/create-connection/create-connection.on-pointer-up.mjs +13 -15
- package/esm2022/f-draggable/connections/create-connection/f-create-connection.event.mjs +3 -2
- package/esm2022/f-draggable/connections/reassign-connection/reassign-connection.prepare-drag-sequence.mjs +6 -6
- package/esm2022/f-draggable/f-draggable-data-context.mjs +4 -1
- package/esm2022/f-draggable/node/node.prepare-drag-sequence.mjs +6 -6
- package/esm2022/f-draggable/single-select/single-select.on-pointer-down.mjs +45 -55
- package/esm2022/f-flow/f-flow.component.mjs +4 -1
- package/esm2022/f-flow.module.mjs +4 -1
- package/esm2022/f-group/f-group-base.mjs +13 -0
- package/esm2022/f-group/f-group.directive.mjs +57 -0
- package/esm2022/f-group/index.mjs +4 -0
- package/esm2022/f-group/is-group.mjs +4 -0
- package/esm2022/public-api.mjs +2 -1
- package/f-components-store.d.ts +4 -0
- package/f-connection/common/domain/f-bezier.path-builder.d.ts +3 -5
- package/f-connection/common/domain/f-segment.path-builder.d.ts +3 -5
- package/f-connection/common/domain/f-straight.path-builder.d.ts +3 -5
- package/f-connection/common/domain/index.d.ts +0 -4
- package/f-connection/common/f-connection-base.d.ts +3 -3
- package/f-connection/common/mixins/change-connection-selection.mixin.d.ts +1 -0
- package/f-connection/f-connection/f-connection.component.d.ts +2 -1
- package/f-connection/f-connection-builder/f-connection-builders.d.ts +6 -0
- package/f-connection/f-connection-builder/f-connection-factory.d.ts +11 -0
- package/f-connection/{common/domain/i-f-path-builder-request.d.ts → f-connection-builder/i-f-connection-builder-request.d.ts} +2 -4
- package/f-connection/f-connection-builder/i-f-connection-builder-response.d.ts +5 -0
- package/f-connection/f-connection-builder/i-f-connection-builder.d.ts +6 -0
- package/f-connection/f-connection-builder/i-f-connection-factory-request.d.ts +6 -0
- package/f-connection/f-connection-builder/index.d.ts +6 -0
- package/f-connection/f-connection-for-create/f-connection-for-create.component.d.ts +3 -2
- package/f-connection/index.d.ts +1 -0
- package/f-draggable/canvas/providers.d.ts +1 -1
- package/f-draggable/connections/create-connection/f-create-connection.event.d.ts +4 -2
- package/f-draggable/connections/providers.d.ts +1 -1
- package/f-draggable/connections/reassign-connection/reassign-connection.prepare-drag-sequence.d.ts +2 -3
- package/f-draggable/f-draggable-data-context.d.ts +1 -0
- package/f-draggable/node/node.prepare-drag-sequence.d.ts +2 -3
- package/f-draggable/node/providers.d.ts +1 -1
- package/f-draggable/selection-area/providers.d.ts +1 -1
- package/f-draggable/single-select/single-select.on-pointer-down.d.ts +11 -6
- package/f-flow.module.d.ts +14 -13
- package/f-group/f-group-base.d.ts +12 -0
- package/f-group/f-group.directive.d.ts +21 -0
- package/f-group/index.d.ts +3 -0
- package/f-group/is-group.d.ts +1 -0
- package/fesm2022/foblex-flow.mjs +283 -217
- package/fesm2022/foblex-flow.mjs.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/domain/update-connection-layer.handler.d.ts +0 -12
- package/domain/update-node-layer.handler.d.ts +0 -12
- package/esm2022/domain/update-connection-layer.handler.mjs +0 -29
- package/esm2022/domain/update-node-layer.handler.mjs +0 -29
- package/esm2022/f-connection/common/domain/f-path-builder-base.mjs +0 -3
- package/esm2022/f-connection/common/domain/f-path-builder-selector.mjs +0 -19
- package/esm2022/f-connection/common/domain/i-f-path-builder-request.mjs +0 -2
- package/esm2022/f-connection/common/domain/i-f-path-builder-response.mjs +0 -2
- package/f-connection/common/domain/f-path-builder-base.d.ts +0 -6
- package/f-connection/common/domain/f-path-builder-selector.d.ts +0 -7
- package/f-connection/common/domain/i-f-path-builder-response.d.ts +0 -5
package/fesm2022/foblex-flow.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Component, ChangeDetectionStrategy, Input, Directive, Injectable, ContentChild, Inject, ViewChild,
|
|
2
|
+
import { InjectionToken, Component, ChangeDetectionStrategy, Input, Directive, Injectable, ContentChild, Inject, ViewChild, Optional, ContentChildren, SkipSelf, EventEmitter, Output, NgModule } from '@angular/core';
|
|
3
3
|
import { TransformModelExtensions, DomElementExtensions, PointExtensions, RectExtensions, BooleanExtensions, sanitizeElementId, Point, GuidExtensions, VectorExtensions, EventExtensions, mixinChangePosition, mixinFitToParent, mixinOneToOneCentering, mixinChangeZoom, MouseEventExtensions, IMouseEvent, ITouchDownEvent, ITouchMoveEvent, ITouchUpEvent, SizeExtensions } from '@foblex/core';
|
|
4
4
|
import { Subject, Observable, Subscription, startWith, debounceTime } from 'rxjs';
|
|
5
|
-
import * as
|
|
5
|
+
import * as i3 from '@angular/common';
|
|
6
6
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
7
7
|
import { __decorate } from 'tslib';
|
|
8
8
|
|
|
9
9
|
const F_BACKGROUND_PATTERN = new InjectionToken('F_BACKGROUND_PATTERN');
|
|
10
10
|
|
|
11
|
-
let uniqueId$
|
|
11
|
+
let uniqueId$a = 0;
|
|
12
12
|
class FCellPatternComponent {
|
|
13
13
|
get hostElement() {
|
|
14
14
|
return this.elementReference.nativeElement;
|
|
@@ -16,7 +16,7 @@ class FCellPatternComponent {
|
|
|
16
16
|
constructor(elementReference, changeDetectorRef) {
|
|
17
17
|
this.elementReference = elementReference;
|
|
18
18
|
this.changeDetectorRef = changeDetectorRef;
|
|
19
|
-
this.id = `f-pattern-${uniqueId$
|
|
19
|
+
this.id = `f-pattern-${uniqueId$a++}`;
|
|
20
20
|
this.verticalLineColor = 'rgba(0,0,0,0.1)';
|
|
21
21
|
this.horizontalLineColor = 'rgba(0,0,0,0.1)';
|
|
22
22
|
this.transform = TransformModelExtensions.default();
|
|
@@ -107,6 +107,7 @@ class FComponentsStore {
|
|
|
107
107
|
constructor() {
|
|
108
108
|
this.changes = new Subject();
|
|
109
109
|
this.fNodes = [];
|
|
110
|
+
this.fGroups = [];
|
|
110
111
|
this.fConnections = [];
|
|
111
112
|
this.fOutputs = [];
|
|
112
113
|
this.fInputs = [];
|
|
@@ -161,6 +162,14 @@ class FComponentsStore {
|
|
|
161
162
|
this.fConnections = this.fConnections.filter(c => c !== connection);
|
|
162
163
|
this.changes.next();
|
|
163
164
|
}
|
|
165
|
+
addGroup(group) {
|
|
166
|
+
this.fGroups.push(group);
|
|
167
|
+
this.changes.next();
|
|
168
|
+
}
|
|
169
|
+
removeGroup(group) {
|
|
170
|
+
this.fGroups = this.fGroups.filter(n => n !== group);
|
|
171
|
+
this.changes.next();
|
|
172
|
+
}
|
|
164
173
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FComponentsStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
165
174
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FComponentsStore }); }
|
|
166
175
|
}
|
|
@@ -168,7 +177,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
168
177
|
type: Injectable
|
|
169
178
|
}] });
|
|
170
179
|
|
|
171
|
-
let uniqueId$
|
|
180
|
+
let uniqueId$9 = 0;
|
|
172
181
|
class FBackgroundComponent extends FBackgroundBase {
|
|
173
182
|
get hostElement() {
|
|
174
183
|
return this.elementReference.nativeElement;
|
|
@@ -186,7 +195,7 @@ class FBackgroundComponent extends FBackgroundBase {
|
|
|
186
195
|
const pattern = children.length ? children[0] : undefined;
|
|
187
196
|
if (pattern) {
|
|
188
197
|
const defs = DomElementExtensions.createSvgElement('defs');
|
|
189
|
-
pattern.id = 'f-background-marker-' + uniqueId$
|
|
198
|
+
pattern.id = 'f-background-marker-' + uniqueId$9++;
|
|
190
199
|
this.fBackgroundPattern?.hostElement.remove();
|
|
191
200
|
defs.appendChild(pattern);
|
|
192
201
|
this.hostElement?.firstChild?.appendChild(defs);
|
|
@@ -288,9 +297,6 @@ class CalculateConnectionCenterRequest {
|
|
|
288
297
|
}
|
|
289
298
|
}
|
|
290
299
|
|
|
291
|
-
class FPathBuilderBase {
|
|
292
|
-
}
|
|
293
|
-
|
|
294
300
|
var EFConnectableSide;
|
|
295
301
|
(function (EFConnectableSide) {
|
|
296
302
|
EFConnectableSide["LEFT"] = "left";
|
|
@@ -386,7 +392,7 @@ function castToConnectableSide(type) {
|
|
|
386
392
|
return result;
|
|
387
393
|
}
|
|
388
394
|
|
|
389
|
-
let uniqueId$
|
|
395
|
+
let uniqueId$8 = 0;
|
|
390
396
|
class FNodeInputDirective extends FNodeInputBase {
|
|
391
397
|
get disabled() {
|
|
392
398
|
return this.isDisabled;
|
|
@@ -412,7 +418,7 @@ class FNodeInputDirective extends FNodeInputBase {
|
|
|
412
418
|
this.elementReference = elementReference;
|
|
413
419
|
this.fNode = fNode;
|
|
414
420
|
this.fComponentsStore = fComponentsStore;
|
|
415
|
-
this.id = `f-node-input-${uniqueId$
|
|
421
|
+
this.id = `f-node-input-${uniqueId$8++}`;
|
|
416
422
|
this.multiple = true;
|
|
417
423
|
this.isDisabled = false;
|
|
418
424
|
this._fConnectableSide = EFConnectableSide.AUTO;
|
|
@@ -491,7 +497,7 @@ function isNodeOutlet(element) {
|
|
|
491
497
|
return !!element.closest('[fNodeOutlet]');
|
|
492
498
|
}
|
|
493
499
|
|
|
494
|
-
let uniqueId$
|
|
500
|
+
let uniqueId$7 = 0;
|
|
495
501
|
class FNodeOutletDirective extends FNodeOutletBase {
|
|
496
502
|
get disabled() {
|
|
497
503
|
return this.isDisabled;
|
|
@@ -511,7 +517,7 @@ class FNodeOutletDirective extends FNodeOutletBase {
|
|
|
511
517
|
this.elementReference = elementReference;
|
|
512
518
|
this.fNode = fNode;
|
|
513
519
|
this.fComponentsStore = fComponentsStore;
|
|
514
|
-
this.id = `f-node-outlet-${uniqueId$
|
|
520
|
+
this.id = `f-node-outlet-${uniqueId$7++}`;
|
|
515
521
|
this.isDisabled = false;
|
|
516
522
|
this.fConnectableSide = EFConnectableSide.AUTO;
|
|
517
523
|
this._fConnectableSide = EFConnectableSide.AUTO;
|
|
@@ -574,7 +580,7 @@ function isNodeOutput(element) {
|
|
|
574
580
|
return !!element.closest('[fNodeOutput]');
|
|
575
581
|
}
|
|
576
582
|
|
|
577
|
-
let uniqueId$
|
|
583
|
+
let uniqueId$6 = 0;
|
|
578
584
|
class FNodeOutputDirective extends FNodeOutputBase {
|
|
579
585
|
get disabled() {
|
|
580
586
|
return this.isDisabled;
|
|
@@ -600,7 +606,7 @@ class FNodeOutputDirective extends FNodeOutputBase {
|
|
|
600
606
|
this.elementReference = elementReference;
|
|
601
607
|
this.fNode = fNode;
|
|
602
608
|
this.fComponentsStore = fComponentsStore;
|
|
603
|
-
this.id = `f-node-output-${uniqueId$
|
|
609
|
+
this.id = `f-node-output-${uniqueId$6++}`;
|
|
604
610
|
this.multiple = false;
|
|
605
611
|
this.isDisabled = false;
|
|
606
612
|
this._fConnectableSide = EFConnectableSide.AUTO;
|
|
@@ -656,7 +662,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
656
662
|
type: Input
|
|
657
663
|
}] } });
|
|
658
664
|
|
|
659
|
-
class FBezierPathBuilder
|
|
665
|
+
class FBezierPathBuilder {
|
|
660
666
|
static getConnectorOffset(distance, offset) {
|
|
661
667
|
if (distance >= offset) {
|
|
662
668
|
return distance;
|
|
@@ -686,24 +692,8 @@ class FBezierPathBuilder extends FPathBuilderBase {
|
|
|
686
692
|
const sourceAnglePoint = FBezierPathBuilder.getAnglePoint(sourceSide, source, target, offset);
|
|
687
693
|
const targetAnglePoint = FBezierPathBuilder.getAnglePoint(targetSide, target, source, offset);
|
|
688
694
|
const path = `M ${source.x} ${source.y} C ${sourceAnglePoint.x} ${sourceAnglePoint.y}, ${targetAnglePoint.x} ${targetAnglePoint.y}, ${target.x + 0.0001} ${target.y + 0.0001}`;
|
|
689
|
-
const
|
|
690
|
-
return { path,
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
var EFConnectionType;
|
|
695
|
-
(function (EFConnectionType) {
|
|
696
|
-
EFConnectionType["SEGMENT"] = "segment";
|
|
697
|
-
EFConnectionType["STRAIGHT"] = "straight";
|
|
698
|
-
EFConnectionType["BEZIER"] = "bezier";
|
|
699
|
-
})(EFConnectionType || (EFConnectionType = {}));
|
|
700
|
-
|
|
701
|
-
class FStraightPathBuilder extends FPathBuilderBase {
|
|
702
|
-
handle(request) {
|
|
703
|
-
const { source, target } = request;
|
|
704
|
-
const path = `M ${source.x} ${source.y} L ${target.x + 0.0001} ${target.y + 0.0001}`;
|
|
705
|
-
const center = new CalculateConnectionCenterHandler().handle(new CalculateConnectionCenterRequest([source, target]));
|
|
706
|
-
return { path, center };
|
|
695
|
+
const connectionCenter = new CalculateConnectionCenterHandler().handle(new CalculateConnectionCenterRequest([source, sourceAnglePoint, targetAnglePoint, target]));
|
|
696
|
+
return { path, connectionCenter };
|
|
707
697
|
}
|
|
708
698
|
}
|
|
709
699
|
|
|
@@ -714,12 +704,12 @@ const CONNECTOR_SIDE_POINT = {
|
|
|
714
704
|
[EFConnectableSide.BOTTOM]: PointExtensions.initialize(0, 1),
|
|
715
705
|
[EFConnectableSide.AUTO]: PointExtensions.initialize(0, 0),
|
|
716
706
|
};
|
|
717
|
-
class FSegmentPathBuilder
|
|
707
|
+
class FSegmentPathBuilder {
|
|
718
708
|
handle(request) {
|
|
719
709
|
const { source, sourceSide, target, targetSide } = request;
|
|
720
710
|
const { points, center } = this.getPathPoints(source, sourceSide, target, targetSide, request.offset);
|
|
721
711
|
const path = this.buildPath(points, request.radius);
|
|
722
|
-
return { path, center };
|
|
712
|
+
return { path, connectionCenter: center };
|
|
723
713
|
}
|
|
724
714
|
getPathPoints(source, sourceSide, target, targetSide, offset) {
|
|
725
715
|
const sourceDirection = CONNECTOR_SIDE_POINT[sourceSide];
|
|
@@ -844,17 +834,12 @@ class FSegmentPathBuilder extends FPathBuilderBase {
|
|
|
844
834
|
}
|
|
845
835
|
}
|
|
846
836
|
|
|
847
|
-
class
|
|
848
|
-
constructor() {
|
|
849
|
-
super(...arguments);
|
|
850
|
-
this.builders = {
|
|
851
|
-
[EFConnectionType.STRAIGHT]: new FStraightPathBuilder(),
|
|
852
|
-
[EFConnectionType.BEZIER]: new FBezierPathBuilder(),
|
|
853
|
-
[EFConnectionType.SEGMENT]: new FSegmentPathBuilder(),
|
|
854
|
-
};
|
|
855
|
-
}
|
|
837
|
+
class FStraightPathBuilder {
|
|
856
838
|
handle(request) {
|
|
857
|
-
|
|
839
|
+
const { source, target } = request;
|
|
840
|
+
const path = `M ${source.x} ${source.y} L ${target.x + 0.0001} ${target.y + 0.0001}`;
|
|
841
|
+
const connectionCenter = new CalculateConnectionCenterHandler().handle(new CalculateConnectionCenterRequest([source, target]));
|
|
842
|
+
return { path, connectionCenter };
|
|
858
843
|
}
|
|
859
844
|
}
|
|
860
845
|
|
|
@@ -1256,6 +1241,7 @@ function mixinChangeConnectionSelection(base) {
|
|
|
1256
1241
|
}
|
|
1257
1242
|
constructor(...args) {
|
|
1258
1243
|
super(...args);
|
|
1244
|
+
this.fSelectionDisabled = false;
|
|
1259
1245
|
}
|
|
1260
1246
|
};
|
|
1261
1247
|
}
|
|
@@ -1274,18 +1260,50 @@ function mixinChangeConnectionVisibility(base) {
|
|
|
1274
1260
|
};
|
|
1275
1261
|
}
|
|
1276
1262
|
|
|
1263
|
+
const F_CONNECTION_BUILDERS = new InjectionToken('F_CONNECTION_BUILDERS');
|
|
1264
|
+
|
|
1265
|
+
class FConnectionFactory {
|
|
1266
|
+
constructor(builders) {
|
|
1267
|
+
this.builders = {
|
|
1268
|
+
[EFConnectionType.STRAIGHT]: new FStraightPathBuilder(),
|
|
1269
|
+
[EFConnectionType.BEZIER]: new FBezierPathBuilder(),
|
|
1270
|
+
[EFConnectionType.SEGMENT]: new FSegmentPathBuilder(),
|
|
1271
|
+
};
|
|
1272
|
+
if (builders) {
|
|
1273
|
+
this.builders = { ...this.builders, ...builders };
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
handle(request) {
|
|
1277
|
+
const builder = this.builders[request.type];
|
|
1278
|
+
if (!builder) {
|
|
1279
|
+
throw new Error(`FConnectionBuilder not found for type ${request.type}`);
|
|
1280
|
+
}
|
|
1281
|
+
return builder.handle(request.payload);
|
|
1282
|
+
}
|
|
1283
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FConnectionFactory, deps: [{ token: F_CONNECTION_BUILDERS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1284
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FConnectionFactory }); }
|
|
1285
|
+
}
|
|
1286
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FConnectionFactory, decorators: [{
|
|
1287
|
+
type: Injectable
|
|
1288
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1289
|
+
type: Optional
|
|
1290
|
+
}, {
|
|
1291
|
+
type: Inject,
|
|
1292
|
+
args: [F_CONNECTION_BUILDERS]
|
|
1293
|
+
}] }] });
|
|
1294
|
+
|
|
1277
1295
|
const MIXIN_BASE$1 = mixinChangeConnectionSelection(mixinChangeConnectionVisibility(class {
|
|
1278
1296
|
constructor(hostElement) {
|
|
1279
1297
|
this.hostElement = hostElement;
|
|
1280
1298
|
}
|
|
1281
1299
|
}));
|
|
1282
1300
|
class FConnectionBase extends MIXIN_BASE$1 {
|
|
1283
|
-
constructor(elementReference) {
|
|
1301
|
+
constructor(elementReference, connectionFactory) {
|
|
1284
1302
|
super(elementReference.nativeElement);
|
|
1303
|
+
this.connectionFactory = connectionFactory;
|
|
1285
1304
|
this.path = '';
|
|
1286
1305
|
this.vector = VectorExtensions.initialize();
|
|
1287
1306
|
this.stateChanges = new Subject();
|
|
1288
|
-
this.fPathBuilder = new FPathBuilderSelector();
|
|
1289
1307
|
}
|
|
1290
1308
|
initialize() {
|
|
1291
1309
|
this.fPath.initialize();
|
|
@@ -1303,17 +1321,19 @@ class FConnectionBase extends MIXIN_BASE$1 {
|
|
|
1303
1321
|
}
|
|
1304
1322
|
setVector(from, fromSide, to, toSide) {
|
|
1305
1323
|
this.vector = { point1: from, point2: to };
|
|
1306
|
-
const pathResult = this.
|
|
1324
|
+
const pathResult = this.connectionFactory.handle({
|
|
1307
1325
|
type: this.fType,
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1326
|
+
payload: {
|
|
1327
|
+
source: from,
|
|
1328
|
+
sourceSide: fromSide,
|
|
1329
|
+
target: to,
|
|
1330
|
+
targetSide: toSide,
|
|
1331
|
+
radius: 8,
|
|
1332
|
+
offset: 32
|
|
1333
|
+
}
|
|
1314
1334
|
});
|
|
1315
1335
|
this.path = pathResult.path;
|
|
1316
|
-
const transform = `position: absolute; pointerEvents: all; transform: translate(-50%, -50%); left: ${pathResult.
|
|
1336
|
+
const transform = `position: absolute; pointerEvents: all; transform: translate(-50%, -50%); left: ${pathResult.connectionCenter.x}px; top: ${pathResult.connectionCenter.y}px`;
|
|
1317
1337
|
this.fConnectionCenter?.nativeElement?.setAttribute('style', transform);
|
|
1318
1338
|
}
|
|
1319
1339
|
setMarkers() {
|
|
@@ -1348,12 +1368,12 @@ class FConnectionBase extends MIXIN_BASE$1 {
|
|
|
1348
1368
|
this.fDragHandle.redraw(this.vector.point2);
|
|
1349
1369
|
this.fTextComponent.redraw(this.vector);
|
|
1350
1370
|
}
|
|
1351
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FConnectionBase, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1371
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FConnectionBase, deps: [{ token: i0.ElementRef }, { token: FConnectionFactory }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1352
1372
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.1", type: FConnectionBase, usesInheritance: true, ngImport: i0 }); }
|
|
1353
1373
|
}
|
|
1354
1374
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FConnectionBase, decorators: [{
|
|
1355
1375
|
type: Directive
|
|
1356
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
|
1376
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: FConnectionFactory }] });
|
|
1357
1377
|
|
|
1358
1378
|
var EFConnectionBehavior;
|
|
1359
1379
|
(function (EFConnectionBehavior) {
|
|
@@ -1370,6 +1390,13 @@ function castToConnectionBehavior(behavior) {
|
|
|
1370
1390
|
return result;
|
|
1371
1391
|
}
|
|
1372
1392
|
|
|
1393
|
+
var EFConnectionType;
|
|
1394
|
+
(function (EFConnectionType) {
|
|
1395
|
+
EFConnectionType["SEGMENT"] = "segment";
|
|
1396
|
+
EFConnectionType["STRAIGHT"] = "straight";
|
|
1397
|
+
EFConnectionType["BEZIER"] = "bezier";
|
|
1398
|
+
})(EFConnectionType || (EFConnectionType = {}));
|
|
1399
|
+
|
|
1373
1400
|
function castToConnectionType(type) {
|
|
1374
1401
|
const result = EFConnectionType[type.toUpperCase()];
|
|
1375
1402
|
if (result === undefined) {
|
|
@@ -1389,7 +1416,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
1389
1416
|
}]
|
|
1390
1417
|
}] });
|
|
1391
1418
|
|
|
1392
|
-
let uniqueId$
|
|
1419
|
+
let uniqueId$5 = 0;
|
|
1393
1420
|
class FConnectionForCreateComponent extends FConnectionBase {
|
|
1394
1421
|
set fBehavior(value) {
|
|
1395
1422
|
this._behavior = castToConnectionBehavior(value);
|
|
@@ -1398,7 +1425,7 @@ class FConnectionForCreateComponent extends FConnectionBase {
|
|
|
1398
1425
|
return this._behavior;
|
|
1399
1426
|
}
|
|
1400
1427
|
set fType(value) {
|
|
1401
|
-
this._type =
|
|
1428
|
+
this._type = value;
|
|
1402
1429
|
}
|
|
1403
1430
|
get fType() {
|
|
1404
1431
|
return this._type;
|
|
@@ -1406,10 +1433,10 @@ class FConnectionForCreateComponent extends FConnectionBase {
|
|
|
1406
1433
|
get boundingElement() {
|
|
1407
1434
|
return this.fPath.hostElement;
|
|
1408
1435
|
}
|
|
1409
|
-
constructor(elementReference, fComponentsStore) {
|
|
1410
|
-
super(elementReference);
|
|
1436
|
+
constructor(elementReference, fConnectionFactory, fComponentsStore) {
|
|
1437
|
+
super(elementReference, fConnectionFactory);
|
|
1411
1438
|
this.fComponentsStore = fComponentsStore;
|
|
1412
|
-
this.fConnectionId = `f-connection-for-create-${uniqueId$
|
|
1439
|
+
this.fConnectionId = `f-connection-for-create-${uniqueId$5++}`;
|
|
1413
1440
|
this.fText = '';
|
|
1414
1441
|
this.fStartColor = 'black';
|
|
1415
1442
|
this.fEndColor = 'black';
|
|
@@ -1427,15 +1454,15 @@ class FConnectionForCreateComponent extends FConnectionBase {
|
|
|
1427
1454
|
ngOnDestroy() {
|
|
1428
1455
|
this.fComponentsStore.fTempConnection = undefined;
|
|
1429
1456
|
}
|
|
1430
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FConnectionForCreateComponent, deps: [{ token: i0.ElementRef }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1431
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.1", type: FConnectionForCreateComponent, selector: "f-connection-for-create", inputs: { fStartColor: "fStartColor", fEndColor: "fEndColor", fBehavior: "fBehavior", fType: "fType" }, host: { classAttribute: "f-component f-connection f-connection-for-create" }, providers: [{ provide: F_CONNECTION, useExisting: FConnectionForCreateComponent }], queries: [{ propertyName: "fMarkers", predicate: F_MARKER, descendants: true }, { propertyName: "fConnectionCenters", predicate: FConnectionCenterDirective, descendants: true }], viewQueries: [{ propertyName: "fDefs", first: true, predicate: ["defs"], descendants: true, static: true }, { propertyName: "fPath", first: true, predicate: CONNECTION_PATH, descendants: true, static: true }, { propertyName: "fGradient", first: true, predicate: CONNECTION_GRADIENT, descendants: true, static: true }, { propertyName: "fDragHandle", first: true, predicate: FConnectionDragHandleComponent, descendants: true, static: true }, { propertyName: "fSelection", first: true, predicate: FConnectionSelectionComponent, descendants: true, static: true }, { propertyName: "fTextComponent", first: true, predicate: CONNECTION_TEXT, descendants: true, static: true }, { propertyName: "fConnectionCenter", first: true, predicate: ["fConnectionCenter"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\">\n <defs #defs></defs>\n <g class=\"f-connection-group\">\n <linearGradient fConnectionGradient></linearGradient>\n <path fConnectionSelection [attr.d]=\"path\"></path>\n <g>\n <path f-connection-path\n [attr.d]=\"path\">\n </path>\n <circle f-connection-drag-handle r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n <ng-content></ng-content>\n</svg>\n<div #fConnectionCenter class=\"f-connection-center\" *ngIf=\"fConnectionCenters.length\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n</div>\n", styles: [":host{pointer-events:none;position:absolute}:host svg{overflow:visible}:host svg .f-connection-group{pointer-events:all}\n"], dependencies: [{ kind: "directive", type:
|
|
1457
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FConnectionForCreateComponent, deps: [{ token: i0.ElementRef }, { token: FConnectionFactory }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1458
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.1", type: FConnectionForCreateComponent, selector: "f-connection-for-create", inputs: { fStartColor: "fStartColor", fEndColor: "fEndColor", fBehavior: "fBehavior", fType: "fType" }, host: { classAttribute: "f-component f-connection f-connection-for-create" }, providers: [{ provide: F_CONNECTION, useExisting: FConnectionForCreateComponent }], queries: [{ propertyName: "fMarkers", predicate: F_MARKER, descendants: true }, { propertyName: "fConnectionCenters", predicate: FConnectionCenterDirective, descendants: true }], viewQueries: [{ propertyName: "fDefs", first: true, predicate: ["defs"], descendants: true, static: true }, { propertyName: "fPath", first: true, predicate: CONNECTION_PATH, descendants: true, static: true }, { propertyName: "fGradient", first: true, predicate: CONNECTION_GRADIENT, descendants: true, static: true }, { propertyName: "fDragHandle", first: true, predicate: FConnectionDragHandleComponent, descendants: true, static: true }, { propertyName: "fSelection", first: true, predicate: FConnectionSelectionComponent, descendants: true, static: true }, { propertyName: "fTextComponent", first: true, predicate: CONNECTION_TEXT, descendants: true, static: true }, { propertyName: "fConnectionCenter", first: true, predicate: ["fConnectionCenter"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\">\n <defs #defs></defs>\n <g class=\"f-connection-group\">\n <linearGradient fConnectionGradient></linearGradient>\n <path fConnectionSelection [attr.d]=\"path\"></path>\n <g>\n <path f-connection-path\n [attr.d]=\"path\">\n </path>\n <circle f-connection-drag-handle r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n <ng-content></ng-content>\n</svg>\n<div #fConnectionCenter class=\"f-connection-center\" *ngIf=\"fConnectionCenters.length\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n</div>\n", styles: [":host{pointer-events:none;position:absolute}:host svg{overflow:visible}:host svg .f-connection-group{pointer-events:all}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FConnectionDragHandleComponent, selector: "circle[f-connection-drag-handle]" }, { kind: "component", type: FConnectionGradientComponent, selector: "linearGradient[fConnectionGradient]" }, { kind: "component", type: FConnectionPathComponent, selector: "path[f-connection-path]" }, { kind: "component", type: FConnectionTextComponent, selector: "text[f-connection-text]" }, { kind: "component", type: FConnectionSelectionComponent, selector: "path[fConnectionSelection]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1432
1459
|
}
|
|
1433
1460
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FConnectionForCreateComponent, decorators: [{
|
|
1434
1461
|
type: Component,
|
|
1435
1462
|
args: [{ selector: "f-connection-for-create", changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
1436
1463
|
class: "f-component f-connection f-connection-for-create"
|
|
1437
1464
|
}, providers: [{ provide: F_CONNECTION, useExisting: FConnectionForCreateComponent }], template: "<svg xmlns=\"http://www.w3.org/2000/svg\">\n <defs #defs></defs>\n <g class=\"f-connection-group\">\n <linearGradient fConnectionGradient></linearGradient>\n <path fConnectionSelection [attr.d]=\"path\"></path>\n <g>\n <path f-connection-path\n [attr.d]=\"path\">\n </path>\n <circle f-connection-drag-handle r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n <ng-content></ng-content>\n</svg>\n<div #fConnectionCenter class=\"f-connection-center\" *ngIf=\"fConnectionCenters.length\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n</div>\n", styles: [":host{pointer-events:none;position:absolute}:host svg{overflow:visible}:host svg .f-connection-group{pointer-events:all}\n"] }]
|
|
1438
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: FComponentsStore }], propDecorators: { fStartColor: [{
|
|
1465
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: FConnectionFactory }, { type: FComponentsStore }], propDecorators: { fStartColor: [{
|
|
1439
1466
|
type: Input
|
|
1440
1467
|
}], fEndColor: [{
|
|
1441
1468
|
type: Input
|
|
@@ -1472,7 +1499,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
1472
1499
|
args: [FConnectionCenterDirective, { descendants: true }]
|
|
1473
1500
|
}] } });
|
|
1474
1501
|
|
|
1475
|
-
let uniqueId$
|
|
1502
|
+
let uniqueId$4 = 0;
|
|
1476
1503
|
class FConnectionComponent extends FConnectionBase {
|
|
1477
1504
|
set fBehavior(value) {
|
|
1478
1505
|
this._behavior = castToConnectionBehavior(value);
|
|
@@ -1481,7 +1508,7 @@ class FConnectionComponent extends FConnectionBase {
|
|
|
1481
1508
|
return this._behavior;
|
|
1482
1509
|
}
|
|
1483
1510
|
set fType(value) {
|
|
1484
|
-
this._type =
|
|
1511
|
+
this._type = value;
|
|
1485
1512
|
}
|
|
1486
1513
|
get fType() {
|
|
1487
1514
|
return this._type;
|
|
@@ -1489,10 +1516,10 @@ class FConnectionComponent extends FConnectionBase {
|
|
|
1489
1516
|
get boundingElement() {
|
|
1490
1517
|
return this.fPath.hostElement;
|
|
1491
1518
|
}
|
|
1492
|
-
constructor(elementReference, fComponentsStore) {
|
|
1493
|
-
super(elementReference);
|
|
1519
|
+
constructor(elementReference, fConnectionFactory, fComponentsStore) {
|
|
1520
|
+
super(elementReference, fConnectionFactory);
|
|
1494
1521
|
this.fComponentsStore = fComponentsStore;
|
|
1495
|
-
this.fConnectionId = `f-connection-${uniqueId$
|
|
1522
|
+
this.fConnectionId = `f-connection-${uniqueId$4++}`;
|
|
1496
1523
|
this.fText = '';
|
|
1497
1524
|
this.fStartColor = 'black';
|
|
1498
1525
|
this.fEndColor = 'black';
|
|
@@ -1507,8 +1534,8 @@ class FConnectionComponent extends FConnectionBase {
|
|
|
1507
1534
|
ngOnDestroy() {
|
|
1508
1535
|
this.fComponentsStore.removeConnection(this);
|
|
1509
1536
|
}
|
|
1510
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FConnectionComponent, deps: [{ token: i0.ElementRef }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1511
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.1", type: FConnectionComponent, selector: "f-connection", inputs: { fConnectionId: "fConnectionId", fText: "fText", fStartColor: "fStartColor", fEndColor: "fEndColor", fOutputId: "fOutputId", fInputId: "fInputId", fBehavior: "fBehavior", fType: "fType", fDraggingDisabled: ["fReassignDisabled", "fDraggingDisabled"], fSelectionDisabled: "fSelectionDisabled" }, host: { properties: { "attr.id": "fConnectionId", "class.f-connection-selection-disabled": "fSelectionDisabled", "class.f-connection-reassign-disabled": "fDraggingDisabled" }, classAttribute: "f-component f-connection" }, providers: [{ provide: F_CONNECTION, useExisting: FConnectionComponent }], queries: [{ propertyName: "fMarkers", predicate: F_MARKER, descendants: true }, { propertyName: "fConnectionCenters", predicate: FConnectionCenterDirective, descendants: true }], viewQueries: [{ propertyName: "fDefs", first: true, predicate: ["defs"], descendants: true, static: true }, { propertyName: "fPath", first: true, predicate: CONNECTION_PATH, descendants: true, static: true }, { propertyName: "fGradient", first: true, predicate: CONNECTION_GRADIENT, descendants: true, static: true }, { propertyName: "fDragHandle", first: true, predicate: FConnectionDragHandleComponent, descendants: true, static: true }, { propertyName: "fSelection", first: true, predicate: FConnectionSelectionComponent, descendants: true, static: true }, { propertyName: "fTextComponent", first: true, predicate: CONNECTION_TEXT, descendants: true, static: true }, { propertyName: "fConnectionCenter", first: true, predicate: ["fConnectionCenter"], descendants: true }], exportAs: ["fComponent"], usesInheritance: true, ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"overflow: visible; display: block; vertical-align: middle;\">\n <defs #defs></defs>\n <g class=\"f-connection-group\">\n <linearGradient fConnectionGradient></linearGradient>\n <path fConnectionSelection [attr.d]=\"path\"></path>\n <g>\n <path f-connection-path
|
|
1537
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FConnectionComponent, deps: [{ token: i0.ElementRef }, { token: FConnectionFactory }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1538
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.1", type: FConnectionComponent, selector: "f-connection", inputs: { fConnectionId: "fConnectionId", fText: "fText", fStartColor: "fStartColor", fEndColor: "fEndColor", fOutputId: "fOutputId", fInputId: "fInputId", fBehavior: "fBehavior", fType: "fType", fDraggingDisabled: ["fReassignDisabled", "fDraggingDisabled"], fSelectionDisabled: "fSelectionDisabled" }, host: { properties: { "attr.id": "fConnectionId", "class.f-connection-selection-disabled": "fSelectionDisabled", "class.f-connection-reassign-disabled": "fDraggingDisabled" }, classAttribute: "f-component f-connection" }, providers: [{ provide: F_CONNECTION, useExisting: FConnectionComponent }], queries: [{ propertyName: "fMarkers", predicate: F_MARKER, descendants: true }, { propertyName: "fConnectionCenters", predicate: FConnectionCenterDirective, descendants: true }], viewQueries: [{ propertyName: "fDefs", first: true, predicate: ["defs"], descendants: true, static: true }, { propertyName: "fPath", first: true, predicate: CONNECTION_PATH, descendants: true, static: true }, { propertyName: "fGradient", first: true, predicate: CONNECTION_GRADIENT, descendants: true, static: true }, { propertyName: "fDragHandle", first: true, predicate: FConnectionDragHandleComponent, descendants: true, static: true }, { propertyName: "fSelection", first: true, predicate: FConnectionSelectionComponent, descendants: true, static: true }, { propertyName: "fTextComponent", first: true, predicate: CONNECTION_TEXT, descendants: true, static: true }, { propertyName: "fConnectionCenter", first: true, predicate: ["fConnectionCenter"], descendants: true }], exportAs: ["fComponent"], usesInheritance: true, ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"overflow: visible; display: block; vertical-align: middle;\">\n <defs #defs></defs>\n <g class=\"f-connection-group\">\n <linearGradient fConnectionGradient></linearGradient>\n <path fConnectionSelection [attr.d]=\"path\"></path>\n <g>\n <path f-connection-path [attr.d]=\"path\">\n </path>\n <circle f-connection-drag-handle r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n <ng-content></ng-content>\n</svg>\n<div #fConnectionCenter class=\"f-connection-center\" *ngIf=\"fConnectionCenters.length\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n</div>\n", styles: [":host{pointer-events:none;position:absolute}:host svg{overflow:visible}:host svg .f-connection-group{pointer-events:all}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FConnectionDragHandleComponent, selector: "circle[f-connection-drag-handle]" }, { kind: "component", type: FConnectionGradientComponent, selector: "linearGradient[fConnectionGradient]" }, { kind: "component", type: FConnectionPathComponent, selector: "path[f-connection-path]" }, { kind: "component", type: FConnectionTextComponent, selector: "text[f-connection-text]" }, { kind: "component", type: FConnectionSelectionComponent, selector: "path[fConnectionSelection]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1512
1539
|
}
|
|
1513
1540
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FConnectionComponent, decorators: [{
|
|
1514
1541
|
type: Component,
|
|
@@ -1517,8 +1544,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
1517
1544
|
class: "f-component f-connection",
|
|
1518
1545
|
'[class.f-connection-selection-disabled]': 'fSelectionDisabled',
|
|
1519
1546
|
'[class.f-connection-reassign-disabled]': 'fDraggingDisabled',
|
|
1520
|
-
}, providers: [{ provide: F_CONNECTION, useExisting: FConnectionComponent }], template: "<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"overflow: visible; display: block; vertical-align: middle;\">\n <defs #defs></defs>\n <g class=\"f-connection-group\">\n <linearGradient fConnectionGradient></linearGradient>\n <path fConnectionSelection [attr.d]=\"path\"></path>\n <g>\n <path f-connection-path
|
|
1521
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: FComponentsStore }], propDecorators: { fConnectionId: [{
|
|
1547
|
+
}, providers: [{ provide: F_CONNECTION, useExisting: FConnectionComponent }], template: "<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"overflow: visible; display: block; vertical-align: middle;\">\n <defs #defs></defs>\n <g class=\"f-connection-group\">\n <linearGradient fConnectionGradient></linearGradient>\n <path fConnectionSelection [attr.d]=\"path\"></path>\n <g>\n <path f-connection-path [attr.d]=\"path\">\n </path>\n <circle f-connection-drag-handle r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n <ng-content></ng-content>\n</svg>\n<div #fConnectionCenter class=\"f-connection-center\" *ngIf=\"fConnectionCenters.length\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n</div>\n", styles: [":host{pointer-events:none;position:absolute}:host svg{overflow:visible}:host svg .f-connection-group{pointer-events:all}\n"] }]
|
|
1548
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: FConnectionFactory }, { type: FComponentsStore }], propDecorators: { fConnectionId: [{
|
|
1522
1549
|
type: Input
|
|
1523
1550
|
}], fText: [{
|
|
1524
1551
|
type: Input
|
|
@@ -1681,7 +1708,7 @@ class FResizeObserver extends Observable {
|
|
|
1681
1708
|
}
|
|
1682
1709
|
}
|
|
1683
1710
|
|
|
1684
|
-
let uniqueId$
|
|
1711
|
+
let uniqueId$3 = 0;
|
|
1685
1712
|
class FNodeDirective extends FNodeBase {
|
|
1686
1713
|
set position(value) {
|
|
1687
1714
|
this._position = PointExtensions.castToPoint(value);
|
|
@@ -1699,7 +1726,7 @@ class FNodeDirective extends FNodeBase {
|
|
|
1699
1726
|
this.renderer = renderer;
|
|
1700
1727
|
this.fComponentsStore = fComponentsStore;
|
|
1701
1728
|
this.subscriptions$ = new Subscription();
|
|
1702
|
-
this.fNodeId = `f-node-${uniqueId$
|
|
1729
|
+
this.fNodeId = `f-node-${uniqueId$3++}`;
|
|
1703
1730
|
this.positionChange = new EventEmitter();
|
|
1704
1731
|
this.fDraggingDisabled = false;
|
|
1705
1732
|
this.fSelectionDisabled = false;
|
|
@@ -2026,6 +2053,9 @@ class FDraggableDataContext {
|
|
|
2026
2053
|
this.onPointerDownPosition = new Point(0, 0);
|
|
2027
2054
|
this.isSelectedChanged = false;
|
|
2028
2055
|
}
|
|
2056
|
+
markSelectionAsChanged() {
|
|
2057
|
+
this.isSelectedChanged = true;
|
|
2058
|
+
}
|
|
2029
2059
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FDraggableDataContext, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2030
2060
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FDraggableDataContext }); }
|
|
2031
2061
|
}
|
|
@@ -2150,9 +2180,10 @@ class CreateConnectionDragHandler {
|
|
|
2150
2180
|
}
|
|
2151
2181
|
|
|
2152
2182
|
class FCreateConnectionEvent {
|
|
2153
|
-
constructor(fOutputId, fInputId) {
|
|
2183
|
+
constructor(fOutputId, fInputId, fDropPosition) {
|
|
2154
2184
|
this.fOutputId = fOutputId;
|
|
2155
2185
|
this.fInputId = fInputId;
|
|
2186
|
+
this.fDropPosition = fDropPosition;
|
|
2156
2187
|
}
|
|
2157
2188
|
}
|
|
2158
2189
|
|
|
@@ -2287,23 +2318,21 @@ class CreateConnectionOnPointerUp {
|
|
|
2287
2318
|
if (isCreateConnection) {
|
|
2288
2319
|
const handler = this.fDraggableDataContext.draggableItems[0];
|
|
2289
2320
|
const inputsUnderPointer = this.findInputsUnderPointerHandler.handle(new FindInputsUnderPointerRequest(event, handler));
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2321
|
+
let output = this.fComponentsStore.fOutputs.find((x) => x.id === handler.connection.fOutputId);
|
|
2322
|
+
if (!output) {
|
|
2323
|
+
output = this.fComponentsStore.fOutlets.find((x) => x.id === handler.connection.fOutputId);
|
|
2324
|
+
}
|
|
2325
|
+
if (!output) {
|
|
2326
|
+
throw OutputNotFound(handler.connection.fOutputId);
|
|
2327
|
+
}
|
|
2328
|
+
const isOutlet = isNodeOutlet(output.hostElement);
|
|
2329
|
+
if (isOutlet) {
|
|
2330
|
+
output = this.findFirstCanBeConnectedOutputByOutletHandler.handle(output);
|
|
2295
2331
|
if (!output) {
|
|
2296
|
-
throw
|
|
2332
|
+
throw RequiredOutput();
|
|
2297
2333
|
}
|
|
2298
|
-
const isOutlet = isNodeOutlet(output.hostElement);
|
|
2299
|
-
if (isOutlet) {
|
|
2300
|
-
output = this.findFirstCanBeConnectedOutputByOutletHandler.handle(output);
|
|
2301
|
-
if (!output) {
|
|
2302
|
-
throw RequiredOutput();
|
|
2303
|
-
}
|
|
2304
|
-
}
|
|
2305
|
-
this.fComponentsStore.fDraggable?.fCreateConnection.emit(new FCreateConnectionEvent(output.id, inputsUnderPointer[0]?.id));
|
|
2306
2334
|
}
|
|
2335
|
+
this.fComponentsStore.fDraggable?.fCreateConnection.emit(new FCreateConnectionEvent(output.id, inputsUnderPointer[0]?.id, event.getPosition()));
|
|
2307
2336
|
handler.complete();
|
|
2308
2337
|
}
|
|
2309
2338
|
}
|
|
@@ -2466,12 +2495,11 @@ class ReassignConnectionPrepareDragSequence {
|
|
|
2466
2495
|
get flowHost() {
|
|
2467
2496
|
return this.fComponentsStore.fFlow.hostElement;
|
|
2468
2497
|
}
|
|
2469
|
-
constructor(fComponentsStore, fDraggableDataContext, getConnectionHandler, fMediator
|
|
2498
|
+
constructor(fComponentsStore, fDraggableDataContext, getConnectionHandler, fMediator) {
|
|
2470
2499
|
this.fComponentsStore = fComponentsStore;
|
|
2471
2500
|
this.fDraggableDataContext = fDraggableDataContext;
|
|
2472
2501
|
this.getConnectionHandler = getConnectionHandler;
|
|
2473
2502
|
this.fMediator = fMediator;
|
|
2474
|
-
this.updateConnectionLayerHandler = updateConnectionLayerHandler;
|
|
2475
2503
|
}
|
|
2476
2504
|
handle(event) {
|
|
2477
2505
|
const pointerPositionInFlow = Point.fromPoint(event.getPosition()).elementTransform(this.flowHost);
|
|
@@ -2488,7 +2516,7 @@ class ReassignConnectionPrepareDragSequence {
|
|
|
2488
2516
|
}
|
|
2489
2517
|
}
|
|
2490
2518
|
if (connectionToReassign && !this.fDraggableDataContext.draggableItems.length) {
|
|
2491
|
-
this.
|
|
2519
|
+
this.fMediator.send(new UpdateItemLayerRequest(connectionToReassign, this.fComponentsStore.fCanvas.fConnectionsContainer.nativeElement));
|
|
2492
2520
|
this.fDraggableDataContext.onPointerDownScale = this.transform.scale;
|
|
2493
2521
|
this.fDraggableDataContext.onPointerDownPosition = pointerPositionInFlow.div(this.transform.scale);
|
|
2494
2522
|
this.fDraggableDataContext.draggableItems = [
|
|
@@ -2496,12 +2524,12 @@ class ReassignConnectionPrepareDragSequence {
|
|
|
2496
2524
|
];
|
|
2497
2525
|
}
|
|
2498
2526
|
}
|
|
2499
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ReassignConnectionPrepareDragSequence, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: GetConnectionHandler }, { token: FFlowMediator }
|
|
2527
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ReassignConnectionPrepareDragSequence, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: GetConnectionHandler }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2500
2528
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ReassignConnectionPrepareDragSequence }); }
|
|
2501
2529
|
}
|
|
2502
2530
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ReassignConnectionPrepareDragSequence, decorators: [{
|
|
2503
2531
|
type: Injectable
|
|
2504
|
-
}], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: GetConnectionHandler }, { type: FFlowMediator }
|
|
2532
|
+
}], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: GetConnectionHandler }, { type: FFlowMediator }] });
|
|
2505
2533
|
|
|
2506
2534
|
const CONNECTIONS_PROVIDERS = [
|
|
2507
2535
|
FindFirstCanBeConnectedOutputByOutletHandler,
|
|
@@ -2595,7 +2623,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
2595
2623
|
}]
|
|
2596
2624
|
}] });
|
|
2597
2625
|
|
|
2598
|
-
let uniqueId$
|
|
2626
|
+
let uniqueId$2 = 0;
|
|
2599
2627
|
class FExternalItemDirective extends FExternalItemBase {
|
|
2600
2628
|
get hostElement() {
|
|
2601
2629
|
return this.elementReference.nativeElement;
|
|
@@ -2604,7 +2632,7 @@ class FExternalItemDirective extends FExternalItemBase {
|
|
|
2604
2632
|
super();
|
|
2605
2633
|
this.elementReference = elementReference;
|
|
2606
2634
|
this.fExternalItemService = fExternalItemService;
|
|
2607
|
-
this.fExternalItemId = `f-external-item-${uniqueId$
|
|
2635
|
+
this.fExternalItemId = `f-external-item-${uniqueId$2++}`;
|
|
2608
2636
|
this.fDisabled = false;
|
|
2609
2637
|
}
|
|
2610
2638
|
ngOnInit() {
|
|
@@ -2916,10 +2944,9 @@ class NodePrepareDragSequence {
|
|
|
2916
2944
|
get flowHost() {
|
|
2917
2945
|
return this.fComponentsStore.fFlow.hostElement;
|
|
2918
2946
|
}
|
|
2919
|
-
constructor(fComponentsStore, fDraggableDataContext,
|
|
2947
|
+
constructor(fComponentsStore, fDraggableDataContext, getOutgoingConnectionsHandler, getIncomingConnectionsHandler, fMediator) {
|
|
2920
2948
|
this.fComponentsStore = fComponentsStore;
|
|
2921
2949
|
this.fDraggableDataContext = fDraggableDataContext;
|
|
2922
|
-
this.updateNodeLayerHandler = updateNodeLayerHandler;
|
|
2923
2950
|
this.getOutgoingConnectionsHandler = getOutgoingConnectionsHandler;
|
|
2924
2951
|
this.getIncomingConnectionsHandler = getIncomingConnectionsHandler;
|
|
2925
2952
|
this.fMediator = fMediator;
|
|
@@ -2934,7 +2961,7 @@ class NodePrepareDragSequence {
|
|
|
2934
2961
|
node.select();
|
|
2935
2962
|
this.fDraggableDataContext.isSelectedChanged = true;
|
|
2936
2963
|
}
|
|
2937
|
-
this.
|
|
2964
|
+
this.fMediator.send(new UpdateItemLayerRequest(node, this.fComponentsStore.fCanvas.fNodesContainer.nativeElement));
|
|
2938
2965
|
const itemsToDrag = this.calculateDraggableConnectionsAndNodes();
|
|
2939
2966
|
const draggedNodes = itemsToDrag.filter((x) => {
|
|
2940
2967
|
return x.type === EFDraggableType.NODE;
|
|
@@ -2990,12 +3017,12 @@ class NodePrepareDragSequence {
|
|
|
2990
3017
|
getOutputsForNode(node) {
|
|
2991
3018
|
return this.fComponentsStore.fOutputs.filter((x) => node.isContains(x.hostElement));
|
|
2992
3019
|
}
|
|
2993
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: NodePrepareDragSequence, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token:
|
|
3020
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: NodePrepareDragSequence, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: GetOutgoingConnectionsHandler }, { token: GetIncomingConnectionsHandler }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2994
3021
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: NodePrepareDragSequence }); }
|
|
2995
3022
|
}
|
|
2996
3023
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: NodePrepareDragSequence, decorators: [{
|
|
2997
3024
|
type: Injectable
|
|
2998
|
-
}], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type:
|
|
3025
|
+
}], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: GetOutgoingConnectionsHandler }, { type: GetIncomingConnectionsHandler }, { type: FFlowMediator }] });
|
|
2999
3026
|
|
|
3000
3027
|
const NODE_PROVIDERS = [
|
|
3001
3028
|
NodeOnPointerUp,
|
|
@@ -3152,82 +3179,71 @@ const SELECTION_AREA_PROVIDERS = [
|
|
|
3152
3179
|
];
|
|
3153
3180
|
|
|
3154
3181
|
class SingleSelectOnPointerDown {
|
|
3155
|
-
constructor(fComponentsStore, fDraggableDataContext, getConnectionHandler,
|
|
3182
|
+
constructor(fComponentsStore, fDraggableDataContext, getConnectionHandler, fMediator) {
|
|
3156
3183
|
this.fComponentsStore = fComponentsStore;
|
|
3157
3184
|
this.fDraggableDataContext = fDraggableDataContext;
|
|
3158
3185
|
this.getConnectionHandler = getConnectionHandler;
|
|
3159
|
-
this.
|
|
3186
|
+
this.fMediator = fMediator;
|
|
3160
3187
|
}
|
|
3161
3188
|
handle(event) {
|
|
3162
3189
|
if (!this.fComponentsStore.fFlow?.hostElement.contains(event.targetElement)) {
|
|
3163
3190
|
return;
|
|
3164
3191
|
}
|
|
3165
|
-
const
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
let element;
|
|
3169
|
-
if (this.fDraggableDataContext.selectedItems.length) {
|
|
3170
|
-
element = this.fDraggableDataContext.selectedItems[0];
|
|
3192
|
+
const item = this.getSelectableItem(event);
|
|
3193
|
+
if (item) {
|
|
3194
|
+
this.fMediator.send(new UpdateItemLayerRequest(item, item.hostElement.parentElement));
|
|
3171
3195
|
}
|
|
3172
|
-
this.
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3196
|
+
this.isMultiselectEnabled(event) ? this.multiSelect(item) : this.singleSelect(item);
|
|
3197
|
+
}
|
|
3198
|
+
getSelectableItem(event) {
|
|
3199
|
+
return this.fComponentsStore.findNode(event.targetElement) || this.getConnectionHandler.handle(event.targetElement);
|
|
3200
|
+
}
|
|
3201
|
+
isMultiselectEnabled(event) {
|
|
3202
|
+
return MouseEventExtensions.isCommandButton(event.originalEvent) ||
|
|
3203
|
+
MouseEventExtensions.isShiftPressed(event.originalEvent);
|
|
3204
|
+
}
|
|
3205
|
+
singleSelect(item) {
|
|
3206
|
+
if (item) {
|
|
3207
|
+
if (!item.isSelected() && !item.fSelectionDisabled) {
|
|
3208
|
+
this.clearSelection();
|
|
3209
|
+
this.selectItem(item);
|
|
3185
3210
|
}
|
|
3186
3211
|
}
|
|
3187
|
-
else
|
|
3188
|
-
this.
|
|
3189
|
-
if (!this.fDraggableDataContext.selectedItems.includes(connection) && !connection.fSelectionDisabled) {
|
|
3190
|
-
this.fDraggableDataContext.selectedItems.push(connection);
|
|
3191
|
-
if (element?.hostElement.id !== connection.hostElement.id) {
|
|
3192
|
-
this.fDraggableDataContext.isSelectedChanged = true;
|
|
3193
|
-
}
|
|
3194
|
-
}
|
|
3195
|
-
else {
|
|
3196
|
-
const index = this.fDraggableDataContext.selectedItems.indexOf(connection);
|
|
3197
|
-
if (index > -1) {
|
|
3198
|
-
this.fDraggableDataContext.selectedItems.splice(index, 1);
|
|
3199
|
-
}
|
|
3200
|
-
}
|
|
3212
|
+
else {
|
|
3213
|
+
this.clearSelection();
|
|
3201
3214
|
}
|
|
3202
|
-
this.selectIfNotSelected();
|
|
3203
3215
|
}
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
}
|
|
3209
|
-
});
|
|
3216
|
+
multiSelect(item) {
|
|
3217
|
+
if (item && !item.fSelectionDisabled) {
|
|
3218
|
+
item.isSelected() ? this.deselectItem(item) : this.selectItem(item);
|
|
3219
|
+
}
|
|
3210
3220
|
}
|
|
3211
|
-
|
|
3212
|
-
const
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
this.fDraggableDataContext.selectedItems = [];
|
|
3221
|
+
deselectItem(item) {
|
|
3222
|
+
const index = this.fDraggableDataContext.selectedItems.indexOf(item);
|
|
3223
|
+
if (index > -1) {
|
|
3224
|
+
this.fDraggableDataContext.selectedItems.splice(index, 1);
|
|
3216
3225
|
}
|
|
3226
|
+
item.deselect();
|
|
3227
|
+
this.fDraggableDataContext.markSelectionAsChanged();
|
|
3228
|
+
}
|
|
3229
|
+
selectItem(item) {
|
|
3230
|
+
this.fDraggableDataContext.selectedItems.push(item);
|
|
3231
|
+
item.select();
|
|
3232
|
+
this.fDraggableDataContext.markSelectionAsChanged();
|
|
3217
3233
|
}
|
|
3218
|
-
|
|
3234
|
+
clearSelection() {
|
|
3219
3235
|
this.fDraggableDataContext.selectedItems.forEach((x) => {
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
}
|
|
3236
|
+
x.deselect();
|
|
3237
|
+
this.fDraggableDataContext.markSelectionAsChanged();
|
|
3223
3238
|
});
|
|
3239
|
+
this.fDraggableDataContext.selectedItems = [];
|
|
3224
3240
|
}
|
|
3225
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: SingleSelectOnPointerDown, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: GetConnectionHandler }, { token:
|
|
3241
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: SingleSelectOnPointerDown, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: GetConnectionHandler }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3226
3242
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: SingleSelectOnPointerDown }); }
|
|
3227
3243
|
}
|
|
3228
3244
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: SingleSelectOnPointerDown, decorators: [{
|
|
3229
3245
|
type: Injectable
|
|
3230
|
-
}], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: GetConnectionHandler }, { type:
|
|
3246
|
+
}], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: GetConnectionHandler }, { type: FFlowMediator }] });
|
|
3231
3247
|
|
|
3232
3248
|
const SINGLE_SELECT_PROVIDERS = [
|
|
3233
3249
|
SingleSelectOnPointerDown
|
|
@@ -3769,8 +3785,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
3769
3785
|
}], ctorParameters: () => [{ type: FDraggableDataContext }] });
|
|
3770
3786
|
|
|
3771
3787
|
class RedrawConnectionsRequest {
|
|
3772
|
-
constructor() {
|
|
3773
|
-
}
|
|
3774
3788
|
}
|
|
3775
3789
|
|
|
3776
3790
|
let RedrawConnectionsHandler = class RedrawConnectionsHandler {
|
|
@@ -3797,8 +3811,8 @@ let RedrawConnectionsHandler = class RedrawConnectionsHandler {
|
|
|
3797
3811
|
output.setConnected(true);
|
|
3798
3812
|
input.setConnected(true);
|
|
3799
3813
|
const vector = this.getVector(output, input, connection);
|
|
3800
|
-
connection.setVector(vector.point1, output.fConnectableSide, vector.point2, input.fConnectableSide);
|
|
3801
3814
|
connection.setMarkers();
|
|
3815
|
+
connection.setVector(vector.point1, output.fConnectableSide, vector.point2, input.fConnectableSide);
|
|
3802
3816
|
connection.initialize();
|
|
3803
3817
|
}
|
|
3804
3818
|
getVector(output, input, connection) {
|
|
@@ -3892,6 +3906,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
3892
3906
|
type: Injectable
|
|
3893
3907
|
}], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }] });
|
|
3894
3908
|
|
|
3909
|
+
class UpdateItemLayerRequest {
|
|
3910
|
+
constructor(item, itemContainer) {
|
|
3911
|
+
this.item = item;
|
|
3912
|
+
this.itemContainer = itemContainer;
|
|
3913
|
+
}
|
|
3914
|
+
}
|
|
3915
|
+
|
|
3916
|
+
let UpdateItemLayerHandler = class UpdateItemLayerHandler {
|
|
3917
|
+
handle(request) {
|
|
3918
|
+
const elements = Array.from(request.itemContainer.children);
|
|
3919
|
+
const elementsCount = elements.length;
|
|
3920
|
+
const targetIndex = elements.findIndex((x) => x === request.item.hostElement);
|
|
3921
|
+
if (targetIndex !== elementsCount - 1) {
|
|
3922
|
+
const afterElements = elements.splice(targetIndex + 1);
|
|
3923
|
+
afterElements.forEach((x) => {
|
|
3924
|
+
request.itemContainer.removeChild(x);
|
|
3925
|
+
request.itemContainer.insertBefore(x, request.item.hostElement);
|
|
3926
|
+
});
|
|
3927
|
+
}
|
|
3928
|
+
}
|
|
3929
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: UpdateItemLayerHandler, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3930
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: UpdateItemLayerHandler }); }
|
|
3931
|
+
};
|
|
3932
|
+
UpdateItemLayerHandler = __decorate([
|
|
3933
|
+
FHandlerRegister(UpdateItemLayerRequest)
|
|
3934
|
+
], UpdateItemLayerHandler);
|
|
3935
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: UpdateItemLayerHandler, decorators: [{
|
|
3936
|
+
type: Injectable
|
|
3937
|
+
}] });
|
|
3938
|
+
|
|
3895
3939
|
class GetConnectionHandler {
|
|
3896
3940
|
get fConnections() {
|
|
3897
3941
|
return this.fComponentsStore.fConnections;
|
|
@@ -3950,58 +3994,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
3950
3994
|
type: Injectable
|
|
3951
3995
|
}], ctorParameters: () => [{ type: FComponentsStore }] });
|
|
3952
3996
|
|
|
3953
|
-
class UpdateNodeLayerHandler {
|
|
3954
|
-
get fNodesContainer() {
|
|
3955
|
-
return this.fComponentsStore.fCanvas?.fNodesContainer?.nativeElement;
|
|
3956
|
-
}
|
|
3957
|
-
constructor(fComponentsStore) {
|
|
3958
|
-
this.fComponentsStore = fComponentsStore;
|
|
3959
|
-
}
|
|
3960
|
-
handle(node) {
|
|
3961
|
-
const elements = Array.from(this.fNodesContainer.children);
|
|
3962
|
-
const elementsCount = elements.length;
|
|
3963
|
-
const targetIndex = elements.findIndex((x) => x === node.hostElement);
|
|
3964
|
-
if (targetIndex !== elementsCount - 1) {
|
|
3965
|
-
const afterElements = elements.splice(targetIndex + 1);
|
|
3966
|
-
afterElements.forEach((x) => {
|
|
3967
|
-
this.fNodesContainer.removeChild(x);
|
|
3968
|
-
this.fNodesContainer.insertBefore(x, node.hostElement);
|
|
3969
|
-
});
|
|
3970
|
-
}
|
|
3971
|
-
}
|
|
3972
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: UpdateNodeLayerHandler, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3973
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: UpdateNodeLayerHandler }); }
|
|
3974
|
-
}
|
|
3975
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: UpdateNodeLayerHandler, decorators: [{
|
|
3976
|
-
type: Injectable
|
|
3977
|
-
}], ctorParameters: () => [{ type: FComponentsStore }] });
|
|
3978
|
-
|
|
3979
|
-
class UpdateConnectionLayerHandler {
|
|
3980
|
-
get fConnectionsContainer() {
|
|
3981
|
-
return this.fComponentsStore.fCanvas?.fConnectionsContainer?.nativeElement;
|
|
3982
|
-
}
|
|
3983
|
-
constructor(fComponentsStore) {
|
|
3984
|
-
this.fComponentsStore = fComponentsStore;
|
|
3985
|
-
}
|
|
3986
|
-
handle(connection) {
|
|
3987
|
-
const elements = Array.from(this.fConnectionsContainer.children);
|
|
3988
|
-
const elementsCount = elements.length;
|
|
3989
|
-
const targetIndex = elements.findIndex((x) => x === connection.hostElement);
|
|
3990
|
-
if (targetIndex !== elementsCount - 1) {
|
|
3991
|
-
const afterElements = elements.splice(targetIndex + 1);
|
|
3992
|
-
afterElements.forEach((x) => {
|
|
3993
|
-
this.fConnectionsContainer.removeChild(x);
|
|
3994
|
-
this.fConnectionsContainer.insertBefore(x, connection.hostElement);
|
|
3995
|
-
});
|
|
3996
|
-
}
|
|
3997
|
-
}
|
|
3998
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: UpdateConnectionLayerHandler, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3999
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: UpdateConnectionLayerHandler }); }
|
|
4000
|
-
}
|
|
4001
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: UpdateConnectionLayerHandler, decorators: [{
|
|
4002
|
-
type: Injectable
|
|
4003
|
-
}], ctorParameters: () => [{ type: FComponentsStore }] });
|
|
4004
|
-
|
|
4005
3997
|
const COMMON_PROVIDERS = [
|
|
4006
3998
|
ClearSelectionHandler,
|
|
4007
3999
|
GetConnectionVectorHandler,
|
|
@@ -4012,12 +4004,14 @@ const COMMON_PROVIDERS = [
|
|
|
4012
4004
|
RedrawConnectionsHandler,
|
|
4013
4005
|
SelectHandler,
|
|
4014
4006
|
SelectAllHandler,
|
|
4007
|
+
UpdateItemLayerHandler,
|
|
4015
4008
|
GetConnectionHandler,
|
|
4016
4009
|
GetInputRectInFlowHandler,
|
|
4017
4010
|
GetIncomingConnectionsHandler,
|
|
4018
4011
|
GetOutgoingConnectionsHandler,
|
|
4019
|
-
UpdateConnectionLayerHandler,
|
|
4020
|
-
|
|
4012
|
+
// UpdateConnectionLayerHandler,
|
|
4013
|
+
//
|
|
4014
|
+
// UpdateNodeLayerHandler,
|
|
4021
4015
|
];
|
|
4022
4016
|
|
|
4023
4017
|
class FCanvasComponent extends FCanvasBase {
|
|
@@ -4408,7 +4402,7 @@ const F_FLOW = new InjectionToken('F_FLOW');
|
|
|
4408
4402
|
class FFlowBase {
|
|
4409
4403
|
}
|
|
4410
4404
|
|
|
4411
|
-
let uniqueId = 0;
|
|
4405
|
+
let uniqueId$1 = 0;
|
|
4412
4406
|
class FFlowComponent extends FFlowBase {
|
|
4413
4407
|
get hostElement() {
|
|
4414
4408
|
return this.elementReference.nativeElement;
|
|
@@ -4419,7 +4413,7 @@ class FFlowComponent extends FFlowBase {
|
|
|
4419
4413
|
this.fComponentsStore = fComponentsStore;
|
|
4420
4414
|
this.fMediator = fMediator;
|
|
4421
4415
|
this.subscription$ = new Subscription();
|
|
4422
|
-
this.fFlowId = `f-flow-${uniqueId++}`;
|
|
4416
|
+
this.fFlowId = `f-flow-${uniqueId$1++}`;
|
|
4423
4417
|
this.fLoaded = new EventEmitter();
|
|
4424
4418
|
this.isLoaded = false;
|
|
4425
4419
|
}
|
|
@@ -4467,6 +4461,7 @@ class FFlowComponent extends FFlowBase {
|
|
|
4467
4461
|
FFlowMediator,
|
|
4468
4462
|
FComponentsStore,
|
|
4469
4463
|
FDraggableDataContext,
|
|
4464
|
+
FConnectionFactory,
|
|
4470
4465
|
...SINGLE_SELECT_PROVIDERS,
|
|
4471
4466
|
...SELECTION_AREA_PROVIDERS,
|
|
4472
4467
|
...NODE_PROVIDERS,
|
|
@@ -4486,6 +4481,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
4486
4481
|
FFlowMediator,
|
|
4487
4482
|
FComponentsStore,
|
|
4488
4483
|
FDraggableDataContext,
|
|
4484
|
+
FConnectionFactory,
|
|
4489
4485
|
...SINGLE_SELECT_PROVIDERS,
|
|
4490
4486
|
...SELECTION_AREA_PROVIDERS,
|
|
4491
4487
|
...NODE_PROVIDERS,
|
|
@@ -4501,6 +4497,74 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
4501
4497
|
type: Output
|
|
4502
4498
|
}] } });
|
|
4503
4499
|
|
|
4500
|
+
const F_GROUP = new InjectionToken('F_GROUP');
|
|
4501
|
+
class FGroupBase {
|
|
4502
|
+
isContains(element) {
|
|
4503
|
+
return this.hostElement.contains(element);
|
|
4504
|
+
}
|
|
4505
|
+
redraw() {
|
|
4506
|
+
this.setStyle('transform', 'translate(' + this.position.x + 'px,' + this.position.y + 'px)');
|
|
4507
|
+
this.setStyle('width', `${this.size.width}px`);
|
|
4508
|
+
this.setStyle('height', `${this.size.height}px`);
|
|
4509
|
+
}
|
|
4510
|
+
}
|
|
4511
|
+
|
|
4512
|
+
let uniqueId = 0;
|
|
4513
|
+
class FGroupDirective extends FGroupBase {
|
|
4514
|
+
get hostElement() {
|
|
4515
|
+
return this.elementReference.nativeElement;
|
|
4516
|
+
}
|
|
4517
|
+
constructor(elementReference, renderer, fComponentsStore) {
|
|
4518
|
+
super();
|
|
4519
|
+
this.elementReference = elementReference;
|
|
4520
|
+
this.renderer = renderer;
|
|
4521
|
+
this.fComponentsStore = fComponentsStore;
|
|
4522
|
+
this.subscriptions$ = new Subscription();
|
|
4523
|
+
this.fGroupId = `f-group-${uniqueId++}`;
|
|
4524
|
+
}
|
|
4525
|
+
ngOnInit() {
|
|
4526
|
+
this.setStyle('position', 'absolute');
|
|
4527
|
+
this.setStyle('transform-origin', '0 0');
|
|
4528
|
+
this.setStyle('user-select', 'none');
|
|
4529
|
+
this.setStyle('pointer-events', 'all');
|
|
4530
|
+
this.setStyle('left', '0');
|
|
4531
|
+
this.setStyle('top', '0');
|
|
4532
|
+
super.redraw();
|
|
4533
|
+
this.fComponentsStore.addGroup(this);
|
|
4534
|
+
}
|
|
4535
|
+
setStyle(styleName, value) {
|
|
4536
|
+
this.renderer.setStyle(this.hostElement, styleName, value);
|
|
4537
|
+
}
|
|
4538
|
+
ngOnDestroy() {
|
|
4539
|
+
this.fComponentsStore.removeGroup(this);
|
|
4540
|
+
this.subscriptions$.unsubscribe();
|
|
4541
|
+
}
|
|
4542
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FGroupDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4543
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.1", type: FGroupDirective, selector: "[fGroup]", inputs: { fGroupId: "fGroupId" }, host: { properties: { "attr.data-f-group-id": "fGroupId" }, classAttribute: "f-group f-component" }, providers: [
|
|
4544
|
+
{ provide: F_GROUP, useExisting: FGroupDirective }
|
|
4545
|
+
], exportAs: ["fComponent"], usesInheritance: true, ngImport: i0 }); }
|
|
4546
|
+
}
|
|
4547
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FGroupDirective, decorators: [{
|
|
4548
|
+
type: Directive,
|
|
4549
|
+
args: [{
|
|
4550
|
+
selector: "[fGroup]",
|
|
4551
|
+
exportAs: "fComponent",
|
|
4552
|
+
host: {
|
|
4553
|
+
'[attr.data-f-group-id]': 'fGroupId',
|
|
4554
|
+
class: "f-group f-component",
|
|
4555
|
+
},
|
|
4556
|
+
providers: [
|
|
4557
|
+
{ provide: F_GROUP, useExisting: FGroupDirective }
|
|
4558
|
+
],
|
|
4559
|
+
}]
|
|
4560
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: FComponentsStore }], propDecorators: { fGroupId: [{
|
|
4561
|
+
type: Input
|
|
4562
|
+
}] } });
|
|
4563
|
+
|
|
4564
|
+
function isGroup(element) {
|
|
4565
|
+
return !!element.closest('[f-group]');
|
|
4566
|
+
}
|
|
4567
|
+
|
|
4504
4568
|
class FFlowModule {
|
|
4505
4569
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FFlowModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
4506
4570
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.1", ngImport: i0, type: FFlowModule, declarations: [FConnectionDragHandleComponent,
|
|
@@ -4516,6 +4580,7 @@ class FFlowModule {
|
|
|
4516
4580
|
FCellPatternComponent,
|
|
4517
4581
|
FCanvasComponent,
|
|
4518
4582
|
FNodeDirective,
|
|
4583
|
+
FGroupDirective,
|
|
4519
4584
|
FDragHandleDirective,
|
|
4520
4585
|
FConnectionComponent,
|
|
4521
4586
|
FConnectionForCreateComponent,
|
|
@@ -4565,6 +4630,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
4565
4630
|
FCellPatternComponent,
|
|
4566
4631
|
FCanvasComponent,
|
|
4567
4632
|
FNodeDirective,
|
|
4633
|
+
FGroupDirective,
|
|
4568
4634
|
FDragHandleDirective,
|
|
4569
4635
|
FConnectionComponent,
|
|
4570
4636
|
FConnectionForCreateComponent,
|
|
@@ -4610,5 +4676,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
4610
4676
|
* Generated bundle index. Do not edit.
|
|
4611
4677
|
*/
|
|
4612
4678
|
|
|
4613
|
-
export { CANVAS_PROVIDERS, COMMON_PROVIDERS, CONNECTIONS_PROVIDERS, CONNECTION_GRADIENT, CONNECTION_PATH, CONNECTION_TEXT, CalculateCenterBetweenPointsHandler, CalculateCenterBetweenPointsRequest, CalculateConnectionCenterHandler, CalculateConnectionCenterRequest, CalculateConnectorConnectableSideHandler, CalculateConnectorConnectableSideRequest, CanvasDragHandler, CanvasOnPointerUp, CanvasPrepareDragSequence, ClearSelectionHandler, ClearSelectionRequest, ConnectionDragHandler, ConnectionSourceDragHandler, ConnectionTargetDragHandler, CreateConnectionDragHandler, CreateConnectionOnPointerUp, CreateConnectionPrepareDragSequence, EFConnectableSide, EFConnectionBehavior, EFConnectionType, EFDraggableType, EFMarkerType, EXTERNAL_ITEM_PROVIDERS, ExternalItemDragHandler, ExternalItemOnPointerUp, ExternalItemPrepareDragSequence, FBackgroundBase, FBackgroundComponent, FBezierPathBuilder, FCanvasBase, FCanvasChangeEvent, FCanvasComponent, FCellPatternComponent, FComponentsStore, FConnectionBase, FConnectionCenterDirective, FConnectionComponent, FConnectionDragHandleComponent, FConnectionForCreateComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionTextComponent, FConnectionTextPathDirective, FConnectorBase, FCreateConnectionEvent, FCreateNodeEvent, FDragHandleDirective, FDraggableBase, FDraggableDataContext, FDraggableDirective, FExternalItemBase, FExternalItemDirective, FExternalItemService, FFlowBase, FFlowComponent, FFlowMediator, FFlowModule, FHandlerRegister, FLOW, FLineAlignmentBase, FLineAlignmentComponent, FMarkerBase, FMarkerDirective, FNodeBase, FNodeDirective, FNodeInputBase, FNodeInputDirective, FNodeOutletBase, FNodeOutletDirective, FNodeOutputBase, FNodeOutputDirective,
|
|
4679
|
+
export { CANVAS_PROVIDERS, COMMON_PROVIDERS, CONNECTIONS_PROVIDERS, CONNECTION_GRADIENT, CONNECTION_PATH, CONNECTION_TEXT, CalculateCenterBetweenPointsHandler, CalculateCenterBetweenPointsRequest, CalculateConnectionCenterHandler, CalculateConnectionCenterRequest, CalculateConnectorConnectableSideHandler, CalculateConnectorConnectableSideRequest, CanvasDragHandler, CanvasOnPointerUp, CanvasPrepareDragSequence, ClearSelectionHandler, ClearSelectionRequest, ConnectionDragHandler, ConnectionSourceDragHandler, ConnectionTargetDragHandler, CreateConnectionDragHandler, CreateConnectionOnPointerUp, CreateConnectionPrepareDragSequence, EFConnectableSide, EFConnectionBehavior, EFConnectionType, EFDraggableType, EFMarkerType, EXTERNAL_ITEM_PROVIDERS, ExternalItemDragHandler, ExternalItemOnPointerUp, ExternalItemPrepareDragSequence, FBackgroundBase, FBackgroundComponent, FBezierPathBuilder, FCanvasBase, FCanvasChangeEvent, FCanvasComponent, FCellPatternComponent, FComponentsStore, FConnectionBase, FConnectionCenterDirective, FConnectionComponent, FConnectionDragHandleComponent, FConnectionFactory, FConnectionForCreateComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionTextComponent, FConnectionTextPathDirective, FConnectorBase, FCreateConnectionEvent, FCreateNodeEvent, FDragHandleDirective, FDraggableBase, FDraggableDataContext, FDraggableDirective, FExternalItemBase, FExternalItemDirective, FExternalItemService, FFlowBase, FFlowComponent, FFlowMediator, FFlowModule, FGroupBase, FGroupDirective, FHandlerRegister, FLOW, FLineAlignmentBase, FLineAlignmentComponent, FMarkerBase, FMarkerDirective, FNodeBase, FNodeDirective, FNodeInputBase, FNodeInputDirective, FNodeOutletBase, FNodeOutletDirective, FNodeOutputBase, FNodeOutputDirective, FReassignConnectionEvent, FResizeObserver, FSegmentPathBuilder, FSelectionAreaBase, FSelectionAreaComponent, FSelectionChangeEvent, FStraightPathBuilder, FZoomBase, FZoomDirective, F_BACKGROUND, F_BACKGROUND_PATTERN, F_CANVAS, F_CONNECTION_BUILDERS, F_CONNECTION_DRAG_HANDLE_CLASS, F_CONNECTION_IDENTIFIERS, F_DRAGGABLE, F_DRAG_HANDLE, F_EXTERNAL_ITEM, F_FLOW, F_GROUP, F_LINE_ALIGNMENT, F_MARKER, F_NODE, F_NODE_INPUT, F_NODE_OUTLET, F_NODE_OUTPUT, F_SELECTED_CLASS, F_SELECTION_AREA, F_ZOOM, FindFirstCanBeConnectedOutputByOutletHandler, FindInputsUnderPointerHandler, FindInputsUnderPointerRequest, FirstNotConnectedInputOfNodeUnderPointerHandler, GetCanBeSelectedItemsHandler, GetConnectionHandler, GetConnectionVectorHandler, GetConnectionVectorRequest, GetElementRectInFlowHandler, GetElementRectInFlowRequest, GetIncomingConnectionsHandler, GetInputRectInFlowHandler, GetInputRectInFlowRequest, GetInputRectInFlowResponse, GetNodesRectHandler, GetNodesRectRequest, GetOutgoingConnectionsHandler, GetOutputRectInFlowHandler, GetOutputRectInFlowRequest, GetOutputRectInFlowResponse, GetSelectionHandler, GetSelectionRequest, IsConnectionUnderNodeHandler, LineElement, LineService, MOUSE_EVENT_IGNORE_TIME, NODE_PROVIDERS, NearestCoordinateFinder, NodeDragHandler, NodeOnPointerUp, NodePrepareDragSequence, ReassignConnectionDragHandler, ReassignConnectionOnPointerUp, ReassignConnectionPrepareDragSequence, RedrawConnectionsHandler, RedrawConnectionsRequest, SELECTION_AREA_PROVIDERS, SINGLE_SELECT_PROVIDERS, SelectAllHandler, SelectAllRequest, SelectHandler, SelectRequest, SelectionAreaDragHandle, SelectionAreaOnPointerUp, SelectionAreaPrepareDragSequence, SingleSelectOnPointerDown, UpdateItemLayerHandler, UpdateItemLayerRequest, castToConnectableSide, castToConnectionBehavior, castToConnectionType, getExternalItem, getFlowUid, isExternalItem, isGroup, isNode, isNodeDragHandle, isNodeInput, isNodeOutlet, isNodeOutput, mixinChangeConnectionSelection, mixinChangeConnectionVisibility };
|
|
4614
4680
|
//# sourceMappingURL=foblex-flow.mjs.map
|