@unifylib/ui-lib 1.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/README.md +0 -0
- package/ng-package.json +7 -0
- package/package.json +12 -0
- package/src/lib/base-model/SearchStrConfig.ts +12 -0
- package/src/lib/base-model/api-response.ts +23 -0
- package/src/lib/base-model/audit-log-entry.ts +7 -0
- package/src/lib/base-model/button-action-settings.ts +25 -0
- package/src/lib/base-model/column-def.model.ts +34 -0
- package/src/lib/base-model/do-action-request.ts +11 -0
- package/src/lib/base-model/field-action.ts +7 -0
- package/src/lib/base-model/field-filter.model.ts +14 -0
- package/src/lib/base-model/field-info.ts +98 -0
- package/src/lib/base-model/field-predicate.model.ts +7 -0
- package/src/lib/base-model/filter-request.ts +27 -0
- package/src/lib/base-model/filter.model.ts +49 -0
- package/src/lib/base-model/get-items-list.ts +24 -0
- package/src/lib/base-model/index.ts +11 -0
- package/src/lib/base-model/lookupItem.ts +21 -0
- package/src/lib/base-model/null-snackmessage.ts +9 -0
- package/src/lib/base-model/page-info.ts +51 -0
- package/src/lib/base-model/report-request.model.ts +33 -0
- package/src/lib/base-model/response-envelop.model.ts +15 -0
- package/src/lib/base-model/snack-message.model.ts +14 -0
- package/src/lib/base-model/snackmessage-interface.ts +7 -0
- package/src/lib/base-model/table-column.interface.ts +29 -0
- package/src/lib/base-model/table-page-user-action.interface.ts +33 -0
- package/src/lib/base-model/workflow/workflow-steps.model.ts +9 -0
- package/src/lib/base-model/workflow/workflow.model.ts +52 -0
- package/src/lib/components/action-confirmation/action-confirmation.component.css +34 -0
- package/src/lib/components/action-confirmation/action-confirmation.component.html +18 -0
- package/src/lib/components/action-confirmation/action-confirmation.component.spec.ts +23 -0
- package/src/lib/components/action-confirmation/action-confirmation.component.ts +58 -0
- package/src/lib/components/activity-report-form/activity-report-form.component.html +109 -0
- package/src/lib/components/activity-report-form/activity-report-form.component.scss +0 -0
- package/src/lib/components/activity-report-form/activity-report-form.component.spec.ts +25 -0
- package/src/lib/components/activity-report-form/activity-report-form.component.ts +605 -0
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.css +51 -0
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.html +23 -0
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.spec.ts +23 -0
- package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.ts +69 -0
- package/src/lib/components/audit-log-list/audit-log.component.html +23 -0
- package/src/lib/components/audit-log-list/audit-log.component.scss +0 -0
- package/src/lib/components/audit-log-list/audit-log.component.spec.ts +25 -0
- package/src/lib/components/audit-log-list/audit-log.component.ts +116 -0
- package/src/lib/components/auto-complete/auto-complete.component.css +14 -0
- package/src/lib/components/auto-complete/auto-complete.component.html +29 -0
- package/src/lib/components/auto-complete/auto-complete.component.spec.ts +23 -0
- package/src/lib/components/auto-complete/auto-complete.component.ts +330 -0
- package/src/lib/components/base-form/base-form.component.html +58 -0
- package/src/lib/components/base-form/base-form.component.scss +0 -0
- package/src/lib/components/base-form/base-form.component.spec.ts +25 -0
- package/src/lib/components/base-form/base-form.component.ts +305 -0
- package/src/lib/components/base-form-canvas/base-form-canvas.component.css +22 -0
- package/src/lib/components/base-form-canvas/base-form-canvas.component.html +1006 -0
- package/src/lib/components/base-form-canvas/base-form-canvas.component.spec.ts +23 -0
- package/src/lib/components/base-form-canvas/base-form-canvas.component.ts +573 -0
- package/src/lib/components/base-input-dialog/base-input-dialog.component.css +0 -0
- package/src/lib/components/base-input-dialog/base-input-dialog.component.html +42 -0
- package/src/lib/components/base-input-dialog/base-input-dialog.component.spec.ts +23 -0
- package/src/lib/components/base-input-dialog/base-input-dialog.component.ts +78 -0
- package/src/lib/components/base-table/base-table.component.html +242 -0
- package/src/lib/components/base-table/base-table.component.scss +31 -0
- package/src/lib/components/base-table/base-table.component.spec.ts +25 -0
- package/src/lib/components/base-table/base-table.component.ts +568 -0
- package/src/lib/components/button-actions/button-actions.component.html +28 -0
- package/src/lib/components/button-actions/button-actions.component.scss +6 -0
- package/src/lib/components/button-actions/button-actions.component.spec.ts +23 -0
- package/src/lib/components/button-actions/button-actions.component.ts +72 -0
- package/src/lib/components/editable-base-table/editable-base-table.component.html +372 -0
- package/src/lib/components/editable-base-table/editable-base-table.component.scss +44 -0
- package/src/lib/components/editable-base-table/editable-base-table.component.spec.ts +25 -0
- package/src/lib/components/editable-base-table/editable-base-table.component.ts +570 -0
- package/src/lib/components/equation-builder/equation-builder.component.css +0 -0
- package/src/lib/components/equation-builder/equation-builder.component.html +31 -0
- package/src/lib/components/equation-builder/equation-builder.component.spec.ts +23 -0
- package/src/lib/components/equation-builder/equation-builder.component.ts +121 -0
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.css +11 -0
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.html +38 -0
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.spec.ts +23 -0
- package/src/lib/components/multi-auto-complete/multi-auto-complete.component.ts +317 -0
- package/src/lib/components/paginator/paginator.component.css +25 -0
- package/src/lib/components/paginator/paginator.component.html +34 -0
- package/src/lib/components/paginator/paginator.component.ts +94 -0
- package/src/lib/components/rejection-comment/action-comment.component.css +33 -0
- package/src/lib/components/rejection-comment/action-comment.component.html +46 -0
- package/src/lib/components/rejection-comment/action-comment.component.spec.ts +23 -0
- package/src/lib/components/rejection-comment/action-comment.component.ts +86 -0
- package/src/lib/components/report-details-dialog/report-details-dialog.component.css +17 -0
- package/src/lib/components/report-details-dialog/report-details-dialog.component.html +16 -0
- package/src/lib/components/report-details-dialog/report-details-dialog.component.spec.ts +23 -0
- package/src/lib/components/report-details-dialog/report-details-dialog.component.ts +113 -0
- package/src/lib/components/report-form/report-form.component.html +94 -0
- package/src/lib/components/report-form/report-form.component.scss +0 -0
- package/src/lib/components/report-form/report-form.component.spec.ts +25 -0
- package/src/lib/components/report-form/report-form.component.ts +588 -0
- package/src/lib/components/search-bar/search-bar.component.html +62 -0
- package/src/lib/components/search-bar/search-bar.component.scss +8 -0
- package/src/lib/components/search-bar/search-bar.component.spec.ts +25 -0
- package/src/lib/components/search-bar/search-bar.component.ts +70 -0
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.css +54 -0
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.html +22 -0
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.spec.ts +23 -0
- package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.ts +45 -0
- package/src/lib/components/shared-list/shared-list.component.css +0 -0
- package/src/lib/components/shared-list/shared-list.component.html +17 -0
- package/src/lib/components/shared-list/shared-list.component.spec.ts +23 -0
- package/src/lib/components/shared-list/shared-list.component.ts +53 -0
- package/src/lib/components/title-bar/title-bar.component.css +0 -0
- package/src/lib/components/title-bar/title-bar.component.css.map +1 -0
- package/src/lib/components/title-bar/title-bar.component.html +31 -0
- package/src/lib/components/title-bar/title-bar.component.scss +23 -0
- package/src/lib/components/title-bar/title-bar.component.spec.ts +23 -0
- package/src/lib/components/title-bar/title-bar.component.ts +119 -0
- package/src/lib/services/backend-service.ts +286 -0
- package/src/lib/services/index.ts +3 -0
- package/src/lib/services/top-panel.ts +17 -0
- package/src/lib/services/trigger-form.service.ts +11 -0
- package/src/lib/share-module/shared-module.ts +10 -0
- package/src/lib/styles/invoiceq-theme.scss +252 -0
- package/src/lib/styles/styles.scss +1723 -0
- package/src/lib/utils/base-utils.ts +102 -0
- package/src/lib/validators/date-range-validator.ts +31 -0
- package/src/lib/validators/index.ts +3 -0
- package/src/lib/validators/match-list.validator.ts +10 -0
- package/src/lib/validators/multi-email-validator.ts +15 -0
- package/src/public-api.ts +21 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {Component, Inject, Input, OnInit} from '@angular/core';
|
|
2
|
+
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
|
|
3
|
+
import {FormGroup, ReactiveFormsModule} from "@angular/forms";
|
|
4
|
+
import {FlexLayoutModule, FlexModule} from "@angular/flex-layout";
|
|
5
|
+
import {NgClass, NgIf} from "@angular/common";
|
|
6
|
+
import {MatIconModule} from "@angular/material/icon";
|
|
7
|
+
import {MatSelectModule} from "@angular/material/select";
|
|
8
|
+
import {MatInputModule} from "@angular/material/input";
|
|
9
|
+
import {TranslateModule} from "@ngx-translate/core";
|
|
10
|
+
import { BaseFormCanvasComponent } from '../base-form-canvas/base-form-canvas.component';
|
|
11
|
+
import {TitleBarComponent} from "../title-bar/title-bar.component";
|
|
12
|
+
import {FieldInfo, PageInfo} from "../../base-model";
|
|
13
|
+
import {BaseUtils} from "../../utils/base-utils";
|
|
14
|
+
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'lib-base-input-dialog',
|
|
17
|
+
standalone: true,
|
|
18
|
+
imports: [
|
|
19
|
+
FlexModule,
|
|
20
|
+
NgIf,
|
|
21
|
+
NgClass,
|
|
22
|
+
MatIconModule,
|
|
23
|
+
ReactiveFormsModule,
|
|
24
|
+
MatSelectModule,
|
|
25
|
+
MatInputModule,
|
|
26
|
+
BaseFormCanvasComponent,
|
|
27
|
+
FlexLayoutModule,
|
|
28
|
+
TranslateModule,
|
|
29
|
+
NgIf,
|
|
30
|
+
TranslateModule,
|
|
31
|
+
TitleBarComponent
|
|
32
|
+
],
|
|
33
|
+
templateUrl: './base-input-dialog.component.html',
|
|
34
|
+
styleUrl: './base-input-dialog.component.css'
|
|
35
|
+
})
|
|
36
|
+
export class BaseInputDialogComponent extends BaseUtils implements OnInit {
|
|
37
|
+
fieldsInfo: FieldInfo[];
|
|
38
|
+
default: any;
|
|
39
|
+
isLoaded: boolean = false;
|
|
40
|
+
formGroup: FormGroup;
|
|
41
|
+
|
|
42
|
+
constructor(public dialogRef: MatDialogRef<BaseInputDialogComponent>,
|
|
43
|
+
@Inject(MAT_DIALOG_DATA) public data: any) {
|
|
44
|
+
super()
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
ngOnInit(): void {
|
|
48
|
+
console.log('data' ,this.data);
|
|
49
|
+
this.fieldsInfo = this.data.fieldsInfo;
|
|
50
|
+
this.pageInfo = this.data.pageInfo;
|
|
51
|
+
this.default = this.data.element;
|
|
52
|
+
this.isLoaded = true;
|
|
53
|
+
}
|
|
54
|
+
captureForm($event: FormGroup) {
|
|
55
|
+
this.formGroup = $event;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
saveDisabled() {
|
|
59
|
+
return !this.formGroup?.valid;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
getTitle() {
|
|
63
|
+
return this.pageInfo.labelsSection + '.pop_up_title';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
doSave(save: string) {
|
|
67
|
+
if (this.formGroup.valid) {
|
|
68
|
+
let id = this.default?.id;
|
|
69
|
+
this.default = this.formGroup.value;
|
|
70
|
+
this.default.id = id;
|
|
71
|
+
this.dialogRef.close(this.default);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
doCancel(cancel: string) {
|
|
76
|
+
this.dialogRef.close(null);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
<div fxLayout="column" class="baseTable">
|
|
2
|
+
<div fxLayout="row" fxFlex="100" >
|
|
3
|
+
<div fxFlex="50" fxLayout="column" fxLayoutAlign="center start" >
|
|
4
|
+
<!-- <span style="font-size: 14px">{{ 'totalCountItem' | translate }} : {{ this.totalElements }}</span>-->
|
|
5
|
+
</div>
|
|
6
|
+
<div fxFlex="50" fxLayout="column" fxLayoutAlign="start end" >
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
<div fxLayout="row" fxFlex="100" >
|
|
10
|
+
<div [fxFlex]="pageInfo.draftSupported ? 50 : 100" fxLayout="column" fxLayoutAlign="center start" >
|
|
11
|
+
<app-title-bar [pageTitle]="pageInfo.hideTitle ? '' : pageInfo.labelsSection+'.list_title'"
|
|
12
|
+
[titleMode]="''"
|
|
13
|
+
[newAction]="showAddNew()"
|
|
14
|
+
[showExtractButton]="!pageInfo.hideExtractButton"
|
|
15
|
+
[extraButton]="extraButton"
|
|
16
|
+
(newActionClicked)="onAddNewAction($event)"
|
|
17
|
+
(extractReport)="extractReport($event)"
|
|
18
|
+
[totalElements]="pageInfo.hideTitle ? undefined : totalElements"
|
|
19
|
+
>
|
|
20
|
+
</app-title-bar>
|
|
21
|
+
</div>
|
|
22
|
+
<div fxFlex="50" fxLayout="column" fxLayoutAlign="start end" *ngIf="pageInfo.draftSupported" >
|
|
23
|
+
<mat-chip-listbox aria-label="Color selection" [multiple]="false" >
|
|
24
|
+
<mat-chip-option [selected]="!this.isPending" [color]="'accent'" [value]="'COMPLETED'" (click)="switchViewMode(false)">{{'finished' | translate}}</mat-chip-option>
|
|
25
|
+
<mat-chip-option [selected]="this.isPending" [color]="'accent'" [value]="'PENDING'" (click)="switchViewMode(true)">{{'todo' | translate}}</mat-chip-option>
|
|
26
|
+
</mat-chip-listbox>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div fxLayout="row" fxFlex="100" class="baseTable__detailsColumn">
|
|
30
|
+
<div fxFlex="100">
|
|
31
|
+
<div fxLayout="row" fxLayout.lt-md="row" fxLayoutGap="0" fxLayoutAlign="start start" class="mainTable">
|
|
32
|
+
<table [dataSource]="dataSource" fxFlexFill mat-table matSort>
|
|
33
|
+
<ng-container *ngFor="let column of this.columns; let last=last">
|
|
34
|
+
<ng-container matColumnDef="{{column.property}}">
|
|
35
|
+
<ng-container *ngIf="column.enableSorting; else withoutSortingColumn">
|
|
36
|
+
<th *matHeaderCellDef class="mainTable__th" mat-header-cell mat-sort-header>{{ labelKey(column) | translate}}</th>
|
|
37
|
+
</ng-container>
|
|
38
|
+
<ng-template #withoutSortingColumn>
|
|
39
|
+
<th *matHeaderCellDef class="mainTable__th" mat-header-cell>{{ labelKey(column) | translate}}</th>
|
|
40
|
+
</ng-template>
|
|
41
|
+
<ng-container [ngSwitch]="column.viewType || column.type">
|
|
42
|
+
<ng-container *ngSwitchCase="'workflowStatus'">
|
|
43
|
+
<td *matCellDef="let element" class="mainTable__td" [ngClass]="['mainTable__td__text-secondary']" mat-cell>
|
|
44
|
+
<button mat-button class="wfStatus {{ getStatusDescription(element)}} ">{{ getStatusDescription(element)}}</button>
|
|
45
|
+
</td>
|
|
46
|
+
<td *matCellDef="let element" [ngClass]="['mainTable__td__text-secondary__td']" mat-cell>
|
|
47
|
+
<button mat-button class="wfStatus {{ getStatusDescription(element)}} ">{{ getStatusDescription(element)}}</button>
|
|
48
|
+
</td>
|
|
49
|
+
</ng-container>
|
|
50
|
+
<ng-container *ngSwitchCase="'hyper-text'">
|
|
51
|
+
<td *matCellDef="let element" [ngClass]="['mainTable__td__text-secondary__td']"
|
|
52
|
+
(click)="hyperLinkClicked(column.property,element)"
|
|
53
|
+
mat-cell>
|
|
54
|
+
<mat-label
|
|
55
|
+
[ngClass]="{
|
|
56
|
+
'hyper-link': shouldRenderAsHyperLink(element)
|
|
57
|
+
}">
|
|
58
|
+
{{ extractFieldName(element, column.property) }}
|
|
59
|
+
</mat-label>
|
|
60
|
+
</td>
|
|
61
|
+
</ng-container>
|
|
62
|
+
<ng-container *ngSwitchCase="'button'">
|
|
63
|
+
<td *matCellDef="let element" class="mainTable__td" [ngClass]="['mainTable__td__text-secondary']" mat-cell>
|
|
64
|
+
<button
|
|
65
|
+
*ngIf="shouldShowButton(element)"
|
|
66
|
+
mat-button
|
|
67
|
+
class="primary"
|
|
68
|
+
(click)="$event.stopPropagation(); actionButtonClicked(column.property, element)">
|
|
69
|
+
{{ labelKey(column) + '_title' | translate }}
|
|
70
|
+
</button>
|
|
71
|
+
</td>
|
|
72
|
+
</ng-container>
|
|
73
|
+
<ng-container *ngSwitchCase="'icon'">
|
|
74
|
+
<td *matCellDef="let element" class="mainTable__td" mat-cell>
|
|
75
|
+
<mat-icon
|
|
76
|
+
[ngClass]="{
|
|
77
|
+
'mainTable__td__icon-green': element[column.property] === 'pass',
|
|
78
|
+
'mainTable__td__icon-orange': element[column.property] === 'warning',
|
|
79
|
+
'mainTable__td__icon-red': element[column.property] === 'error'
|
|
80
|
+
}">
|
|
81
|
+
{{ getIcon(element[column.property]) }}
|
|
82
|
+
</mat-icon>
|
|
83
|
+
</td>
|
|
84
|
+
</ng-container>
|
|
85
|
+
<ng-container *ngSwitchCase="'checkbox'">
|
|
86
|
+
<td *matCellDef="let element" class="mainTable__td" [ngClass]="['mainTable__td__text-secondary']" mat-cell>
|
|
87
|
+
<mat-checkbox class="primary" [checked]="element[column.property]" (click)="$event.stopPropagation();actionCheckedClicked(column.property,element)"></mat-checkbox>
|
|
88
|
+
|
|
89
|
+
</td>
|
|
90
|
+
</ng-container>
|
|
91
|
+
<ng-container *ngSwitchCase="'stateType'">
|
|
92
|
+
<td *matCellDef="let element" class="mainTable__td" [ngClass]="['mainTable__td__text-secondary']" mat-cell>
|
|
93
|
+
<button mat-button class="stateType {{ element[column.property]}} ">{{ labelKeyByValue(column, element) | translate}}</button>
|
|
94
|
+
</td>
|
|
95
|
+
</ng-container>
|
|
96
|
+
<ng-container *ngSwitchCase="'date'">
|
|
97
|
+
<td *matCellDef="let element" [ngClass]="['mainTable__td__text-secondary__td']"
|
|
98
|
+
mat-cell>{{ extractFieldName(element, column.property) | date:'yyyy-MM-dd' }} </td>
|
|
99
|
+
</ng-container>
|
|
100
|
+
<ng-container *ngSwitchCase="'croppedText'">
|
|
101
|
+
<td *matCellDef="let element" [ngClass]="['mainTable__td__text-secondary__td']"
|
|
102
|
+
mat-cell>{{ getCroppedText(element[column.property], element[column.width]) }} </td>
|
|
103
|
+
</ng-container>
|
|
104
|
+
<ng-container *ngSwitchCase="'download'">
|
|
105
|
+
<td *matCellDef="let element" [ngClass]="['mainTable__td__text-secondary__td']" style="padding: 0;margin: 0;text-align: center;"
|
|
106
|
+
mat-cell><mat-icon class="mainTable__td__icon-blue">system_update_alt</mat-icon></td>
|
|
107
|
+
</ng-container>
|
|
108
|
+
<ng-container *ngSwitchCase="'onOff'">
|
|
109
|
+
<td *matCellDef="let element" class="mainTable__td" [ngClass]="['mainTable__td__text-secondary__td']" mat-cell>
|
|
110
|
+
<mat-icon *ngIf="element[column.property] === null" class="mainTable__td__icon-darkorange">flag</mat-icon>
|
|
111
|
+
<mat-icon class="mainTable__td__icon-red" *ngIf="element[column.property] === false">flag</mat-icon>
|
|
112
|
+
<mat-icon class="mainTable__td__icon-green" *ngIf="element[column.property] === true">flag</mat-icon>
|
|
113
|
+
</td>
|
|
114
|
+
</ng-container>
|
|
115
|
+
<ng-container *ngSwitchCase="'status'">
|
|
116
|
+
<td *matCellDef="let element" class="mainTable__td"
|
|
117
|
+
[ngClass]="['mainTable__td__text-secondary__td']" mat-cell>
|
|
118
|
+
<span
|
|
119
|
+
*ngIf="element[column.property] === null">{{ this.pageInfo.labelsSection + '.' + column.label + 'InActive' | translate }}</span>
|
|
120
|
+
<span
|
|
121
|
+
*ngIf="element[column.property] === false">{{ this.pageInfo.labelsSection + '.' + column.label + 'InActive' | translate }}</span>
|
|
122
|
+
<span
|
|
123
|
+
*ngIf="element[column.property] === true">{{ this.pageInfo.labelsSection + '.' + column.label + 'Active' | translate }}</span>
|
|
124
|
+
</td>
|
|
125
|
+
</ng-container>
|
|
126
|
+
<ng-container *ngSwitchCase="'info'">
|
|
127
|
+
<td *matCellDef="let element" class="mainTable__td" [ngClass]="['text-secondary']" mat-cell>
|
|
128
|
+
<button mat-icon-button (click)="$event.stopPropagation();emitEvent(element)"> <mat-icon>info</mat-icon></button>
|
|
129
|
+
</td>
|
|
130
|
+
</ng-container>
|
|
131
|
+
<!-- <ng-container *ngSwitchCase="'onOff'">-->
|
|
132
|
+
<!-- <td *matCellDef="let element" class="mainTable__td" [ngClass]="['mainTable__td__text-secondary__td']" mat-cell>-->
|
|
133
|
+
<!-- <mat-icon *ngIf="!element[column.property]" class="mainTable__td__icon-darkorange">flag</mat-icon>-->
|
|
134
|
+
<!-- <mat-icon class="mainTable__td__icon-red">flag</mat-icon>-->
|
|
135
|
+
<!-- <mat-icon class="mainTable__td__icon-green">flag</mat-icon>-->
|
|
136
|
+
<!-- </td>-->
|
|
137
|
+
<!-- </ng-container>-->
|
|
138
|
+
<ng-container *ngSwitchCase="'netAmount'">
|
|
139
|
+
<td *matCellDef="let element" class="mainTable__td" [ngClass]="['mainTable__td__text-secondary__td']" mat-cell>
|
|
140
|
+
<small><sup class="mainTable__td__currency">{{element[column.currency]}}</sup></small>
|
|
141
|
+
<span class="mainTable__td__property">{{ extractFieldName(element, column.property) | currency:element[column.currency] :'' }}</span> of
|
|
142
|
+
{{ extractFieldName(element, column.additionalProperty) | currency:element[column.currency] :'' }}
|
|
143
|
+
</td>
|
|
144
|
+
</ng-container>
|
|
145
|
+
<ng-container *ngSwitchCase="'localDateTime'">
|
|
146
|
+
<td *matCellDef="let element" class="mainTable__td" [ngClass]="['mainTable__td__text-secondary__td']"
|
|
147
|
+
mat-cell>{{ extractFieldName(element, column.property) | date : extractFormat(column) }} </td>
|
|
148
|
+
</ng-container>
|
|
149
|
+
<ng-container *ngSwitchCase="'bigdecimal'">
|
|
150
|
+
<td *matCellDef="let element" class="mainTable__td" [ngClass]="['mainTable__td__text-secondary__td']"
|
|
151
|
+
mat-cell>
|
|
152
|
+
<small><sup class="mainTable__td__currency">{{element[column.currency]}}</sup></small>
|
|
153
|
+
{{ extractFieldName(element, column.property) | number : (column.digitInfo || '1.3-5') }}
|
|
154
|
+
</td>
|
|
155
|
+
</ng-container>
|
|
156
|
+
<ng-container *ngSwitchCase="'listAction'" >
|
|
157
|
+
<td *matCellDef="let element" class="mainTable__td" [ngClass]="['mainTable__td__text-secondary__td']" style="padding: 0!important;"
|
|
158
|
+
mat-cell>
|
|
159
|
+
<app-button-actions [buttonsAction]="false" [listAction]="listAction" (clickedButton)="actionListClicked($event,element)"></app-button-actions>
|
|
160
|
+
|
|
161
|
+
</td>
|
|
162
|
+
</ng-container>
|
|
163
|
+
<ng-container *ngSwitchDefault>
|
|
164
|
+
<ng-container *ngIf="column.translate; else noTranslate">
|
|
165
|
+
<td *matCellDef="let element" class="mainTable__td" (click)="emitRoutePage(element)" [ngClass]="['mainTable__td__text-secondary__td']" mat-cell>
|
|
166
|
+
{{extractFieldName(element, column.property) | translate}}
|
|
167
|
+
</td>
|
|
168
|
+
</ng-container>
|
|
169
|
+
<ng-template #noTranslate>
|
|
170
|
+
<td *matCellDef="let element" class="mainTable__td" (click)="emitRoutePage(element)" [ngClass]="['mainTable__td__text-secondary__td']" mat-cell
|
|
171
|
+
[innerHtml]='extractFieldName(element, column.property)'></td>
|
|
172
|
+
</ng-template>
|
|
173
|
+
</ng-container>
|
|
174
|
+
</ng-container>
|
|
175
|
+
</ng-container>
|
|
176
|
+
</ng-container>
|
|
177
|
+
<ng-container *ngIf="hasGroups()" >
|
|
178
|
+
<ng-container *ngFor="let groupName of this.groupNames">
|
|
179
|
+
<ng-container matColumnDef="{{groupName}}">
|
|
180
|
+
<th mat-header-cell class="extra-header" *matHeaderCellDef [attr.colspan]="groupSpans.get(groupName)">{{(isHumanMade(groupName) ? groupName : "") | translate}}</th>
|
|
181
|
+
</ng-container>
|
|
182
|
+
</ng-container>
|
|
183
|
+
<tr mat-header-row *matHeaderRowDef="this.groupNames"></tr>
|
|
184
|
+
</ng-container>
|
|
185
|
+
<tr *matHeaderRowDef="visibleColumns" mat-header-row></tr>
|
|
186
|
+
<tr
|
|
187
|
+
(auxclick)="openNewTab(row)"
|
|
188
|
+
(click)="$event.stopPropagation(); onSelectItem(row)"
|
|
189
|
+
*matRowDef="let row; columns: visibleColumns"
|
|
190
|
+
[ngClass]="{
|
|
191
|
+
'mainTable__highlight': selectedRowIndex == row.id ||
|
|
192
|
+
(pageInfo.groupByProperty && pageInfo.groupByValue?.includes(row[pageInfo.groupByProperty])),
|
|
193
|
+
'mainTable__dark_highlight': isDarkHighlight(row)
|
|
194
|
+
}"
|
|
195
|
+
mat-row
|
|
196
|
+
></tr>
|
|
197
|
+
|
|
198
|
+
</table>
|
|
199
|
+
</div>
|
|
200
|
+
<div fxLayout="row" *ngIf="noDataFound" class="dataNotFound">
|
|
201
|
+
<div fxLayout="column" fxFlex="100" >
|
|
202
|
+
<span class="dataNotFound__details">
|
|
203
|
+
<mat-icon class="dataNotFound__details__icon">info</mat-icon>
|
|
204
|
+
<span>{{'dataNotFound' | translate}}</span>
|
|
205
|
+
</span>
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
<div fxLayout="row" fxLayout.lt-md="column" fxLayoutAlign.lt-md="center center" fxLayoutAlign.gt-sm="center center" *ngIf="(dataSource.data?.length > 0 || customizedData) && !pageInfo.hidePagination" class="main-pagination">
|
|
209
|
+
<ng-container *ngIf="enablePagination">
|
|
210
|
+
<div fxLayout="column" fxFlex.lt-md="100">
|
|
211
|
+
<app-paginator
|
|
212
|
+
[currentPage]="pageIndex"
|
|
213
|
+
[totalPages]="pagesCount"
|
|
214
|
+
(pageChange)="onPageChange($event)"
|
|
215
|
+
></app-paginator>
|
|
216
|
+
<!-- <pagination-controls-->
|
|
217
|
+
<!-- [maxSize]="maxSize"-->
|
|
218
|
+
<!-- [directionLinks]="directionLinks"-->
|
|
219
|
+
<!-- [autoHide]="autoHide"-->
|
|
220
|
+
<!-- [responsive]="responsive"-->
|
|
221
|
+
<!-- [previousLabel]="labels['previousLabel']"-->
|
|
222
|
+
<!-- [nextLabel]="labels['nextLabel']"-->
|
|
223
|
+
<!-- [screenReaderPaginationLabel]="labels['screenReaderPaginationLabel']"-->
|
|
224
|
+
<!-- [screenReaderPageLabel]="labels['screenReaderPageLabel']"-->
|
|
225
|
+
<!-- [screenReaderCurrentLabel]="labels['screenReaderCurrentLabel']"-->
|
|
226
|
+
<!-- (pageChange)="onPageChange($event)"-->
|
|
227
|
+
<!-- >-->
|
|
228
|
+
<!-- </pagination-controls>-->
|
|
229
|
+
|
|
230
|
+
</div>
|
|
231
|
+
</ng-container>
|
|
232
|
+
|
|
233
|
+
<div fxLayout="column" fxFlex="100" class="countItem" fxHide.gt-xs>
|
|
234
|
+
<span class="countItem__totalElement">{{ 'totalCountItem' | translate}} : {{this.totalElements}}</span>
|
|
235
|
+
</div>
|
|
236
|
+
<div fxLayout="column" fxFlex="2">
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.baseTable {
|
|
2
|
+
padding: 20px;
|
|
3
|
+
}
|
|
4
|
+
th.mat-header-cell {
|
|
5
|
+
text-align: center;
|
|
6
|
+
font-weight: bold;
|
|
7
|
+
vertical-align: middle;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.extra-header{
|
|
11
|
+
text-align: center !important;
|
|
12
|
+
font-weight: bold;
|
|
13
|
+
vertical-align: middle !important;
|
|
14
|
+
border: 1px solid #000000;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.mdc-data-table__header-cell {
|
|
18
|
+
text-align: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@media (max-width: 959px) {
|
|
22
|
+
.responsive-top-gap {
|
|
23
|
+
margin-top: 1px;
|
|
24
|
+
}
|
|
25
|
+
.baseTable {
|
|
26
|
+
padding: 20px;
|
|
27
|
+
margin-inline: 8px;
|
|
28
|
+
width: max-content;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import {BaseTableComponent} from './base-table.component';
|
|
4
|
+
|
|
5
|
+
describe('BaseTableComponent', () => {
|
|
6
|
+
let component: BaseTableComponent;
|
|
7
|
+
let fixture: ComponentFixture<BaseTableComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ BaseTableComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(BaseTableComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|