@foblex/flow 17.9.0 → 17.9.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,12 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, Injectable, Directive, input, computed, signal, Injector, Renderer2, effect, untracked, DestroyRef, model, output, booleanAttribute, ElementRef, Input, viewChild, Component, ChangeDetectionStrategy, isDevMode, contentChildren, numberAttribute, ViewContainerRef, TemplateRef, EventEmitter, NgZone, Output, ContentChildren, contentChild, NgModule } from '@angular/core';
2
+ import { InjectionToken, inject, Injectable, Directive, input, computed, signal, Injector, Renderer2, effect, untracked, DestroyRef, model, output, booleanAttribute, ElementRef, Input, viewChild, Component, ChangeDetectionStrategy, isDevMode, contentChildren, numberAttribute, ViewContainerRef, TemplateRef, NgZone, EventEmitter, Output, ContentChildren, contentChild, NgModule } from '@angular/core';
3
3
  import { RectExtensions, RoundedRect, TransformModelExtensions, PointExtensions, Point, LineExtensions, GetIntersections, SizeExtensions, findClosestAlignment, setRectToElement, adjustRectToMinSize, setRectToViewBox } from '@foblex/2d';
4
4
  import { __decorate } from 'tslib';
5
5
  import { FExecutionRegister, FMediator } from '@foblex/mediator';
6
6
  import { BrowserService, PlatformService, EOperationSystem } from '@foblex/platform';
7
7
  import { normalizeDomElementId, castToEnum, isClosestElementHasClass, flatMap, getOrCreateRootNodeForViewRef, deepCloneNode, disableDragInteractions, extendStyles, getDataAttrValueFromClosestElementWithClass } from '@foblex/utils';
8
8
  import { coerceNumberProperty } from '@angular/cdk/coercion';
9
- import { CommonModule } from '@angular/common';
9
+ import { DOCUMENT, CommonModule } from '@angular/common';
10
10
 
11
11
  const F_BACKGROUND_PATTERN = new InjectionToken('F_BACKGROUND_PATTERN');
12
12
 
@@ -3326,7 +3326,7 @@ class FConnectionComponent extends FConnectionBase {
3326
3326
  this._mediator.execute(new RemoveConnectionFromStoreRequest(this));
3327
3327
  }
3328
3328
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FConnectionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3329
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: FConnectionComponent, selector: "f-connection", inputs: { fId: { classPropertyName: "fId", publicName: "fConnectionId", isSignal: true, isRequired: false, transformFunction: null }, fText: { classPropertyName: "fText", publicName: "fText", isSignal: false, isRequired: false, transformFunction: null }, fTextStartOffset: { classPropertyName: "fTextStartOffset", publicName: "fTextStartOffset", isSignal: false, isRequired: false, transformFunction: null }, fOutputId: { classPropertyName: "fOutputId", publicName: "fOutputId", isSignal: true, isRequired: false, transformFunction: null }, fInputId: { classPropertyName: "fInputId", publicName: "fInputId", isSignal: true, isRequired: false, transformFunction: null }, fRadius: { classPropertyName: "fRadius", publicName: "fRadius", isSignal: false, isRequired: false, transformFunction: numberAttribute }, fOffset: { classPropertyName: "fOffset", publicName: "fOffset", isSignal: false, isRequired: false, transformFunction: numberAttribute }, fBehavior: { classPropertyName: "fBehavior", publicName: "fBehavior", isSignal: false, isRequired: false, transformFunction: (value) => castToEnum(value, 'fBehavior', EFConnectionBehavior) }, fType: { classPropertyName: "fType", publicName: "fType", isSignal: false, isRequired: false, transformFunction: null }, fSelectionDisabled: { classPropertyName: "fSelectionDisabled", publicName: "fSelectionDisabled", isSignal: true, isRequired: false, transformFunction: null }, fReassignableStart: { classPropertyName: "fReassignableStart", publicName: "fReassignableStart", isSignal: true, isRequired: false, transformFunction: null }, fDraggingDisabled: { classPropertyName: "fDraggingDisabled", publicName: "fReassignDisabled", isSignal: true, isRequired: false, transformFunction: null }, fInputSide: { classPropertyName: "fInputSide", publicName: "fInputSide", isSignal: true, isRequired: false, transformFunction: null }, fOutputSide: { classPropertyName: "fOutputSide", publicName: "fOutputSide", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "fId()", "class.f-connection-selection-disabled": "fSelectionDisabled()", "class.f-connection-reassign-disabled": "fDraggingDisabled()" }, classAttribute: "f-component f-connection" }, providers: [{ provide: F_CONNECTION, useExisting: FConnectionComponent }], exportAs: ["fComponent"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n style=\"overflow: visible; display: block; vertical-align: middle;\"\n>\n <defs #defs></defs>\n <ng-content></ng-content>\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\"></path>\n @if (fReassignableStart()) {\n <circle f-connection-drag-handle-start r=\"8\"></circle>\n }\n <circle f-connection-drag-handle-end r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n</svg>\n@if (fConnectionCenters().length) {\n <div #fConnectionCenter class=\"f-connection-center\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n </div>\n}\n\n@if (fConnectionContents().length) {\n <ng-content select=\"[fConnectionContent]\"></ng-content>\n}\n", styles: [":host{pointer-events:none;position:absolute}:host svg{overflow:visible}:host svg .f-connection-group{pointer-events:all}:host .f-connection-center,:host .f-connection-content{pointer-events:all}\n"], dependencies: [{ kind: "component", type: FConnectionTextComponent, selector: "text[f-connection-text]" }, { kind: "component", type: FConnectionDragHandleStartComponent, selector: "circle[f-connection-drag-handle-start]" }, { kind: "component", type: FConnectionDragHandleEndComponent, selector: "circle[f-connection-drag-handle-end]" }, { kind: "component", type: FConnectionGradientComponent, selector: "linearGradient[fConnectionGradient]" }, { kind: "component", type: FConnectionPathComponent, selector: "path[f-connection-path]" }, { kind: "component", type: FConnectionSelectionComponent, selector: "path[fConnectionSelection]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3329
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: FConnectionComponent, selector: "f-connection", inputs: { fId: { classPropertyName: "fId", publicName: "fConnectionId", isSignal: true, isRequired: false, transformFunction: null }, fText: { classPropertyName: "fText", publicName: "fText", isSignal: false, isRequired: false, transformFunction: null }, fTextStartOffset: { classPropertyName: "fTextStartOffset", publicName: "fTextStartOffset", isSignal: false, isRequired: false, transformFunction: null }, fOutputId: { classPropertyName: "fOutputId", publicName: "fOutputId", isSignal: true, isRequired: false, transformFunction: null }, fInputId: { classPropertyName: "fInputId", publicName: "fInputId", isSignal: true, isRequired: false, transformFunction: null }, fRadius: { classPropertyName: "fRadius", publicName: "fRadius", isSignal: false, isRequired: false, transformFunction: numberAttribute }, fOffset: { classPropertyName: "fOffset", publicName: "fOffset", isSignal: false, isRequired: false, transformFunction: numberAttribute }, fBehavior: { classPropertyName: "fBehavior", publicName: "fBehavior", isSignal: false, isRequired: false, transformFunction: (value) => castToEnum(value, 'fBehavior', EFConnectionBehavior) }, fType: { classPropertyName: "fType", publicName: "fType", isSignal: false, isRequired: false, transformFunction: null }, fSelectionDisabled: { classPropertyName: "fSelectionDisabled", publicName: "fSelectionDisabled", isSignal: true, isRequired: false, transformFunction: null }, fReassignableStart: { classPropertyName: "fReassignableStart", publicName: "fReassignableStart", isSignal: true, isRequired: false, transformFunction: null }, fDraggingDisabled: { classPropertyName: "fDraggingDisabled", publicName: "fReassignDisabled", isSignal: true, isRequired: false, transformFunction: null }, fInputSide: { classPropertyName: "fInputSide", publicName: "fInputSide", isSignal: true, isRequired: false, transformFunction: null }, fOutputSide: { classPropertyName: "fOutputSide", publicName: "fOutputSide", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "fId()", "class.f-connection-selection-disabled": "fSelectionDisabled()", "class.f-connection-reassign-disabled": "fDraggingDisabled()" }, classAttribute: "f-component f-connection" }, providers: [{ provide: F_CONNECTION, useExisting: FConnectionComponent }], exportAs: ["fComponent"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n style=\"display: block; vertical-align: middle;\"\n>\n <defs #defs></defs>\n <ng-content></ng-content>\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\"></path>\n @if (fReassignableStart()) {\n <circle f-connection-drag-handle-start r=\"8\"></circle>\n }\n <circle f-connection-drag-handle-end r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n</svg>\n@if (fConnectionCenters().length) {\n <div #fConnectionCenter class=\"f-connection-center\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n </div>\n}\n\n@if (fConnectionContents().length) {\n <ng-content select=\"[fConnectionContent]\"></ng-content>\n}\n", styles: [":host{pointer-events:none}:host svg{overflow:visible!important;position:absolute}:host svg .f-connection-group{pointer-events:all}:host .f-connection-center,:host .f-connection-content{pointer-events:all}\n"], dependencies: [{ kind: "component", type: FConnectionTextComponent, selector: "text[f-connection-text]" }, { kind: "component", type: FConnectionDragHandleStartComponent, selector: "circle[f-connection-drag-handle-start]" }, { kind: "component", type: FConnectionDragHandleEndComponent, selector: "circle[f-connection-drag-handle-end]" }, { kind: "component", type: FConnectionGradientComponent, selector: "linearGradient[fConnectionGradient]" }, { kind: "component", type: FConnectionPathComponent, selector: "path[f-connection-path]" }, { kind: "component", type: FConnectionSelectionComponent, selector: "path[fConnectionSelection]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3330
3330
  }
3331
3331
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FConnectionComponent, decorators: [{
3332
3332
  type: Component,
@@ -3335,7 +3335,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
3335
3335
  class: 'f-component f-connection',
3336
3336
  '[class.f-connection-selection-disabled]': 'fSelectionDisabled()',
3337
3337
  '[class.f-connection-reassign-disabled]': 'fDraggingDisabled()',
3338
- }, providers: [{ provide: F_CONNECTION, useExisting: FConnectionComponent }], template: "<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n style=\"overflow: visible; display: block; vertical-align: middle;\"\n>\n <defs #defs></defs>\n <ng-content></ng-content>\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\"></path>\n @if (fReassignableStart()) {\n <circle f-connection-drag-handle-start r=\"8\"></circle>\n }\n <circle f-connection-drag-handle-end r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n</svg>\n@if (fConnectionCenters().length) {\n <div #fConnectionCenter class=\"f-connection-center\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n </div>\n}\n\n@if (fConnectionContents().length) {\n <ng-content select=\"[fConnectionContent]\"></ng-content>\n}\n", styles: [":host{pointer-events:none;position:absolute}:host svg{overflow:visible}:host svg .f-connection-group{pointer-events:all}:host .f-connection-center,:host .f-connection-content{pointer-events:all}\n"] }]
3338
+ }, providers: [{ provide: F_CONNECTION, useExisting: FConnectionComponent }], template: "<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n style=\"display: block; vertical-align: middle;\"\n>\n <defs #defs></defs>\n <ng-content></ng-content>\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\"></path>\n @if (fReassignableStart()) {\n <circle f-connection-drag-handle-start r=\"8\"></circle>\n }\n <circle f-connection-drag-handle-end r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n</svg>\n@if (fConnectionCenters().length) {\n <div #fConnectionCenter class=\"f-connection-center\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n </div>\n}\n\n@if (fConnectionContents().length) {\n <ng-content select=\"[fConnectionContent]\"></ng-content>\n}\n", styles: [":host{pointer-events:none}:host svg{overflow:visible!important;position:absolute}:host svg .f-connection-group{pointer-events:all}:host .f-connection-center,:host .f-connection-content{pointer-events:all}\n"] }]
3339
3339
  }], propDecorators: { fText: [{
3340
3340
  type: Input
3341
3341
  }], fTextStartOffset: [{
@@ -4841,7 +4841,6 @@ class FCanvasMoveFinalizeRequest {
4841
4841
  }
4842
4842
 
4843
4843
  class FDraggableDataContext {
4844
- isDragging = false;
4845
4844
  selectedItems = [];
4846
4845
  isSelectedChanged = false;
4847
4846
  onPointerDownScale = 1;
@@ -8671,11 +8670,12 @@ let FSingleSelectExecution = class FSingleSelectExecution {
8671
8670
  return this._getNodeOrGroup(event.targetElement) || this._getConnection(event.targetElement);
8672
8671
  }
8673
8672
  _getNodeOrGroup(targetElement) {
8674
- return this._store.fNodes.find((x) => (x).isContains(targetElement));
8673
+ return this._store.fNodes.find((x) => x.isContains(targetElement));
8675
8674
  }
8676
8675
  _getConnection(element) {
8677
- return this._store.fConnections
8678
- .find(c => c.isContains(element) || c.fConnectionCenter()?.nativeElement?.contains(element));
8676
+ return this._store.fConnections.find((c) => c.isContains(element) ||
8677
+ c.fConnectionCenter()?.nativeElement?.contains(element) ||
8678
+ Array.from(c.fConnectionContents()?.values() ?? []).some((content) => content.hostElement?.contains(element)));
8679
8679
  }
8680
8680
  _updateItemAndChildrenLayers(fItem) {
8681
8681
  if (fItem) {
@@ -8855,34 +8855,33 @@ class ITouchMoveEvent extends IPointerEvent {
8855
8855
  }
8856
8856
 
8857
8857
  class EventExtensions {
8858
- static isSupported;
8859
- static isPassiveEventListenerSupported() {
8860
- if (EventExtensions.isSupported == null && typeof window !== 'undefined') {
8858
+ static _isSupported;
8859
+ static _isPassiveEventListenerSupported() {
8860
+ if (EventExtensions._isSupported == null && typeof window !== 'undefined') {
8861
8861
  try {
8862
8862
  window.addEventListener('test', EventExtensions.emptyListener, { passive: true });
8863
- EventExtensions.isSupported = true;
8863
+ EventExtensions._isSupported = true;
8864
8864
  }
8865
8865
  catch (e) {
8866
- EventExtensions.isSupported = false;
8866
+ EventExtensions._isSupported = false;
8867
8867
  }
8868
8868
  }
8869
- return EventExtensions.isSupported;
8869
+ return EventExtensions._isSupported;
8870
8870
  }
8871
- static passiveEventListener(options) {
8872
- return EventExtensions.isPassiveEventListenerSupported() ? options : !!options.capture;
8871
+ static _passiveEventListener(options) {
8872
+ return EventExtensions._isPassiveEventListenerSupported() ? options : !!options.capture;
8873
8873
  }
8874
8874
  static activeListener() {
8875
- return EventExtensions.passiveEventListener({ passive: false });
8875
+ return EventExtensions._passiveEventListener({ passive: false });
8876
8876
  }
8877
8877
  static passiveListener() {
8878
- return EventExtensions.passiveEventListener({ passive: true });
8878
+ return EventExtensions._passiveEventListener({ passive: true });
8879
8879
  }
8880
8880
  static activeCaptureListener() {
8881
- return EventExtensions.passiveEventListener({ passive: false, capture: true });
8881
+ return EventExtensions._passiveEventListener({ passive: false, capture: true });
8882
8882
  }
8883
8883
  static emptyListener() {
8884
- return () => {
8885
- };
8884
+ return () => { };
8886
8885
  }
8887
8886
  }
8888
8887
 
@@ -8893,57 +8892,53 @@ const MOUSE_EVENT_IGNORE_TIME = 800;
8893
8892
  * and provides abstract methods for derived classes to implement specific behaviors.
8894
8893
  */
8895
8894
  class DragAndDropBase {
8896
- ngZone;
8897
- document;
8898
- mouseListeners = EventExtensions.emptyListener();
8899
- touchListeners = EventExtensions.emptyListener();
8900
- startListeners = EventExtensions.emptyListener();
8901
- isSyntheticEvent(event) {
8902
- return !!this.lastTouchEventTime &&
8903
- (this.lastTouchEventTime + MOUSE_EVENT_IGNORE_TIME > Date.now());
8904
- }
8905
- lastTouchEventTime = 0;
8895
+ _document = inject(DOCUMENT);
8896
+ _ngZone = inject(NgZone, { optional: true });
8897
+ _mouseListeners = EventExtensions.emptyListener();
8898
+ _touchListeners = EventExtensions.emptyListener();
8899
+ _startListeners = EventExtensions.emptyListener();
8900
+ isSyntheticEvent(_event) {
8901
+ return (!!this._lastTouchEventTime && this._lastTouchEventTime + MOUSE_EVENT_IGNORE_TIME > Date.now());
8902
+ }
8903
+ _lastTouchEventTime = 0;
8906
8904
  isDragStarted = false;
8907
- dragStartThreshold = 3;
8908
- dragStartDelay = 0;
8909
- dragStartTime = 0;
8910
- dragStartPosition = { x: 0, y: 0 };
8911
- moveHandler = this.checkDragSequenceToStart;
8912
- pointerDownElement = null;
8913
- constructor(ngZone) {
8914
- this.ngZone = ngZone;
8915
- }
8905
+ _dragStartThreshold = 3;
8906
+ _dragStartDelay = 0;
8907
+ _dragStartTime = 0;
8908
+ _dragStartPosition = { x: 0, y: 0 };
8909
+ _moveHandler = this._checkDragSequenceToStart;
8910
+ _pointerDownElement = null;
8916
8911
  /**
8917
8912
  * Handles the mouse down event to initiate the drag sequence.
8918
8913
  * It checks if the event is synthetic or fake, and if the drag is already started.
8919
8914
  * If not, it sets up the drag start sequence by adding necessary event listeners.
8920
8915
  * @param event - The mouse event that triggered the drag.
8921
8916
  */
8922
- onMouseDown = (event) => {
8917
+ _onMouseDown = (event) => {
8923
8918
  const isSyntheticEvent = this.isSyntheticEvent(event);
8924
8919
  const isFakeEvent = isFakeMousedownFromScreenReader(event);
8925
8920
  const mouseEvent = new IMouseEvent(event);
8926
8921
  if (isSyntheticEvent || isFakeEvent || this.disabled || this.isDragStarted) {
8927
8922
  return;
8928
8923
  }
8929
- this.pointerDownElement = mouseEvent.targetElement;
8924
+ this._pointerDownElement = mouseEvent.targetElement;
8930
8925
  const result = this.onPointerDown(mouseEvent);
8931
8926
  if (result) {
8932
- this.dragStartTime = Date.now();
8933
- this.dragStartPosition = mouseEvent.getPosition();
8934
- this.ngZone?.runOutsideAngular(() => {
8935
- this.document?.addEventListener('selectstart', this.onSelectStart, EventExtensions.activeListener());
8936
- this.document?.addEventListener('mousemove', this.onMouseMove);
8937
- this.document?.addEventListener('pointerup', this.onPointerUpEvent);
8938
- this.document?.addEventListener('pointercancel', this.onPointerUpEvent, EventExtensions.activeCaptureListener());
8939
- this.document?.addEventListener('contextmenu', this.onContextMenuDuringDrag, EventExtensions.activeCaptureListener());
8927
+ this._dragStartTime = Date.now();
8928
+ this._dragStartPosition = mouseEvent.getPosition();
8929
+ this._ngZone?.runOutsideAngular(() => {
8930
+ this._listen('selectstart', this._onSelectStart, EventExtensions.activeListener());
8931
+ this._listen('mousemove', this._onMouseMove);
8932
+ this._listen('pointerup', this._onPointerUpEvent);
8933
+ this._listen('pointercancel', this._onPointerUpEvent, EventExtensions.activeCaptureListener());
8934
+ this._listen('contextmenu', this._preventDuringDrag, EventExtensions.activeCaptureListener());
8940
8935
  });
8941
- this.mouseListeners = () => {
8942
- this.document?.removeEventListener('selectstart', this.onSelectStart, EventExtensions.activeListener());
8943
- this.document?.removeEventListener('mousemove', this.onMouseMove);
8944
- this.document?.removeEventListener('pointerup', this.onPointerUpEvent);
8945
- this.document?.removeEventListener('pointercancel', this.onPointerUpEvent, EventExtensions.activeCaptureListener());
8946
- this.document?.removeEventListener('contextmenu', this.onContextMenuDuringDrag, EventExtensions.activeCaptureListener());
8936
+ this._mouseListeners = () => {
8937
+ this._unlisten('selectstart', this._onSelectStart, EventExtensions.activeListener());
8938
+ this._unlisten('mousemove', this._onMouseMove);
8939
+ this._unlisten('pointerup', this._onPointerUpEvent);
8940
+ this._unlisten('pointercancel', this._onPointerUpEvent, EventExtensions.activeCaptureListener());
8941
+ this._unlisten('contextmenu', this._preventDuringDrag, EventExtensions.activeCaptureListener());
8947
8942
  };
8948
8943
  }
8949
8944
  };
@@ -8953,30 +8948,30 @@ class DragAndDropBase {
8953
8948
  * If not, it sets up the drag start sequence by adding necessary event listeners.
8954
8949
  * @param event - The touch event that triggered the drag.
8955
8950
  */
8956
- onTouchDown = (event) => {
8951
+ _onTouchDown = (event) => {
8957
8952
  const isFakeEvent = isFakeTouchstartFromScreenReader(event);
8958
8953
  const touchEvent = new ITouchDownEvent(event);
8959
8954
  if (isFakeEvent || this.disabled || this.isDragStarted) {
8960
8955
  return;
8961
8956
  }
8962
- this.pointerDownElement = touchEvent.targetElement;
8957
+ this._pointerDownElement = touchEvent.targetElement;
8963
8958
  const result = this.onPointerDown(touchEvent);
8964
8959
  if (result) {
8965
- this.dragStartTime = Date.now();
8966
- this.dragStartPosition = touchEvent.getPosition();
8967
- this.ngZone?.runOutsideAngular(() => {
8968
- this.document?.addEventListener('selectstart', this.onSelectStart, EventExtensions.activeListener());
8969
- this.document?.addEventListener('touchmove', this.onTouchMove);
8970
- this.document?.addEventListener('pointerup', this.onPointerUpEvent);
8971
- this.document?.addEventListener('pointercancel', this.onPointerUpEvent, EventExtensions.activeCaptureListener());
8972
- this.document?.addEventListener('contextmenu', this.onContextMenuDuringDrag, EventExtensions.activeCaptureListener());
8960
+ this._dragStartTime = Date.now();
8961
+ this._dragStartPosition = touchEvent.getPosition();
8962
+ this._ngZone?.runOutsideAngular(() => {
8963
+ this._listen('selectstart', this._onSelectStart, EventExtensions.activeListener());
8964
+ this._listen('touchmove', this._onTouchMove);
8965
+ this._listen('pointerup', this._onPointerUpEvent);
8966
+ this._listen('pointercancel', this._onPointerUpEvent, EventExtensions.activeCaptureListener());
8967
+ this._listen('contextmenu', this._preventDuringDrag, EventExtensions.activeCaptureListener());
8973
8968
  });
8974
- this.touchListeners = () => {
8975
- this.document?.removeEventListener('selectstart', this.onSelectStart, EventExtensions.activeListener());
8976
- this.document?.removeEventListener('touchmove', this.onTouchMove);
8977
- this.document?.removeEventListener('pointerup', this.onPointerUpEvent);
8978
- this.document?.removeEventListener('pointercancel', this.onPointerUpEvent, EventExtensions.activeCaptureListener());
8979
- this.document?.removeEventListener('contextmenu', this.onContextMenuDuringDrag, EventExtensions.activeCaptureListener());
8969
+ this._touchListeners = () => {
8970
+ this._unlisten('selectstart', this._onSelectStart, EventExtensions.activeListener());
8971
+ this._unlisten('touchmove', this._onTouchMove);
8972
+ this._unlisten('pointerup', this._onPointerUpEvent);
8973
+ this._unlisten('pointercancel', this._onPointerUpEvent, EventExtensions.activeCaptureListener());
8974
+ this._unlisten('contextmenu', this._preventDuringDrag, EventExtensions.activeCaptureListener());
8980
8975
  };
8981
8976
  }
8982
8977
  };
@@ -8986,7 +8981,7 @@ class DragAndDropBase {
8986
8981
  * It prevents the default behavior and calls the onSelect method to handle the selection.
8987
8982
  * @param event - The event that triggered the select start.
8988
8983
  */
8989
- onSelectStart = (event) => {
8984
+ _onSelectStart = (event) => {
8990
8985
  this.onSelect(event);
8991
8986
  };
8992
8987
  /**
@@ -8994,16 +8989,16 @@ class DragAndDropBase {
8994
8989
  * It checks if the drag sequence should start and calls the move handler accordingly.
8995
8990
  * @param event - The mouse event that triggered the move.
8996
8991
  */
8997
- onMouseMove = (event) => {
8998
- this.moveHandler(new IMouseEvent(event));
8992
+ _onMouseMove = (event) => {
8993
+ this._moveHandler(new IMouseEvent(event));
8999
8994
  };
9000
8995
  /**
9001
8996
  * Handles the touch move event during the drag sequence.
9002
8997
  * It checks if the drag sequence should start and calls the move handler accordingly.
9003
8998
  * @param event - The touch event that triggered the move.
9004
8999
  */
9005
- onTouchMove = (event) => {
9006
- this.moveHandler(new ITouchMoveEvent(event));
9000
+ _onTouchMove = (event) => {
9001
+ this._moveHandler(new ITouchMoveEvent(event));
9007
9002
  };
9008
9003
  /**
9009
9004
  * Checks if the drag sequence should start based on the pointer position.
@@ -9013,25 +9008,25 @@ class DragAndDropBase {
9013
9008
  * it prepares the drag sequence and sets the move handler to onPointerMove.
9014
9009
  * @param event - The pointer event that triggered the check.
9015
9010
  */
9016
- checkDragSequenceToStart(event) {
9011
+ _checkDragSequenceToStart(event) {
9017
9012
  const pointerPosition = event.getPosition();
9018
- if (!this.isDragStarted && this.pointerDownElement) {
9019
- event.setTarget(this.pointerDownElement);
9020
- const distanceX = Math.abs(pointerPosition.x - this.dragStartPosition.x);
9021
- const distanceY = Math.abs(pointerPosition.y - this.dragStartPosition.y);
9022
- const isOverThreshold = distanceX + distanceY >= this.dragStartThreshold;
9013
+ if (!this.isDragStarted && this._pointerDownElement) {
9014
+ event.setTarget(this._pointerDownElement);
9015
+ const distanceX = Math.abs(pointerPosition.x - this._dragStartPosition.x);
9016
+ const distanceY = Math.abs(pointerPosition.y - this._dragStartPosition.y);
9017
+ const isOverThreshold = distanceX + distanceY >= this._dragStartThreshold;
9023
9018
  if (isOverThreshold) {
9024
- const isDelayElapsed = Date.now() >= this.dragStartTime + this.dragStartDelay;
9019
+ const isDelayElapsed = Date.now() >= this._dragStartTime + this._dragStartDelay;
9025
9020
  if (!isDelayElapsed) {
9026
- this.endDragSequence();
9021
+ this._endDragSequence();
9027
9022
  return;
9028
9023
  }
9029
9024
  event.preventDefault();
9030
9025
  this.prepareDragSequence(event);
9031
9026
  this.isDragStarted = true;
9032
- this.moveHandler = this.onPointerMove;
9027
+ this._moveHandler = this.onPointerMove;
9033
9028
  if (isTouchEvent(event.originalEvent)) {
9034
- this.lastTouchEventTime = Date.now();
9029
+ this._lastTouchEventTime = Date.now();
9035
9030
  }
9036
9031
  }
9037
9032
  }
@@ -9043,11 +9038,11 @@ class DragAndDropBase {
9043
9038
  * This method is called when the user releases the mouse button or lifts their finger from the touch screen.
9044
9039
  * @param event - The pointer event that triggered the up action.
9045
9040
  */
9046
- onPointerUpEvent = (event) => {
9041
+ _onPointerUpEvent = (event) => {
9047
9042
  if (this.isDragStarted) {
9048
9043
  this.onPointerUp(new IPointerUpEvent(event));
9049
9044
  }
9050
- this.endDragSequence();
9045
+ this._endDragSequence();
9051
9046
  };
9052
9047
  /**
9053
9048
  * Ends the drag sequence by resetting the state and removing event listeners.
@@ -9055,39 +9050,42 @@ class DragAndDropBase {
9055
9050
  * and resets the moveHandler to checkDragSequenceToStart.
9056
9051
  * It also removes all mouse and touch event listeners that were added during the drag sequence.
9057
9052
  */
9058
- endDragSequence() {
9053
+ _endDragSequence() {
9059
9054
  this.isDragStarted = false;
9060
- this.pointerDownElement = null;
9061
- this.moveHandler = this.checkDragSequenceToStart;
9062
- this.mouseListeners();
9063
- this.mouseListeners = EventExtensions.emptyListener();
9064
- this.touchListeners();
9065
- this.touchListeners = EventExtensions.emptyListener();
9055
+ this._pointerDownElement = null;
9056
+ this._moveHandler = this._checkDragSequenceToStart;
9057
+ this._mouseListeners();
9058
+ this._mouseListeners = EventExtensions.emptyListener();
9059
+ this._touchListeners();
9060
+ this._touchListeners = EventExtensions.emptyListener();
9066
9061
  this.finalizeDragSequence();
9067
9062
  }
9068
- subscribe(fDocument) {
9069
- if (this.document) {
9070
- this.unsubscribe();
9071
- }
9072
- this.document = fDocument;
9073
- this.ngZone?.runOutsideAngular(() => {
9074
- fDocument.addEventListener('mousedown', this.onMouseDown, EventExtensions.activeListener());
9075
- fDocument.addEventListener('touchstart', this.onTouchDown, EventExtensions.passiveListener());
9063
+ subscribe() {
9064
+ this.unsubscribe();
9065
+ this._ngZone?.runOutsideAngular(() => {
9066
+ this._listen('mousedown', this._onMouseDown, EventExtensions.activeListener());
9067
+ this._listen('touchstart', this._onTouchDown, EventExtensions.passiveListener());
9076
9068
  });
9077
- this.startListeners = () => {
9078
- fDocument.removeEventListener('mousedown', this.onMouseDown, EventExtensions.activeListener());
9079
- fDocument.removeEventListener('touchstart', this.onTouchDown, EventExtensions.passiveListener());
9069
+ this._startListeners = () => {
9070
+ this._unlisten('mousedown', this._onMouseDown, EventExtensions.activeListener());
9071
+ this._unlisten('touchstart', this._onTouchDown, EventExtensions.passiveListener());
9080
9072
  };
9081
9073
  }
9082
9074
  unsubscribe() {
9083
- this.startListeners();
9084
- this.startListeners = EventExtensions.emptyListener();
9085
- this.touchListeners();
9086
- this.touchListeners = EventExtensions.emptyListener();
9087
- this.mouseListeners();
9088
- this.mouseListeners = EventExtensions.emptyListener();
9089
- }
9090
- onContextMenuDuringDrag = (e) => {
9075
+ this._startListeners();
9076
+ this._startListeners = EventExtensions.emptyListener();
9077
+ this._touchListeners();
9078
+ this._touchListeners = EventExtensions.emptyListener();
9079
+ this._mouseListeners();
9080
+ this._mouseListeners = EventExtensions.emptyListener();
9081
+ }
9082
+ _listen(type, listener, options) {
9083
+ this._document.addEventListener(type, listener, options);
9084
+ }
9085
+ _unlisten(type, listener, options) {
9086
+ this._document.removeEventListener(type, listener, options);
9087
+ }
9088
+ _preventDuringDrag = (e) => {
9091
9089
  if (this.isDragStarted) {
9092
9090
  e.preventDefault();
9093
9091
  }
@@ -9108,9 +9106,7 @@ function isFakeTouchstartFromScreenReader(event) {
9108
9106
  }
9109
9107
 
9110
9108
  class FDraggableBase extends DragAndDropBase {
9111
- constructor(ngZone) {
9112
- super(ngZone || undefined);
9113
- }
9109
+ hostElement = inject(ElementRef).nativeElement;
9114
9110
  }
9115
9111
 
9116
9112
  const F_BEFORE_MAIN_PLUGIN = new InjectionToken('F_BEFORE_MAIN_PLUGIN');
@@ -9172,11 +9168,9 @@ function isDragBlocker(element) {
9172
9168
  // │ To Start │
9173
9169
  // └──────────────────────────────────────┘
9174
9170
  class FDraggableDirective extends FDraggableBase {
9175
- hostElement = inject(ElementRef).nativeElement;
9176
9171
  _result = inject(FDragHandlerResult);
9177
9172
  _mediator = inject(FMediator);
9178
9173
  _platform = inject(PlatformService);
9179
- _browser = inject(BrowserService);
9180
9174
  disabled = false;
9181
9175
  fMultiSelectTrigger = (event) => {
9182
9176
  return this._platform.getOS() === EOperationSystem.MAC_OS ? event.metaKey : event.ctrlKey;
@@ -9224,14 +9218,11 @@ class FDraggableDirective extends FDraggableBase {
9224
9218
  fDragEnded = new EventEmitter();
9225
9219
  _beforePlugins;
9226
9220
  _afterPlugins;
9227
- constructor() {
9228
- super(inject(NgZone, { optional: true }));
9229
- }
9230
9221
  ngOnInit() {
9231
9222
  this._mediator.execute(new AddDndToStoreRequest(this));
9232
9223
  }
9233
9224
  ngAfterViewInit() {
9234
- super.subscribe(this._browser.document);
9225
+ super.subscribe();
9235
9226
  }
9236
9227
  onPointerDown(event) {
9237
9228
  if (isDragBlocker(event.targetElement)) {
@@ -9289,7 +9280,7 @@ class FDraggableDirective extends FDraggableBase {
9289
9280
  this._mediator.execute(new RemoveDndFromStoreRequest());
9290
9281
  super.unsubscribe();
9291
9282
  }
9292
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FDraggableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
9283
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FDraggableDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
9293
9284
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: FDraggableDirective, selector: "f-flow[fDraggable]", inputs: { disabled: { classPropertyName: "disabled", publicName: "fDraggableDisabled", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, fMultiSelectTrigger: { classPropertyName: "fMultiSelectTrigger", publicName: "fMultiSelectTrigger", isSignal: false, isRequired: false, transformFunction: null }, fReassignConnectionTrigger: { classPropertyName: "fReassignConnectionTrigger", publicName: "fReassignConnectionTrigger", isSignal: false, isRequired: false, transformFunction: null }, fCreateConnectionTrigger: { classPropertyName: "fCreateConnectionTrigger", publicName: "fCreateConnectionTrigger", isSignal: false, isRequired: false, transformFunction: null }, fNodeResizeTrigger: { classPropertyName: "fNodeResizeTrigger", publicName: "fNodeResizeTrigger", isSignal: false, isRequired: false, transformFunction: null }, fNodeRotateTrigger: { classPropertyName: "fNodeRotateTrigger", publicName: "fNodeRotateTrigger", isSignal: false, isRequired: false, transformFunction: null }, fNodeMoveTrigger: { classPropertyName: "fNodeMoveTrigger", publicName: "fNodeMoveTrigger", isSignal: false, isRequired: false, transformFunction: null }, fCanvasMoveTrigger: { classPropertyName: "fCanvasMoveTrigger", publicName: "fCanvasMoveTrigger", isSignal: false, isRequired: false, transformFunction: null }, fExternalItemTrigger: { classPropertyName: "fExternalItemTrigger", publicName: "fExternalItemTrigger", isSignal: false, isRequired: false, transformFunction: null }, fEmitOnNodeIntersect: { classPropertyName: "fEmitOnNodeIntersect", publicName: "fEmitOnNodeIntersect", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, vCellSize: { classPropertyName: "vCellSize", publicName: "vCellSize", isSignal: true, isRequired: false, transformFunction: null }, hCellSize: { classPropertyName: "hCellSize", publicName: "hCellSize", isSignal: true, isRequired: false, transformFunction: null }, fCellSizeWhileDragging: { classPropertyName: "fCellSizeWhileDragging", publicName: "fCellSizeWhileDragging", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fSelectionChange: "fSelectionChange", fNodeIntersectedWithConnections: "fNodeIntersectedWithConnections", fCreateNode: "fCreateNode", fMoveNodes: "fMoveNodes", fReassignConnection: "fReassignConnection", fCreateConnection: "fCreateConnection", fDropToGroup: "fDropToGroup", fDragStarted: "fDragStarted", fDragEnded: "fDragEnded" }, providers: [FDragHandlerResult], queries: [{ propertyName: "_beforePlugins", predicate: F_BEFORE_MAIN_PLUGIN, descendants: true }, { propertyName: "_afterPlugins", predicate: F_AFTER_MAIN_PLUGIN, descendants: true }], exportAs: ["fDraggable"], usesInheritance: true, ngImport: i0 });
9294
9285
  }
9295
9286
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FDraggableDirective, decorators: [{
@@ -9299,7 +9290,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
9299
9290
  exportAs: 'fDraggable',
9300
9291
  providers: [FDragHandlerResult],
9301
9292
  }]
9302
- }], ctorParameters: () => [], propDecorators: { disabled: [{
9293
+ }], propDecorators: { disabled: [{
9303
9294
  type: Input,
9304
9295
  args: [{ transform: booleanAttribute, alias: 'fDraggableDisabled' }]
9305
9296
  }], fMultiSelectTrigger: [{
@@ -12789,7 +12780,7 @@ class FFlowComponent extends FFlowBase {
12789
12780
  ...COMMON_PROVIDERS,
12790
12781
  ...F_DRAGGABLE_PROVIDERS,
12791
12782
  { provide: F_FLOW, useExisting: FFlowComponent },
12792
- ], usesInheritance: true, ngImport: i0, template: "<ng-container>\n <ng-content select=\"[fDefinitions]\"></ng-content>\n\n <ng-content select=\"f-background\"></ng-content>\n\n <ng-content select=\"f-line-alignment\"></ng-content>\n\n <ng-content select=\"f-canvas\"></ng-content>\n\n <ng-content select=\"f-selection-area\"></ng-content>\n\n <ng-content></ng-content>\n</ng-container>\n", styles: [":host{display:block;position:relative;width:100%;height:100%;overflow:hidden;pointer-events:all;-webkit-user-select:none;user-select:none;touch-action:none}::ng-deep .f-connection-content{position:fixed;left:0;top:0;pointer-events:all;transform-origin:50% 50%;will-change:transform}::ng-deep .f-node,::ng-deep .f-group{position:absolute!important;transform-origin:center;-webkit-user-select:none;user-select:none;pointer-events:all;left:0!important;top:0!important}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
12783
+ ], usesInheritance: true, ngImport: i0, template: "<ng-container>\n <ng-content select=\"[fDefinitions]\"></ng-content>\n\n <ng-content select=\"f-background\"></ng-content>\n\n <ng-content select=\"f-line-alignment\"></ng-content>\n\n <ng-content select=\"f-canvas\"></ng-content>\n\n <ng-content select=\"f-selection-area\"></ng-content>\n\n <ng-content></ng-content>\n</ng-container>\n", styles: [":host{display:block;position:relative;width:100%;height:100%;overflow:hidden;pointer-events:all;-webkit-user-select:none;user-select:none;touch-action:none}::ng-deep .f-connection-content{position:absolute;left:0;top:0;pointer-events:all;transform-origin:50% 50%;will-change:transform;z-index:1}::ng-deep .f-node,::ng-deep .f-group{position:absolute!important;transform-origin:center;-webkit-user-select:none;user-select:none;pointer-events:all;left:0!important;top:0!important}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
12793
12784
  }
12794
12785
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FFlowComponent, decorators: [{
12795
12786
  type: Component,
@@ -12804,7 +12795,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
12804
12795
  ...COMMON_PROVIDERS,
12805
12796
  ...F_DRAGGABLE_PROVIDERS,
12806
12797
  { provide: F_FLOW, useExisting: FFlowComponent },
12807
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container>\n <ng-content select=\"[fDefinitions]\"></ng-content>\n\n <ng-content select=\"f-background\"></ng-content>\n\n <ng-content select=\"f-line-alignment\"></ng-content>\n\n <ng-content select=\"f-canvas\"></ng-content>\n\n <ng-content select=\"f-selection-area\"></ng-content>\n\n <ng-content></ng-content>\n</ng-container>\n", styles: [":host{display:block;position:relative;width:100%;height:100%;overflow:hidden;pointer-events:all;-webkit-user-select:none;user-select:none;touch-action:none}::ng-deep .f-connection-content{position:fixed;left:0;top:0;pointer-events:all;transform-origin:50% 50%;will-change:transform}::ng-deep .f-node,::ng-deep .f-group{position:absolute!important;transform-origin:center;-webkit-user-select:none;user-select:none;pointer-events:all;left:0!important;top:0!important}\n"] }]
12798
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container>\n <ng-content select=\"[fDefinitions]\"></ng-content>\n\n <ng-content select=\"f-background\"></ng-content>\n\n <ng-content select=\"f-line-alignment\"></ng-content>\n\n <ng-content select=\"f-canvas\"></ng-content>\n\n <ng-content select=\"f-selection-area\"></ng-content>\n\n <ng-content></ng-content>\n</ng-container>\n", styles: [":host{display:block;position:relative;width:100%;height:100%;overflow:hidden;pointer-events:all;-webkit-user-select:none;user-select:none;touch-action:none}::ng-deep .f-connection-content{position:absolute;left:0;top:0;pointer-events:all;transform-origin:50% 50%;will-change:transform;z-index:1}::ng-deep .f-node,::ng-deep .f-group{position:absolute!important;transform-origin:center;-webkit-user-select:none;user-select:none;pointer-events:all;left:0!important;top:0!important}\n"] }]
12808
12799
  }] });
12809
12800
 
12810
12801
  const F_FLOW_PROVIDERS = [