platform-components-ng/projects/platform-components-lib/src/lib/components/collection/collection-browser-tree/collection-browser-tree.component.ts
Qpp collection tree
| selector | qpp-collection-tree |
| templateUrl | ./collection-browser-tree.component.html |
constructor(collectionService: CollectionBrowsingService, errorMessageService: QppErrorMessageService, treeDragDropService: TreeDragDropService)
|
||||||||||||
|
Parameters :
|
| config |
Type : CollectionBrowserTreeConfig
|
Default value : new CollectionBrowserTreeConfig({ enableCollectionMove: false })
|
|
Parent component can pass the config for move collection to browser tree |
| selectedNodeId |
Type : number
|
| collectionSelected |
Type : EventEmitter
|
| keydown |
Arguments : '$event'
|
keydown(event: KeyboardEvent)
|
| createPrimeNgTreeNode | ||||
createPrimeNgTreeNode(collectionObj)
|
||||
|
The collection data from the API gateway is modelled into Prime NG tree nodes.
Parameters :
Returns :
any
any |
| expandNodeOnDragOver | ||||||
expandNodeOnDragOver(node)
|
||||||
|
Expands the node when dragged over
Parameters :
Returns :
void
|
| expandParents | ||||||||||||
expandParents(parentCollections, nodeId: number)
|
||||||||||||
|
Expands the parent collections.
Parameters :
Returns :
Promise<void>
A promise that resolves when the expansion is complete. |
| findCollectionInHierarchy | |||||||||
findCollectionInHierarchy(tree, collectionId)
|
|||||||||
|
Finds the given collectionId in the tree.
Parameters :
Returns :
any
any |
| getExpandCollapseButton | ||||||||
getExpandCollapseButton(collectionId: number)
|
||||||||
|
Get Expand/Collapse Button
Parameters :
Returns :
any | null
any |
| handleItemsDrop | ||||||||||||
handleItemsDrop(event: CdkDragDrop
|
||||||||||||
|
Handles item drop on a specific node (shared logic)
Parameters :
Returns :
void
|
| loadNode | |||||||||
loadNode(node, el?: any)
|
|||||||||
|
Loads child nodes of the given node.
Parameters :
Returns :
void
void |
| ngOnChanges |
ngOnChanges()
|
|
Component lifecycle hook
Returns :
void
void |
| ngOnDestroy |
ngOnDestroy()
|
|
Componet life cycle hook All subscriptions are closed by setting alive as false.
Returns :
void
|
| ngOnInit | ||||||||
ngOnInit(refresh)
|
||||||||
|
Component lifecycle hook
Parameters :
Returns :
void
void |
| nodeSelect | ||||||
nodeSelect(event)
|
||||||
|
Node select
Parameters :
Returns :
void
void |
| nodeSelectionChanged | ||||
nodeSelectionChanged(collection)
|
||||
|
Node selection changed
Parameters :
Returns :
void
void |
| onDrop | ||||||
onDrop(event)
|
||||||
|
Handles internal collection drag-drop within the tree
Parameters :
Returns :
void
|
| onNodeDragOver | ||||||||||||
onNodeDragOver(event: DragEvent, node: any)
|
||||||||||||
|
Handles node-level drag over for auto-expansion
Parameters :
Returns :
void
|
| onNodeDragOverTreeNode | |||||||||
onNodeDragOverTreeNode(event: DragEvent, node: any)
|
|||||||||
|
Parameters :
Returns :
void
|
| onNodeExpand | ||||||
onNodeExpand(eventNode)
|
||||||
|
On node expand
Parameters :
Returns :
void
void |
| onTreeContainerDragEnter |
onTreeContainerDragEnter()
|
|
Handles CDK drag enter/leave on the tree container
Returns :
void
|
| onTreeContainerDragLeave |
onTreeContainerDragLeave()
|
|
Handles CDK drag leave on the tree container
Returns :
void
|
| onTreeContainerDrop | ||||||||
onTreeContainerDrop(event: CdkDragDrop
|
||||||||
|
Handles CDK drop on the tree container with intelligent node detection
Parameters :
Returns :
void
|
| selectRootNode | ||||
selectRootNode(collectionObj)
|
||||
|
Select root node
Parameters :
Returns :
void
void |
| setSelectedCollectionNode | ||||
setSelectedCollectionNode(collection)
|
||||
|
Set selected collection node
Parameters :
Returns :
void
void |
| updateCollectionHierarchy | ||||||
updateCollectionHierarchy(selectedNode, nodes)
|
||||||
|
Update collection hierarchy
Parameters :
Returns :
void
void |
| updateCollectionTree | ||||||||
updateCollectionTree(treeNodes, selectedCollectionNodeId, childNodes)
|
||||||||
|
All addition, deletion, updation of nodes is done by iterating over the nodes, comparing them with the new data and then updating the tree if changes exist.
Parameters :
Returns :
void
void |
| updateCollectionTreeComponent | ||||||||||||||||||||
updateCollectionTreeComponent(nodeId, parentId: number, refresh)
|
||||||||||||||||||||
|
Change the selected node in the Tree if the target node is already loaded. If the node and its parent nodes have not been loaded, load the parents and expand them until the target node is reached.
Parameters :
Returns :
void
void |
| updateRootNode | ||||
updateRootNode(aCollection)
|
||||
|
Update root node
Parameters :
Returns :
void
|
| alive |
Default value : true
|
| allowItemDrop |
Default value : false
|
| collectionBrowserTree |
Type : Tree
|
Decorators :
@ViewChild('collectionBrowserTree')
|
| collectionMoveDlg |
Type : QppCollectionMoveConfirmComponent
|
Decorators :
@ViewChild('collectionMoveDialog')
|
|
Collection drag dialog present as child component of browser tree component |
| collectionNodes |
Type : any[]
|
Default value : []
|
| dragEntered |
Default value : false
|
| isDragDrop |
Default value : false
|
| lastHoveredNode |
Type : any
|
Default value : null
|
| selectedCollectionId |
Type : number
|
| selectedCollectionNode |
Type : any
|
| showLoader |
Default value : true
|