fix(devtools): links to docs in property view tab

This commit is contained in:
twerske 2021-04-21 09:21:16 -07:00 committed by Minko Gechev
parent fc1e1bca4a
commit 1665bda6cc
3 changed files with 16 additions and 1 deletions

View file

@ -4,6 +4,11 @@
<mat-expansion-panel-header collapsedHeight="25px" expandedHeight="25px">
<mat-panel-title>
{{ panels[index].title }}
<a href="{{ panels[index].documentation }}" target="_blank">
<mat-icon class="docs-link">
link
</mat-icon>
</a>
</mat-panel-title>
</mat-expansion-panel-header>
<ng-property-view-tree

View file

@ -14,6 +14,13 @@
.mat-expansion-panel-header {
padding: 0 15px;
.docs-link {
height: inherit;
width: fit-content;
font-size: initial;
padding-left: 0.1rem;
}
}
.mat-expansion-panel-header-title {

View file

@ -22,22 +22,25 @@ export class PropertyViewBodyComponent {
categoryOrder = [0, 1, 2];
get panels(): { title: string; hidden: boolean; controls: DirectiveTreeData }[] {
get panels(): { title: string; hidden: boolean; controls: DirectiveTreeData; documentation: string }[] {
return [
{
title: '@Inputs',
hidden: this.directiveInputControls.dataSource.data.length === 0,
controls: this.directiveInputControls,
documentation: 'https://angular.io/api/core/Input',
},
{
title: '@Outputs',
hidden: this.directiveOutputControls.dataSource.data.length === 0,
controls: this.directiveOutputControls,
documentation: 'https://angular.io/api/core/Output',
},
{
title: 'Properties',
hidden: this.directiveStateControls.dataSource.data.length === 0,
controls: this.directiveStateControls,
documentation: 'https://angular.io/guide/property-binding',
},
];
}