Skip to content

FilterTreeComponent

Root component for editing a filter tree with drag-and-drop and undo/redo.

  • OnInit

new FilterTreeComponent(): FilterTreeComponent

FilterTreeComponent

allDropListIds: Signal<string[]>

Flat array of ALL cdkDropList IDs currently in the tree. Passed to [cdkDropListConnectedTo] on every branch body so cross-branch dragging works. Each branch contributes one ID: drop-list-<nodeId>.


readonly canClearAll: Signal<boolean>

True when the tree has at least one child (i.e. there are filters to clear).


readonly canRedo: Signal<boolean>

True when there’s at least one state to redo to.


readonly canUndo: Signal<boolean>

True when there’s at least one state to undo to.


initialTree: InputSignal<FilterNode | undefined>

Optional initial tree. If not provided, an empty root branch is created. The component makes its own internal copy so callers don’t need to worry about mutations.


readonly root: WritableSignal<FilterNode>

The authoritative tree state. All mutations update this signal.


treeChange: OutputEmitterRef<FilterNode>

Emitted after every successful tree mutation (including undo/redo).

applyExternalUpdate(newRoot): void

Apply an external tree mutation through the history stack. Used by FilterEditorComponent when appending a new leaf.

FilterNode

void


clearAll(): void

void


ngOnInit(): void

A callback method that is invoked immediately after the default change detector has checked the directive’s data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated.

void

OnInit.ngOnInit


onConjunctionToggle(branchId): void

Handle a conjunction toggle from any branch.

string

void


onKeydown(event): void

KeyboardEvent

void


onNodeDelete(nodeId): void

Handle a node deletion from anywhere in the tree.

string

void


onNodeDrop(event): void

Handle a drop event from any node in the tree. resolveDropPosition runs inside FilterNodeComponent at drop time, so we receive a fully resolved DropPosition here.

string

DropPosition

void


redo(): void

void


undo(): void

void