Skip to content

Commit 42f3631

Browse files
author
mmart1n
committed
refactor(stepper): layout and class names
1 parent 46062af commit 42f3631

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

projects/igniteui-angular/src/lib/stepper/igx-stepper.component.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<div class="igx-stepper" [ngClass]="orientation === 'Horizontal' ? 'igx-stepper--horizontal' : 'igx-stepper--vertical'">
1+
<div class="igx-stepper__header">
22
<ng-content select="igx-step"></ng-content>
33
</div>
44

5-
<div *ngIf="orientation === 'Horizontal'" class="horizontal-container">
5+
<div *ngIf="orientation === 'Horizontal'" class="igx-stepper__body">
66
<ng-container *ngFor="let step of steps">
77
<ng-container *ngTemplateOutlet="step.contentTemplate"></ng-container>
88
</ng-container>

projects/igniteui-angular/src/lib/stepper/igx-stepper.component.ts

+5
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ export class IgxStepperComponent extends IgxCarouselComponentBase implements OnI
3636
@HostBinding('class.igx-stepper')
3737
public cssClass = 'igx-stepper';
3838

39+
@HostBinding('class.igx-stepper--horizontal')
40+
public get directionClass() {
41+
return this.orientation === IgxStepperOrienatation.Horizontal;
42+
}
43+
3944
/** Get/Set the animation settings that branches should use when expanding/collpasing.
4045
*
4146
* ```html

projects/igniteui-angular/src/lib/stepper/step/igx-step.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</ng-template>
66

77
<ng-template #contentTemplate>
8-
<div class="igx-step__content" [ngClass]="{ 'igx-step__content--active': active }" #contentContainer>
8+
<div [ngClass]="contentClasses" #contentContainer>
99
<ng-content *ngIf="active || collapsing"></ng-content>
1010
</div>
1111
</ng-template>

projects/igniteui-angular/src/lib/stepper/step/igx-step.component.ts

+11
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,14 @@ export class IgxStepComponent extends ToggleAnimationPlayer implements OnInit, A
301301
/** @hidden @internal */
302302
public ngAfterViewInit() { }
303303

304+
public get contentClasses() {
305+
if (this.isHorizontal) {
306+
return { 'igx-stepper__body-content': true, 'igx-stepper__body-content--active': this.active };
307+
} else {
308+
return 'igx-step__content';
309+
}
310+
}
311+
304312
public get stepHeaderClasses() {
305313
if (this.active) {
306314
return 'igx-step__header--active';
@@ -311,6 +319,9 @@ export class IgxStepComponent extends ToggleAnimationPlayer implements OnInit, A
311319
if (this.skip) {
312320
return 'igx-step__header--skip';
313321
}
322+
if (this.optional) {
323+
return 'igx-step__header--optional';
324+
}
314325
}
315326

316327
// /**

0 commit comments

Comments
 (0)