@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,372 @@
|
|
|
1
|
+
<div fxLayout="column" class="baseTable">
|
|
2
|
+
<div class="left-align">
|
|
3
|
+
<app-attachment-uploader #uploader
|
|
4
|
+
*ngIf="isBulkItemsSupported"
|
|
5
|
+
(fileSelected)="handleFileUpload($event)">
|
|
6
|
+
</app-attachment-uploader>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
<div fxLayout="row" fxFlex="100">
|
|
11
|
+
<div fxFlex="50" fxLayout="column" fxLayoutAlign="center start">
|
|
12
|
+
<app-title-bar [pageTitle]="pageInfo.hideTitle ? '' : pageInfo.labelsSection+'.list_title'"
|
|
13
|
+
[titleMode]="''"
|
|
14
|
+
[newAction]="false"
|
|
15
|
+
[showExtractButton]="!pageInfo.hideExtractButton"
|
|
16
|
+
>
|
|
17
|
+
</app-title-bar>
|
|
18
|
+
<span style="font-size: 14px">{{ 'totalCountItem' | translate }} : {{ this.totalElements }}</span>
|
|
19
|
+
</div>
|
|
20
|
+
<div fxFlex="50" fxLayout="column" fxLayoutAlign="start end">
|
|
21
|
+
<mat-chip-listbox aria-label="Color selection" [multiple]="false" *ngIf="pageInfo.draftSupported">
|
|
22
|
+
<mat-chip-option [selected]="!this.isPending" [color]="'accent'" [value]="'COMPLETED'"
|
|
23
|
+
(click)="switchViewMode(false)">{{ 'finished' | translate }}
|
|
24
|
+
</mat-chip-option>
|
|
25
|
+
<mat-chip-option [selected]="this.isPending" [color]="'accent'" [value]="'PENDING'"
|
|
26
|
+
(click)="switchViewMode(true)">{{ 'todo' | translate }}
|
|
27
|
+
</mat-chip-option>
|
|
28
|
+
</mat-chip-listbox>
|
|
29
|
+
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<ng-container *ngIf="showSearch()">
|
|
33
|
+
<div fxLayout="row" fxFlex="100">
|
|
34
|
+
<div fxFlex="80" fxLayout="column" fxLayoutAlign="start end">
|
|
35
|
+
<app-base-form-canvas fxFlexFill
|
|
36
|
+
[pageInfo]="pageInfo"
|
|
37
|
+
[fields]="searchFormFields"
|
|
38
|
+
[editable]="true"
|
|
39
|
+
(formUpdated)="updateSearchForm($event)"
|
|
40
|
+
></app-base-form-canvas>
|
|
41
|
+
</div>
|
|
42
|
+
<div fxFlex="15" fxLayout="column" fxLayoutAlign="start end">
|
|
43
|
+
<div fxFlex="100" fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="8px">
|
|
44
|
+
<button mat-button color="primary" type="button" (click)="doSearch()">
|
|
45
|
+
<mat-icon>search</mat-icon>
|
|
46
|
+
{{ 'search' | translate }}
|
|
47
|
+
</button>
|
|
48
|
+
<button mat-button color="primary" type="button" (click)="clearSearch()">
|
|
49
|
+
<mat-icon>clear</mat-icon>
|
|
50
|
+
{{ 'clear' | translate }}
|
|
51
|
+
</button>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</ng-container>
|
|
56
|
+
<div fxLayout="row" fxFlex="100" class="baseTable__detailsColumn">
|
|
57
|
+
<div fxFlex="100">
|
|
58
|
+
<ng-container *ngIf="isLoaded">
|
|
59
|
+
<div fxLayout="row" fxLayout.lt-md="row" fxLayoutGap="0" fxLayoutAlign="start start" class="mainTable">
|
|
60
|
+
<form [formGroup]="formParam" fxFlexFill>
|
|
61
|
+
<table [dataSource]="dataFormArray.controls" fxFlexFill mat-table matSort>
|
|
62
|
+
<ng-container *ngFor="let column of this.fields; let i = index">
|
|
63
|
+
<ng-container matColumnDef="{{column.property}}">
|
|
64
|
+
<ng-container [ngSwitch]="column.type">
|
|
65
|
+
<ng-container *ngSwitchCase="'equation-builder'">
|
|
66
|
+
<th *matHeaderCellDef class="mainTable__th" mat-header-cell>{{ labelKey(column) | translate }}
|
|
67
|
+
</th>
|
|
68
|
+
<td *matCellDef="let element" class="mainTable__td"
|
|
69
|
+
[ngClass]="['mainTable__td__text-secondary__td']" mat-cell>
|
|
70
|
+
<lib-equation-builder
|
|
71
|
+
[form]="element"
|
|
72
|
+
[field]="column"
|
|
73
|
+
[readOnly]="column.readonly"
|
|
74
|
+
[isPending]="isPending"
|
|
75
|
+
(valueChanged)="handleEquationChange($event, element, column)">
|
|
76
|
+
</lib-equation-builder>
|
|
77
|
+
</td>
|
|
78
|
+
</ng-container>
|
|
79
|
+
|
|
80
|
+
<ng-container *ngSwitchCase="'lookup'">
|
|
81
|
+
<th *matHeaderCellDef class="mainTable__th" mat-header-cell>{{ labelKey(column) | translate }}
|
|
82
|
+
</th>
|
|
83
|
+
<td *matCellDef="let element" class="mainTable__td"
|
|
84
|
+
[ngClass]="['mainTable__td__text-secondary__td']"
|
|
85
|
+
mat-cell>
|
|
86
|
+
<app-auto-complete
|
|
87
|
+
[form]="element"
|
|
88
|
+
[field]="column"
|
|
89
|
+
[defaultValue]="element.get(column.property)?.value"
|
|
90
|
+
(selectedValue)="patchLookupValue($event, column.property)">
|
|
91
|
+
</app-auto-complete>
|
|
92
|
+
</td>
|
|
93
|
+
</ng-container>
|
|
94
|
+
<ng-container *ngSwitchCase="'list'">
|
|
95
|
+
<th *matHeaderCellDef class="mainTable__th" mat-header-cell>{{ labelKey(column) | translate }}</th>
|
|
96
|
+
<td *matCellDef="let element" class="mainTable__td"
|
|
97
|
+
[ngClass]="['mainTable__td__text-secondary__td']"
|
|
98
|
+
mat-cell>
|
|
99
|
+
<mat-label>{{element}}</mat-label>
|
|
100
|
+
<mat-select
|
|
101
|
+
formControlName="{{column.property}}"
|
|
102
|
+
[attr.aria-label]="column.label! | translate"
|
|
103
|
+
[multiple]="false"
|
|
104
|
+
[(value)]="element[column.property]">
|
|
105
|
+
<ng-container>
|
|
106
|
+
<mat-option
|
|
107
|
+
*ngFor="let item of column.listOptions"
|
|
108
|
+
[value]="item">
|
|
109
|
+
{{ getOptionValue(item) }}
|
|
110
|
+
</mat-option>
|
|
111
|
+
</ng-container>
|
|
112
|
+
</mat-select>
|
|
113
|
+
</td>
|
|
114
|
+
</ng-container>
|
|
115
|
+
<ng-container *ngSwitchCase="'stateType'">
|
|
116
|
+
<th *matHeaderCellDef class="mainTable__th" mat-header-cell>{{ 'action' | translate }}</th>
|
|
117
|
+
<td *matCellDef="let element" class="mainTable__td"
|
|
118
|
+
[ngClass]="['mainTable__td__text-secondary__td']"
|
|
119
|
+
mat-cell>
|
|
120
|
+
<div fxLayout="column">
|
|
121
|
+
<div fxFlex="100" fxLayout="row">
|
|
122
|
+
|
|
123
|
+
<div fxFlex="33.3" fxLayout="column" fxLayoutAlign="center center">
|
|
124
|
+
<button mat-button class="btn-none-background-primary"
|
|
125
|
+
color="primary"
|
|
126
|
+
[disabled]="disabledSaveButton(element)"
|
|
127
|
+
(click)="fieldButtonEvent(column,element,SAVE) ">
|
|
128
|
+
{{ getPositiveWfActionKey(element.value.stateType) | translate }}
|
|
129
|
+
</button>
|
|
130
|
+
</div>
|
|
131
|
+
<div fxFlex="33.3" fxLayout="column" fxLayoutAlign="center center">
|
|
132
|
+
<button *ngIf="isPending" mat-button class="btn-none-background-primary"
|
|
133
|
+
color="accent"
|
|
134
|
+
(click)="fieldButtonEvent(column,element,REJECT)">
|
|
135
|
+
{{ getNegativeWfActionKey(element.value.stateType) | translate }}
|
|
136
|
+
</button>
|
|
137
|
+
</div>
|
|
138
|
+
<div fxFlex="33.3" fxLayout="column" fxLayoutAlign="center center"></div>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
</td>
|
|
142
|
+
</ng-container>
|
|
143
|
+
<ng-container *ngSwitchCase="'year'">
|
|
144
|
+
<th *matHeaderCellDef class="mainTable__th" mat-header-cell>{{ labelKey(column) | translate }}
|
|
145
|
+
</th>
|
|
146
|
+
<td *matCellDef="let element" class="mainTable__td"
|
|
147
|
+
[ngClass]="['mainTable__td__text-secondary__td']"
|
|
148
|
+
mat-cell>
|
|
149
|
+
<mat-form-field class="flex-auto" appearance="outline" fxFlexFill>
|
|
150
|
+
<mat-label>{{ labelKey(column) | translate }}</mat-label>
|
|
151
|
+
<input matInput
|
|
152
|
+
[disabled]="column.readonly"
|
|
153
|
+
[readonly]="column.readonly"
|
|
154
|
+
[matDatepicker]="picker"
|
|
155
|
+
[formControl]="getField(element, column)"
|
|
156
|
+
[required]="column.required"
|
|
157
|
+
[attr.aria-required]="column.required"
|
|
158
|
+
[attr.aria-labelledby]="'label-' + column.property"
|
|
159
|
+
[attr.aria-describedby]="'error-' + column.property">
|
|
160
|
+
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
|
161
|
+
<mat-datepicker #picker startView="multi-year"
|
|
162
|
+
(yearSelected)="setMonthAndYear($event, picker, element,column)"
|
|
163
|
+
panelClass="example-month-picker"></mat-datepicker>
|
|
164
|
+
|
|
165
|
+
</mat-form-field>
|
|
166
|
+
<!-- <mat-form-field class="flex-auto" appearance="outline" fxFlexFill>-->
|
|
167
|
+
<!-- <input matInput [formControl]="getField(element, column)">-->
|
|
168
|
+
<!-- </mat-form-field>-->
|
|
169
|
+
</td>
|
|
170
|
+
</ng-container>
|
|
171
|
+
<ng-container *ngSwitchCase="'number'">
|
|
172
|
+
<th *matHeaderCellDef class="mainTable__th" mat-header-cell>
|
|
173
|
+
{{ labelKey(column) | translate }}
|
|
174
|
+
</th>
|
|
175
|
+
<td *matCellDef="let element" class="mainTable__td"
|
|
176
|
+
[ngClass]="['mainTable__td__text-secondary__td']"
|
|
177
|
+
mat-cell>
|
|
178
|
+
<mat-form-field class="flex-auto" appearance="outline" fxFlexFill>
|
|
179
|
+
<!-- Visually hidden label just to trigger the floating label and asterisk -->
|
|
180
|
+
<mat-label>
|
|
181
|
+
</mat-label>
|
|
182
|
+
|
|
183
|
+
<input matInput
|
|
184
|
+
type="number"
|
|
185
|
+
[formControl]="getField(element, column)"
|
|
186
|
+
[required]="column.required"
|
|
187
|
+
[readonly]="column.readonly"
|
|
188
|
+
[attr.aria-required]="column.required"
|
|
189
|
+
[attr.aria-labelledby]="'label-' + column.property"
|
|
190
|
+
[attr.aria-describedby]="'error-' + column.property">
|
|
191
|
+
</mat-form-field>
|
|
192
|
+
</td>
|
|
193
|
+
</ng-container>
|
|
194
|
+
<ng-container *ngSwitchCase="'status'">
|
|
195
|
+
<th *matHeaderCellDef class="mainTable__th" mat-header-cell>
|
|
196
|
+
{{ labelKey(column) | translate }}
|
|
197
|
+
</th>
|
|
198
|
+
<td *matCellDef="let element" class="mainTable__td"
|
|
199
|
+
[ngClass]="['mainTable__td__text-secondary__td']"
|
|
200
|
+
mat-cell>
|
|
201
|
+
<mat-checkbox
|
|
202
|
+
style="padding-bottom: 14px; padding-top: 14px;"
|
|
203
|
+
[formControl]="getField(element, column)"
|
|
204
|
+
[required]="column.required"
|
|
205
|
+
[attr.aria-required]="column.required"
|
|
206
|
+
[attr.aria-labelledby]="'label-' + column.property"
|
|
207
|
+
[attr.aria-describedby]="'error-' + column.property"
|
|
208
|
+
[style.pointer-events]="column.readonly ? 'none' : 'auto'"
|
|
209
|
+
[style.opacity]="column.readonly ? 0.7 : 1"
|
|
210
|
+
(click)="column.readonly ? $event.preventDefault() : null">
|
|
211
|
+
</mat-checkbox>
|
|
212
|
+
</td>
|
|
213
|
+
</ng-container>
|
|
214
|
+
<ng-container *ngSwitchCase="'text'">
|
|
215
|
+
<th *matHeaderCellDef class="mainTable__th" mat-header-cell>
|
|
216
|
+
{{ labelKey(column) | translate }}
|
|
217
|
+
</th>
|
|
218
|
+
<td *matCellDef="let element" class="mainTable__td"
|
|
219
|
+
[ngClass]="['mainTable__td__text-secondary__td']"
|
|
220
|
+
mat-cell>
|
|
221
|
+
<mat-form-field class="flex-auto" appearance="outline" fxFlexFill>
|
|
222
|
+
<mat-label>
|
|
223
|
+
{{ labelKey(column) | translate }}
|
|
224
|
+
</mat-label>
|
|
225
|
+
<input matInput
|
|
226
|
+
type="text"
|
|
227
|
+
[formControl]="getField(element, column)"
|
|
228
|
+
[required]="column.required"
|
|
229
|
+
[readonly]="column.readonly"
|
|
230
|
+
[attr.aria-required]="column.required"
|
|
231
|
+
[attr.aria-labelledby]="'label-' + column.property"
|
|
232
|
+
[attr.aria-describedby]="'error-' + column.property">
|
|
233
|
+
</mat-form-field>
|
|
234
|
+
</td>
|
|
235
|
+
</ng-container>
|
|
236
|
+
<ng-container *ngSwitchCase="'date'">
|
|
237
|
+
<th *matHeaderCellDef class="mainTable__th" mat-header-cell>
|
|
238
|
+
{{ labelKey(column) | translate }}
|
|
239
|
+
</th>
|
|
240
|
+
<td *matCellDef="let element" class="mainTable__td"
|
|
241
|
+
[ngClass]="['mainTable__td__text-secondary__td']"
|
|
242
|
+
mat-cell>
|
|
243
|
+
<mat-form-field class="flex-auto" appearance="outline" fxFlexFill>
|
|
244
|
+
<input matInput
|
|
245
|
+
[matDatepicker]="xpicker"
|
|
246
|
+
[formControl]="getField(element, column)"
|
|
247
|
+
[required]="column.required"
|
|
248
|
+
[readonly]="column.readonly"
|
|
249
|
+
[disabled]="column.readonly"
|
|
250
|
+
[attr.aria-required]="column.required"
|
|
251
|
+
[attr.aria-labelledby]="'label-' + column.property"
|
|
252
|
+
[attr.aria-describedby]="'error-' + column.property">
|
|
253
|
+
<mat-datepicker-toggle
|
|
254
|
+
matSuffix
|
|
255
|
+
[for]="xpicker"
|
|
256
|
+
[disabled]="column.readonly">
|
|
257
|
+
</mat-datepicker-toggle>
|
|
258
|
+
<mat-datepicker #xpicker></mat-datepicker>
|
|
259
|
+
</mat-form-field>
|
|
260
|
+
</td>
|
|
261
|
+
</ng-container>
|
|
262
|
+
|
|
263
|
+
<ng-container *ngSwitchDefault>
|
|
264
|
+
<th *matHeaderCellDef class="mainTable__th" mat-header-cell>{{ labelKey(column) | translate }}
|
|
265
|
+
</th>
|
|
266
|
+
<td *matCellDef="let element" class="mainTable__td"
|
|
267
|
+
[ngClass]="['mainTable__td__text-secondary__td']"
|
|
268
|
+
mat-cell>
|
|
269
|
+
<mat-form-field class="flex-auto" appearance="outline" fxFlexFill>
|
|
270
|
+
<input matInput
|
|
271
|
+
[readonly]="column.readonly"
|
|
272
|
+
[attr.aria-required]="column.required"
|
|
273
|
+
[formControl]="getField(element, column)">
|
|
274
|
+
</mat-form-field>
|
|
275
|
+
</td>
|
|
276
|
+
</ng-container>
|
|
277
|
+
</ng-container>
|
|
278
|
+
</ng-container>
|
|
279
|
+
</ng-container>
|
|
280
|
+
<tr *matHeaderRowDef="visibleColumns" mat-header-row></tr>
|
|
281
|
+
<tr (click)="onSelectItem(row)" (auxclick)="openNewTab(row)"
|
|
282
|
+
*matRowDef="let row; columns: visibleColumns | paginate:config"
|
|
283
|
+
mat-row></tr>
|
|
284
|
+
</table>
|
|
285
|
+
</form>
|
|
286
|
+
</div>
|
|
287
|
+
<div fxLayout="row" *ngIf="noDataFound" class="dataNotFound">
|
|
288
|
+
<div fxLayout="column" fxFlex="100">
|
|
289
|
+
<span class="dataNotFound__details">
|
|
290
|
+
<mat-icon class="dataNotFound__details__icon">info</mat-icon>
|
|
291
|
+
<span>{{ 'dataNotFound' | translate }}</span>
|
|
292
|
+
</span>
|
|
293
|
+
</div>
|
|
294
|
+
</div>
|
|
295
|
+
<div fxLayout="row" fxLayout.lt-md="row" fxLayoutGap="0" fxLayoutAlign="start start" class="mainTable"
|
|
296
|
+
*ngIf="!selectedFileFromUploader">
|
|
297
|
+
<div>
|
|
298
|
+
<button *ngIf="!isPending && pageInfo.hasAddButton" mat-button color="primary" type="button"
|
|
299
|
+
(click)="addNewItem()">
|
|
300
|
+
<mat-icon>add_box</mat-icon>
|
|
301
|
+
{{ translationKey | translate }}
|
|
302
|
+
</button>
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
<div fxLayout="row" fxLayout.lt-md="column" fxLayoutAlign.lt-md="center center"
|
|
308
|
+
fxLayoutAlign.gt-sm="center center"
|
|
309
|
+
*ngIf="totalElements > 0" class="main-pagination">
|
|
310
|
+
|
|
311
|
+
<div fxLayout="column" fxFlex.lt-md="100">
|
|
312
|
+
<app-paginator
|
|
313
|
+
[currentPage]="pageIndex"
|
|
314
|
+
[totalPages]="pagesCount"
|
|
315
|
+
(pageChange)="onPageChange($event)"
|
|
316
|
+
></app-paginator>
|
|
317
|
+
|
|
318
|
+
<!-- <pagination-controls-->
|
|
319
|
+
<!-- [maxSize]="maxSize"-->
|
|
320
|
+
<!-- [directionLinks]="directionLinks"-->
|
|
321
|
+
<!-- [autoHide]="autoHide"-->
|
|
322
|
+
<!-- [responsive]="responsive"-->
|
|
323
|
+
<!-- [previousLabel]="labels['previousLabel']"-->
|
|
324
|
+
<!-- [nextLabel]="labels['nextLabel']"-->
|
|
325
|
+
<!-- [screenReaderPaginationLabel]="labels['screenReaderPaginationLabel']"-->
|
|
326
|
+
<!-- [screenReaderPageLabel]="labels['screenReaderPageLabel']"-->
|
|
327
|
+
<!-- [screenReaderCurrentLabel]="labels['screenReaderCurrentLabel']"-->
|
|
328
|
+
<!-- (pageChange)="onPageChange($event)"-->
|
|
329
|
+
<!-- >-->
|
|
330
|
+
<!-- </pagination-controls>-->
|
|
331
|
+
|
|
332
|
+
</div>
|
|
333
|
+
<div fxLayout="column" fxFlex="100" class="countItem" fxHide.gt-xs>
|
|
334
|
+
<span class="countItem__totalElement">{{ 'totalCountItem' | translate }} : {{ this.totalElements }}</span>
|
|
335
|
+
</div>
|
|
336
|
+
<div fxLayout="column" fxFlex="2">
|
|
337
|
+
</div>
|
|
338
|
+
</div>
|
|
339
|
+
</ng-container>
|
|
340
|
+
</div>
|
|
341
|
+
</div>
|
|
342
|
+
<div *ngIf="isBulkItemsSupported"
|
|
343
|
+
fxLayout="row"
|
|
344
|
+
fxLayout.lt-md="row"
|
|
345
|
+
fxLayoutGap="10px"
|
|
346
|
+
fxLayoutAlign="start start"
|
|
347
|
+
class="mainTable">
|
|
348
|
+
|
|
349
|
+
<div>
|
|
350
|
+
<button mat-flat-button
|
|
351
|
+
color="primary"
|
|
352
|
+
type="button"
|
|
353
|
+
(click)="addBulkItems()"
|
|
354
|
+
[disabled]="shouldDisableBulkAdd()">
|
|
355
|
+
<mat-icon>add_box</mat-icon>
|
|
356
|
+
{{ 'addAll' | translate }}
|
|
357
|
+
</button>
|
|
358
|
+
</div>
|
|
359
|
+
|
|
360
|
+
<div>
|
|
361
|
+
<button mat-flat-button
|
|
362
|
+
color="warn"
|
|
363
|
+
type="button"
|
|
364
|
+
[disabled]="!hasDataToClear()"
|
|
365
|
+
(click)="clearBulkItems()">
|
|
366
|
+
<mat-icon>delete</mat-icon>
|
|
367
|
+
{{ 'clearAll' | translate }}
|
|
368
|
+
</button>
|
|
369
|
+
</div>
|
|
370
|
+
|
|
371
|
+
</div>
|
|
372
|
+
</div>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.baseTable {
|
|
2
|
+
padding: 20px;
|
|
3
|
+
//margin-inline: 8px;
|
|
4
|
+
//width: max-content;
|
|
5
|
+
}
|
|
6
|
+
.example-month-picker .mat-calendar-period-button {
|
|
7
|
+
pointer-events: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.example-month-picker .mat-calendar-arrow {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
::ng-deep .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after {
|
|
15
|
+
content: ' *';
|
|
16
|
+
color: red !important; /* asterisk color */
|
|
17
|
+
margin-left: 2px;
|
|
18
|
+
font-size: 1.5em; /* increase size */
|
|
19
|
+
vertical-align: top; /* optional: aligns better with label */
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
::ng-deep .mdc-floating-label--required::after {
|
|
23
|
+
content: ' *';
|
|
24
|
+
color: red !important; /* asterisk color */
|
|
25
|
+
margin-left: 2px;
|
|
26
|
+
font-size: 1.5em; /* increase size */
|
|
27
|
+
vertical-align: top; /* optional: aligns better with label */
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.responsive-top-gap {
|
|
31
|
+
margin-top: 20px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media (max-width: 959px) {
|
|
35
|
+
.responsive-top-gap {
|
|
36
|
+
margin-top: 1px;
|
|
37
|
+
}
|
|
38
|
+
.baseTable {
|
|
39
|
+
padding: 20px;
|
|
40
|
+
margin-inline: 8px;
|
|
41
|
+
width: max-content;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import {EditableBaseTableComponent} from './editable-base-table.component';
|
|
4
|
+
|
|
5
|
+
describe('BaseTableComponent', () => {
|
|
6
|
+
let component: EditableBaseTableComponent;
|
|
7
|
+
let fixture: ComponentFixture<EditableBaseTableComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ EditableBaseTableComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(EditableBaseTableComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|