@falcon-ng/tailwind 0.0.2
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/README.md +71 -0
- package/ng-package.json +7 -0
- package/package.json +11 -0
- package/src/lib/base-control.ts +142 -0
- package/src/lib/base-form-component.ts +363 -0
- package/src/lib/component/auto-complete/auto-complete.component.html +39 -0
- package/src/lib/component/auto-complete/auto-complete.component.scss +0 -0
- package/src/lib/component/auto-complete/auto-complete.component.spec.ts +23 -0
- package/src/lib/component/auto-complete/auto-complete.component.ts +31 -0
- package/src/lib/component/bottom-sheet/bottom-sheet.component.html +9 -0
- package/src/lib/component/bottom-sheet/bottom-sheet.component.scss +0 -0
- package/src/lib/component/bottom-sheet/bottom-sheet.component.spec.ts +23 -0
- package/src/lib/component/bottom-sheet/bottom-sheet.component.ts +19 -0
- package/src/lib/component/button/button.component.css +0 -0
- package/src/lib/component/button/button.component.html +54 -0
- package/src/lib/component/button/button.component.spec.ts +23 -0
- package/src/lib/component/button/button.component.ts +17 -0
- package/src/lib/component/button-toggle/button-toggle.component.html +21 -0
- package/src/lib/component/button-toggle/button-toggle.component.scss +0 -0
- package/src/lib/component/button-toggle/button-toggle.component.spec.ts +23 -0
- package/src/lib/component/button-toggle/button-toggle.component.ts +26 -0
- package/src/lib/component/checkbox/checkbox.component.html +6 -0
- package/src/lib/component/checkbox/checkbox.component.scss +0 -0
- package/src/lib/component/checkbox/checkbox.component.spec.ts +23 -0
- package/src/lib/component/checkbox/checkbox.component.ts +17 -0
- package/src/lib/component/chips/chip.component.html +75 -0
- package/src/lib/component/chips/chip.component.scss +3 -0
- package/src/lib/component/chips/chip.component.spec.ts +23 -0
- package/src/lib/component/chips/chip.component.ts +125 -0
- package/src/lib/component/date-picker/date-picker.component.html +18 -0
- package/src/lib/component/date-picker/date-picker.component.scss +0 -0
- package/src/lib/component/date-picker/date-picker.component.spec.ts +23 -0
- package/src/lib/component/date-picker/date-picker.component.ts +13 -0
- package/src/lib/component/dialog/dialog.component.html +12 -0
- package/src/lib/component/dialog/dialog.component.scss +3 -0
- package/src/lib/component/dialog/dialog.component.spec.ts +23 -0
- package/src/lib/component/dialog/dialog.component.ts +12 -0
- package/src/lib/component/pagination/pagination.component.html +10 -0
- package/src/lib/component/pagination/pagination.component.scss +0 -0
- package/src/lib/component/pagination/pagination.component.spec.ts +23 -0
- package/src/lib/component/pagination/pagination.component.ts +86 -0
- package/src/lib/component/progress-bar/progress-bar.component.html +1 -0
- package/src/lib/component/progress-bar/progress-bar.component.scss +0 -0
- package/src/lib/component/progress-bar/progress-bar.component.spec.ts +23 -0
- package/src/lib/component/progress-bar/progress-bar.component.ts +15 -0
- package/src/lib/component/progress-spinner/progress-spinner.component.html +7 -0
- package/src/lib/component/progress-spinner/progress-spinner.component.scss +0 -0
- package/src/lib/component/progress-spinner/progress-spinner.component.spec.ts +23 -0
- package/src/lib/component/progress-spinner/progress-spinner.component.ts +16 -0
- package/src/lib/component/radio/radio.component.html +13 -0
- package/src/lib/component/radio/radio.component.scss +14 -0
- package/src/lib/component/radio/radio.component.spec.ts +23 -0
- package/src/lib/component/radio/radio.component.ts +29 -0
- package/src/lib/component/rich-text-editor/rich-text-editor.component.html +10 -0
- package/src/lib/component/rich-text-editor/rich-text-editor.component.scss +0 -0
- package/src/lib/component/rich-text-editor/rich-text-editor.component.spec.ts +23 -0
- package/src/lib/component/rich-text-editor/rich-text-editor.component.ts +13 -0
- package/src/lib/component/select/select.component.html +25 -0
- package/src/lib/component/select/select.component.scss +0 -0
- package/src/lib/component/select/select.component.spec.ts +23 -0
- package/src/lib/component/select/select.component.ts +32 -0
- package/src/lib/component/slide-toggle/slide-toggle.component.html +7 -0
- package/src/lib/component/slide-toggle/slide-toggle.component.scss +0 -0
- package/src/lib/component/slide-toggle/slide-toggle.component.spec.ts +23 -0
- package/src/lib/component/slide-toggle/slide-toggle.component.ts +13 -0
- package/src/lib/component/slider/slider.component.html +11 -0
- package/src/lib/component/slider/slider.component.scss +0 -0
- package/src/lib/component/slider/slider.component.spec.ts +23 -0
- package/src/lib/component/slider/slider.component.ts +13 -0
- package/src/lib/component/snack-bar/snack-bar.component.html +1 -0
- package/src/lib/component/snack-bar/snack-bar.component.scss +0 -0
- package/src/lib/component/snack-bar/snack-bar.component.spec.ts +23 -0
- package/src/lib/component/snack-bar/snack-bar.component.ts +10 -0
- package/src/lib/component/table/table.component.html +82 -0
- package/src/lib/component/table/table.component.scss +17 -0
- package/src/lib/component/table/table.component.spec.ts +23 -0
- package/src/lib/component/table/table.component.ts +54 -0
- package/src/lib/component/textarea/textarea.component.html +22 -0
- package/src/lib/component/textarea/textarea.component.scss +3 -0
- package/src/lib/component/textarea/textarea.component.spec.ts +23 -0
- package/src/lib/component/textarea/textarea.component.ts +13 -0
- package/src/lib/component/textbox/textbox.component.html +27 -0
- package/src/lib/component/textbox/textbox.component.scss +3 -0
- package/src/lib/component/textbox/textbox.component.spec.ts +23 -0
- package/src/lib/component/textbox/textbox.component.ts +13 -0
- package/src/lib/control-builder/control-builder.component.html +5 -0
- package/src/lib/control-builder/control-builder.component.scss +0 -0
- package/src/lib/control-builder/control-builder.component.ts +14 -0
- package/src/lib/control-type/AutoComplete.ts +6 -0
- package/src/lib/control-type/Button.ts +6 -0
- package/src/lib/control-type/ButtonToggle.ts +6 -0
- package/src/lib/control-type/CheckBox.ts +6 -0
- package/src/lib/control-type/Chip.ts +6 -0
- package/src/lib/control-type/DatePicker.ts +6 -0
- package/src/lib/control-type/Divider.ts +6 -0
- package/src/lib/control-type/Editor.ts +6 -0
- package/src/lib/control-type/Radio.ts +6 -0
- package/src/lib/control-type/RichTextEditor.ts +6 -0
- package/src/lib/control-type/SlideToggle.ts +6 -0
- package/src/lib/control-type/Slider.ts +6 -0
- package/src/lib/control-type/select.ts +6 -0
- package/src/lib/control-type/textarea.ts +6 -0
- package/src/lib/control-type/textbox.ts +6 -0
- package/src/lib/falcon-core.module.ts +141 -0
- package/src/lib/model/constant.ts +32 -0
- package/src/lib/model/enum.ts +151 -0
- package/src/lib/model/environments.ts +28 -0
- package/src/lib/model/interface.ts +310 -0
- package/src/lib/model/ivalidator.ts +18 -0
- package/src/lib/module/angularmaterial.module.ts +98 -0
- package/src/lib/reactive-field.directive.ts +24 -0
- package/src/lib/service/appsetting.service.ts +57 -0
- package/src/lib/service/http/generic-http-client.ts +205 -0
- package/src/lib/service/http/httpInterceptor.ts +36 -0
- package/src/lib/service/http/igeneric-http-client.ts +110 -0
- package/src/lib/service/logger.service.ts +75 -0
- package/src/lib/service/open-id/TokenHelperService.ts +76 -0
- package/src/lib/service/open-id/auth-guard.service.ts +25 -0
- package/src/lib/service/open-id/auth.service.ts +179 -0
- package/src/public-api.ts +35 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<div class="flex justify-end">
|
|
2
|
+
<mat-form-field *ngIf="matTableConfig?.filter">
|
|
3
|
+
<mat-label>Filter</mat-label>
|
|
4
|
+
<input matInput (keyup)="applyFilter($event)" #input>
|
|
5
|
+
</mat-form-field>
|
|
6
|
+
</div>
|
|
7
|
+
<falcon-progress-bar *ngIf="matTableConfig?.progressBar" [mode]="'indeterminate'"></falcon-progress-bar>
|
|
8
|
+
<div class="mat-elevation-z8">
|
|
9
|
+
<table mat-table [dataSource]="matTableConfig.dataSource" matSort>
|
|
10
|
+
<ng-container *ngFor="let column of matTableConfig?.columns" matColumnDef={{column.columnDef}}>
|
|
11
|
+
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{ column.header }}</th>
|
|
12
|
+
<ng-container *ngIf="column?.link?.isLink; else elseBlock">
|
|
13
|
+
<td mat-cell *matCellDef="let element">
|
|
14
|
+
<a [routerLink]="column?.link?.routerLink(element)">
|
|
15
|
+
{{column?.cell(element) !== undefined ? column?.cell(element) : '' }}
|
|
16
|
+
</a>
|
|
17
|
+
</td>
|
|
18
|
+
</ng-container>
|
|
19
|
+
<ng-template #elseBlock>
|
|
20
|
+
<td mat-cell *matCellDef="let element">
|
|
21
|
+
{{ column.cell(element) !== undefined ? column.cell(element) : ''}}
|
|
22
|
+
</td>
|
|
23
|
+
</ng-template>
|
|
24
|
+
|
|
25
|
+
</ng-container>
|
|
26
|
+
|
|
27
|
+
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
|
28
|
+
<tr mat-row *matRowDef="let row; columns: displayedColumns;" class="mat-row-element example-expanded-row"></tr>
|
|
29
|
+
|
|
30
|
+
<!– Row shown when there is no matching data. –>
|
|
31
|
+
<tr class="mat-row" *matNoDataRow>
|
|
32
|
+
<td class="mat-cell" colspan="columns.length">No data matching the filter</td>
|
|
33
|
+
</tr>
|
|
34
|
+
|
|
35
|
+
<ng-container matColumnDef="action">
|
|
36
|
+
<th mat-header-cell *matHeaderCellDef style="text-align: center;"></th>
|
|
37
|
+
<td mat-cell *matCellDef="let element">
|
|
38
|
+
|
|
39
|
+
<div *ngIf="matTableConfig?.action?.isMenu; else nonMenuBlock">
|
|
40
|
+
|
|
41
|
+
<button mat-icon-button matTooltip="Action" [matMenuTriggerFor]="tableActionMenu"
|
|
42
|
+
aria-label="Table action menu">
|
|
43
|
+
<mat-icon color="primary">more_horiz</mat-icon>
|
|
44
|
+
</button>
|
|
45
|
+
<mat-menu #tableActionMenu="matMenu">
|
|
46
|
+
<a [routerLink]="item?.link?.routerLink" mat-menu-item
|
|
47
|
+
*ngFor="let item of matTableConfig?.action?.menu" [disabled]="item.disabled">
|
|
48
|
+
<mat-icon [color]="item?.icon?.iconColor">{{item?.icon?.iconText}}</mat-icon>
|
|
49
|
+
<span>{{item.text}}</span>
|
|
50
|
+
</a>
|
|
51
|
+
</mat-menu>
|
|
52
|
+
</div>
|
|
53
|
+
<ng-template #nonMenuBlock>
|
|
54
|
+
<div class="flex justify-between">
|
|
55
|
+
<div>
|
|
56
|
+
<button *ngIf="matTableConfig?.action?.view" mat-icon-button aria-label="view button"
|
|
57
|
+
color="primary" matTooltip="View" (click)="tableAction(element, 0)">
|
|
58
|
+
<mat-icon>visibility</mat-icon>
|
|
59
|
+
</button>
|
|
60
|
+
<button *ngIf="matTableConfig?.action?.edit" mat-icon-button aria-label="edit button"
|
|
61
|
+
color="primary" matTooltip="Edit" (click)="tableAction(element, 1)">
|
|
62
|
+
<mat-icon>create</mat-icon>
|
|
63
|
+
</button>
|
|
64
|
+
<button *ngIf="matTableConfig?.action?.delete" mat-icon-button aria-label="Delete button"
|
|
65
|
+
color="warn" matTooltip="Delete" (click)="tableAction(element, 2)">
|
|
66
|
+
<mat-icon>delete</mat-icon>
|
|
67
|
+
</button>
|
|
68
|
+
</div>
|
|
69
|
+
<button *ngIf="matTableConfig?.action?.arrowRight" mat-icon-button aria-label="Arrow button"
|
|
70
|
+
color="primary" matTooltip="Expand" (click)="tableAction(element, 3)">
|
|
71
|
+
<mat-icon>chevron_right</mat-icon>
|
|
72
|
+
</button>
|
|
73
|
+
</div>
|
|
74
|
+
</ng-template>
|
|
75
|
+
</td>
|
|
76
|
+
</ng-container>
|
|
77
|
+
|
|
78
|
+
</table>
|
|
79
|
+
<mat-paginator *ngIf="matTableConfig?.paginationConfig?.pagination" (page)="page($event)"
|
|
80
|
+
[pageSizeOptions]="matTableConfig.paginationConfig?.pageSizeOptions!" showFirstLastButtons>
|
|
81
|
+
</mat-paginator>
|
|
82
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
table {
|
|
2
|
+
text-align: center !important;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
.mat-form-field {
|
|
6
|
+
font-size: 14px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host ::ng-deep {
|
|
10
|
+
.mat-sort-header-container {
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
}
|
|
14
|
+
.mat-row:hover {
|
|
15
|
+
background-color: whitesmoke;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { TableComponent } from './table.component';
|
|
4
|
+
|
|
5
|
+
describe('TableComponent', () => {
|
|
6
|
+
let component: TableComponent;
|
|
7
|
+
let fixture: ComponentFixture<TableComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ TableComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(TableComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';
|
|
2
|
+
import {MatTableConfig} from "../../model/interface";
|
|
3
|
+
import {MatPaginator, PageEvent} from "@angular/material/paginator";
|
|
4
|
+
import {MatSort} from "@angular/material/sort";
|
|
5
|
+
import {MatTableDataSource} from "@angular/material/table";
|
|
6
|
+
import {TableAction} from "../../model/enum";
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'falcon-table',
|
|
10
|
+
templateUrl: './table.component.html',
|
|
11
|
+
styleUrls: ['./table.component.scss']
|
|
12
|
+
})
|
|
13
|
+
export class TableComponent implements OnInit {
|
|
14
|
+
@Input() matTableConfig!: MatTableConfig;
|
|
15
|
+
@ViewChild(MatPaginator, { static: false }) paginator!: MatPaginator;
|
|
16
|
+
@ViewChild(MatSort, { static: false }) sort!: MatSort;
|
|
17
|
+
@Output() pageEvent = new EventEmitter<PageEvent>();
|
|
18
|
+
@Input() displayedColumns!: string[];
|
|
19
|
+
@Output() tableActionRowEvent = new EventEmitter<any>();
|
|
20
|
+
ngOnInit(): void {
|
|
21
|
+
const cols = this.matTableConfig.columns?.map((c) => c.columnDef);
|
|
22
|
+
if (this.displayedColumns !== undefined)
|
|
23
|
+
this.displayedColumns.unshift(...cols as string[]);
|
|
24
|
+
else this.displayedColumns = cols as string[];
|
|
25
|
+
}
|
|
26
|
+
ngAfterViewInit() {
|
|
27
|
+
setTimeout(() => {
|
|
28
|
+
this.matTableConfig.dataSource = new MatTableDataSource(
|
|
29
|
+
this.matTableConfig.dataSource,
|
|
30
|
+
);
|
|
31
|
+
this.matTableConfig.dataSource.paginator = this.paginator;
|
|
32
|
+
this.matTableConfig.dataSource.sort = this.sort;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
applyFilter(event: Event) {
|
|
36
|
+
const filterValue = (event.target as HTMLInputElement).value;
|
|
37
|
+
this.matTableConfig.dataSource.filter = filterValue
|
|
38
|
+
.trim()
|
|
39
|
+
.toLowerCase();
|
|
40
|
+
|
|
41
|
+
if (this.matTableConfig.dataSource.paginator) {
|
|
42
|
+
this.matTableConfig.dataSource.paginator.firstPage();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public page(e: any) {
|
|
47
|
+
this.pageEvent.emit(e);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public tableAction($item: any, action: TableAction) {
|
|
51
|
+
const item = Object.assign($item, { action: action });
|
|
52
|
+
this.tableActionRowEvent.next(item);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<mat-form-field [appearance]="control.appearance" [formGroup]="formGroup" [floatLabel]="control.floatLabel"
|
|
2
|
+
[ngStyle]="control.style" [ngClass]="control.class" class="textarea-form">
|
|
3
|
+
<mat-label>{{control.label}}</mat-label>
|
|
4
|
+
|
|
5
|
+
<textarea matInput [formControlName]="control.formControlName" [placeholder]="control.placeHolder"
|
|
6
|
+
[ngStyle]="control.style" [ngClass]="control.class"
|
|
7
|
+
[cdkTextareaAutosize]="control.textAreaProperty.cdkTextareaAutosize"
|
|
8
|
+
[cdkAutosizeMinRows]="control.textAreaProperty.cdkAutosizeMinRows"
|
|
9
|
+
[cdkAutosizeMaxRows]="control.textAreaProperty.cdkAutosizeMaxRows" [rows]="control.textAreaProperty.rows"
|
|
10
|
+
[cols]="control.textAreaProperty.cols"></textarea>
|
|
11
|
+
|
|
12
|
+
<span matPrefix [ngClass]="{'material-icons': control.prefix.isIcon}">{{control.prefix.text}}</span>
|
|
13
|
+
<span matSuffix [ngClass]="{'material-icons': control.suffix.isIcon}">{{control.suffix.text}}</span>
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
<mat-hint>{{control.hint.text}}</mat-hint>
|
|
17
|
+
|
|
18
|
+
<ng-container *ngFor="let validation of control.validations;" ngProjectAs="mat-error">
|
|
19
|
+
<mat-error *ngIf="formGroup.get(control.formControlName)?.hasError(validation.name)">{{validation.message}}
|
|
20
|
+
</mat-error>
|
|
21
|
+
</ng-container>
|
|
22
|
+
</mat-form-field>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { TextareaComponent } from './textarea.component';
|
|
4
|
+
|
|
5
|
+
describe('TextareaComponent', () => {
|
|
6
|
+
let component: TextareaComponent;
|
|
7
|
+
let fixture: ComponentFixture<TextareaComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ TextareaComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(TextareaComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { BaseControl } from '../../base-control';
|
|
3
|
+
import { FormGroup } from '@angular/forms';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'falcon-textarea',
|
|
7
|
+
templateUrl: './textarea.component.html',
|
|
8
|
+
styleUrls: ['./textarea.component.scss'],
|
|
9
|
+
})
|
|
10
|
+
export class TextareaComponent {
|
|
11
|
+
control!: BaseControl<string>;
|
|
12
|
+
formGroup!: FormGroup;
|
|
13
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<mat-form-field [formGroup]="formGroup" [appearance]="control.appearance" class="textbox-form">
|
|
2
|
+
<mat-label>{{control.label}}</mat-label>
|
|
3
|
+
<input matInput [type]="control.type" [formControlName]="control.formControlName" [class]="control.class"
|
|
4
|
+
[required]="formGroup.get(control.formControlName)?.errors !== null && formGroup.get(control.formControlName)?.errors?.['required']">
|
|
5
|
+
|
|
6
|
+
<span matPrefix [matTooltip]="control.prefix.toolTipText!"
|
|
7
|
+
[ngClass]="{'material-icons': control.prefix.isIcon}">{{control.prefix.text}} </span>
|
|
8
|
+
<span matSuffix [matTooltip]="control.suffix.toolTipText!"
|
|
9
|
+
[ngClass]="{'material-icons': control.suffix.isIcon}">{{control.suffix.text}} </span>
|
|
10
|
+
<mat-hint *ngIf="control.hint.link?.isLink; else elseBlock">
|
|
11
|
+
<ng-container *ngIf="control.hint.link?.queryParams !== undefined; else withoutQueryBlock">
|
|
12
|
+
<a [routerLink]="[control.hint.link?.routerLink]" [queryParams]="{ query: control.hint.link?.queryParams }"
|
|
13
|
+
routerLinkActive="router-link-active">{{control.hint.text}}</a>
|
|
14
|
+
</ng-container>
|
|
15
|
+
</mat-hint>
|
|
16
|
+
<ng-template #elseBlock>
|
|
17
|
+
<mat-hint>{{control.hint.text}}</mat-hint>
|
|
18
|
+
</ng-template>
|
|
19
|
+
<ng-template #withoutQueryBlock>
|
|
20
|
+
<a [routerLink]="[control.hint.link?.routerLink]" routerLinkActive="router-link-active">{{control.hint.text}}</a>
|
|
21
|
+
</ng-template>
|
|
22
|
+
|
|
23
|
+
<ng-container *ngFor="let validation of control.validations;" ngProjectAs="mat-error">
|
|
24
|
+
<mat-error *ngIf="formGroup.get(control.formControlName)?.hasError(validation.name)">{{validation.message}}
|
|
25
|
+
</mat-error>
|
|
26
|
+
</ng-container>
|
|
27
|
+
</mat-form-field>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { TextboxComponent } from './textbox.component';
|
|
4
|
+
|
|
5
|
+
describe('TextboxComponent', () => {
|
|
6
|
+
let component: TextboxComponent;
|
|
7
|
+
let fixture: ComponentFixture<TextboxComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ TextboxComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(TextboxComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
3
|
+
import { BaseControl } from '../../base-control';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'falcon-textbox',
|
|
7
|
+
templateUrl: './textbox.component.html',
|
|
8
|
+
styleUrls: ['./textbox.component.scss'],
|
|
9
|
+
})
|
|
10
|
+
export class TextboxComponent {
|
|
11
|
+
control!: BaseControl<string>;
|
|
12
|
+
formGroup!: FormGroup;
|
|
13
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {Component, Input} from '@angular/core';
|
|
2
|
+
import {FormGroup, ReactiveFormsModule} from "@angular/forms";
|
|
3
|
+
import {BaseControl, Layout} from "../base-control";
|
|
4
|
+
import {CommonModule} from "@angular/common";
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'control-builder',
|
|
8
|
+
templateUrl: './control-builder.component.html',
|
|
9
|
+
styleUrls: ['./control-builder.component.scss']
|
|
10
|
+
})
|
|
11
|
+
export class ControlBuilderComponent {
|
|
12
|
+
@Input() layout!: Layout<string>;
|
|
13
|
+
@Input() formGroup!: FormGroup;
|
|
14
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import {ModuleWithProviders, NgModule, APP_INITIALIZER, inject} from '@angular/core';
|
|
2
|
+
import {TextboxComponent} from './component/textbox/textbox.component';
|
|
3
|
+
import {TextareaComponent} from './component/textarea/textarea.component';
|
|
4
|
+
import {SelectComponent} from './component/select/select.component';
|
|
5
|
+
import {ReactiveFieldDirective} from './reactive-field.directive';
|
|
6
|
+
import {AngularmaterialModule} from "./module/angularmaterial.module";
|
|
7
|
+
import {CommonModule} from "@angular/common";
|
|
8
|
+
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
|
|
9
|
+
import {ControlBuilderComponent} from "./control-builder/control-builder.component";
|
|
10
|
+
import {EnvironmentViewModel} from "./model/environments";
|
|
11
|
+
import {RouterModule} from "@angular/router";
|
|
12
|
+
import {IGenericHttpClient} from "./service/http/igeneric-http-client";
|
|
13
|
+
import {GenericHttpClient} from "./service/http/generic-http-client";
|
|
14
|
+
import {AppSettingService, appSettingsFactory} from "./service/appsetting.service";
|
|
15
|
+
import {AuthService, authServiceFactory} from "./service/open-id/auth.service";
|
|
16
|
+
import {LoggerService, loggerServiceFactory} from "./service/logger.service";
|
|
17
|
+
import {MAT_SNACK_BAR_DEFAULT_OPTIONS} from "@angular/material/snack-bar";
|
|
18
|
+
import {provideHttpClient, withInterceptors} from "@angular/common/http";
|
|
19
|
+
import { DatePickerComponent } from './component/date-picker/date-picker.component';
|
|
20
|
+
import { CheckboxComponent } from './component/checkbox/checkbox.component';
|
|
21
|
+
import { RadioComponent } from './component/radio/radio.component';
|
|
22
|
+
import { AutoCompleteComponent } from './component/auto-complete/auto-complete.component';
|
|
23
|
+
import { ButtonToggleComponent } from './component/button-toggle/button-toggle.component';
|
|
24
|
+
import { ChipComponent } from './component/chips/chip.component';
|
|
25
|
+
import { SliderComponent } from './component/slider/slider.component';
|
|
26
|
+
import { SlideToggleComponent } from './component/slide-toggle/slide-toggle.component';
|
|
27
|
+
import { ButtonComponent } from './component/button/button.component';
|
|
28
|
+
import { DialogComponent } from './component/dialog/dialog.component';
|
|
29
|
+
import { SnackBarComponent } from './component/snack-bar/snack-bar.component';
|
|
30
|
+
import { BottomSheetComponent } from './component/bottom-sheet/bottom-sheet.component';
|
|
31
|
+
import { ProgressBarComponent } from './component/progress-bar/progress-bar.component';
|
|
32
|
+
import { ProgressSpinnerComponent } from './component/progress-spinner/progress-spinner.component';
|
|
33
|
+
import { TableComponent } from './component/table/table.component';
|
|
34
|
+
import { PaginationComponent } from './component/pagination/pagination.component';
|
|
35
|
+
import { RichTextEditorComponent } from './component/rich-text-editor/rich-text-editor.component';
|
|
36
|
+
import {AngularEditorModule} from "@kolkov/angular-editor";
|
|
37
|
+
|
|
38
|
+
@NgModule({
|
|
39
|
+
declarations: [
|
|
40
|
+
TextboxComponent,
|
|
41
|
+
TextareaComponent,
|
|
42
|
+
SelectComponent,
|
|
43
|
+
ReactiveFieldDirective,
|
|
44
|
+
ControlBuilderComponent,
|
|
45
|
+
DatePickerComponent,
|
|
46
|
+
CheckboxComponent,
|
|
47
|
+
RadioComponent,
|
|
48
|
+
AutoCompleteComponent,
|
|
49
|
+
ButtonToggleComponent,
|
|
50
|
+
ChipComponent,
|
|
51
|
+
SliderComponent,
|
|
52
|
+
SlideToggleComponent,
|
|
53
|
+
ButtonComponent,
|
|
54
|
+
DialogComponent,
|
|
55
|
+
SnackBarComponent,
|
|
56
|
+
BottomSheetComponent,
|
|
57
|
+
ProgressBarComponent,
|
|
58
|
+
ProgressSpinnerComponent,
|
|
59
|
+
TableComponent,
|
|
60
|
+
PaginationComponent,
|
|
61
|
+
RichTextEditorComponent
|
|
62
|
+
],
|
|
63
|
+
imports: [
|
|
64
|
+
AngularmaterialModule,
|
|
65
|
+
CommonModule,
|
|
66
|
+
FormsModule,
|
|
67
|
+
ReactiveFormsModule,
|
|
68
|
+
RouterModule,
|
|
69
|
+
AngularEditorModule,
|
|
70
|
+
],
|
|
71
|
+
exports: [
|
|
72
|
+
AngularmaterialModule,
|
|
73
|
+
CommonModule,
|
|
74
|
+
FormsModule,
|
|
75
|
+
ReactiveFormsModule,
|
|
76
|
+
ControlBuilderComponent,
|
|
77
|
+
RouterModule,
|
|
78
|
+
ProgressBarComponent,
|
|
79
|
+
ProgressSpinnerComponent,
|
|
80
|
+
ChipComponent,
|
|
81
|
+
PaginationComponent,
|
|
82
|
+
TableComponent,
|
|
83
|
+
AngularEditorModule,
|
|
84
|
+
ButtonComponent,
|
|
85
|
+
],
|
|
86
|
+
providers: [
|
|
87
|
+
provideHttpClient(
|
|
88
|
+
withInterceptors([
|
|
89
|
+
(req, next) => {
|
|
90
|
+
// Get the auth token from the service.
|
|
91
|
+
const authToken = inject(AuthService).getAuthorizationHeaderValue();
|
|
92
|
+
inject(LoggerService).info("Auth bearer token ", authToken);
|
|
93
|
+
if (authToken) {
|
|
94
|
+
req = req.clone({
|
|
95
|
+
setHeaders: {
|
|
96
|
+
'Content-Type': 'application/json',
|
|
97
|
+
Authorization: authToken
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return next(req);
|
|
102
|
+
},
|
|
103
|
+
])
|
|
104
|
+
),
|
|
105
|
+
{provide: IGenericHttpClient, useClass: GenericHttpClient},
|
|
106
|
+
{
|
|
107
|
+
provide: APP_INITIALIZER,
|
|
108
|
+
useFactory: appSettingsFactory,
|
|
109
|
+
deps: [AppSettingService],
|
|
110
|
+
multi: true,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
provide: APP_INITIALIZER,
|
|
114
|
+
useFactory: authServiceFactory,
|
|
115
|
+
deps: [AuthService, AppSettingService, EnvironmentViewModel],
|
|
116
|
+
multi: true,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
provide: APP_INITIALIZER,
|
|
120
|
+
useFactory: loggerServiceFactory,
|
|
121
|
+
deps: [LoggerService, AppSettingService],
|
|
122
|
+
multi: true,
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
provide: MAT_SNACK_BAR_DEFAULT_OPTIONS,
|
|
126
|
+
useValue: {duration: 5000},
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
})
|
|
130
|
+
export class FalconCoreModule {
|
|
131
|
+
public static forRoot(
|
|
132
|
+
environment: any,
|
|
133
|
+
): ModuleWithProviders<FalconCoreModule> {
|
|
134
|
+
return {
|
|
135
|
+
ngModule: FalconCoreModule,
|
|
136
|
+
providers: [
|
|
137
|
+
{provide: EnvironmentViewModel, useValue: environment},
|
|
138
|
+
],
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TextboxComponent } from '../component/textbox/textbox.component';
|
|
2
|
+
import { TextareaComponent } from '../component/textarea/textarea.component';
|
|
3
|
+
import { SelectComponent } from '../component/select/select.component';
|
|
4
|
+
import { DatePickerComponent } from '../component/date-picker/date-picker.component';
|
|
5
|
+
import { RadioComponent } from '../component/radio/radio.component';
|
|
6
|
+
import { CheckboxComponent } from '../component/checkbox/checkbox.component';
|
|
7
|
+
import { SlideToggleComponent } from '../component/slide-toggle/slide-toggle.component';
|
|
8
|
+
import { SliderComponent } from '../component/slider/slider.component';
|
|
9
|
+
import { ButtonToggleComponent } from '../component/button-toggle/button-toggle.component';
|
|
10
|
+
import { AutoCompleteComponent } from '../component/auto-complete/auto-complete.component';
|
|
11
|
+
import { ChipComponent } from '../component/chips/chip.component';
|
|
12
|
+
import {ButtonComponent} from "../component/button/button.component";
|
|
13
|
+
import {RichTextEditorComponent} from "../component/rich-text-editor/rich-text-editor.component";
|
|
14
|
+
|
|
15
|
+
export class Constant {
|
|
16
|
+
public static ComponentMapper = [
|
|
17
|
+
TextboxComponent,
|
|
18
|
+
TextareaComponent,
|
|
19
|
+
SelectComponent,
|
|
20
|
+
DatePickerComponent,
|
|
21
|
+
RadioComponent,
|
|
22
|
+
CheckboxComponent,
|
|
23
|
+
ButtonComponent,
|
|
24
|
+
SlideToggleComponent,
|
|
25
|
+
SliderComponent,
|
|
26
|
+
ButtonToggleComponent,
|
|
27
|
+
AutoCompleteComponent,
|
|
28
|
+
ChipComponent,
|
|
29
|
+
RichTextEditorComponent,
|
|
30
|
+
//DividerComponent,
|
|
31
|
+
];
|
|
32
|
+
}
|