Skip to content

Commit 46310e2

Browse files
committed
feat(package): ability to use always the green color for strong password #162
1 parent f312dac commit 46310e2

File tree

6 files changed

+50
-9
lines changed

6 files changed

+50
-9
lines changed

demo/src/app/examples/examples.component.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,5 +279,47 @@ <h1>Explore the library and try these examples <3</h1>
279279
</mat-card-content>
280280
</mat-card>
281281
</mat-card>
282+
283+
<!-- #7 GREEN COLOR FOR STRONG PASSWORD-->
284+
<mat-card>
285+
<mat-card-title>#7</mat-card-title>
286+
<mat-card-subtitle>
287+
Use always the green color for a strong password
288+
</mat-card-subtitle>
289+
290+
<mat-slide-toggle #toggle7>Show Password Details</mat-slide-toggle>
291+
292+
<mat-card-content>
293+
<!--password input filed-->
294+
<mat-form-field appearance="outline" style="width: 100%" [color]="passwordComponent7.color">
295+
<mat-pass-toggle-visibility #toggle matSuffix></mat-pass-toggle-visibility>
296+
<mat-label>Password</mat-label>
297+
<input matInput #password
298+
[type]="toggle.type"
299+
placeholder="Password">
300+
<mat-hint align="end" aria-live="polite">
301+
{{password.value.length}} / {{passwordComponent7.max}}
302+
</mat-hint>
303+
</mat-form-field>
304+
305+
<!--@angular-material-extensions/password-strength's main component-->
306+
<mat-password-strength #passwordComponent7
307+
class="green"
308+
[password]="password.value">
309+
</mat-password-strength>
310+
<!--Password's strength info-->
311+
<mat-password-strength-info
312+
*ngIf="toggle7.checked"
313+
[passwordComponent]="passwordComponent7">
314+
</mat-password-strength-info>
315+
</mat-card-content>
316+
317+
<mat-card class="mt-2">
318+
<mat-card-title>code</mat-card-title>
319+
<mat-card-content>
320+
<markdown src="assets/md/examples/e7.md"></markdown>
321+
</mat-card-content>
322+
</mat-card>
323+
</mat-card>
282324
</div>
283325
</section>

demo/src/app/home/home.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ <h1>@angular-material-extensions/password-strength</h1>
157157

158158
<!--@angular-material-extensions/password-strength's main component-->
159159
<mat-password-strength #passwordComponentWithValidation
160-
[greenStrongPassword]="true"
161160
(onStrengthChanged)="onStrengthChanged($event)"
162161
[password]="passwordWithValidation.value">
163162
</mat-password-strength>

demo/src/assets/md/examples/e7.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
```html
2+
<mat-password-strength #passwordComponent
3+
class="green"
4+
[password]="password.value">
5+
</mat-password-strength>
6+
```
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<mat-progress-bar mode="determinate"
2-
class="green"
32
[color]="color"
43
[value]="strength">
54
</mat-progress-bar>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
::ng-deep .mat-progress-bar.mat-primary .mat-progress-bar-fill::after {
2-
background-color: blue;
1+
.green :host::ng-deep .mat-progress-bar.mat-primary .mat-progress-bar-fill::after {
2+
background-color: #43A047;
33
}

src/module/component/mat-password-strength/mat-password-strength.component.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export class MatPasswordStrengthComponent implements OnInit, OnChanges {
1919
@Input() password: string;
2020
@Input() customValidator: RegExp;
2121
@Input() externalError: boolean;
22-
@Input() greenStrongPassword: boolean;
2322

2423
@Input() enableLengthRule = true;
2524
@Input() enableLowerCaseLetterRule = true;
@@ -30,10 +29,6 @@ export class MatPasswordStrengthComponent implements OnInit, OnChanges {
3029
@Input() min = 8;
3130
@Input() max = 30;
3231

33-
// TODO 17.04.19 @anthonynahas
34-
// @Output()
35-
// onColorChanged: EventEmitter<string> = new EventEmitter();
36-
3732
@Output()
3833
onStrengthChanged: EventEmitter<number> = new EventEmitter();
3934

0 commit comments

Comments
 (0)