-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stepper): add step change event (#2779)
- Loading branch information
1 parent
07db7f5
commit 1b871f4
Showing
9 changed files
with
240 additions
and
8 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
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
48 changes: 48 additions & 0 deletions
48
src/playground/with-layout/stepper/stepper-step-change-event.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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<nb-card> | ||
<nb-card-body> | ||
<p *ngIf="changeEvent">Previous step: {{ changeEvent.previouslySelectedIndex }}</p> | ||
<p *ngIf="changeEvent">Current step: {{ changeEvent.index }}</p> | ||
|
||
<nb-stepper orientation="horizontal" (stepChange)="handleStepChange($event)"> | ||
<nb-step [label]="labelOne"> | ||
<ng-template #labelOne>First step</ng-template> | ||
<h4>Step content #1</h4> | ||
<p class="lorem"> | ||
Lorizzle ipsum dolizzle stuff fizzle, consectetuer adipiscing break it down. Nullizzle sapien velizzle, my | ||
shizz pimpin', shizzle my nizzle crocodizzle shut the shizzle up, gravida vizzle, dang. | ||
</p> | ||
<button nbButton disabled nbStepperNext>prev</button> | ||
<button nbButton nbStepperNext>next</button> | ||
</nb-step> | ||
<nb-step [label]="labelTwo"> | ||
<ng-template #labelTwo>Second step</ng-template> | ||
<h4>Step content #2</h4> | ||
<p class="lorem"> | ||
Lorizzle ipsum dolizzle stuff fizzle, consectetuer adipiscing break it down. Nullizzle sapien velizzle, my | ||
shizz pimpin', shizzle my nizzle crocodizzle shut the shizzle up, gravida vizzle, dang. | ||
</p> | ||
<button nbButton nbStepperPrevious>prev</button> | ||
<button nbButton nbStepperNext>next</button> | ||
</nb-step> | ||
<nb-step label="Third step"> | ||
<h4>Step content #3</h4> | ||
<p class="lorem"> | ||
Lorizzle ipsum dolizzle stuff fizzle, consectetuer adipiscing break it down. Nullizzle sapien velizzle, my | ||
shizz pimpin', shizzle my nizzle crocodizzle shut the shizzle up, gravida vizzle, dang. | ||
</p> | ||
<button nbButton nbStepperPrevious>prev</button> | ||
<button nbButton nbStepperNext>next</button> | ||
</nb-step> | ||
<nb-step [label]="labelFour"> | ||
<ng-template #labelFour>Fourth step</ng-template> | ||
<h4>Step content #4</h4> | ||
<p class="lorem"> | ||
Lorizzle ipsum dolizzle stuff fizzle, consectetuer adipiscing break it down. Nullizzle sapien velizzle, my | ||
shizz pimpin', shizzle my nizzle crocodizzle shut the shizzle up, gravida vizzle, dang. | ||
</p> | ||
<button nbButton nbStepperPrevious>prev</button> | ||
<button nbButton disabled nbStepperNext>next</button> | ||
</nb-step> | ||
</nb-stepper> | ||
</nb-card-body> | ||
</nb-card> |
3 changes: 3 additions & 0 deletions
3
src/playground/with-layout/stepper/stepper-step-change-event.component.scss
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,3 @@ | ||
button { | ||
margin: 0.5rem; | ||
} |
14 changes: 14 additions & 0 deletions
14
src/playground/with-layout/stepper/stepper-step-change-event.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Component } from '@angular/core'; | ||
import { NbStepChangeEvent } from '@nebular/theme'; | ||
|
||
@Component({ | ||
templateUrl: './stepper-step-change-event.component.html', | ||
styleUrls: ['./stepper-step-change-event.component.scss'], | ||
}) | ||
export class StepperStepChangeEventComponent { | ||
changeEvent: NbStepChangeEvent; | ||
|
||
handleStepChange(e: NbStepChangeEvent): void { | ||
this.changeEvent = e; | ||
} | ||
} |
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