FilterTreeService
Defined in: filtering/tree/filter-tree.service.ts:50
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FilterTreeService():
FilterTreeService
Returns
Section titled “Returns”FilterTreeService
Methods
Section titled “Methods”applyDrop()
Section titled “applyDrop()”applyDrop(
root,dragId,position):FilterNode
Defined in: filtering/tree/filter-tree.service.ts:61
Apply a drop operation to the tree and return a new root.
Deep-clones the incoming root first so the caller’s reference is never mutated. All splice / replace operations happen on the clone.
Parameters
Section titled “Parameters”dragId
Section titled “dragId”string
position
Section titled “position”Returns
Section titled “Returns”canRedo()
Section titled “canRedo()”canRedo(
history):boolean
Defined in: filtering/tree/filter-tree.service.ts:174
Parameters
Section titled “Parameters”history
Section titled “history”Returns
Section titled “Returns”boolean
canUndo()
Section titled “canUndo()”canUndo(
history):boolean
Defined in: filtering/tree/filter-tree.service.ts:170
Parameters
Section titled “Parameters”history
Section titled “history”Returns
Section titled “Returns”boolean
commitState()
Section titled “commitState()”commitState(
history,newRoot):FilterTreeHistory
Defined in: filtering/tree/filter-tree.service.ts:147
Push a new tree state onto the history stack. Truncates any redo states beyond the current index.
Parameters
Section titled “Parameters”history
Section titled “history”newRoot
Section titled “newRoot”Returns
Section titled “Returns”currentRoot()
Section titled “currentRoot()”currentRoot(
history):FilterNode
Defined in: filtering/tree/filter-tree.service.ts:166
The tree at the current history position.
Parameters
Section titled “Parameters”history
Section titled “history”Returns
Section titled “Returns”deleteNode()
Section titled “deleteNode()”deleteNode(
root,nodeId):FilterNode
Defined in: filtering/tree/filter-tree.service.ts:126
Delete a node from the tree by ID.
Deep-clones the tree first, extracts the target node from the clone, enforces the >=2-children invariant, then returns the clone.
Parameters
Section titled “Parameters”nodeId
Section titled “nodeId”string
Returns
Section titled “Returns”initHistory()
Section titled “initHistory()”initHistory(
root):FilterTreeHistory
Defined in: filtering/tree/filter-tree.service.ts:139
Create a fresh history with a single initial state.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”redo()
Section titled “redo()”redo(
history):FilterTreeHistory|null
Defined in: filtering/tree/filter-tree.service.ts:160
Step forward one state. Returns null if already at the end.
Parameters
Section titled “Parameters”history
Section titled “history”Returns
Section titled “Returns”FilterTreeHistory | null
toggleConjunction()
Section titled “toggleConjunction()”toggleConjunction(
root,branchId):FilterNode
Defined in: filtering/tree/filter-tree.service.ts:111
Toggle a branch’s conjunction between ”&&” and ”||”. Deep-clones the tree first so the original is never mutated.
Parameters
Section titled “Parameters”branchId
Section titled “branchId”string
Returns
Section titled “Returns”undo()
Section titled “undo()”undo(
history):FilterTreeHistory|null
Defined in: filtering/tree/filter-tree.service.ts:154
Step back one state. Returns null if already at the beginning.
Parameters
Section titled “Parameters”history
Section titled “history”Returns
Section titled “Returns”FilterTreeHistory | null