Skip to content

Commit 49f53ee

Browse files
author
Vitor Durante
committed
Implement MaterialInput directive for BSB theme inputs
1 parent e157927 commit 49f53ee

15 files changed

+59
-56
lines changed

angular/src/account/account.module.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { RegisterComponent } from './register/register.component';
2020
import { AccountLanguagesComponent } from './layout/account-languages.component';
2121

2222
import { LoginService } from './login/login.service';
23+
import { MaterialInput } from '@shared/directives/material-input.directive';
2324

2425
@NgModule({
2526
imports: [
@@ -39,12 +40,13 @@ import { LoginService } from './login/login.service';
3940
TenantChangeModalComponent,
4041
LoginComponent,
4142
RegisterComponent,
42-
AccountLanguagesComponent
43+
AccountLanguagesComponent,
44+
MaterialInput
4345
],
4446
providers: [
4547
LoginService
4648
]
4749
})
4850
export class AccountModule {
4951

50-
}
52+
}

angular/src/account/login/login.component.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ <h4 class="text-center">{{l("LogIn")}}</h4>
88
<i class="material-icons">person</i>
99
</span>
1010
<div class="form-line">
11-
<input [(ngModel)]="loginService.authenticateModel.userNameOrEmailAddress" autoFocus class="form-control" type="text" autocomplete="off" placeholder="{{l('UserNameOrEmail')}}" name="userNameOrEmailAddress" required maxlength="255" />
11+
<input materialInput [(ngModel)]="loginService.authenticateModel.userNameOrEmailAddress" autoFocus class="form-control" type="text" autocomplete="off" placeholder="{{l('UserNameOrEmail')}}" name="userNameOrEmailAddress" required maxlength="255" />
1212
</div>
1313
</div>
14-
14+
1515
<div class="input-group">
1616
<span class="input-group-addon">
1717
<i class="material-icons">lock</i>
1818
</span>
1919
<div class="form-line">
20-
<input type="password" [(ngModel)]="loginService.authenticateModel.password" class="form-control" name="password" placeholder="{{l('Password')}}" required maxlength="32">
20+
<input materialInput type="password" [(ngModel)]="loginService.authenticateModel.password" class="form-control" name="password" placeholder="{{l('Password')}}" required maxlength="32">
2121
</div>
2222
</div>
2323
<div class="row">
@@ -29,14 +29,14 @@ <h4 class="text-center">{{l("LogIn")}}</h4>
2929
<button id="LoginButton" class="btn btn-block bg-pink waves-effect" type="submit">{{l("LogIn")}}</button>
3030
</div>
3131
</div>
32-
32+
3333
<div class="row m-t-15 m-b--20" *ngIf="isSelfRegistrationAllowed">
3434
<div class="col-xs-12">
3535
<a [routerLink]="['../register']">{{l("Register")}}</a>
3636
</div>
3737
</div>
3838
</form>
39-
39+
4040
<div class="login-options" *ngIf="multiTenancySideIsTeanant && loginService.externalLoginProviders.length > 0">
4141
<h4>{{l("OrLoginWith")}}</h4>
4242
<ul class="social-icons">
@@ -48,4 +48,4 @@ <h4>{{l("OrLoginWith")}}</h4>
4848
</ul>
4949
</div>
5050
</div>
51-
</div>
51+
</div>

angular/src/account/login/login.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { AbpSessionService } from '@abp/session/abp-session.service';
1010
styleUrls: [
1111
'./login.component.less'
1212
],
13-
animations: [accountModuleAnimation()]
13+
animations: [accountModuleAnimation()]
1414
})
1515
export class LoginComponent extends AppComponentBase {
1616

@@ -28,7 +28,6 @@ export class LoginComponent extends AppComponentBase {
2828
}
2929

3030
ngAfterViewInit(): void {
31-
($ as any).AdminBSB.input.activate($(this.cardBody.nativeElement));
3231
$(this.cardBody.nativeElement).find('input:first').focus();
3332
}
3433

@@ -54,4 +53,4 @@ export class LoginComponent extends AppComponentBase {
5453
externalLogin(provider: ExternalLoginProvider) {
5554
this.loginService.externalAuthenticate(provider);
5655
}
57-
}
56+
}

angular/src/account/register/register.component.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,35 @@ <h4 class="text-center">{{l("Register")}}</h4>
55

66
<div class="form-group form-float">
77
<div class="form-line">
8-
<input class="form-control" autoFocus type="text" [(ngModel)]="model.name" name="Name" required maxlength="32" />
8+
<input materialInput class="form-control" autoFocus type="text" [(ngModel)]="model.name" name="Name" required maxlength="32" />
99
<label class="form-label">{{l('Name')}}</label>
1010
</div>
1111
</div>
12-
12+
1313
<div class="form-group form-float">
1414
<div class="form-line">
15-
<input class="form-control" type="text" [(ngModel)]="model.surname" name="Surname" required maxlength="32" />
15+
<input materialInput class="form-control" type="text" [(ngModel)]="model.surname" name="Surname" required maxlength="32" />
1616
<label class="form-label">{{l('Surname')}}</label>
1717
</div>
1818
</div>
1919

2020
<div class="form-group form-float">
2121
<div class="form-line">
22-
<input class="form-control" type="email" [(ngModel)]="model.emailAddress" name="EmailAddress" required maxlength="255" pattern="^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{1,})+$" />
22+
<input materialInput class="form-control" type="email" [(ngModel)]="model.emailAddress" name="EmailAddress" required maxlength="255" pattern="^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{1,})+$" />
2323
<label class="form-label">{{l('EmailAddress')}}</label>
2424
</div>
2525
</div>
2626

2727
<div class="form-group form-float">
2828
<div class="form-line">
29-
<input class="form-control" type="text" autocomplete="off" [(ngModel)]="model.userName" name="UserName" required maxlength="32" />
29+
<input materialInput class="form-control" type="text" autocomplete="off" [(ngModel)]="model.userName" name="UserName" required maxlength="32" />
3030
<label class="form-label">{{l('UserName')}}</label>
3131
</div>
3232
</div>
33-
33+
3434
<div class="form-group form-float">
3535
<div class="form-line">
36-
<input class="form-control" type="password" [(ngModel)]="model.password" name="Password" required maxlength="32" />
36+
<input materialInput class="form-control" type="password" [(ngModel)]="model.password" name="Password" required maxlength="32" />
3737
<label class="form-label">{{l('Password')}}</label>
3838
</div>
3939
</div>
@@ -45,4 +45,4 @@ <h4 class="text-center">{{l("Register")}}</h4>
4545

4646
</form>
4747
</div>
48-
</div>
48+
</div>

angular/src/account/register/register.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export class RegisterComponent extends AppComponentBase implements AfterViewInit
2727
}
2828

2929
ngAfterViewInit(): void {
30-
($ as any).AdminBSB.input.activate($(this.cardBody.nativeElement));
3130
$(this.cardBody.nativeElement).find('input:first').focus();
3231
}
3332

@@ -53,4 +52,4 @@ export class RegisterComponent extends AppComponentBase implements AfterViewInit
5352
this._loginService.authenticate(() => { this.saving = false; });
5453
});
5554
}
56-
}
55+
}

angular/src/account/tenant/tenant-change-modal.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h4 class="modal-title">
1717
<div class="modal-body">
1818
<div class="form-group form-float">
1919
<div class="form-line">
20-
<input #tenancyNameInput type="text" name="TenancyName" class="form-control" [ngClass]="{'edited':tenancyName}" [(ngModel)]="tenancyName" maxlength="64">
20+
<input #tenancyNameInput materialInput type="text" name="TenancyName" class="form-control" [ngClass]="{'edited':tenancyName}" [(ngModel)]="tenancyName" maxlength="64">
2121
<label class="form-label">{{l("TenancyName")}}</label>
2222
</div>
2323
</div>
@@ -33,4 +33,4 @@ <h4 class="modal-title">
3333

3434
</div>
3535
</div>
36-
</div>
36+
</div>

angular/src/account/tenant/tenant-change-modal.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export class TenantChangeModalComponent extends AppComponentBase {
3333
}
3434

3535
onShown(): void {
36-
($ as any).AdminBSB.input.activate($(this.modalContent.nativeElement));
3736
$(this.tenancyNameInput.nativeElement).focus().select();
3837
}
3938

@@ -73,4 +72,4 @@ export class TenantChangeModalComponent extends AppComponentBase {
7372
this.active = false;
7473
this.modal.hide();
7574
}
76-
}
75+
}

angular/src/app/app.module.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { SideBarUserAreaComponent } from '@app/layout/sidebar-user-area.componen
2525
import { SideBarNavComponent } from '@app/layout/sidebar-nav.component';
2626
import { SideBarFooterComponent } from '@app/layout/sidebar-footer.component';
2727
import { RightSideBarComponent } from '@app/layout/right-sidebar.component';
28+
import { MaterialInput } from '@shared/directives/material-input.directive';
2829

2930
@NgModule({
3031
declarations: [
@@ -40,7 +41,8 @@ import { RightSideBarComponent } from '@app/layout/right-sidebar.component';
4041
SideBarUserAreaComponent,
4142
SideBarNavComponent,
4243
SideBarFooterComponent,
43-
RightSideBarComponent
44+
RightSideBarComponent,
45+
MaterialInput
4446
],
4547
imports: [
4648
CommonModule,
@@ -57,4 +59,4 @@ import { RightSideBarComponent } from '@app/layout/right-sidebar.component';
5759

5860
]
5961
})
60-
export class AppModule { }
62+
export class AppModule { }

angular/src/app/layout/topbar.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="search-icon">
44
<i class="material-icons">search</i>
55
</div>
6-
<input type="text" placeholder="START TYPING...">
6+
<input materialInput type="text" placeholder="START TYPING...">
77
<div class="close-search">
88
<i class="material-icons">close</i>
99
</div>
@@ -24,4 +24,4 @@
2424
</ul>
2525
</div>
2626
</div>
27-
</nav>
27+
</nav>

angular/src/app/tenants/create-tenant-modal.component.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@ <h4 class="modal-title">
1717
<div class="modal-body">
1818
<div class="form-group form-float">
1919
<div class="form-line">
20-
<input class="form-control" type="text" name="TenancyName" [(ngModel)]="tenant.tenancyName" required maxlength="64" minlength="2">
20+
<input materialInput class="form-control" type="text" name="TenancyName" [(ngModel)]="tenant.tenancyName" required maxlength="64" minlength="2">
2121
<label class="form-label">{{l("TenancyName")}}</label>
2222
</div>
2323
</div>
2424
<div class="form-group form-float">
2525
<div class="form-line">
26-
<input type="text" name="Name" class="form-control" [(ngModel)]="tenant.name" required maxlength="128">
26+
<input materialInput type="text" name="Name" class="form-control" [(ngModel)]="tenant.name" required maxlength="128">
2727
<label class="form-label">{{l("Name")}}</label>
2828
</div>
2929
</div>
3030
<div class="form-group form-float">
3131
<div class="form-line">
32-
<input type="text" name="ConnectionString" class="form-control" [(ngModel)]="tenant.connectionString" maxlength="1024">
32+
<input materialInput type="text" name="ConnectionString" class="form-control" [(ngModel)]="tenant.connectionString" maxlength="1024">
3333
<label class="form-label">{{l("DatabaseConnectionString")}} ({{l("Optional")}})</label>
3434
</div>
3535
</div>
3636
<div class="form-group form-float">
3737
<div class="form-line">
38-
<input type="email" name="AdminEmailAddress" class="form-control" [(ngModel)]="tenant.adminEmailAddress" required maxlength="256" pattern="^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{1,})+$">
38+
<input materialInput type="email" name="AdminEmailAddress" class="form-control" [(ngModel)]="tenant.adminEmailAddress" required maxlength="256" pattern="^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{1,})+$">
3939
<label class="form-label">{{l("AdminEmailAddress")}}</label>
4040
</div>
4141
</div>
@@ -51,4 +51,4 @@ <h4 class="modal-title">
5151

5252
</div>
5353
</div>
54-
</div>
54+
</div>

0 commit comments

Comments
 (0)