Commit 65e971f0e05bd49088a21c29fe68fc90e7c8046b

Authored by Vladyslav
Committed by GitHub
1 parent bf4b690c

[3.0] [WIP] Minor fixed to style (#2562)

* Added support Safari browser (not support DragEvent)

* Imporovement style login page

* Change flex responsive API breakpoint

* Add support long name menu item

* Home page add link to page
... ... @@ -15,10 +15,8 @@
15 15 limitations under the License.
16 16
17 17 -->
18   -<a class="mat-button" routerLinkActive="tb-active" [routerLinkActiveOptions]="{exact: true}" routerLink="{{section.path}}">
19   - <span class="mat-button-wrapper">
20   - <mat-icon *ngIf="!section.isMdiIcon && section.icon != null" class="material-icons">{{section.icon}}</mat-icon>
21   - <mat-icon *ngIf="section.isMdiIcon && section.icon != null" [svgIcon]="section.icon"></mat-icon>
22   - <span>{{section.name | translate}}</span>
23   - </span>
  18 +<a mat-button routerLinkActive="tb-active" [routerLinkActiveOptions]="{exact: true}" routerLink="{{section.path}}">
  19 + <mat-icon *ngIf="!section.isMdiIcon && section.icon != null" class="material-icons">{{section.icon}}</mat-icon>
  20 + <mat-icon *ngIf="section.isMdiIcon && section.icon != null" [svgIcon]="section.icon"></mat-icon>
  21 + <span>{{section.name | translate}}</span>
24 22 </a>
... ...
... ... @@ -15,15 +15,13 @@
15 15 limitations under the License.
16 16
17 17 -->
18   -<a class="mat-button tb-button-toggle"
  18 +<a mat-button class="tb-button-toggle"
19 19 routerLinkActive="tb-active" [routerLinkActiveOptions]="{exact: true}" routerLink="{{section.path}}">
20   - <span class="mat-button-wrapper">
21   - <mat-icon *ngIf="!section.isMdiIcon && section.icon != null" class="material-icons">{{section.icon}}</mat-icon>
22   - <mat-icon *ngIf="section.isMdiIcon && section.icon != null" [svgIcon]="section.icon"></mat-icon>
23   - <span>{{section.name | translate}}</span>
24   - <span class=" pull-right fa fa-chevron-down tb-toggle-icon"
25   - [ngClass]="{'tb-toggled' : sectionActive()}"></span>
26   - </span>
  20 + <mat-icon *ngIf="!section.isMdiIcon && section.icon != null" class="material-icons">{{section.icon}}</mat-icon>
  21 + <mat-icon *ngIf="section.isMdiIcon && section.icon != null" [svgIcon]="section.icon"></mat-icon>
  22 + <span>{{section.name | translate}}</span>
  23 + <span class=" pull-right fa fa-chevron-down tb-toggle-icon"
  24 + [ngClass]="{'tb-toggled' : sectionActive()}"></span>
27 25 </a>
28 26 <ul id="docs-menu-{{section.name | nospace}}" class="tb-menu-toggle-list" [ngStyle]="{height: sectionHeight()}">
29 27 <li *ngFor="let page of section.pages">
... ...
... ... @@ -13,6 +13,34 @@
13 13 * See the License for the specific language governing permissions and
14 14 * limitations under the License.
15 15 */
16   -:host {
  16 +:host ::ng-deep {
  17 + .tb-button-toggle {
  18 + .tb-toggle-icon {
  19 + display: inline-block;
  20 + width: 15px;
  21 + margin: auto 0 auto auto;
  22 + background-size: 100% auto;
  23 + transition: transform .3s ease-in-out;
  24 + &.tb-toggled {
  25 + transform: rotateZ(180deg);
  26 + }
  27 + }
  28 + }
17 29
  30 + .tb-menu-toggle-list {
  31 + position: relative;
  32 + z-index: 1;
  33 + overflow: hidden;
  34 +
  35 + transition: .75s cubic-bezier(.35, 0, .25, 1);
  36 +
  37 + transition-property: height;
  38 +
  39 + a.mat-button {
  40 + padding: 0 16px 0 32px;
  41 + font-weight: 500;
  42 + text-transform: none !important;
  43 + text-rendering: optimizeLegibility;
  44 + }
  45 + }
18 46 }
... ...
... ... @@ -34,18 +34,8 @@
34 34 a.mat-button {
35 35 text-transform: uppercase;
36 36 display: flex;
37   - width: 100%;
38   - max-height: 40px;
39   - padding: 0 16px;
40   - margin: 0;
41 37 overflow: hidden;
42 38 line-height: 40px;
43   - color: inherit;
44   - text-align: left;
45   - text-decoration: none;
46   - text-overflow: ellipsis;
47   - white-space: nowrap;
48   - cursor: pointer;
49 39 border-radius: 0;
50 40 &:hover {
51 41 border-bottom: none;
... ... @@ -61,6 +51,8 @@
61 51
62 52 .mat-button-wrapper {
63 53 width: 100%;
  54 + display: inline-flex;
  55 + align-items: center;
64 56 mat-icon {
65 57 margin-right: 8px;
66 58 margin-left: 0;
... ... @@ -76,35 +68,4 @@
76 68 }
77 69 }
78 70 }
79   -
80   - .tb-button-toggle {
81   - .tb-toggle-icon {
82   - display: inline-block;
83   - width: 15px;
84   - margin: auto 0 auto auto;
85   - background-size: 100% auto;
86   - transition: transform .3s, ease-in-out;
87   - &.tb-toggled {
88   - transform: rotateZ(180deg);
89   - }
90   - }
91   - }
92   -
93   - .tb-menu-toggle-list {
94   - position: relative;
95   - z-index: 1;
96   - overflow: hidden;
97   -
98   - transition: .75s cubic-bezier(.35, 0, .25, 1);
99   -
100   - transition-property: height;
101   -
102   - a.mat-button {
103   - padding: 0 16px 0 32px;
104   - font-weight: 500;
105   - text-transform: none !important;
106   - text-rendering: optimizeLegibility;
107   - }
108   - }
109   -
110 71 }
... ...
... ... @@ -24,11 +24,11 @@
24 24 <mat-card-content>
25 25 <mat-grid-list rowHeight="170px" [cols]="section.places.length">
26 26 <mat-grid-tile *ngFor="let place of section.places">
27   - <button mat-button mat-raised-button color="primary" class="tb-card-button" routerLink="{{place.path}}">
  27 + <a mat-raised-button color="primary" class="tb-card-button" routerLink="{{place.path}}">
28 28 <mat-icon *ngIf="!place.isMdiIcon" class="material-icons tb-mat-96">{{place.icon}}</mat-icon>
29 29 <mat-icon *ngIf="place.isMdiIcon" class="tb-mat-96" [svgIcon]="place.icon"></mat-icon>
30 30 <span translate>{{place.name}}</span>
31   - </button>
  31 + </a>
32 32 </mat-grid-tile>
33 33 </mat-grid-list>
34 34 </mat-card-content>
... ...
... ... @@ -37,10 +37,17 @@
37 37 padding: 16px;
38 38 }
39 39 }
40   - button.tb-card-button {
  40 + .tb-card-button {
41 41 width: 100%;
42 42 height: 100%;
43 43 max-width: 240px;
  44 + text-transform: uppercase;
  45 + &:hover {
  46 + border-bottom: none;
  47 + }
  48 + &:focus {
  49 + border-bottom: none;
  50 + }
44 51 .mat-button-wrapper {
45 52 width: 100%;
46 53 height: 100%;
... ... @@ -52,8 +59,8 @@
52 59 }
53 60 span {
54 61 height: 18px;
55   - min-height: 18px;
56   - max-height: 18px;
  62 + min-height: 36px;
  63 + max-height: 36px;
57 64 padding: 0 0 20px 0;
58 65 margin: auto;
59 66 font-size: 18px;
... ...
... ... @@ -17,7 +17,7 @@
17 17 -->
18 18 <div class="tb-create-password-content mat-app-background tb-dark" fxLayout="row" fxLayoutAlign="center center" style="width: 100%;">
19 19 <mat-card fxFlex="initial" class="tb-create-password-card">
20   - <mat-card-title>
  20 + <mat-card-title class="layout-padding">
21 21 <span translate class="mat-headline">login.create-password</span>
22 22 </mat-card-title>
23 23 <mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async">
... ... @@ -38,8 +38,8 @@
38 38 <input matInput type="password" formControlName="password2"/>
39 39 <mat-icon class="material-icons" matPrefix>lock</mat-icon>
40 40 </mat-form-field>
41   - <div fxLayout="column" fxLayout.gt-sm="row" fxLayoutGap="16px" fxLayoutAlign="start center"
42   - fxLayoutAlign.gt-sm="center start" class="layout-padding">
  41 + <div fxLayout="column" fxLayout.gt-xs="row" fxLayoutGap="16px" fxLayoutAlign="start center"
  42 + fxLayoutAlign.gt-xs="center start">
43 43 <button mat-raised-button color="accent" type="submit" [disabled]="(isLoading$ | async)">
44 44 {{ 'login.create-password' | translate }}
45 45 </button>
... ...
... ... @@ -17,11 +17,11 @@
17 17
18 18 :host {
19 19 display: flex;
20   - flex: 1 1 0%;
  20 + flex: 1 1 0;
21 21 .tb-create-password-content {
22 22 background-color: #eee;
23 23 .tb-create-password-card {
24   - @media #{$mat-gt-sm} {
  24 + @media #{$mat-gt-xs} {
25 25 width: 450px !important;
26 26 }
27 27 }
... ...
... ... @@ -15,43 +15,39 @@
15 15 limitations under the License.
16 16
17 17 -->
18   -<div class="tb-login-content mat-app-background tb-dark" fxLayout="row" fxLayoutAlign="center center" fxFlex>
19   - <mat-card style="height: 100%; max-height: 600px; overflow-y: auto; overflow-x: hidden;">
  18 +<div class="tb-login-content mat-app-background tb-dark" fxFlex fxLayoutAlign="center center">
  19 + <mat-card style="height: 100%; max-height: 525px; overflow-y: auto;">
20 20 <mat-card-content>
21   - <form #loginForm="ngForm" class="tb-login-form" fxLayout="column" [formGroup]="loginFormGroup" (ngSubmit)="login()">
22   - <fieldset [disabled]="isLoading$ | async">
23   - <div fxFlex fxLayout="column">
24   - <div fxLayout="column" fxLayoutAlign="start center" style="padding: 15px 0;">
25   - <tb-logo class="login-logo" style="padding-bottom: 25px;"></tb-logo>
  21 + <form #loginForm="ngForm" class="tb-login-form" [formGroup]="loginFormGroup" (ngSubmit)="login()">
  22 + <fieldset [disabled]="isLoading$ | async" fxLayout="column">
  23 + <div fxLayout="column" fxLayoutAlign="start center" style="padding: 15px 0;">
  24 + <tb-logo class="login-logo"></tb-logo>
  25 + </div>
  26 + <mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async">
  27 + </mat-progress-bar>
  28 + <span style="height: 4px;" *ngIf="!(isLoading$ | async)"></span>
  29 + <div tb-toast fxLayout="column" class="layout-padding">
  30 + <span style="height: 50px;"></span>
  31 + <mat-form-field>
  32 + <mat-label translate>login.username</mat-label>
  33 + <input id="username-input" matInput type="email" autofocus formControlName="username" email required/>
  34 + <mat-icon matPrefix>email</mat-icon>
  35 + <mat-error *ngIf="loginFormGroup.get('username').invalid">
  36 + {{ 'user.invalid-email-format' | translate }}
  37 + </mat-error>
  38 + </mat-form-field>
  39 + <mat-form-field>
  40 + <mat-label translate>common.password</mat-label>
  41 + <input id="password-input" matInput type="password" formControlName="password"/>
  42 + <mat-icon matPrefix>lock</mat-icon>
  43 + </mat-form-field>
  44 + <div fxLayoutAlign="end center">
  45 + <button class="tb-reset-password" mat-button type="button" routerLink="/login/resetPasswordRequest">{{ 'login.forgot-password' | translate }}
  46 + </button>
26 47 </div>
27   - <mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async">
28   - </mat-progress-bar>
29   - <span style="height: 4px;" *ngIf="!(isLoading$ | async)"></span>
30   - <div tb-toast fxLayout="column" class="layout-padding">
31   - <span style="height: 50px;"></span>
32   - <mat-form-field>
33   - <mat-label translate>login.username</mat-label>
34   - <input id="username-input" matInput type="email" autofocus formControlName="username" email required/>
35   - <mat-icon class="material-icons" matPrefix>email</mat-icon>
36   - <mat-error *ngIf="loginFormGroup.get('username').invalid">
37   - {{ 'user.invalid-email-format' | translate }}
38   - </mat-error>
39   - </mat-form-field>
40   - <mat-form-field>
41   - <mat-label translate>common.password</mat-label>
42   - <input id="password-input" matInput type="password" formControlName="password"/>
43   - <mat-icon class="material-icons" matPrefix>lock</mat-icon>
44   - </mat-form-field>
45   - <div fxLayout.gt-sm="column" fxLayoutAlign="space-between stretch">
46   - <div fxLayout.gt-sm="column" fxLayoutAlign="space-between end">
47   - <button mat-button type="button" routerLink="/login/resetPasswordRequest">{{ 'login.forgot-password' | translate }}
48   - </button>
49   - </div>
50   - </div>
51   - <div fxLayout="column" style="padding: 15px 0;">
52   - <button mat-raised-button color="accent" [disabled]="(isLoading$ | async)"
53   - type="submit">{{ 'login.login' | translate }}</button>
54   - </div>
  48 + <div fxLayout="column" class="tb-action-button">
  49 + <button mat-raised-button color="accent" [disabled]="(isLoading$ | async)"
  50 + type="submit">{{ 'login.login' | translate }}</button>
55 51 </div>
56 52 </div>
57 53 </fieldset>
... ...
... ... @@ -17,15 +17,24 @@
17 17
18 18 :host {
19 19 display: flex;
20   - flex: 1 1 0%;
  20 + flex: 1 1 0;
21 21 .tb-login-content {
22 22 margin-top: 36px;
23 23 margin-bottom: 76px;
24   - background-color: rgb(250,250,250);
  24 + background-color: rgb(250, 250, 250);
25 25 .tb-login-form {
26   - @media #{$mat-gt-sm} {
  26 + @media #{$mat-gt-xs} {
27 27 width: 550px !important;
28 28 }
  29 +
  30 + .tb-reset-password{
  31 + padding: 0 6px;
  32 + }
  33 +
  34 + .tb-action-button{
  35 + padding-top: 20px;
  36 + padding-bottom: 20px;
  37 + }
29 38 }
30 39 }
31 40 }
... ...
... ... @@ -17,7 +17,7 @@
17 17 -->
18 18 <div class="tb-request-password-reset-content mat-app-background tb-dark" fxLayout="row" fxLayoutAlign="center center" style="width: 100%;">
19 19 <mat-card fxFlex="initial" class="tb-request-password-reset-card">
20   - <mat-card-title>
  20 + <mat-card-title class="layout-padding">
21 21 <span translate class="mat-headline">login.request-password-reset</span>
22 22 </mat-card-title>
23 23 <mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async">
... ... @@ -36,8 +36,8 @@
36 36 {{ 'user.invalid-email-format' | translate }}
37 37 </mat-error>
38 38 </mat-form-field>
39   - <div fxLayout="column" fxLayout.gt-sm="row" fxLayoutGap="16px" fxLayoutAlign="start center"
40   - fxLayoutAlign.gt-sm="center start" class="layout-padding">
  39 + <div fxLayout="column" fxLayout.gt-xs="row" fxLayoutGap="16px" fxLayoutAlign="start center"
  40 + fxLayoutAlign.gt-xs="center start">
41 41 <button mat-raised-button color="accent" type="submit" [disabled]="(isLoading$ | async)">
42 42 {{ 'login.request-password-reset' | translate }}
43 43 </button>
... ...
... ... @@ -17,11 +17,11 @@
17 17
18 18 :host {
19 19 display: flex;
20   - flex: 1 1 0%;
  20 + flex: 1 1 0;
21 21 .tb-request-password-reset-content {
22 22 background-color: #eee;
23 23 .tb-request-password-reset-card {
24   - @media #{$mat-gt-sm} {
  24 + @media #{$mat-gt-xs} {
25 25 width: 450px !important;
26 26 }
27 27 }
... ...
... ... @@ -17,11 +17,11 @@
17 17 -->
18 18 <div class="tb-reset-password-content mat-app-background tb-dark" fxLayout="row" fxLayoutAlign="center center" style="width: 100%;">
19 19 <mat-card fxFlex="initial" class="tb-reset-password-card">
20   - <mat-card-title>
21   - <span translate class="mat-headline">login.password-reset</span>
  20 + <mat-card-title class="layout-padding tb-card-title">
  21 + <span translate class="mat-headline tb-card-title">login.password-reset</span>
22 22 </mat-card-title>
23   - <mat-card-subtitle>
24   - <span *ngIf="isExpiredPassword" translate>login.expired-password-reset-message</span>
  23 + <mat-card-subtitle *ngIf="isExpiredPassword" class="layout-padding tb-card-title">
  24 + <div class="tb-card-title" translate>login.expired-password-reset-message</div>
25 25 </mat-card-subtitle>
26 26 <mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async">
27 27 </mat-progress-bar>
... ... @@ -42,7 +42,7 @@
42 42 <mat-icon class="material-icons" matPrefix>lock</mat-icon>
43 43 </mat-form-field>
44 44 <div fxLayout="column" fxLayout.gt-sm="row" fxLayoutGap="16px" fxLayoutAlign="start center"
45   - fxLayoutAlign.gt-sm="center start" class="layout-padding">
  45 + fxLayoutAlign.gt-sm="center start">
46 46 <button mat-raised-button color="accent" type="submit" [disabled]="(isLoading$ | async)">
47 47 {{ 'login.reset-password' | translate }}
48 48 </button>
... ...
... ... @@ -17,7 +17,7 @@
17 17
18 18 :host {
19 19 display: flex;
20   - flex: 1 1 0%;
  20 + flex: 1 1 0;
21 21 .tb-reset-password-content {
22 22 background-color: #eee;
23 23 .tb-reset-password-card {
... ... @@ -25,5 +25,10 @@
25 25 width: 450px !important;
26 26 }
27 27 }
  28 +
  29 + .tb-card-title{
  30 + padding-top: 0;
  31 + padding-bottom: 0;
  32 + }
28 33 }
29 34 }
... ...
... ... @@ -120,7 +120,7 @@ class DraggableChip {
120 120 }
121 121 }
122 122
123   - private onDragStart(event: DragEvent) {
  123 + private onDragStart(event: Event | any) {
124 124 if (this.preventDrag) {
125 125 event.preventDefault();
126 126 } else {
... ... @@ -136,7 +136,7 @@ class DraggableChip {
136 136 }
137 137 }
138 138
139   - private onDragEnter(event: DragEvent) {
  139 + private onDragEnter(event: Event | any) {
140 140 this.counter++;
141 141 if (this.dragging) {
142 142 return;
... ... @@ -148,7 +148,7 @@ class DraggableChip {
148 148 this.chipElement.addEventListener('drop', this.dropHandler);
149 149 }
150 150
151   - private onDragLeave(event: DragEvent) {
  151 + private onDragLeave(event: Event | any) {
152 152 this.counter--;
153 153 if (this.counter <= 0) {
154 154 this.counter = 0;
... ... @@ -158,14 +158,14 @@ class DraggableChip {
158 158 }
159 159 }
160 160
161   - private onDragEnd(event: DragEvent) {
  161 + private onDragEnd(event: Event | any) {
162 162 this.dragging = false;
163 163 globalDraggingChipListId = null;
164 164 this.chipListElement.classList.remove(draggingClassName);
165 165 this.chipElement.classList.remove(draggingClassName);
166 166 }
167 167
168   - private onDragOver(event: DragEvent) {
  168 + private onDragOver(event: Event | any) {
169 169 if (this.dragging) {
170 170 return;
171 171 }
... ... @@ -203,7 +203,7 @@ class DraggableChip {
203 203
204 204 }
205 205
206   - private onDrop(event: DragEvent) {
  206 + private onDrop(event: Event | any) {
207 207 this.counter = 0;
208 208 event.preventDefault();
209 209 if (globalDraggingChipListId !== this.chipListElement.id) {
... ...
... ... @@ -445,10 +445,10 @@ mat-label {
445 445 }
446 446
447 447 .layout-padding, .layout-padding > * {
448   - @media #{$mat-lt-md} {
  448 + @media #{$mat-lt-sm} {
449 449 padding: 4px;
450 450 }
451   - @media #{$mat-gt-sm} {
  451 + @media #{$mat-gt-xs} {
452 452 padding: 8px;
453 453 }
454 454 }
... ... @@ -473,6 +473,13 @@ mat-label {
473 473 display: block;
474 474 }
475 475
  476 + .mat-form-field{
  477 + .mat-icon{
  478 + margin-right: 4px;
  479 + margin-left: 4px;
  480 + }
  481 + }
  482 +
476 483 button.mat-menu-item {
477 484 overflow: hidden;
478 485 fill: #737373;
... ... @@ -684,7 +691,7 @@ mat-label {
684 691 }
685 692
686 693 .mat-icon {
687   - vertical-align: middle;
  694 + vertical-align: bottom;
688 695 box-sizing: content-box;
689 696 &.tb-mat-16 {
690 697 @include tb-mat-icon-size(16);
... ...