angular-matecu 4.0.2 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/angular-matecu.mjs +5 -0
- package/esm2022/lib/components/matecu-alert-box/matecu-alert-box.component.mjs +67 -0
- package/esm2022/lib/components/matecu-alert-dialog/matecu-alert-dialog.component.mjs +54 -0
- package/esm2022/lib/components/matecu-alert-snack-bar/matecu-alert-snack-bar.component.mjs +43 -0
- package/esm2022/lib/components/matecu-spinner/matecu-spinner.component.mjs +58 -0
- package/esm2022/lib/components/matecu-topbar-action/matecu-topbar-action.component.mjs +18 -0
- package/esm2022/lib/components/matecu-topbar-body/matecu-topbar-body.component.mjs +17 -0
- package/esm2022/lib/components/matecu-topbar-fab/matecu-topbar-fab.component.mjs +43 -0
- package/esm2022/lib/components/matecu-topbar-header-column/matecu-topbar-header-column.component.mjs +12 -0
- package/esm2022/lib/components/matecu-topbar-header-row/matecu-topbar-header-row.component.mjs +29 -0
- package/esm2022/lib/components/matecu-topbar-layout/matecu-topbar-layout.component.mjs +112 -0
- package/esm2022/lib/components/matecu-topbar-search/matecu-topbar-search.component.mjs +93 -0
- package/esm2022/lib/components/matecu-topbar-title/matecu-topbar-title.component.mjs +18 -0
- package/esm2022/lib/modules/matecu-alert-box/matecu-alert-box.module.mjs +24 -0
- package/esm2022/lib/modules/matecu-spinner/matecu-spinner.module.mjs +22 -0
- package/esm2022/lib/modules/matecu-topbar-layout/matecu-topbar-layout.module.mjs +83 -0
- package/esm2022/lib/services/matecu-snack-bar.service.mjs +66 -0
- package/esm2022/lib/services/matecu-spinner.service.mjs +44 -0
- package/esm2022/lib/types/matecu-alert-dialog.mjs +2 -0
- package/esm2022/lib/types/matecu-alert-snackbar.mjs +2 -0
- package/esm2022/lib/types/matecu-altert-box-type.mjs +8 -0
- package/esm2022/public-api.mjs +32 -0
- package/fesm2022/angular-matecu.mjs +735 -0
- package/fesm2022/angular-matecu.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/matecu-alert-box/matecu-alert-box.component.d.ts +19 -0
- package/lib/components/matecu-alert-dialog/matecu-alert-dialog.component.d.ts +22 -0
- package/lib/components/matecu-alert-snack-bar/matecu-alert-snack-bar.component.d.ts +20 -0
- package/lib/components/matecu-spinner/matecu-spinner.component.d.ts +20 -0
- package/lib/components/matecu-topbar-action/matecu-topbar-action.component.d.ts +9 -0
- package/lib/components/matecu-topbar-body/matecu-topbar-body.component.d.ts +6 -0
- package/lib/components/matecu-topbar-fab/matecu-topbar-fab.component.d.ts +12 -0
- package/lib/components/matecu-topbar-header-column/matecu-topbar-header-column.component.d.ts +5 -0
- package/lib/components/matecu-topbar-header-row/matecu-topbar-header-row.component.d.ts +8 -0
- package/lib/components/matecu-topbar-layout/matecu-topbar-layout.component.d.ts +27 -0
- package/lib/components/matecu-topbar-search/matecu-topbar-search.component.d.ts +27 -0
- package/lib/components/matecu-topbar-title/matecu-topbar-title.component.d.ts +9 -0
- package/lib/modules/matecu-alert-box/matecu-alert-box.module.d.ts +14 -0
- package/lib/modules/matecu-spinner/matecu-spinner.module.d.ts +8 -0
- package/lib/modules/matecu-topbar-layout/matecu-topbar-layout.module.d.ts +19 -0
- package/lib/services/matecu-snack-bar.service.d.ts +17 -0
- package/lib/services/matecu-spinner.service.d.ts +15 -0
- package/lib/types/matecu-alert-dialog.d.ts +9 -0
- package/{src/lib/types/matecu-alert-snackbar.ts → lib/types/matecu-alert-snackbar.d.ts} +4 -5
- package/lib/types/matecu-altert-box-type.d.ts +6 -0
- package/package.json +19 -4
- package/{src/public-api.ts → public-api.d.ts} +0 -7
- package/karma.conf.js +0 -44
- package/ng-package.json +0 -13
- package/src/lib/components/matecu-alert-box/matecu-alert-box.component.html +0 -11
- package/src/lib/components/matecu-alert-box/matecu-alert-box.component.scss +0 -39
- package/src/lib/components/matecu-alert-box/matecu-alert-box.component.spec.ts +0 -25
- package/src/lib/components/matecu-alert-box/matecu-alert-box.component.ts +0 -60
- package/src/lib/components/matecu-alert-dialog/matecu-alert-dialog.component.html +0 -14
- package/src/lib/components/matecu-alert-dialog/matecu-alert-dialog.component.scss +0 -5
- package/src/lib/components/matecu-alert-dialog/matecu-alert-dialog.component.spec.ts +0 -25
- package/src/lib/components/matecu-alert-dialog/matecu-alert-dialog.component.ts +0 -53
- package/src/lib/components/matecu-alert-snack-bar/matecu-alert-snack-bar.component.html +0 -8
- package/src/lib/components/matecu-alert-snack-bar/matecu-alert-snack-bar.component.scss +0 -34
- package/src/lib/components/matecu-alert-snack-bar/matecu-alert-snack-bar.component.spec.ts +0 -25
- package/src/lib/components/matecu-alert-snack-bar/matecu-alert-snack-bar.component.ts +0 -45
- package/src/lib/components/matecu-spinner/matecu-spinner.component.css +0 -15
- package/src/lib/components/matecu-spinner/matecu-spinner.component.html +0 -35
- package/src/lib/components/matecu-spinner/matecu-spinner.component.spec.ts +0 -25
- package/src/lib/components/matecu-spinner/matecu-spinner.component.ts +0 -50
- package/src/lib/components/matecu-spinner/spinner-loader.component.scss +0 -13
- package/src/lib/components/matecu-topbar-action/matecu-topbar-action.component.html +0 -1
- package/src/lib/components/matecu-topbar-action/matecu-topbar-action.component.scss +0 -19
- package/src/lib/components/matecu-topbar-action/matecu-topbar-action.component.spec.ts +0 -25
- package/src/lib/components/matecu-topbar-action/matecu-topbar-action.component.ts +0 -14
- package/src/lib/components/matecu-topbar-body/matecu-topbar-body.component.html +0 -1
- package/src/lib/components/matecu-topbar-body/matecu-topbar-body.component.scss +0 -14
- package/src/lib/components/matecu-topbar-body/matecu-topbar-body.component.spec.ts +0 -25
- package/src/lib/components/matecu-topbar-body/matecu-topbar-body.component.ts +0 -11
- package/src/lib/components/matecu-topbar-fab/matecu-topbar-fab.component.html +0 -3
- package/src/lib/components/matecu-topbar-fab/matecu-topbar-fab.component.scss +0 -19
- package/src/lib/components/matecu-topbar-fab/matecu-topbar-fab.component.spec.ts +0 -25
- package/src/lib/components/matecu-topbar-fab/matecu-topbar-fab.component.ts +0 -31
- package/src/lib/components/matecu-topbar-header-column/matecu-topbar-header-column.component.html +0 -1
- package/src/lib/components/matecu-topbar-header-column/matecu-topbar-header-column.component.scss +0 -8
- package/src/lib/components/matecu-topbar-header-column/matecu-topbar-header-column.component.spec.ts +0 -23
- package/src/lib/components/matecu-topbar-header-column/matecu-topbar-header-column.component.ts +0 -11
- package/src/lib/components/matecu-topbar-header-row/matecu-topbar-header-row.component.html +0 -13
- package/src/lib/components/matecu-topbar-header-row/matecu-topbar-header-row.component.scss +0 -34
- package/src/lib/components/matecu-topbar-header-row/matecu-topbar-header-row.component.spec.ts +0 -23
- package/src/lib/components/matecu-topbar-header-row/matecu-topbar-header-row.component.ts +0 -18
- package/src/lib/components/matecu-topbar-layout/matecu-topbar-layout.component.html +0 -7
- package/src/lib/components/matecu-topbar-layout/matecu-topbar-layout.component.scss +0 -49
- package/src/lib/components/matecu-topbar-layout/matecu-topbar-layout.component.spec.ts +0 -25
- package/src/lib/components/matecu-topbar-layout/matecu-topbar-layout.component.ts +0 -112
- package/src/lib/components/matecu-topbar-search/matecu-topbar-search.component.html +0 -29
- package/src/lib/components/matecu-topbar-search/matecu-topbar-search.component.scss +0 -90
- package/src/lib/components/matecu-topbar-search/matecu-topbar-search.component.spec.ts +0 -25
- package/src/lib/components/matecu-topbar-search/matecu-topbar-search.component.ts +0 -92
- package/src/lib/components/matecu-topbar-title/matecu-topbar-title.component.html +0 -1
- package/src/lib/components/matecu-topbar-title/matecu-topbar-title.component.scss +0 -91
- package/src/lib/components/matecu-topbar-title/matecu-topbar-title.component.spec.ts +0 -25
- package/src/lib/components/matecu-topbar-title/matecu-topbar-title.component.ts +0 -14
- package/src/lib/modules/matecu-alert-box/matecu-alert-box.module.ts +0 -16
- package/src/lib/modules/matecu-spinner/matecu-spinner.module.ts +0 -14
- package/src/lib/modules/matecu-topbar-layout/matecu-topbar-layout.module.ts +0 -45
- package/src/lib/services/matecu-snack-bar.service.spec.ts +0 -16
- package/src/lib/services/matecu-snack-bar.service.ts +0 -66
- package/src/lib/services/matecu-spinner.service.spec.ts +0 -16
- package/src/lib/services/matecu-spinner.service.ts +0 -40
- package/src/lib/types/matecu-alert-dialog.ts +0 -10
- package/src/lib/types/matecu-altert-box-type.ts +0 -6
- package/src/test.ts +0 -17
- package/tsconfig.lib.json +0 -24
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -17
- package/tslint.json +0 -17
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
:host.matecu-alert-box {
|
|
2
|
-
display: flex;
|
|
3
|
-
padding: 1rem;
|
|
4
|
-
border-radius: 0.25rem;
|
|
5
|
-
position: relative;
|
|
6
|
-
border: 1px solid rgb(224, 224, 224);
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
margin: 1rem 0;
|
|
9
|
-
|
|
10
|
-
&--success {
|
|
11
|
-
color: rgb(15, 80, 50);
|
|
12
|
-
background-color: rgb(210, 230, 220);
|
|
13
|
-
border-color: rgb(186, 220, 205);
|
|
14
|
-
}
|
|
15
|
-
&--danger {
|
|
16
|
-
color: rgb(130, 30, 40);
|
|
17
|
-
background-color: rgb(248, 215, 218);
|
|
18
|
-
border-color: rgb(245, 194, 199);
|
|
19
|
-
}
|
|
20
|
-
&--warning {
|
|
21
|
-
color: rgb(100, 77, 3);
|
|
22
|
-
background-color: rgb(255, 243, 205);
|
|
23
|
-
border-color: rgb(255, 236, 180);
|
|
24
|
-
}
|
|
25
|
-
&--info {
|
|
26
|
-
color: rgb(5, 81, 96);
|
|
27
|
-
background-color: rgb(207, 244, 252);
|
|
28
|
-
border-color: rgb(182, 239, 251);
|
|
29
|
-
}
|
|
30
|
-
.matecu-alert-box {
|
|
31
|
-
&__icon {
|
|
32
|
-
display: flex;
|
|
33
|
-
margin-right: 1rem;
|
|
34
|
-
}
|
|
35
|
-
&__content {
|
|
36
|
-
align-self: center;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { MatecuAlertBoxComponent } from './matecu-alert-box.component';
|
|
4
|
-
|
|
5
|
-
describe('MatecuAlertBoxComponent', () => {
|
|
6
|
-
let component: MatecuAlertBoxComponent;
|
|
7
|
-
let fixture: ComponentFixture<MatecuAlertBoxComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ MatecuAlertBoxComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(MatecuAlertBoxComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { Component, HostBinding, Input, OnInit } from '@angular/core';
|
|
3
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
4
|
-
import { MatecuAlertBoxType } from '../../types/matecu-altert-box-type';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'matecu-alert-box',
|
|
8
|
-
templateUrl: './matecu-alert-box.component.html',
|
|
9
|
-
styleUrls: ['./matecu-alert-box.component.scss'],
|
|
10
|
-
standalone: true,
|
|
11
|
-
imports: [CommonModule, MatIconModule]
|
|
12
|
-
})
|
|
13
|
-
export class MatecuAlertBoxComponent implements OnInit {
|
|
14
|
-
classNameBase = 'matecu-alert-box';
|
|
15
|
-
alertColor?: MatecuAlertBoxType | undefined | string | null;
|
|
16
|
-
iconValue?: string | null | undefined;
|
|
17
|
-
private alertIcon = false;
|
|
18
|
-
get color(): MatecuAlertBoxType | undefined | string | null {
|
|
19
|
-
return this.alertColor;
|
|
20
|
-
}
|
|
21
|
-
@Input() set color(value: MatecuAlertBoxType | undefined | string | null) {
|
|
22
|
-
this.alertColor = value;
|
|
23
|
-
if (!!value) {
|
|
24
|
-
this.className = `${this.classNameBase} ${this.classNameBase}--${value}`;
|
|
25
|
-
} else {
|
|
26
|
-
this.className = this.classNameBase;
|
|
27
|
-
}
|
|
28
|
-
this.updateIcon();
|
|
29
|
-
}
|
|
30
|
-
get icon(): boolean {
|
|
31
|
-
return this.alertIcon;
|
|
32
|
-
}
|
|
33
|
-
@Input() set icon(value: boolean) {
|
|
34
|
-
this.alertIcon = value;
|
|
35
|
-
}
|
|
36
|
-
@HostBinding('class') className = this.classNameBase;
|
|
37
|
-
constructor() { }
|
|
38
|
-
|
|
39
|
-
ngOnInit(): void { }
|
|
40
|
-
|
|
41
|
-
private updateIcon(): void {
|
|
42
|
-
switch (this.color) {
|
|
43
|
-
case MatecuAlertBoxType.danger:
|
|
44
|
-
this.iconValue = 'dangerous';
|
|
45
|
-
break;
|
|
46
|
-
case MatecuAlertBoxType.warning:
|
|
47
|
-
this.iconValue = 'warning';
|
|
48
|
-
break;
|
|
49
|
-
case MatecuAlertBoxType.success:
|
|
50
|
-
this.iconValue = 'check_circle';
|
|
51
|
-
break;
|
|
52
|
-
case MatecuAlertBoxType.info:
|
|
53
|
-
this.iconValue = 'info';
|
|
54
|
-
break;
|
|
55
|
-
default:
|
|
56
|
-
this.iconValue = null;
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<h2 mat-dialog-title *ngIf="hasTitle">{{dialogData.title}}</h2>
|
|
2
|
-
<mat-dialog-content>
|
|
3
|
-
|
|
4
|
-
<matecu-alert-box [color]="dialogData.type" [icon]="!!dialogData.icon">
|
|
5
|
-
{{dialogData.message}}
|
|
6
|
-
</matecu-alert-box>
|
|
7
|
-
|
|
8
|
-
</mat-dialog-content>
|
|
9
|
-
<mat-dialog-actions *ngIf="showActions" align="end">
|
|
10
|
-
<button mat-button color="primary" tabindex="-1" mat-dialog-close
|
|
11
|
-
*ngIf="hasDismissBtn">{{dialogData.dismissText}}</button>
|
|
12
|
-
<button mat-button color="primary" tabindex="-2" (click)="activateAction()"
|
|
13
|
-
*ngIf="hasActionBtn">{{dialogData.action}}</button>
|
|
14
|
-
</mat-dialog-actions>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { MatecuAlertDialogComponent } from './matecu-alert-dialog.component';
|
|
4
|
-
|
|
5
|
-
describe('MatecuAlertDialogComponent', () => {
|
|
6
|
-
let component: MatecuAlertDialogComponent;
|
|
7
|
-
let fixture: ComponentFixture<MatecuAlertDialogComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ MatecuAlertDialogComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(MatecuAlertDialogComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { Component, Inject, OnInit } from '@angular/core';
|
|
3
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
4
|
-
import { MAT_DIALOG_DATA, MatDialogRef, MatDialogModule } from '@angular/material/dialog';
|
|
5
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
6
|
-
import { MatecuAlertDialogData } from '../../types/matecu-alert-dialog';
|
|
7
|
-
import { MatecuAlertBoxComponent } from '../matecu-alert-box/matecu-alert-box.component';
|
|
8
|
-
@Component({
|
|
9
|
-
selector: 'matecu-alert-dialog',
|
|
10
|
-
templateUrl: './matecu-alert-dialog.component.html',
|
|
11
|
-
styleUrls: ['./matecu-alert-dialog.component.scss'],
|
|
12
|
-
standalone: true,
|
|
13
|
-
imports: [CommonModule, MatDialogModule, MatIconModule, MatecuAlertBoxComponent, MatButtonModule]
|
|
14
|
-
})
|
|
15
|
-
export class MatecuAlertDialogComponent implements OnInit {
|
|
16
|
-
hasTitle = false;
|
|
17
|
-
hasDismissBtn = false;
|
|
18
|
-
hasActionBtn = false;
|
|
19
|
-
showActions = false;
|
|
20
|
-
constructor(
|
|
21
|
-
@Inject(MAT_DIALOG_DATA) public dialogData: MatecuAlertDialogData,
|
|
22
|
-
public dialogRef: MatDialogRef<MatecuAlertDialogComponent>
|
|
23
|
-
) {
|
|
24
|
-
this.setHasTitle();
|
|
25
|
-
this.setHasDismissBtn();
|
|
26
|
-
this.setHasActionBtn();
|
|
27
|
-
this.setShowActions();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
ngOnInit(): void { }
|
|
31
|
-
|
|
32
|
-
activateAction(): void {
|
|
33
|
-
this.dialogRef.close(true);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
private setHasTitle(): void {
|
|
37
|
-
this.hasTitle = this.isValidString(this.dialogData.title);
|
|
38
|
-
}
|
|
39
|
-
private setHasDismissBtn(): void {
|
|
40
|
-
this.hasDismissBtn = this.isValidString(this.dialogData.dismissText);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
private setHasActionBtn(): void {
|
|
44
|
-
this.hasActionBtn = this.isValidString(this.dialogData.action);
|
|
45
|
-
}
|
|
46
|
-
private setShowActions(): void {
|
|
47
|
-
this.showActions = this.hasActionBtn || this.hasDismissBtn;
|
|
48
|
-
}
|
|
49
|
-
private isValidString(str: string | null | undefined): boolean {
|
|
50
|
-
const isValid = typeof str === 'string' && str.trim().length > 0;
|
|
51
|
-
return isValid;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
:host.matecu-alert-snackbar {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
> * {
|
|
5
|
-
&:not(:first-child) {
|
|
6
|
-
margin-left: 10px;
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
&--success {
|
|
12
|
-
strong {
|
|
13
|
-
|
|
14
|
-
color: rgb(32, 219, 32);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
&--danger {
|
|
18
|
-
strong {
|
|
19
|
-
color: red;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
&--warning {
|
|
23
|
-
strong {
|
|
24
|
-
color: orange;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
&--info {
|
|
28
|
-
strong {
|
|
29
|
-
color: rgb(7, 160, 237)
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { MatecuAlertSnackBarComponent } from './matecu-alert-snack-bar.component';
|
|
4
|
-
|
|
5
|
-
describe('MatecuAlertSnackBarComponent', () => {
|
|
6
|
-
let component: MatecuAlertSnackBarComponent;
|
|
7
|
-
let fixture: ComponentFixture<MatecuAlertSnackBarComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ MatecuAlertSnackBarComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(MatecuAlertSnackBarComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { Component, HostBinding, Inject, OnInit } from '@angular/core';
|
|
3
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
4
|
-
import { MatSnackBarModule, MatSnackBarRef, MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar';
|
|
5
|
-
import { MatecuAlertSnackBarData } from '../../types/matecu-alert-snackbar';
|
|
6
|
-
import { MatecuAlertBoxType } from '../../types/matecu-altert-box-type';
|
|
7
|
-
|
|
8
|
-
@Component({
|
|
9
|
-
selector: 'matecu-alert-snack-bar',
|
|
10
|
-
templateUrl: './matecu-alert-snack-bar.component.html',
|
|
11
|
-
styleUrls: ['./matecu-alert-snack-bar.component.scss'],
|
|
12
|
-
standalone: true,
|
|
13
|
-
imports: [CommonModule, MatButtonModule, MatSnackBarModule]
|
|
14
|
-
})
|
|
15
|
-
export class MatecuAlertSnackBarComponent {
|
|
16
|
-
|
|
17
|
-
title: string;
|
|
18
|
-
message: string;
|
|
19
|
-
action?: string;
|
|
20
|
-
classNameBase = 'matecu-alert-snackbar';
|
|
21
|
-
alertColor!: MatecuAlertBoxType;
|
|
22
|
-
get color(): MatecuAlertBoxType {
|
|
23
|
-
return this.alertColor;
|
|
24
|
-
}
|
|
25
|
-
set color(value: MatecuAlertBoxType) {
|
|
26
|
-
this.alertColor = value;
|
|
27
|
-
this.className = `${this.classNameBase} ${this.classNameBase}--${value}`;
|
|
28
|
-
}
|
|
29
|
-
@HostBinding('class') className = this.classNameBase;
|
|
30
|
-
constructor(
|
|
31
|
-
@Inject(MAT_SNACK_BAR_DATA) public data: MatecuAlertSnackBarData,
|
|
32
|
-
private snackBarRef: MatSnackBarRef<MatecuAlertSnackBarComponent>) {
|
|
33
|
-
this.title = data.title;
|
|
34
|
-
this.message = data.message;
|
|
35
|
-
this.action = data.action;
|
|
36
|
-
this.color = data.type;
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
dismiss(): void {
|
|
41
|
-
this.snackBarRef.dismissWithAction();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<ng-container *ngIf="active">
|
|
2
|
-
<svg xmlns:svg="http://www.w3.org/2000/svg" [attr.width]="size" [attr.height]="size"
|
|
3
|
-
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" viewBox="0 0 128 128" xml:space="preserve">
|
|
4
|
-
<rect x="0" y="0" width="100%" height="100%" fill="transparent" />
|
|
5
|
-
<g>
|
|
6
|
-
<path class="matecu-spinner__100" d="M122.5 69.25H96.47a33.1 33.1 0 0 0 0-10.5h26.05a5.25 5.25 0 0 1 0 10.5z" [attr.fill]="color"
|
|
7
|
-
fill-opacity="1" />
|
|
8
|
-
<path class="matecu-spinner__30" d="M112.04 97.83L89.47 84.8a33.1 33.1 0 0 0 5.25-9.1l22.57 13.03a5.25 5.25 0 0 1-5.28 9.1z" [attr.fill]="color"
|
|
9
|
-
fill-opacity="0.3" />
|
|
10
|
-
<path class="matecu-spinner__30" d="M88.68 117.35L75.65 94.78a33.1 33.1 0 0 0 9.1-5.25l13.02 22.57a5.25 5.25 0 1 1-9.1 5.25z"
|
|
11
|
-
[attr.fill]="color" fill-opacity="0.3" />
|
|
12
|
-
<path class="matecu-spinner__30" d="M58.7 122.57V96.5a33.1 33.1 0 0 0 10.5 0v26.07a5.25 5.25 0 0 1-10.5 0z" [attr.fill]="color"
|
|
13
|
-
fill-opacity="0.3" />
|
|
14
|
-
<path class="matecu-spinner__30" d="M30.1 112.1l13.04-22.57a33.1 33.1 0 0 0 9.1 5.25L39.2 117.35a5.25 5.25 0 1 1-9.1-5.25z" [attr.fill]="color"
|
|
15
|
-
fill-opacity="0.3" />
|
|
16
|
-
<path class="matecu-spinner__30" d="M10.6 88.74L33.16 75.7a33.1 33.1 0 0 0 5.25 9.1L15.88 97.83a5.25 5.25 0 1 1-5.25-9.1z" [attr.fill]="color"
|
|
17
|
-
fill-opacity="0.3" />
|
|
18
|
-
<path class="matecu-spinner__40" d="M5.37 58.75h26.06a33.1 33.1 0 0 0 0 10.5H5.37a5.25 5.25 0 0 1 0-10.5z" [attr.fill]="color"
|
|
19
|
-
fill-opacity="0.4" />
|
|
20
|
-
<path class="matecu-spinner__50" d="M15.85 30.17L38.4 43.2a33.1 33.1 0 0 0-5.24 9.1L10.6 39.25a5.25 5.25 0 1 1 5.25-9.1z" [attr.fill]="color"
|
|
21
|
-
fill-opacity="0.5" />
|
|
22
|
-
<path class="matecu-spinner__60" d="M39.2 10.65l13.03 22.57a33.1 33.1 0 0 0-9.1 5.25l-13-22.57a5.25 5.25 0 1 1 9.1-5.25z" [attr.fill]="color"
|
|
23
|
-
fill-opacity="0.6" />
|
|
24
|
-
<path class="matecu-spinner__70" d="M69.2 5.43V31.5a33.1 33.1 0 0 0-10.5 0V5.42a5.25 5.25 0 1 1 10.5 0z" [attr.fill]="color"
|
|
25
|
-
fill-opacity="0.7" />
|
|
26
|
-
<path class="matecu-spinner__80" d="M97.77 15.9L84.75 38.47a33.1 33.1 0 0 0-9.1-5.25l13.03-22.57a5.25 5.25 0 1 1 9.1 5.25z" [attr.fill]="color"
|
|
27
|
-
fill-opacity="0.8" />
|
|
28
|
-
<path class="matecu-spinner__90" d="M117.3 39.26L94.7 52.3a33.1 33.1 0 0 0-5.25-9.1l22.57-13.03a5.25 5.25 0 0 1 5.25 9.1z" [attr.fill]="color"
|
|
29
|
-
fill-opacity="0.9" />
|
|
30
|
-
<animateTransform attributeName="transform" type="rotate"
|
|
31
|
-
values="0 64 64;30 64 64;60 64 64;90 64 64;120 64 64;150 64 64;180 64 64;210 64 64;240 64 64;270 64 64;300 64 64;330 64 64"
|
|
32
|
-
calcMode="discrete" dur="600ms" repeatCount="indefinite"></animateTransform>
|
|
33
|
-
</g>
|
|
34
|
-
</svg>
|
|
35
|
-
</ng-container>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { MatecuSpinnerComponent } from './matecu-spinner.component';
|
|
4
|
-
|
|
5
|
-
describe('MatecuSpinnerComponent', () => {
|
|
6
|
-
let component: MatecuSpinnerComponent;
|
|
7
|
-
let fixture: ComponentFixture<MatecuSpinnerComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ MatecuSpinnerComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(MatecuSpinnerComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { Component, HostBinding, Input, OnDestroy, OnInit } from '@angular/core';
|
|
3
|
-
import { Subject } from 'rxjs';
|
|
4
|
-
import { takeUntil, tap } from 'rxjs/operators';
|
|
5
|
-
import { MatecuSpinnerService } from '../../services/matecu-spinner.service';
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'matecu-spinner',
|
|
8
|
-
templateUrl: './matecu-spinner.component.html',
|
|
9
|
-
styleUrls: ['./matecu-spinner.component.css'],
|
|
10
|
-
standalone: true,
|
|
11
|
-
imports: [CommonModule]
|
|
12
|
-
})
|
|
13
|
-
export class MatecuSpinnerComponent implements OnInit, OnDestroy {
|
|
14
|
-
|
|
15
|
-
private destroy$ = new Subject();
|
|
16
|
-
private hiddenClass = 'matecu-spinner--hidden';
|
|
17
|
-
private activeCache = false;
|
|
18
|
-
@HostBinding('class') className = 'matecu-spinner';
|
|
19
|
-
@Input() color = '#2196F3';
|
|
20
|
-
@Input() global = false;
|
|
21
|
-
get active(): boolean {
|
|
22
|
-
return this.activeCache;
|
|
23
|
-
}
|
|
24
|
-
@Input() set active(value: boolean) {
|
|
25
|
-
if (this.global) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
this.activeCache = value;
|
|
29
|
-
this.className = value
|
|
30
|
-
? this.className.replace(` ${this.hiddenClass}`, '')
|
|
31
|
-
: (this.className += ` ${this.hiddenClass}`);
|
|
32
|
-
}
|
|
33
|
-
@Input() size = '70px';
|
|
34
|
-
|
|
35
|
-
constructor(
|
|
36
|
-
private spinnerService: MatecuSpinnerService,
|
|
37
|
-
) { }
|
|
38
|
-
ngOnDestroy(): void {
|
|
39
|
-
this.destroy$.next();
|
|
40
|
-
this.destroy$.complete();
|
|
41
|
-
}
|
|
42
|
-
ngOnInit(): void {
|
|
43
|
-
if (this.global) {
|
|
44
|
-
this.spinnerService.watch().pipe(
|
|
45
|
-
tap(value => this.activeCache = value),
|
|
46
|
-
takeUntil(this.destroy$)
|
|
47
|
-
).subscribe();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<ng-content></ng-content>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
--mtb-bar-height: 64px;
|
|
3
|
-
--mtb-action-padding: 10px;
|
|
4
|
-
--mtb-action-margin: 0px;
|
|
5
|
-
}
|
|
6
|
-
:host,
|
|
7
|
-
.matecu-topbar-action {
|
|
8
|
-
&,
|
|
9
|
-
* {
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
outline: none;
|
|
12
|
-
}
|
|
13
|
-
height: 100%;
|
|
14
|
-
display: flex;
|
|
15
|
-
align-items: flex-start;
|
|
16
|
-
max-height: var(--mtb-bar-height);
|
|
17
|
-
padding: var(--mtb-action-padding);
|
|
18
|
-
margin: var(--mtb-action-margin);
|
|
19
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { MatecuTopbarActionComponent } from './matecu-topbar-action.component';
|
|
4
|
-
|
|
5
|
-
describe('MatecuTopbarActionsComponent', () => {
|
|
6
|
-
let component: MatecuTopbarActionComponent;
|
|
7
|
-
let fixture: ComponentFixture<MatecuTopbarActionComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [MatecuTopbarActionComponent]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(MatecuTopbarActionComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Component, HostBinding, OnInit } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'matecu-topbar-action',
|
|
5
|
-
templateUrl: './matecu-topbar-action.component.html',
|
|
6
|
-
styleUrls: ['./matecu-topbar-action.component.scss'],
|
|
7
|
-
standalone: true,
|
|
8
|
-
})
|
|
9
|
-
export class MatecuTopbarActionComponent implements OnInit {
|
|
10
|
-
@HostBinding('class') className = 'matecu-topbar-action';
|
|
11
|
-
constructor() {}
|
|
12
|
-
|
|
13
|
-
ngOnInit(): void {}
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<ng-content></ng-content>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
:host,
|
|
2
|
-
.matecu-topbar-body {
|
|
3
|
-
display: block;
|
|
4
|
-
&,
|
|
5
|
-
* {
|
|
6
|
-
box-sizing: border-box;
|
|
7
|
-
outline: none;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
padding: var(--mtb-body-padding, 30px);
|
|
11
|
-
background-color: var(--mtb-body-background, auto);
|
|
12
|
-
overflow-y: auto;
|
|
13
|
-
padding-bottom: var(--mtb-body-padding-button, 60px);
|
|
14
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { MatecuTopbarBodyComponent } from './matecu-topbar-body.component';
|
|
4
|
-
|
|
5
|
-
describe('MatecuTopbarBodyComponent', () => {
|
|
6
|
-
let component: MatecuTopbarBodyComponent;
|
|
7
|
-
let fixture: ComponentFixture<MatecuTopbarBodyComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ MatecuTopbarBodyComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(MatecuTopbarBodyComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Component, HostBinding } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'matecu-topbar-body',
|
|
5
|
-
templateUrl: './matecu-topbar-body.component.html',
|
|
6
|
-
styleUrls: ['./matecu-topbar-body.component.scss'],
|
|
7
|
-
standalone: true,
|
|
8
|
-
})
|
|
9
|
-
export class MatecuTopbarBodyComponent {
|
|
10
|
-
@HostBinding('class') className = 'matecu-topbar-body';
|
|
11
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
:host,
|
|
2
|
-
.matecu-topbar-fab {
|
|
3
|
-
&,
|
|
4
|
-
* {
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
outline: none;
|
|
7
|
-
}
|
|
8
|
-
display: flex;
|
|
9
|
-
align-self: flex-end;
|
|
10
|
-
align-items: flex-start;
|
|
11
|
-
transform: translateY(50%);
|
|
12
|
-
transition: all 300ms ease-in-out;
|
|
13
|
-
&.mobile-style {
|
|
14
|
-
position: absolute;
|
|
15
|
-
transform: translate(0);
|
|
16
|
-
bottom: var(--mtb-fab-mobile-bottom-position, 20px);
|
|
17
|
-
right: var(--mtb-fab-mobile-right-position, 20px);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { MatecuTopbarFabComponent } from './matecu-topbar-fab.component';
|
|
4
|
-
|
|
5
|
-
describe('MatecuTopbarFabComponent', () => {
|
|
6
|
-
let component: MatecuTopbarFabComponent;
|
|
7
|
-
let fixture: ComponentFixture<MatecuTopbarFabComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ MatecuTopbarFabComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(MatecuTopbarFabComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|