Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(collapse): add horizontal collapse
- Loading branch information
1 parent
f96ec1a
commit 98f0527
Showing
8 changed files
with
124 additions
and
53 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
15 changes: 15 additions & 0 deletions
15
demo/src/app/components/collapse/demos/horizontal/collapse-horizontal.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<p>You need a width on the immediate child element for the animation to work correctly.<p> | ||
<button type="button" class="btn btn-outline-primary" (click)="collapse.toggle()" [attr.aria-expanded]="!isCollapsed" | ||
aria-controls="collapseExample"> | ||
Toggle | ||
</button> | ||
</p> | ||
<div style="min-height: 100px;"> | ||
<div #collapse="ngbCollapse" [(ngbCollapse)]="isCollapsed" [horizontal]="true"> | ||
<div class="card" style="width: 300px;"> | ||
<div class="card-body"> | ||
You can collapse horizontally this card by clicking Toggle | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
14 changes: 14 additions & 0 deletions
14
demo/src/app/components/collapse/demos/horizontal/collapse-horizontal.module.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {BrowserModule} from '@angular/platform-browser'; | ||
import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; | ||
|
||
import {NgbdCollapseHorizontal} from './collapse-horizontal'; | ||
|
||
@NgModule({ | ||
imports: [BrowserModule, NgbModule], | ||
declarations: [NgbdCollapseHorizontal], | ||
exports: [NgbdCollapseHorizontal], | ||
bootstrap: [NgbdCollapseHorizontal] | ||
}) | ||
export class NgbdCollapseHorizontalModule { | ||
} |
10 changes: 10 additions & 0 deletions
10
demo/src/app/components/collapse/demos/horizontal/collapse-horizontal.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {Component} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'ngbd-collapse-horizontal', | ||
templateUrl: './collapse-horizontal.html' | ||
}) | ||
|
||
export class NgbdCollapseHorizontal { | ||
public isCollapsed = false; | ||
} |
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