angular-matecu 4.1.0 → 4.2.0
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/fesm2022/angular-matecu.mjs +1740 -0
- package/fesm2022/angular-matecu.mjs.map +1 -0
- package/package.json +16 -3
- package/types/angular-matecu.d.ts +490 -0
- package/ng-package.json +0 -7
- package/src/css/main.css +0 -1
- 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 -24
- 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 -10
- 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-autocomplete/matecu-autocomplete.html +0 -36
- package/src/lib/components/matecu-autocomplete/matecu-autocomplete.scss +0 -56
- package/src/lib/components/matecu-autocomplete/matecu-autocomplete.spec.ts +0 -23
- package/src/lib/components/matecu-autocomplete/matecu-autocomplete.ts +0 -336
- package/src/lib/components/matecu-autocomplete-multiple/matecu-autocomplete-multiple.html +0 -64
- package/src/lib/components/matecu-autocomplete-multiple/matecu-autocomplete-multiple.scss +0 -23
- package/src/lib/components/matecu-autocomplete-multiple/matecu-autocomplete-multiple.spec.ts +0 -23
- package/src/lib/components/matecu-autocomplete-multiple/matecu-autocomplete-multiple.ts +0 -314
- package/src/lib/components/matecu-file-input/matecu-file-input-customization.md +0 -284
- package/src/lib/components/matecu-file-input/matecu-file-input.example.md +0 -228
- package/src/lib/components/matecu-file-input/matecu-file-input.html +0 -128
- package/src/lib/components/matecu-file-input/matecu-file-input.scss +0 -461
- package/src/lib/components/matecu-file-input/matecu-file-input.spec.ts +0 -340
- package/src/lib/components/matecu-file-input/matecu-file-input.ts +0 -438
- package/src/lib/components/matecu-spinner/matecu-spinner.component.css +0 -15
- package/src/lib/components/matecu-spinner/matecu-spinner.component.html +0 -44
- package/src/lib/components/matecu-spinner/matecu-spinner.component.spec.ts +0 -25
- package/src/lib/components/matecu-spinner/matecu-spinner.component.ts +0 -54
- 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 -9
- 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 -20
- 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 -39
- package/src/lib/types/matecu-alert-dialog.ts +0 -10
- package/src/lib/types/matecu-alert-snackbar.ts +0 -8
- package/src/lib/types/matecu-altert-box-type.ts +0 -6
- package/src/lib/types/matecu-autocomplete.ts +0 -5
- package/src/public-api.ts +0 -42
- package/src/scss/main.scss +0 -2
- package/src/scss/matecu-spinner-module/_matecu-spinner-component.scss +0 -8
- package/src/scss/matecu-topbar-layout/_variables.scss +0 -2
- package/tsconfig.lib.json +0 -17
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -15
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { OnInit, OnDestroy, ChangeDetectorRef, AfterViewInit, EventEmitter, ElementRef, NgZone, OnChanges, DoCheck, Injector, SimpleChanges } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { Observable, Subject } from 'rxjs';
|
|
5
|
+
import * as i2 from '@angular/material/toolbar';
|
|
6
|
+
import * as i3 from '@angular/material/icon';
|
|
7
|
+
import * as i4 from '@angular/forms';
|
|
8
|
+
import { FormControl, ControlValueAccessor, NgControl } from '@angular/forms';
|
|
9
|
+
import * as i5 from '@angular/material/button';
|
|
10
|
+
import * as i3$1 from '@angular/material/dialog';
|
|
11
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
12
|
+
import * as i5$1 from '@angular/material/snack-bar';
|
|
13
|
+
import { MatSnackBarRef, MatSnackBar, MatSnackBarConfig, TextOnlySnackBar } from '@angular/material/snack-bar';
|
|
14
|
+
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
15
|
+
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
16
|
+
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
17
|
+
import { MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
|
18
|
+
|
|
19
|
+
declare class MatecuSpinnerService {
|
|
20
|
+
private active$;
|
|
21
|
+
private requestsKeys;
|
|
22
|
+
constructor();
|
|
23
|
+
watch(): Observable<boolean>;
|
|
24
|
+
add(customKey?: string): string;
|
|
25
|
+
remove(key: string): void;
|
|
26
|
+
clear(): void;
|
|
27
|
+
private updateStatus;
|
|
28
|
+
private createKey;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuSpinnerService, never>;
|
|
30
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MatecuSpinnerService>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
declare class MatecuSpinnerComponent implements OnInit, OnDestroy {
|
|
34
|
+
private spinnerService;
|
|
35
|
+
private cdr;
|
|
36
|
+
private destroy$;
|
|
37
|
+
private hiddenClass;
|
|
38
|
+
private activeCache;
|
|
39
|
+
className: string;
|
|
40
|
+
color: string;
|
|
41
|
+
global: boolean;
|
|
42
|
+
get active(): boolean;
|
|
43
|
+
set active(value: boolean);
|
|
44
|
+
size: string;
|
|
45
|
+
constructor(spinnerService: MatecuSpinnerService, cdr: ChangeDetectorRef);
|
|
46
|
+
ngOnDestroy(): void;
|
|
47
|
+
ngOnInit(): void;
|
|
48
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuSpinnerComponent, never>;
|
|
49
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatecuSpinnerComponent, "matecu-spinner", never, { "color": { "alias": "color"; "required": false; }; "global": { "alias": "global"; "required": false; }; "active": { "alias": "active"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, {}, never, never, true, never>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare class MatecuSpinnerModule {
|
|
53
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuSpinnerModule, never>;
|
|
54
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MatecuSpinnerModule, never, [typeof i1.CommonModule, typeof MatecuSpinnerComponent], [typeof MatecuSpinnerComponent]>;
|
|
55
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<MatecuSpinnerModule>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare class MatecuTopbarLayoutComponent implements AfterViewInit, OnDestroy {
|
|
59
|
+
private elementRef;
|
|
60
|
+
private changeDetector;
|
|
61
|
+
private zone;
|
|
62
|
+
private _scrolled;
|
|
63
|
+
private _prominent;
|
|
64
|
+
get scrolled(): boolean;
|
|
65
|
+
set scrolled(value: boolean);
|
|
66
|
+
private destroy$;
|
|
67
|
+
mobileStyle: boolean;
|
|
68
|
+
mobileStyleChange: EventEmitter<boolean>;
|
|
69
|
+
mobileWidth: number;
|
|
70
|
+
whenResize: EventEmitter<number>;
|
|
71
|
+
get prominent(): boolean;
|
|
72
|
+
set prominent(value: boolean);
|
|
73
|
+
className: string;
|
|
74
|
+
bodyElement?: ElementRef;
|
|
75
|
+
constructor(elementRef: ElementRef, changeDetector: ChangeDetectorRef, zone: NgZone);
|
|
76
|
+
ngOnDestroy(): void;
|
|
77
|
+
private spyScroll;
|
|
78
|
+
ngAfterViewInit(): void;
|
|
79
|
+
scrollTop(): void;
|
|
80
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuTopbarLayoutComponent, never>;
|
|
81
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatecuTopbarLayoutComponent, "matecu-topbar-layout", never, { "mobileStyle": { "alias": "mobileStyle"; "required": false; }; "mobileWidth": { "alias": "mobileWidth"; "required": false; }; "prominent": { "alias": "prominent"; "required": false; }; }, { "mobileStyleChange": "mobileStyleChange"; "whenResize": "whenResize"; }, never, ["matecu-topbar-header-row[first-row]", "matecu-topbar-header-row[second-row]", "matecu-topbar-body"], true, never>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
declare class MatecuTopbarTitleComponent implements OnInit {
|
|
85
|
+
className: string;
|
|
86
|
+
constructor();
|
|
87
|
+
ngOnInit(): void;
|
|
88
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuTopbarTitleComponent, never>;
|
|
89
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatecuTopbarTitleComponent, "matecu-topbar-title", never, {}, {}, never, ["*"], true, never>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
declare class MatecuTopbarBodyComponent {
|
|
93
|
+
className: string;
|
|
94
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuTopbarBodyComponent, never>;
|
|
95
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatecuTopbarBodyComponent, "matecu-topbar-body", never, {}, {}, never, ["*"], true, never>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
declare class MatecuTopbarFabComponent {
|
|
99
|
+
private _mobileStyle;
|
|
100
|
+
private mainClassName;
|
|
101
|
+
display: boolean;
|
|
102
|
+
get mobileStyle(): boolean;
|
|
103
|
+
set mobileStyle(value: boolean);
|
|
104
|
+
className: string;
|
|
105
|
+
get color(): "flex" | "none";
|
|
106
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuTopbarFabComponent, never>;
|
|
107
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatecuTopbarFabComponent, "matecu-topbar-fab", never, { "display": { "alias": "display"; "required": false; }; "mobileStyle": { "alias": "mobileStyle"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
declare class MatecuTopbarSearchComponent implements OnInit {
|
|
111
|
+
hasValue: boolean;
|
|
112
|
+
activeMobileSearch: boolean;
|
|
113
|
+
inputCtrl: FormControl<string | null>;
|
|
114
|
+
private _value;
|
|
115
|
+
private _mobileStyle;
|
|
116
|
+
private destroy$;
|
|
117
|
+
display: boolean;
|
|
118
|
+
placeholder: string;
|
|
119
|
+
delyValueChanges: number;
|
|
120
|
+
get value(): string;
|
|
121
|
+
set value(v: string);
|
|
122
|
+
get mobileStyle(): boolean;
|
|
123
|
+
set mobileStyle(value: boolean);
|
|
124
|
+
valueChange: EventEmitter<string>;
|
|
125
|
+
className: string;
|
|
126
|
+
get color(): "flex" | "none";
|
|
127
|
+
ngOnInit(): void;
|
|
128
|
+
toggleActiveMobildeSearch(): void;
|
|
129
|
+
clearSearch(): void;
|
|
130
|
+
updateHasValueFn(): (value: string) => void;
|
|
131
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuTopbarSearchComponent, never>;
|
|
132
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatecuTopbarSearchComponent, "matecu-topbar-search", never, { "display": { "alias": "display"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "delyValueChanges": { "alias": "delyValueChanges"; "required": false; }; "value": { "alias": "value"; "required": false; }; "mobileStyle": { "alias": "mobileStyle"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
declare class MatecuTopbarActionComponent implements OnInit {
|
|
136
|
+
className: string;
|
|
137
|
+
constructor();
|
|
138
|
+
ngOnInit(): void;
|
|
139
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuTopbarActionComponent, never>;
|
|
140
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatecuTopbarActionComponent, "matecu-topbar-action", never, {}, {}, never, ["*"], true, never>;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
declare class MatecuTopbarHeaderRowComponent {
|
|
144
|
+
display: boolean;
|
|
145
|
+
className: string;
|
|
146
|
+
get color(): "flex" | "none";
|
|
147
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuTopbarHeaderRowComponent, never>;
|
|
148
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatecuTopbarHeaderRowComponent, "matecu-topbar-header-row", never, { "display": { "alias": "display"; "required": false; }; }, {}, never, ["matecu-topbar-header-column[left-column]", "matecu-topbar-header-column[right-column]"], true, never>;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
declare class MatecuTopbarHeaderColumnComponent {
|
|
152
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuTopbarHeaderColumnComponent, never>;
|
|
153
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatecuTopbarHeaderColumnComponent, "matecu-topbar-header-column", never, {}, {}, never, ["*"], true, never>;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
declare class MatecuTopbarLayoutModule {
|
|
157
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuTopbarLayoutModule, never>;
|
|
158
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MatecuTopbarLayoutModule, never, [typeof i1.CommonModule, typeof i2.MatToolbarModule, typeof i3.MatIconModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule, typeof i5.MatButtonModule, typeof MatecuTopbarLayoutComponent, typeof MatecuTopbarTitleComponent, typeof MatecuTopbarBodyComponent, typeof MatecuTopbarFabComponent, typeof MatecuTopbarSearchComponent, typeof MatecuTopbarActionComponent, typeof MatecuTopbarHeaderRowComponent, typeof MatecuTopbarHeaderColumnComponent], [typeof MatecuTopbarLayoutComponent, typeof MatecuTopbarTitleComponent, typeof MatecuTopbarBodyComponent, typeof MatecuTopbarFabComponent, typeof MatecuTopbarSearchComponent, typeof MatecuTopbarActionComponent, typeof MatecuTopbarHeaderRowComponent, typeof MatecuTopbarHeaderColumnComponent]>;
|
|
159
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<MatecuTopbarLayoutModule>;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
declare enum MatecuAlertBoxType {
|
|
163
|
+
warning = "warning",
|
|
164
|
+
success = "success",
|
|
165
|
+
danger = "danger",
|
|
166
|
+
info = "info"
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
declare class MatecuAlertBoxComponent implements OnInit {
|
|
170
|
+
classNameBase: string;
|
|
171
|
+
alertColor?: MatecuAlertBoxType | undefined | string | null;
|
|
172
|
+
iconValue?: string | null | undefined;
|
|
173
|
+
private alertIcon;
|
|
174
|
+
get color(): MatecuAlertBoxType | undefined | string | null;
|
|
175
|
+
set color(value: MatecuAlertBoxType | undefined | string | null);
|
|
176
|
+
get icon(): boolean;
|
|
177
|
+
set icon(value: boolean);
|
|
178
|
+
className: string;
|
|
179
|
+
constructor();
|
|
180
|
+
ngOnInit(): void;
|
|
181
|
+
private updateIcon;
|
|
182
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuAlertBoxComponent, never>;
|
|
183
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatecuAlertBoxComponent, "matecu-alert-box", never, { "color": { "alias": "color"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
interface MatecuAlertDialogData {
|
|
187
|
+
message: string;
|
|
188
|
+
title?: string | null | undefined;
|
|
189
|
+
action?: string | null | undefined;
|
|
190
|
+
icon?: boolean | null | undefined;
|
|
191
|
+
type?: MatecuAlertBoxType | string | null | undefined;
|
|
192
|
+
dismissText?: string | null | undefined;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
declare class MatecuAlertDialogComponent implements OnInit {
|
|
196
|
+
dialogData: MatecuAlertDialogData;
|
|
197
|
+
dialogRef: MatDialogRef<MatecuAlertDialogComponent>;
|
|
198
|
+
hasTitle: boolean;
|
|
199
|
+
hasDismissBtn: boolean;
|
|
200
|
+
hasActionBtn: boolean;
|
|
201
|
+
showActions: boolean;
|
|
202
|
+
constructor(dialogData: MatecuAlertDialogData, dialogRef: MatDialogRef<MatecuAlertDialogComponent>);
|
|
203
|
+
ngOnInit(): void;
|
|
204
|
+
activateAction(): void;
|
|
205
|
+
private setHasTitle;
|
|
206
|
+
private setHasDismissBtn;
|
|
207
|
+
private setHasActionBtn;
|
|
208
|
+
private setShowActions;
|
|
209
|
+
private isValidString;
|
|
210
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuAlertDialogComponent, never>;
|
|
211
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatecuAlertDialogComponent, "matecu-alert-dialog", never, {}, {}, never, never, true, never>;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
interface MatecuAlertSnackBarData {
|
|
215
|
+
message: string;
|
|
216
|
+
title: string;
|
|
217
|
+
action?: string;
|
|
218
|
+
type: MatecuAlertBoxType;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
declare class MatecuAlertSnackBarComponent {
|
|
222
|
+
data: MatecuAlertSnackBarData;
|
|
223
|
+
private snackBarRef;
|
|
224
|
+
title: string;
|
|
225
|
+
message: string;
|
|
226
|
+
action?: string;
|
|
227
|
+
classNameBase: string;
|
|
228
|
+
alertColor: MatecuAlertBoxType;
|
|
229
|
+
get color(): MatecuAlertBoxType;
|
|
230
|
+
set color(value: MatecuAlertBoxType);
|
|
231
|
+
className: string;
|
|
232
|
+
constructor(data: MatecuAlertSnackBarData, snackBarRef: MatSnackBarRef<MatecuAlertSnackBarComponent>);
|
|
233
|
+
dismiss(): void;
|
|
234
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuAlertSnackBarComponent, never>;
|
|
235
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatecuAlertSnackBarComponent, "matecu-alert-snack-bar", never, {}, {}, never, never, true, never>;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
declare class MatecuAlertBoxModule {
|
|
239
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuAlertBoxModule, never>;
|
|
240
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MatecuAlertBoxModule, never, [typeof i1.CommonModule, typeof i3.MatIconModule, typeof i3$1.MatDialogModule, typeof i5.MatButtonModule, typeof i5$1.MatSnackBarModule, typeof MatecuAlertBoxComponent, typeof MatecuAlertDialogComponent, typeof MatecuAlertSnackBarComponent], [typeof MatecuAlertBoxComponent]>;
|
|
241
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<MatecuAlertBoxModule>;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
declare class MatecuSnackBarService {
|
|
245
|
+
private snackBar;
|
|
246
|
+
constructor(snackBar: MatSnackBar);
|
|
247
|
+
openError(error: string | Error, title?: string | null, action?: string, config?: MatSnackBarConfig<any>): MatSnackBarRef<MatecuAlertSnackBarComponent>;
|
|
248
|
+
openSuccess(message: string, title?: string | null, action?: string, config?: MatSnackBarConfig<any>): MatSnackBarRef<MatecuAlertSnackBarComponent>;
|
|
249
|
+
openWarning(message: string, title?: string | null, action?: string, config?: MatSnackBarConfig<any>): MatSnackBarRef<MatecuAlertSnackBarComponent>;
|
|
250
|
+
openInfo(message: string, title?: string | null, action?: string, config?: MatSnackBarConfig<any>): MatSnackBarRef<MatecuAlertSnackBarComponent>;
|
|
251
|
+
open(message: string, action?: string, config?: MatSnackBarConfig<any>): MatSnackBarRef<TextOnlySnackBar>;
|
|
252
|
+
dismiss(): void;
|
|
253
|
+
private openAlert;
|
|
254
|
+
private getErrorMessage;
|
|
255
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuSnackBarService, never>;
|
|
256
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MatecuSnackBarService>;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* [value,label]
|
|
261
|
+
*/
|
|
262
|
+
type MatecuAutocompleteOption = [string, string];
|
|
263
|
+
type MatecuAutocompleteFilterFn = (optionLabel: string, search: string) => boolean;
|
|
264
|
+
|
|
265
|
+
declare class MatecuAutocomplete implements ControlValueAccessor, MatFormFieldControl<string>, OnChanges, OnInit, OnDestroy, DoCheck {
|
|
266
|
+
options: MatecuAutocompleteOption[];
|
|
267
|
+
allowCreate: boolean;
|
|
268
|
+
loading: boolean;
|
|
269
|
+
readonly: boolean;
|
|
270
|
+
filterFn: MatecuAutocompleteFilterFn;
|
|
271
|
+
searchChangeDebounceTime: number;
|
|
272
|
+
get placeholder(): string;
|
|
273
|
+
set placeholder(value: string);
|
|
274
|
+
private _placeholder;
|
|
275
|
+
get required(): boolean;
|
|
276
|
+
set required(value: boolean);
|
|
277
|
+
private _required;
|
|
278
|
+
get disabled(): boolean;
|
|
279
|
+
set disabled(value: boolean);
|
|
280
|
+
private _disabled;
|
|
281
|
+
get value(): string | null;
|
|
282
|
+
set value(value: string | null);
|
|
283
|
+
searchChange: EventEmitter<string>;
|
|
284
|
+
create: EventEmitter<string>;
|
|
285
|
+
valueChange: EventEmitter<string | null>;
|
|
286
|
+
static nextId: number;
|
|
287
|
+
readonly stateChanges: Subject<void>;
|
|
288
|
+
readonly id: string;
|
|
289
|
+
ngControl: NgControl | null;
|
|
290
|
+
focused: boolean;
|
|
291
|
+
lastSearchText: string | null;
|
|
292
|
+
readonly controlType = "matecu-autocomplete";
|
|
293
|
+
readonly autofilled = false;
|
|
294
|
+
inputControl: FormControl<string | null>;
|
|
295
|
+
filteredOptions$: Observable<MatecuAutocompleteOption[]>;
|
|
296
|
+
private internalValue;
|
|
297
|
+
private focusMonitor;
|
|
298
|
+
private elementRef;
|
|
299
|
+
private injector;
|
|
300
|
+
private optionMap;
|
|
301
|
+
private onChange;
|
|
302
|
+
private onTouched;
|
|
303
|
+
get empty(): boolean;
|
|
304
|
+
get shouldLabelFloat(): boolean;
|
|
305
|
+
get errorState(): boolean;
|
|
306
|
+
get showCreateOption(): boolean;
|
|
307
|
+
constructor(focusMonitor: FocusMonitor, elementRef: ElementRef<HTMLElement>, injector: Injector);
|
|
308
|
+
ngOnInit(): void;
|
|
309
|
+
ngOnDestroy(): void;
|
|
310
|
+
ngDoCheck(): void;
|
|
311
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
312
|
+
private filter;
|
|
313
|
+
private createFilterFn;
|
|
314
|
+
displayLabel: (value: string | null) => string;
|
|
315
|
+
onOptionSelected(value: string): void;
|
|
316
|
+
onCreateClick(): void;
|
|
317
|
+
private updateInputLabelFromValue;
|
|
318
|
+
writeValue(value: string | null): void;
|
|
319
|
+
registerOnChange(fn: any): void;
|
|
320
|
+
registerOnTouched(fn: any): void;
|
|
321
|
+
setDisabledState(isDisabled: boolean): void;
|
|
322
|
+
focus(options?: FocusOptions): void;
|
|
323
|
+
onContainerClick(): void;
|
|
324
|
+
setDescribedByIds(ids: string[]): void;
|
|
325
|
+
private rebuildOptionMap;
|
|
326
|
+
private clearValue;
|
|
327
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuAutocomplete, never>;
|
|
328
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatecuAutocomplete, "matecu-autocomplete", never, { "options": { "alias": "options"; "required": false; }; "allowCreate": { "alias": "allowCreate"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "filterFn": { "alias": "filterFn"; "required": false; }; "searchChangeDebounceTime": { "alias": "searchChangeDebounceTime"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "required": { "alias": "required"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "searchChange": "searchChange"; "create": "create"; "valueChange": "valueChange"; }, never, never, true, never>;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
declare class MatecuAutocompleteMultiple implements ControlValueAccessor, MatFormFieldControl<string[]>, OnDestroy, OnInit {
|
|
332
|
+
static nextId: number;
|
|
333
|
+
placeholder: string;
|
|
334
|
+
loading: boolean;
|
|
335
|
+
searchChangeDebounceTime: number;
|
|
336
|
+
enableSelectAll: boolean;
|
|
337
|
+
readonly: boolean;
|
|
338
|
+
selectAllLabel: string;
|
|
339
|
+
clearAllLabel: string;
|
|
340
|
+
showTooltip: boolean;
|
|
341
|
+
filterFn: MatecuAutocompleteFilterFn;
|
|
342
|
+
private _options;
|
|
343
|
+
set options(value: MatecuAutocompleteOption[]);
|
|
344
|
+
get options(): MatecuAutocompleteOption[];
|
|
345
|
+
searchChange: EventEmitter<string>;
|
|
346
|
+
valueChange: EventEmitter<string[] | null>;
|
|
347
|
+
control: FormControl<string[]>;
|
|
348
|
+
controlValue$: i0.Signal<string[] | undefined>;
|
|
349
|
+
searchControl: FormControl<string>;
|
|
350
|
+
autocompleteTrigger: MatAutocompleteTrigger;
|
|
351
|
+
readonly searchText: i0.WritableSignal<string>;
|
|
352
|
+
readonly filteredOptions: i0.Signal<MatecuAutocompleteOption[]>;
|
|
353
|
+
readonly selectedItems: i0.Signal<{
|
|
354
|
+
value: string;
|
|
355
|
+
label: string;
|
|
356
|
+
}[]>;
|
|
357
|
+
stateChanges: Subject<void>;
|
|
358
|
+
focused: boolean;
|
|
359
|
+
controlType: string;
|
|
360
|
+
id: string;
|
|
361
|
+
describedBy: string;
|
|
362
|
+
disabled: boolean;
|
|
363
|
+
required: boolean;
|
|
364
|
+
errorState: boolean;
|
|
365
|
+
private injector;
|
|
366
|
+
ngControl: NgControl | null;
|
|
367
|
+
get empty(): boolean;
|
|
368
|
+
get shouldLabelFloat(): boolean;
|
|
369
|
+
constructor(injector: Injector);
|
|
370
|
+
value: string[] | null;
|
|
371
|
+
autofilled?: boolean | undefined;
|
|
372
|
+
userAriaDescribedBy?: string | undefined;
|
|
373
|
+
disableAutomaticLabeling?: boolean | undefined;
|
|
374
|
+
describedByIds?: string[] | undefined;
|
|
375
|
+
ngOnInit(): void;
|
|
376
|
+
selectOption(option: [string, string]): void;
|
|
377
|
+
displayLabel(option: [string, string]): string;
|
|
378
|
+
remove(value: string): void;
|
|
379
|
+
selectAll(): void;
|
|
380
|
+
clearAll(): void;
|
|
381
|
+
drop(event: CdkDragDrop<any>): void;
|
|
382
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
383
|
+
onChange: (value: string[]) => void;
|
|
384
|
+
onTouched: () => void;
|
|
385
|
+
writeValue(value: string[] | null): void;
|
|
386
|
+
registerOnChange(fn: any): void;
|
|
387
|
+
registerOnTouched(fn: any): void;
|
|
388
|
+
setDisabledState(isDisabled: boolean): void;
|
|
389
|
+
setDescribedByIds(ids: string[]): void;
|
|
390
|
+
onContainerClick(): void;
|
|
391
|
+
ngOnDestroy(): void;
|
|
392
|
+
trackByValue: (_: number, item: [string, string]) => string;
|
|
393
|
+
openPanel(): void;
|
|
394
|
+
private createFilterFn;
|
|
395
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuAutocompleteMultiple, never>;
|
|
396
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatecuAutocompleteMultiple, "matecu-autocomplete-multiple", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "searchChangeDebounceTime": { "alias": "searchChangeDebounceTime"; "required": false; }; "enableSelectAll": { "alias": "enableSelectAll"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "selectAllLabel": { "alias": "selectAllLabel"; "required": false; }; "clearAllLabel": { "alias": "clearAllLabel"; "required": false; }; "showTooltip": { "alias": "showTooltip"; "required": false; }; "filterFn": { "alias": "filterFn"; "required": false; }; "options": { "alias": "options"; "required": true; }; }, { "searchChange": "searchChange"; "valueChange": "valueChange"; }, never, never, true, never>;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
interface ErrorMessages {
|
|
400
|
+
invalidSize: string;
|
|
401
|
+
invalidType: string;
|
|
402
|
+
tooManyFiles: string;
|
|
403
|
+
uploadError: string;
|
|
404
|
+
}
|
|
405
|
+
type FileSizeUnit = 'AUTO' | 'bytes' | 'KB' | 'MB' | 'GB' | 'TB';
|
|
406
|
+
|
|
407
|
+
declare enum FileInputState {
|
|
408
|
+
IDLE = "idle",
|
|
409
|
+
LOADING = "loading",
|
|
410
|
+
SUCCESS = "success",
|
|
411
|
+
ERROR = "error"
|
|
412
|
+
}
|
|
413
|
+
declare class MatecuFileInput implements ControlValueAccessor, OnDestroy {
|
|
414
|
+
fileInput: ElementRef<HTMLInputElement>;
|
|
415
|
+
files: File[];
|
|
416
|
+
file?: File;
|
|
417
|
+
isDisabled: boolean;
|
|
418
|
+
fileName?: string;
|
|
419
|
+
selectedFileSize?: number;
|
|
420
|
+
hasInvalidSize: boolean;
|
|
421
|
+
hasInvalidType: boolean;
|
|
422
|
+
previewUrl?: string;
|
|
423
|
+
previewUrls: Map<string, string>;
|
|
424
|
+
currentState: FileInputState;
|
|
425
|
+
validationErrors: string[];
|
|
426
|
+
isDragOver: boolean;
|
|
427
|
+
private onChange;
|
|
428
|
+
private onTouched;
|
|
429
|
+
optimizeImage?: (img: File) => Promise<File>;
|
|
430
|
+
optimizeImageToSize?: number;
|
|
431
|
+
maxFileSize?: number;
|
|
432
|
+
maxFiles: number;
|
|
433
|
+
multiple: boolean;
|
|
434
|
+
showFileSize: boolean;
|
|
435
|
+
fileSizeUnit: FileSizeUnit;
|
|
436
|
+
displayName?: string;
|
|
437
|
+
placeholder: string;
|
|
438
|
+
buttonText: string;
|
|
439
|
+
changeSelectedFileText: string;
|
|
440
|
+
loadingText: string;
|
|
441
|
+
ariaLabel?: string;
|
|
442
|
+
acceptedMimeTypes: string[];
|
|
443
|
+
acceptedExtensions: string[];
|
|
444
|
+
errorMessages: ErrorMessages;
|
|
445
|
+
enableDragDrop: boolean;
|
|
446
|
+
showPreview: boolean;
|
|
447
|
+
previewMaxWidth: number;
|
|
448
|
+
previewMaxHeight: number;
|
|
449
|
+
showProgress: boolean;
|
|
450
|
+
fileSelected: EventEmitter<File>;
|
|
451
|
+
filesSelected: EventEmitter<File[]>;
|
|
452
|
+
fileRemoved: EventEmitter<File>;
|
|
453
|
+
validationError: EventEmitter<string[]>;
|
|
454
|
+
dragEnter: EventEmitter<DragEvent>;
|
|
455
|
+
dragLeave: EventEmitter<DragEvent>;
|
|
456
|
+
stateChange: EventEmitter<FileInputState>;
|
|
457
|
+
writeValue(value: any): void;
|
|
458
|
+
registerOnChange(fn: (value: any) => void): void;
|
|
459
|
+
registerOnTouched(fn: () => void): void;
|
|
460
|
+
setDisabledState(isDisabled: boolean): void;
|
|
461
|
+
ngOnDestroy(): void;
|
|
462
|
+
onFileChange(event: Event): void;
|
|
463
|
+
onDragOver(event: DragEvent): void;
|
|
464
|
+
onDragLeave(event: DragEvent): void;
|
|
465
|
+
onDrop(event: DragEvent): void;
|
|
466
|
+
openFileDialog(): void;
|
|
467
|
+
removeFile(fileToRemove: File): void;
|
|
468
|
+
private handleFileSelection;
|
|
469
|
+
private handleSingleFile;
|
|
470
|
+
private handleMultipleFiles;
|
|
471
|
+
private processFile;
|
|
472
|
+
private validateFile;
|
|
473
|
+
private generatePreview;
|
|
474
|
+
private cleanupPreview;
|
|
475
|
+
private resetComponent;
|
|
476
|
+
private notifyChange;
|
|
477
|
+
private changeState;
|
|
478
|
+
calculateFileSizeInMB(file: File): number;
|
|
479
|
+
formatFileSize(file: File): string;
|
|
480
|
+
getFileIcon(file?: File): string;
|
|
481
|
+
getPreviewUrl(file: File): string;
|
|
482
|
+
get hasErrors(): boolean;
|
|
483
|
+
get isLoading(): boolean;
|
|
484
|
+
get hasFiles(): boolean;
|
|
485
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatecuFileInput, never>;
|
|
486
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MatecuFileInput, "matecu-file-input", never, { "optimizeImage": { "alias": "optimizeImage"; "required": false; }; "optimizeImageToSize": { "alias": "optimizeImageToSize"; "required": false; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; }; "maxFiles": { "alias": "maxFiles"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "showFileSize": { "alias": "showFileSize"; "required": false; }; "fileSizeUnit": { "alias": "fileSizeUnit"; "required": false; }; "displayName": { "alias": "displayName"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "buttonText": { "alias": "buttonText"; "required": false; }; "changeSelectedFileText": { "alias": "changeSelectedFileText"; "required": false; }; "loadingText": { "alias": "loadingText"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "acceptedMimeTypes": { "alias": "acceptedMimeTypes"; "required": false; }; "acceptedExtensions": { "alias": "acceptedExtensions"; "required": false; }; "errorMessages": { "alias": "errorMessages"; "required": false; }; "enableDragDrop": { "alias": "enableDragDrop"; "required": false; }; "showPreview": { "alias": "showPreview"; "required": false; }; "previewMaxWidth": { "alias": "previewMaxWidth"; "required": false; }; "previewMaxHeight": { "alias": "previewMaxHeight"; "required": false; }; "showProgress": { "alias": "showProgress"; "required": false; }; }, { "fileSelected": "fileSelected"; "filesSelected": "filesSelected"; "fileRemoved": "fileRemoved"; "validationError": "validationError"; "dragEnter": "dragEnter"; "dragLeave": "dragLeave"; "stateChange": "stateChange"; }, never, never, true, never>;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export { FileInputState, MatecuAlertBoxComponent, MatecuAlertBoxModule, MatecuAlertBoxType, MatecuAlertDialogComponent, MatecuAlertSnackBarComponent, MatecuAutocomplete, MatecuAutocompleteMultiple, MatecuFileInput, MatecuSnackBarService, MatecuSpinnerComponent, MatecuSpinnerModule, MatecuSpinnerService, MatecuTopbarActionComponent, MatecuTopbarBodyComponent, MatecuTopbarFabComponent, MatecuTopbarHeaderColumnComponent, MatecuTopbarHeaderRowComponent, MatecuTopbarLayoutComponent, MatecuTopbarLayoutModule, MatecuTopbarSearchComponent, MatecuTopbarTitleComponent };
|
|
490
|
+
export type { FileSizeUnit, MatecuAlertDialogData };
|
package/ng-package.json
DELETED
package/src/css/main.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.matecu-spinner{display:inline-flex;justify-content:center;align-content:center}.matecu-spinner__hidden{display:none}
|
|
@@ -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,24 +0,0 @@
|
|
|
1
|
-
@if (hasTitle) {
|
|
2
|
-
|
|
3
|
-
<h2 mat-dialog-title>{{dialogData.title}}</h2>
|
|
4
|
-
}
|
|
5
|
-
<mat-dialog-content>
|
|
6
|
-
|
|
7
|
-
<matecu-alert-box [color]="dialogData.type" [icon]="!!dialogData.icon">
|
|
8
|
-
{{dialogData.message}}
|
|
9
|
-
</matecu-alert-box>
|
|
10
|
-
|
|
11
|
-
</mat-dialog-content>
|
|
12
|
-
@if (showActions) {
|
|
13
|
-
|
|
14
|
-
<mat-dialog-actions align="end">
|
|
15
|
-
@if (hasDismissBtn) {
|
|
16
|
-
<button mat-button color="primary" tabindex="-1" mat-dialog-close>{{dialogData.dismissText}}
|
|
17
|
-
</button>
|
|
18
|
-
}
|
|
19
|
-
@if(hasActionBtn) {
|
|
20
|
-
<button mat-button color="primary" tabindex="-2" (click)="activateAction()">{{dialogData.action}}
|
|
21
|
-
</button>
|
|
22
|
-
}
|
|
23
|
-
</mat-dialog-actions>
|
|
24
|
-
}
|