Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit 136d446

Browse files
matgraynshahan
authored andcommitted
Add partially complete state to material stepper
PiperOrigin-RevId: 258970316
1 parent 809e6c7 commit 136d446

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

angular_components/lib/material_stepper/material_step.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ class StepDirective extends TemplatePortal {
5656
@Input()
5757
bool complete = false;
5858

59+
/// Whether the step is partially complete
60+
///
61+
/// This will show the step icon with a 3/4 circle
62+
bool _partiallyComplete = false;
63+
@Input()
64+
set partiallyComplete(bool b) {
65+
assert(!b || complete == false);
66+
_partiallyComplete = b;
67+
}
68+
69+
bool get partiallyComplete => _partiallyComplete;
70+
5971
/// Whether the step can continue.
6072
///
6173
/// This can be used to prevent continuing on from a step until all parts of

angular_components/lib/material_stepper/material_stepper.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
[attr.orientation]="orientation"
2626
[attr.active]="step.active"
2727
[attr.complete]="step.complete"
28+
[class.partially-complete]="step.partiallyComplete"
2829
[class.can-select]="step.isSelectable">
2930
{{step.complete ? "" : step.index +1}}
3031
<span *ngIf="step.complete">

angular_components/lib/material_stepper/material_stepper.scss

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ $edit-icon-size: $mat-grid * 2;
7272
}
7373

7474
.stepper-step-index {
75+
background-color: $mat-grey-500;
7576
border: 2px solid $mat-white;
7677
border-radius: 100%;
7778
box-sizing: content-box;
@@ -91,16 +92,21 @@ $edit-icon-size: $mat-grid * 2;
9192
position: absolute;
9293
}
9394

94-
&[active = true] {
95+
&[active = true],
96+
&[complete = true] {
9597
background-color: $mat-blue-500;
9698
}
9799

98-
&[active = false] {
99-
background-color: $mat-grey-500;
100-
}
101-
102-
&[complete = true] {
103-
background-color: $mat-blue-500;
100+
&.partially-complete {
101+
background: $mat-white;
102+
height: 0;
103+
width: 0;
104+
border: $mat-grid solid $mat-blue-500;
105+
color: transparent;
106+
border-radius: 50%;
107+
border-left-color: transparent;
108+
box-shadow: 0 0 0 2px $mat-white, 0 0 0 4px $mat-blue-500;
109+
margin: $mat-grid-type * 1.5;
104110
}
105111
}
106112

0 commit comments

Comments
 (0)