-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(stark-demo): change default behaviour of collapsible icon
- rotate the default icon by 90deg when the collapsible is open - small refactor ISSUES CLOSED: #1013
- Loading branch information
1 parent
c5c34c6
commit 3737371
Showing
9 changed files
with
77 additions
and
94 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
5 changes: 4 additions & 1 deletion
5
packages/stark-ui/src/modules/collapsible/components/collapsible.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
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
29 changes: 9 additions & 20 deletions
29
showcase/src/app/demo-ui/pages/collapsible/demo-collapsible-page.component.ts
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,32 +1,21 @@ | ||
import { Component, OnInit } from "@angular/core"; | ||
import { Component } from "@angular/core"; | ||
import { ReferenceLink } from "../../../shared/components"; | ||
|
||
@Component({ | ||
selector: "demo-collapsible", | ||
styleUrls: ["./demo-collapsible-page.component.scss"], | ||
templateUrl: "./demo-collapsible-page.component.html" | ||
}) | ||
export class DemoCollapsiblePageComponent implements OnInit { | ||
public collapsed: boolean[] = [false, true, false, true, false, false, false]; | ||
public referenceList: ReferenceLink[]; | ||
|
||
public constructor() { | ||
// empty constructor | ||
} | ||
export class DemoCollapsiblePageComponent { | ||
public collapsed: boolean[] = [false, false, true]; | ||
public referenceList: ReferenceLink[] = [ | ||
{ | ||
label: "Stark Collapsible component", | ||
url: "https://stark.nbb.be/api-docs/stark-ui/latest/components/StarkCollapsibleComponent.html" | ||
} | ||
]; | ||
|
||
public toggleCollapsible(nb: number): void { | ||
this.collapsed[nb] = !this.collapsed[nb]; | ||
} | ||
|
||
/** | ||
* Component lifecycle hook | ||
*/ | ||
public ngOnInit(): void { | ||
this.referenceList = [ | ||
{ | ||
label: "Stark Collapsible component", | ||
url: "https://stark.nbb.be/api-docs/stark-ui/latest/components/StarkCollapsibleComponent.html" | ||
} | ||
]; | ||
} | ||
} |
29 changes: 14 additions & 15 deletions
29
showcase/src/assets/examples/collapsible/collapsible-custom.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,22 +1,21 @@ | ||
<stark-collapsible | ||
htmlId="secondCollapsible" | ||
titleLabel="Custom icon collapsible title" | ||
[(isExpanded)]="collapsed[0]" | ||
[iconSpinningEnabled]="true" | ||
icon="chevron-down" | ||
>Any HTML content | ||
</stark-collapsible> | ||
<button color="primary" class="collapsible-demo-button" (click)="toggleCollapsible(0)" mat-raised-button>Toggle collapsible</button> | ||
<hr class="collapsible-demo-line" /> | ||
|
||
<stark-collapsible htmlId="thirdCollapsible" titleLabel="Custom icon collapsible title" [(isExpanded)]="collapsed[1]" icon="information" | ||
<stark-collapsible htmlId="thirdCollapsible" | ||
titleLabel="Custom icon collapsible title" | ||
[(isExpanded)]="collapsed[0]" | ||
icon="information" | ||
>Any HTML content | ||
</stark-collapsible> | ||
|
||
<button color="primary" class="collapsible-demo-button" (click)="toggleCollapsible(1)" mat-raised-button>Toggle collapsible</button> | ||
<button color="primary" class="collapsible-demo-button" (click)="toggleCollapsible(0)" mat-raised-button>Toggle | ||
collapsible | ||
</button> | ||
<hr class="collapsible-demo-line" /> | ||
|
||
<stark-collapsible htmlId="fourthCollapsible" titleLabel="Custom icon collapsible title" [(isExpanded)]="collapsed[2]" icon="account-circle" | ||
<stark-collapsible htmlId="fourthCollapsible" | ||
titleLabel="Custom icon collapsible title" | ||
[(isExpanded)]="collapsed[1]" | ||
icon="account-circle" | ||
>Any HTML content | ||
</stark-collapsible> | ||
<button color="primary" class="collapsible-demo-button" (click)="toggleCollapsible(2)" mat-raised-button>Toggle collapsible</button> | ||
<button color="primary" class="collapsible-demo-button" (click)="toggleCollapsible(1)" mat-raised-button>Toggle | ||
collapsible | ||
</button> |
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