Skip to content

Commit ed677aa

Browse files
authored
Merge pull request #7314 from masudul-tikweb/master
Button changes and color changes
2 parents b04cc51 + b527c9b commit ed677aa

File tree

61 files changed

+495
-237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+495
-237
lines changed

eform-client/src/app/app.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
55
import {GalleryModule} from 'ng-gallery';
66
import {TranslateModule} from '@ngx-translate/core';
77
import {LightboxModule} from 'ng-gallery/lightbox';
8+
import { AppIconComponent } from './components/icons/app-icon/app-icon.component';
9+
810
// TODO fix ngx-mask
911
//import {NgxMaskModule} from 'ngx-mask';
1012
import {ToastrModule} from 'ngx-toastr';
@@ -136,6 +138,7 @@ import {NgxMaterialTimepickerModule} from 'ngx-material-timepicker';
136138
MatProgressSpinnerModule,
137139
// EformDateFnsDateModule,
138140
EformMatDateFnsDateModule,
141+
AppIconComponent,
139142
],
140143
schemas: [NO_ERRORS_SCHEMA],
141144
providers: [providers],

eform-client/src/app/common/modules/eform-shared-tags/components/shared-tag-create/shared-tag-create.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ <h3 mat-dialog-title>{{ 'New tag' | translate }}</h3>
1111
<mat-label>{{ 'Name' | translate }}</mat-label>
1212
</mat-form-field>
1313
</div>
14-
<div mat-dialog-actions class="d-flex flex-row justify-content-end">
14+
<div mat-dialog-actions class="d-flex flex-row justify-content-end align-items-center gap-12">
1515
<button
16-
mat-raised-button
16+
class="btn-primary btn-primary--icon-left"
1717
color="accent"
1818
id="newTagSaveBtn"
1919
[disabled]="!name"
@@ -22,7 +22,7 @@ <h3 mat-dialog-title>{{ 'New tag' | translate }}</h3>
2222
{{ 'Save' | translate }}
2323
</button>
2424
<button
25-
mat-raised-button
25+
class="btn-cancel"
2626
id="newTagSaveCancelBtn"
2727
(click)="cancelCreate()"
2828
>

eform-client/src/app/common/modules/eform-shared-tags/components/shared-tags/shared-tags.component.html

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,20 @@ <h3 mat-dialog-title>{{ 'Tags management' | translate }}</h3>
44
<div class="d-flex flex-row justify-content-end mb-2">
55
<button
66
*ngIf="showMultipleCreateBtn"
7-
mat-raised-button
8-
color="primary"
7+
class="btn-primary btn-primary--icon-left"
98
id="newTagsBtn"
109
(click)="showMultipleCreateTagModal()"
1110
type="button">
1211
<mat-icon>add</mat-icon>
13-
{{'Add bulk' | translate}}
12+
<span>{{'Add bulk' | translate}}</span>
1413
</button>
1514
<button
16-
mat-raised-button
17-
color="accent"
15+
class="btn-primary btn-primary--icon-left"
1816
id="newTagBtn"
1917
(click)="showCreateTagModal()"
2018
type="button">
2119
<mat-icon>add</mat-icon>
22-
{{'Add new' | translate}}
20+
<span>{{'Add new' | translate}}</span>
2321
</button>
2422
</div>
2523
<div class="d-flex flex-column">
@@ -53,7 +51,7 @@ <h3 mat-dialog-title>{{ 'Tags management' | translate }}</h3>
5351
</div></div>
5452
<div mat-dialog-actions class="d-flex flex-row justify-content-end">
5553
<button
56-
mat-raised-button
54+
class="btn-cancel"
5755
(click)="hide()"
5856
id="tagsModalCloseBtn">
5957
{{ 'Close' | translate }}

eform-client/src/app/common/modules/eform-shared/components/entity-edit-create/entity-edit-create.component.html

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<eform-new-subheader [title]="title | translate" [forceStaticTitle]="true">
22
<button
33
*ngIf="edit"
4-
mat-raised-button
5-
color="accent"
4+
class="btn-primary btn-primary--icon-left"
65
id="entityUpdateSaveBtn"
76
(click)="updateEntityGroup()"
87
[disabled]="entityGroupEditModel.isLocked && !entityGroupEditModel.isEditable"
@@ -11,17 +10,15 @@
1110
</button>
1211
<button
1312
*ngIf="!edit"
14-
mat-raised-button
15-
color="accent"
13+
class="btn-primary btn-primary--icon-left"
1614
id="entityCreateSaveBtn"
1715
(click)="createEntityGroup()"
1816
[disabled]="!entityGroupEditModel.name"
1917
>
2018
{{ 'Create' | translate }}
2119
</button>
2220
<button
23-
mat-raised-button
24-
color="primary"
21+
class="btn-cancel"
2522
id="entitySearchUpdateCancelBtn"
2623
(click)="goBack()"
2724
>

eform-client/src/app/common/modules/eform-shared/components/entity-item-edit-name/entity-item-edit-name.component.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ <h3 mat-dialog-title>{{ 'Edit element' | translate}}</h3>
99
id="entityItemEditNameBox">
1010
</mat-form-field>
1111
</div>
12-
<div mat-dialog-actions class="d-flex flex-row justify-content-end">
12+
<div mat-dialog-actions class="d-flex flex-row justify-content-end align-items-center gap-12">
1313
<button
14-
mat-raised-button
15-
color="accent"
14+
class="btn-primary btn-primary--icon-left"
1615
(click)="emitValue();"
1716
id="entityItemSaveBtn"
1817
>
1918
{{'Save' | translate}}
2019
</button>
2120
<button
22-
mat-raised-button
21+
class="btn-cancel"
2322
id="entityItemCancelBtn"
2423
(click)="hide()"
2524
>

eform-client/src/app/components/app.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ import {
1111
} from 'src/app/state';
1212
import {AuthStateService} from 'src/app/common/store';
1313
import {TranslateService} from '@ngx-translate/core';
14+
import IconService from './icons/index';
1415

1516
@Component({
1617
selector: 'app-root',
1718
templateUrl: './app.component.html',
1819
standalone: false
1920
})
2021
export class AppComponent implements OnInit, OnDestroy {
22+
private iconService = inject(IconService);
2123
private router = inject(Router);
2224
private authStore = inject(Store);
2325
private userSettings = inject(UserSettingsService);
@@ -31,6 +33,7 @@ export class AppComponent implements OnInit, OnDestroy {
3133
public selectIsAuth$ = this.authStore.select(selectAuthIsAuth);
3234

3335
ngOnInit(): void {
36+
this.iconService.register();
3437
this.authSyncStorageService.init();
3538
this.selectIsAuth$.pipe(debounceTime(1000), take(1)).subscribe((isAuth) => {
3639
if (isAuth) {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<mat-icon
2+
[svgIcon]="name"
3+
[ngStyle]="{
4+
'width.px': size,
5+
'height.px': size,
6+
'font-size.px': size,
7+
'color': color
8+
}"
9+
class="app-icon"
10+
></mat-icon>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.app-icon {
2+
display: inline-flex;
3+
align-items: center;
4+
justify-content: center;
5+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Component, Input } from '@angular/core';
2+
import { MatIconModule } from '@angular/material/icon';
3+
import {NgStyle} from '@angular/common';
4+
5+
@Component({
6+
selector: 'app-icon',
7+
standalone: true,
8+
imports: [MatIconModule, NgStyle],
9+
templateUrl: './app-icon.component.html',
10+
styleUrls: ['./app-icon.component.scss']
11+
})
12+
export class AppIconComponent {
13+
@Input() name!: string;
14+
@Input() size: number | string = 20;
15+
@Input() color: string = 'currentColor';
16+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
export const CUSTOM_ICONS: Record<string, string> = {
2+
xmlFile: `
3+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">
4+
<path d="M15.8333 18.3346H4.16667C3.24619 18.3346 2.5 17.5884 2.5 16.668L2.5 3.33464C2.5 2.41416 3.24619 1.66797 4.16667 1.66797H10L15.8333 7.5013V9.16797M15.4167 7.5013H11.665C10.7446 7.5013 9.99837 6.75511 9.99837 5.83464V2.08464"
5+
stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
6+
<path d="M5.4165 11.6798L7.05439 13.7142M7.05439 13.7142L8.74984 15.7753M7.05439 13.7142L8.63236 11.668M7.05439 13.7142L5.43119 15.8346M10.4165 15.8346V11.668L12.0832 14.168L13.7498 11.668V15.8346M15.8332 11.668V15.8346H17.4998"
7+
stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
8+
</svg>
9+
`,
10+
11+
tags: `
12+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">
13+
<path d="M12.0791 8.33464C12.7802 7.86845 13.4025 7.12039 13.7892 6.19008C14.5875 4.26932 14.0788 2.299 12.6532 1.78925C11.2274 1.27949 9.42441 2.42334 8.62616 4.34409C8.49266 4.66519 8.39575 4.98769 8.3335 5.30449" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
14+
<path d="M8.3335 16.6667V8.89952C8.3335 8.54826 8.5178 8.22275 8.819 8.04203L11.6668 6.33333M8.3335 16.6667V17.3333C8.3335 17.8856 8.78121 18.3333 9.3335 18.3333H15.6668C16.2191 18.3333 16.6668 17.8856 16.6668 17.3333V8.89952C16.6668 8.54826 16.4825 8.22275 16.1813 8.04203L13.0147 6.14203C12.698 5.95202 12.3023 5.95202 11.9857 6.14203L11.6668 6.33333M8.3335 16.6667L4.41295 16.0132C3.83317 15.9166 3.46136 15.3432 3.60973 14.7744L5.6874 6.81005C5.77777 6.46361 6.04647 6.19192 6.3919 6.09771L9.83596 5.15842C10.1933 5.06096 10.5753 5.16901 10.8286 5.43924L11.6668 6.33333" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
15+
</svg>
16+
`,
17+
18+
upload: `
19+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15" fill="none">
20+
<path d="M5.33301 2.83203L7.41634 0.748698L9.49967 2.83203M7.41634 9.08203V1.25602" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
21+
<path d="M14.0833 11.168L13.9452 11.9968C13.7845 12.9611 12.9501 13.668 11.9724 13.668H2.86092C1.88324 13.668 1.04886 12.9611 0.888133 11.9968L0.75 11.168" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
22+
</svg>
23+
`,
24+
pencil: `
25+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15" fill="none">
26+
<path d="M13.3756 5.04304L4.74938 13.6693H0.75V9.66927L9.37561 1.04309C9.76613 0.652545 10.3993 0.652534 10.7898 1.04307L13.3756 3.62883C13.7661 4.01936 13.7661 4.65252 13.3756 5.04304Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
27+
<path d="M7.41602 3.00195L11.416 7.00195" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
28+
<path d="M14.0833 13.668H8.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
29+
</svg>
30+
`
31+
32+
};

0 commit comments

Comments
 (0)