-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(gantt-table): add collapse in gantt table group
- Loading branch information
1 parent
3b817ba
commit 5101eea
Showing
11 changed files
with
118 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export const defaultStyles = { | ||
lineHeight: 50, | ||
lineHeight: 44, | ||
barHeight: 25, | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,26 @@ | ||
<div class="gantt-table-group-header"> | ||
<ng-template | ||
[ngTemplateOutlet]="groupHeader" | ||
[ngTemplateOutletContext]="{ $implicit: group, group: group }" | ||
></ng-template> | ||
<ng-container *ngIf="groupHeader; else default"> | ||
<ng-template | ||
[ngTemplateOutlet]="groupHeader" | ||
[ngTemplateOutletContext]="{ $implicit: group, group: group.origin }" | ||
></ng-template> | ||
</ng-container> | ||
<ng-template #default> | ||
<div class="gantt-table-group-header-title" (click)="collapseGroup()"> | ||
<!-- todo --> | ||
<span>-></span> | ||
<ng-container *ngIf="groupHeaderTitle; else defaultTitle"> | ||
<ng-template | ||
[ngTemplateOutlet]="groupHeaderTitle" | ||
[ngTemplateOutletContext]="{ $implicit: group, group: group.origin }" | ||
></ng-template> | ||
</ng-container> | ||
<ng-template #defaultTitle> | ||
<span class="group-title"> {{ group.title }}</span> | ||
</ng-template> | ||
</div> | ||
</ng-template> | ||
</div> | ||
<div [hidden]="isCollapse"> | ||
<ng-content></ng-content> | ||
</div> | ||
<ng-content></ng-content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
.gantt-table-group { | ||
.gantt-table-group-header { | ||
height: 50px; | ||
height: 44px; | ||
line-height: 44px; | ||
background: #fafafa; | ||
vertical-align: middle; | ||
display: flex; | ||
align-items: center; | ||
padding: 0 15px; | ||
.gantt-table-group-header-title { | ||
cursor: pointer; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,30 @@ | ||
<table> | ||
<tbody> | ||
<ng-container *ngFor="let row of items; let i = index"> | ||
<ng-template | ||
[ngTemplateOutlet]="trTemplate" | ||
[ngTemplateOutletContext]="{ row: row, index: i, level: 0 }" | ||
></ng-template> | ||
<ng-container *ngFor="let row of items"> | ||
<ng-template [ngTemplateOutlet]="trTemplate" [ngTemplateOutletContext]="{ row: row }"></ng-template> | ||
</ng-container> | ||
</tbody> | ||
</table> | ||
|
||
<ng-template #trTemplate let-row="row" let-i="index" let-level="level"> | ||
<ng-template #trTemplate let-row="row"> | ||
<tr> | ||
<td *ngFor="let column of columns"> | ||
<div [class.text-truncate]="true"> | ||
<ng-template | ||
[ngTemplateOutlet]="tdTemplate" | ||
[ngTemplateOutletContext]="{ | ||
column: column, | ||
row: row.origin, | ||
index: i | ||
row: row.origin | ||
}" | ||
></ng-template> | ||
</div> | ||
</td> | ||
</tr> | ||
</ng-template> | ||
|
||
<ng-template #tdTemplate let-column="column" let-row="row" let-index="index"> | ||
<ng-template #tdTemplate let-column="column" let-row="row"> | ||
<ng-template | ||
[ngTemplateOutlet]="column.templateRef" | ||
[ngTemplateOutletContext]="{ $implicit: row, row: row.origin, index: index }" | ||
[ngTemplateOutletContext]="{ $implicit: row, row: row.origin }" | ||
></ng-template> | ||
</ng-template> |