diff --git a/docs/content-services/components/tree.component.md b/docs/content-services/components/tree.component.md index d49ddeb2cb..2ee18cb4eb 100644 --- a/docs/content-services/components/tree.component.md +++ b/docs/content-services/components/tree.component.md @@ -27,23 +27,25 @@ Shows the nodes in tree structure, each node containing children is collapsible/ ### Properties -| Name | Type | Default value | Description | -| ---- | ---- | ------------- | ----------- | -| emptyContentTemplate | `TemplateRef` | | Template that will be rendered when no nodes are loaded. | -| nodeActionsMenuTemplate | `TemplateRef` | | Template that will be rendered when context menu for given node is opened. | -| stickyHeader | `boolean` | false | If set to true header will be sticky. | -| selectableNodes | `boolean` | false | If set to true nodes will be selectable. | -| displayName | `string` | | Display name for tree title. | -| loadMoreSuffix | `string` | | Suffix added to `Load more` string inside load more node. | -| expandIcon | `string` | `chevron_right` | Icon shown when node is collapsed. | -| collapseIcon | `string` | `expand_more` | Icon showed when node is expanded. | +| Name | Type | Default value | Description | +| ---- |---------------| --------- | ----------- | +| emptyContentTemplate | `TemplateRef` | | Template that will be rendered when no nodes are loaded. | +| nodeActionsMenuTemplate | `TemplateRef` | | Template that will be rendered when context menu for given node is opened. | +| stickyHeader | `boolean` | false | If set to true header will be sticky. | +| selectableNodes | `boolean` | false | If set to true nodes will be selectable. | +| displayName | `string` | | Display name for tree title. | +| loadMoreSuffix | `string` | | Suffix added to `Load more` string inside load more node. | +| expandIcon | `string` | `chevron_right` | Icon shown when node is collapsed. | +| collapseIcon | `string` | `expand_more` | Icon showed when node is expanded. | +| contextMenuOptions | `any[]` | | Array of context menu options which should be displayed for each row. | ### Events -| Name | Type | Description | -| ---- | ---- | ----------- | -| paginationChanged | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when during loading additional nodes pagination changes. | +| Name | Type | Description | +| ---- |----------------------------------------------------------------------------------------|------------------------------------------------------------------| +| paginationChanged | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when during loading additional nodes pagination changes. | +| contextMenuOptionSelected | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`>` | Emitted when any context menu option is selected. | ## Details diff --git a/lib/content-services/src/lib/tree/components/tree.component.html b/lib/content-services/src/lib/tree/components/tree.component.html index 22b8ad1414..c559cf44f5 100644 --- a/lib/content-services/src/lib/tree/components/tree.component.html +++ b/lib/content-services/src/lib/tree/components/tree.component.html @@ -33,7 +33,9 @@
- + {{ 'ADF-TREE.LOAD-MORE-BUTTON' | translate: { name: loadMoreSuffix } }}
@@ -42,7 +44,10 @@ class="adf-tree-row" [attr.data-automation-id]="'node_' + node.id" *matTreeNodeDef="let node" - matTreeNodePadding> + matTreeNodePadding + [adf-context-menu]="contextMenuOptions" + [adf-context-menu-enabled]="!!contextMenuOptions" + (contextmenu)="contextMenuSource = node">