-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ɵtoolkit/accordion): remove viewport from accordion
It turned out to be impractical to put the accordion in a viewport by default. Instead, it should be left to the developer to decide. Perhaps, if at all, only certain accordion item need to be displayed in a viewport.
- Loading branch information
1 parent
8033a79
commit ff0aac3
Showing
4 changed files
with
87 additions
and
62 deletions.
There are no files selected for viewing
51 changes: 22 additions & 29 deletions
51
projects/scion/toolkit.internal/widgets/src/accordion/accordion.component.html
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,29 +1,22 @@ | ||
<sci-viewport> | ||
<div cdkAccordion [multi]="multi" sciDimension #accordion_size="sciDimension"> | ||
<div sciDimension #accordion_client_size="sciDimension" | ||
class="accordion-client" | ||
[class.filled]="accordion_size.dimension.offsetHeight === accordion_client_size.dimension.offsetHeight"> | ||
<section #section | ||
*ngFor="let item of items; trackBy: trackByFn" | ||
class="accordion-item e2e-accordion-item" | ||
[class.e2e-expanded]="cdkAccordionItem.expanded" | ||
[ngClass]="item.cssClass" | ||
cdkAccordionItem #cdkAccordionItem="cdkAccordionItem" | ||
[expanded]="item.expanded"> | ||
<header (click)="onToggle(cdkAccordionItem, section)" class="e2e-accordion-item-header"> | ||
<div> | ||
<ng-container *ngTemplateOutlet="item.template"></ng-container> | ||
</div> | ||
<button class="material-icons e2e-toggle" | ||
[class.e2e-expand]="!cdkAccordionItem.expanded" | ||
[class.e2e-collapse]="cdkAccordionItem.expanded"> | ||
{{cdkAccordionItem.expanded ? 'expand_less' : 'expand_more'}} | ||
</button> | ||
</header> | ||
<section *ngIf="cdkAccordionItem.expanded" @enter> | ||
<ng-container *ngTemplateOutlet="item.panel"></ng-container> | ||
</section> | ||
</section> | ||
</div> | ||
</div> | ||
</sci-viewport> | ||
<div cdkAccordion [multi]="multi" class="accordion"> | ||
<section *ngFor="let item of items; trackBy: trackByFn" | ||
class="accordion-item e2e-accordion-item" | ||
[class.e2e-expanded]="cdkAccordionItem.expanded" | ||
[ngClass]="item.cssClass" | ||
cdkAccordionItem #cdkAccordionItem="cdkAccordionItem" | ||
[expanded]="item.expanded"> | ||
<header (click)="onToggle(cdkAccordionItem)" class="e2e-accordion-item-header"> | ||
<div> | ||
<ng-container *ngTemplateOutlet="item.template"></ng-container> | ||
</div> | ||
<button class="material-icons e2e-toggle" | ||
[class.e2e-expand]="!cdkAccordionItem.expanded" | ||
[class.e2e-collapse]="cdkAccordionItem.expanded"> | ||
{{cdkAccordionItem.expanded ? 'expand_less' : 'expand_more'}} | ||
</button> | ||
</header> | ||
<section *ngIf="cdkAccordionItem.expanded" @enter> | ||
<ng-container *ngTemplateOutlet="item.panel"></ng-container> | ||
</section> | ||
</section> | ||
</div> |
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