@unifylib/ui-lib 1.0.3 → 1.1.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.
Files changed (155) hide show
  1. package/ng-package.json +7 -7
  2. package/package.json +14 -12
  3. package/src/lib/base-model/SearchStrConfig.ts +12 -12
  4. package/src/lib/base-model/api-response.ts +23 -23
  5. package/src/lib/base-model/audit-log-entry.ts +7 -7
  6. package/src/lib/base-model/button-action-settings.ts +29 -25
  7. package/src/lib/base-model/column-def.model.ts +34 -34
  8. package/src/lib/base-model/do-action-request.ts +11 -11
  9. package/src/lib/base-model/feature-item.ts +9 -0
  10. package/src/lib/base-model/field-action.ts +7 -7
  11. package/src/lib/base-model/field-filter.model.ts +7 -14
  12. package/src/lib/base-model/field-info.ts +102 -98
  13. package/src/lib/base-model/field-predicate.model.ts +7 -7
  14. package/src/lib/base-model/filter-request.ts +27 -27
  15. package/src/lib/base-model/filter.model.ts +49 -49
  16. package/src/lib/base-model/get-items-list.ts +24 -24
  17. package/src/lib/base-model/index.ts +11 -11
  18. package/src/lib/base-model/items-total.model.ts +12 -0
  19. package/src/lib/base-model/line-item.model.ts +18 -0
  20. package/src/lib/base-model/lookupItem.ts +21 -21
  21. package/src/lib/base-model/null-snackmessage.ts +9 -9
  22. package/src/lib/base-model/page-info.ts +54 -51
  23. package/src/lib/base-model/report-request.model.ts +33 -33
  24. package/src/lib/base-model/response-envelop.model.ts +15 -15
  25. package/src/lib/base-model/snack-message.model.ts +14 -14
  26. package/src/lib/base-model/snackmessage-interface.ts +7 -7
  27. package/src/lib/base-model/table-column.interface.ts +29 -29
  28. package/src/lib/base-model/table-page-user-action.interface.ts +33 -33
  29. package/src/lib/base-model/workflow/workflow-steps.model.ts +9 -9
  30. package/src/lib/base-model/workflow/workflow.model.ts +52 -52
  31. package/src/lib/components/action-comment/action-comment.component.css +52 -0
  32. package/src/lib/components/action-comment/action-comment.component.html +47 -0
  33. package/src/lib/components/{rejection-comment → action-comment}/action-comment.component.spec.ts +23 -23
  34. package/src/lib/components/{rejection-comment → action-comment}/action-comment.component.ts +102 -86
  35. package/src/lib/components/action-confirmation/action-confirmation.component.css +46 -34
  36. package/src/lib/components/action-confirmation/action-confirmation.component.html +32 -18
  37. package/src/lib/components/action-confirmation/action-confirmation.component.spec.ts +23 -23
  38. package/src/lib/components/action-confirmation/action-confirmation.component.ts +58 -58
  39. package/src/lib/components/activity-report-form/activity-report-form.component.html +110 -109
  40. package/src/lib/components/activity-report-form/activity-report-form.component.scss +69 -0
  41. package/src/lib/components/activity-report-form/activity-report-form.component.spec.ts +25 -25
  42. package/src/lib/components/activity-report-form/activity-report-form.component.ts +616 -605
  43. package/src/lib/components/advanced-filter/field-filter/field-filter.component.html +8 -0
  44. package/src/lib/components/advanced-filter/field-filter/field-filter.component.scss +0 -0
  45. package/src/lib/components/advanced-filter/field-filter/field-filter.component.spec.ts +25 -0
  46. package/src/lib/components/advanced-filter/field-filter/field-filter.component.ts +55 -0
  47. package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.html +36 -0
  48. package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.scss +130 -0
  49. package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.spec.ts +25 -0
  50. package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.ts +186 -0
  51. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.css +51 -51
  52. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.html +23 -23
  53. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.spec.ts +23 -23
  54. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.ts +69 -69
  55. package/src/lib/components/audit-log-list/audit-log.component.html +26 -23
  56. package/src/lib/components/audit-log-list/audit-log.component.scss +50 -0
  57. package/src/lib/components/audit-log-list/audit-log.component.spec.ts +25 -25
  58. package/src/lib/components/audit-log-list/audit-log.component.ts +114 -116
  59. package/src/lib/components/auto-complete/auto-complete.component.css +55 -14
  60. package/src/lib/components/auto-complete/auto-complete.component.html +45 -29
  61. package/src/lib/components/auto-complete/auto-complete.component.spec.ts +23 -23
  62. package/src/lib/components/auto-complete/auto-complete.component.ts +331 -330
  63. package/src/lib/components/base-form/base-form.component.html +59 -58
  64. package/src/lib/components/base-form/base-form.component.scss +68 -0
  65. package/src/lib/components/base-form/base-form.component.spec.ts +25 -25
  66. package/src/lib/components/base-form/base-form.component.ts +323 -305
  67. package/src/lib/components/base-form-canvas/base-form-canvas.component.css +196 -22
  68. package/src/lib/components/base-form-canvas/base-form-canvas.component.html +1095 -1006
  69. package/src/lib/components/base-form-canvas/base-form-canvas.component.spec.ts +23 -23
  70. package/src/lib/components/base-form-canvas/base-form-canvas.component.ts +680 -573
  71. package/src/lib/components/base-input-dialog/base-input-dialog.component.css +67 -0
  72. package/src/lib/components/base-input-dialog/base-input-dialog.component.html +47 -42
  73. package/src/lib/components/base-input-dialog/base-input-dialog.component.spec.ts +23 -23
  74. package/src/lib/components/base-input-dialog/base-input-dialog.component.ts +77 -78
  75. package/src/lib/components/base-table/base-table.component.html +268 -242
  76. package/src/lib/components/base-table/base-table.component.scss +140 -31
  77. package/src/lib/components/base-table/base-table.component.spec.ts +25 -25
  78. package/src/lib/components/base-table/base-table.component.ts +621 -568
  79. package/src/lib/components/button-actions/button-actions.component.html +27 -28
  80. package/src/lib/components/button-actions/button-actions.component.scss +101 -6
  81. package/src/lib/components/button-actions/button-actions.component.spec.ts +23 -23
  82. package/src/lib/components/button-actions/button-actions.component.ts +70 -72
  83. package/src/lib/components/editable-base-table/editable-base-table.component.html +337 -372
  84. package/src/lib/components/editable-base-table/editable-base-table.component.scss +126 -44
  85. package/src/lib/components/editable-base-table/editable-base-table.component.spec.ts +25 -25
  86. package/src/lib/components/editable-base-table/editable-base-table.component.ts +579 -570
  87. package/src/lib/components/equation-builder/equation-builder.component.css +39 -0
  88. package/src/lib/components/equation-builder/equation-builder.component.html +31 -31
  89. package/src/lib/components/equation-builder/equation-builder.component.spec.ts +23 -23
  90. package/src/lib/components/equation-builder/equation-builder.component.ts +119 -121
  91. package/src/lib/components/item-line-editor/item-line-editor.component.html +102 -0
  92. package/src/lib/components/item-line-editor/item-line-editor.component.scss +152 -0
  93. package/src/lib/components/item-line-editor/item-line-editor.component.spec.ts +23 -0
  94. package/src/lib/components/item-line-editor/item-line-editor.component.ts +306 -0
  95. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.css +19 -11
  96. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.html +38 -38
  97. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.spec.ts +23 -23
  98. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.ts +315 -317
  99. package/src/lib/components/paginator/paginator.component.css +65 -25
  100. package/src/lib/components/paginator/paginator.component.html +30 -34
  101. package/src/lib/components/paginator/paginator.component.ts +87 -94
  102. package/src/lib/components/report-details-dialog/report-details-dialog.component.css +17 -17
  103. package/src/lib/components/report-details-dialog/report-details-dialog.component.html +16 -16
  104. package/src/lib/components/report-details-dialog/report-details-dialog.component.spec.ts +23 -23
  105. package/src/lib/components/report-details-dialog/report-details-dialog.component.ts +111 -113
  106. package/src/lib/components/report-form/report-form.component.html +92 -94
  107. package/src/lib/components/report-form/report-form.component.scss +51 -0
  108. package/src/lib/components/report-form/report-form.component.spec.ts +25 -25
  109. package/src/lib/components/report-form/report-form.component.ts +599 -588
  110. package/src/lib/components/search-bar/search-bar.component.html +51 -62
  111. package/src/lib/components/search-bar/search-bar.component.scss +63 -8
  112. package/src/lib/components/search-bar/search-bar.component.spec.ts +25 -25
  113. package/src/lib/components/search-bar/search-bar.component.ts +68 -70
  114. package/src/lib/components/section-form-canvas/section-form-canvas.component.html +43 -0
  115. package/src/lib/components/section-form-canvas/section-form-canvas.component.scss +81 -0
  116. package/src/lib/components/section-form-canvas/section-form-canvas.component.spec.ts +23 -0
  117. package/src/lib/components/section-form-canvas/section-form-canvas.component.ts +67 -0
  118. package/src/lib/components/shared/action-button/action-button.component.html +12 -0
  119. package/src/lib/components/shared/action-button/action-button.component.scss +45 -0
  120. package/src/lib/components/shared/action-button/action-button.component.ts +51 -0
  121. package/src/lib/components/shared/action-card/action-card.component.html +78 -0
  122. package/src/lib/components/shared/action-card/action-card.component.scss +238 -0
  123. package/src/lib/components/shared/action-card/action-card.component.ts +56 -0
  124. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.css +135 -54
  125. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.html +36 -22
  126. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.spec.ts +23 -23
  127. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.ts +71 -45
  128. package/src/lib/components/shared-list/shared-list.component.html +17 -17
  129. package/src/lib/components/shared-list/shared-list.component.spec.ts +23 -23
  130. package/src/lib/components/shared-list/shared-list.component.ts +53 -53
  131. package/src/lib/components/snackbar-static/snackbar-static.component.html +20 -0
  132. package/src/lib/components/snackbar-static/snackbar-static.component.scss +135 -0
  133. package/src/lib/components/snackbar-static/snackbar-static.component.ts +26 -0
  134. package/src/lib/components/title-bar/title-bar.component.html +35 -31
  135. package/src/lib/components/title-bar/title-bar.component.scss +126 -23
  136. package/src/lib/components/title-bar/title-bar.component.spec.ts +23 -23
  137. package/src/lib/components/title-bar/title-bar.component.ts +126 -119
  138. package/src/lib/services/backend-service.ts +287 -286
  139. package/src/lib/services/index.ts +3 -3
  140. package/src/lib/services/top-panel.ts +17 -17
  141. package/src/lib/services/trigger-form.service.ts +11 -11
  142. package/src/lib/share-module/shared-module.ts +10 -10
  143. package/src/lib/utils/base-utils.ts +102 -102
  144. package/src/lib/validators/date-range-validator.ts +31 -31
  145. package/src/lib/validators/index.ts +3 -3
  146. package/src/lib/validators/match-list.validator.ts +10 -10
  147. package/src/lib/validators/multi-email-validator.ts +15 -15
  148. package/src/public-api.ts +29 -21
  149. package/tsconfig.lib.json +15 -15
  150. package/tsconfig.lib.prod.json +11 -11
  151. package/tsconfig.spec.json +15 -15
  152. package/src/lib/components/rejection-comment/action-comment.component.css +0 -33
  153. package/src/lib/components/rejection-comment/action-comment.component.html +0 -46
  154. package/src/lib/styles/invoiceq-theme.scss +0 -252
  155. package/src/lib/styles/styles.scss +0 -1723
@@ -1,62 +1,51 @@
1
- <div class="mainSearchBar">
2
- <div
3
- fxLayout="row"
4
- fxLayoutAlign="start center"
5
- fxLayoutGap="16px"
6
- class="search"
7
- style="width: 100%; padding: 0 16px; margin-bottom: 16px;"
8
- >
9
-
10
- <mat-form-field appearance="outline" class="search__field" fxFlex="50">
11
- <input
12
- matInput
13
- class="search__input"
14
- placeholder="Search..."
15
- (keydown.enter)= onSearch()
16
- [(ngModel)]="searchValue" />
17
- </mat-form-field>
18
-
19
- <mat-form-field appearance="outline" class="search__field" fxFlex="15">
20
- <mat-select
21
- class="search__toggle"
22
- [(ngModel)]="searchType"
23
- placeholder="Type">
24
- <mat-option value="exact">Exact</mat-option>
25
- <mat-option value="like">Like</mat-option>
26
- </mat-select>
27
- </mat-form-field>
28
-
29
-
30
- <mat-form-field appearance="outline" class="search__field" fxFlex="15">
31
- <mat-select
32
- class="search__toggle"
33
- [(ngModel)]="selectedSortKey"
34
- placeholder="Sort By">
35
- <mat-option *ngFor="let col of getColumns()" [value]="col.property">
36
- {{ labelKey(col) | translate }}
37
- </mat-option>
38
- </mat-select>
39
- </mat-form-field>
40
-
41
- <mat-form-field appearance="outline" class="search__field" fxFlex="10">
42
- <mat-select
43
- class="search__toggle"
44
- [(ngModel)]="selectedSortType"
45
- placeholder="Type">
46
- <mat-option value="ASC">ASC</mat-option>
47
- <mat-option value="DESC">DESC</mat-option>
48
- </mat-select>
49
- </mat-form-field>
50
- <div
51
- class="search__button"
52
- fxLayout="row"
53
- fxLayoutAlign="center center"
54
- style="margin-bottom: 6px "
55
- >
56
- <div class="icon-design" (click)="onSearch()">
57
- <mat-icon style="height: 30px; width: 30px; font-size: 30px; margin-bottom: 15px;cursor: pointer" color="primary">search</mat-icon>
58
- </div>
59
- </div>
60
-
61
- </div>
62
- </div>
1
+ <div class="mainSearchBar">
2
+ <div class="search row align-start-center gap-16">
3
+
4
+ <mat-form-field appearance="outline" class="search__field flex-50">
5
+ <input
6
+ matInput
7
+ class="search__input"
8
+ placeholder="Search..."
9
+ (keydown.enter)="onSearch()"
10
+ [(ngModel)]="searchValue" />
11
+ </mat-form-field>
12
+
13
+ <mat-form-field appearance="outline" class="search__field flex-15">
14
+ <mat-select
15
+ class="search__toggle"
16
+ [(ngModel)]="searchType"
17
+ placeholder="Type">
18
+ <mat-option value="exact">Exact</mat-option>
19
+ <mat-option value="like">Like</mat-option>
20
+ </mat-select>
21
+ </mat-form-field>
22
+
23
+ <mat-form-field appearance="outline" class="search__field flex-15">
24
+ <mat-select
25
+ class="search__toggle"
26
+ [(ngModel)]="selectedSortKey"
27
+ placeholder="Sort By">
28
+ <mat-option *ngFor="let col of getColumns()" [value]="col.property">
29
+ {{ labelKey(col) | translate }}
30
+ </mat-option>
31
+ </mat-select>
32
+ </mat-form-field>
33
+
34
+ <mat-form-field appearance="outline" class="search__field flex-10">
35
+ <mat-select
36
+ class="search__toggle"
37
+ [(ngModel)]="selectedSortType"
38
+ placeholder="Type">
39
+ <mat-option value="ASC">ASC</mat-option>
40
+ <mat-option value="DESC">DESC</mat-option>
41
+ </mat-select>
42
+ </mat-form-field>
43
+
44
+ <div class="search__button row align-center-center">
45
+ <div class="icon-design" (click)="onSearch()">
46
+ <mat-icon class="icon-search" color="primary">search</mat-icon>
47
+ </div>
48
+ </div>
49
+
50
+ </div>
51
+ </div>
@@ -1,8 +1,63 @@
1
- ::ng-deep .search__button {
2
- display: flex;
3
- align-items: center;
4
- justify-content: center;
5
- height: 56px;
6
- margin-top: -6px;
7
-
8
- }
1
+ ::ng-deep .search__button {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ height: 56px;
6
+ margin-top: -6px;
7
+
8
+ }
9
+ .row {
10
+ display: flex;
11
+ flex-direction: row;
12
+ width: 100%;
13
+ }
14
+
15
+ .column {
16
+ display: flex;
17
+ flex-direction: column;
18
+ width: 100%;
19
+ }
20
+
21
+ .align-start-center {
22
+ align-items: center;
23
+ justify-content: flex-start;
24
+ }
25
+
26
+ .align-center-center {
27
+ align-items: center;
28
+ justify-content: center;
29
+ }
30
+
31
+ .gap-16 > * + * {
32
+ margin-left: 16px;
33
+ }
34
+
35
+ .flex-50 {
36
+ flex: 0 0 50%;
37
+ }
38
+
39
+ .flex-15 {
40
+ flex: 0 0 15%;
41
+ }
42
+
43
+ .flex-10 {
44
+ flex: 0 0 10%;
45
+ }
46
+
47
+ .search {
48
+ width: 100%;
49
+ padding: 0 16px;
50
+ margin-bottom: 16px;
51
+ }
52
+
53
+ .search__button {
54
+ margin-bottom: 6px;
55
+ }
56
+
57
+ .icon-search {
58
+ height: 30px;
59
+ width: 30px;
60
+ font-size: 30px;
61
+ margin-bottom: 15px;
62
+ cursor: pointer;
63
+ }
@@ -1,25 +1,25 @@
1
- import {async, ComponentFixture, TestBed} from '@angular/core/testing';
2
-
3
- import {SearchBarComponent} from './search-bar.component';
4
-
5
- describe('SearchBarComponent', () => {
6
- let component: SearchBarComponent;
7
- let fixture: ComponentFixture<SearchBarComponent>;
8
-
9
- beforeEach(async(() => {
10
- TestBed.configureTestingModule({
11
- declarations: [ SearchBarComponent ]
12
- })
13
- .compileComponents();
14
- }));
15
-
16
- beforeEach(() => {
17
- fixture = TestBed.createComponent(SearchBarComponent);
18
- component = fixture.componentInstance;
19
- fixture.detectChanges();
20
- });
21
-
22
- it('should create', () => {
23
- expect(component).toBeTruthy();
24
- });
25
- });
1
+ import {async, ComponentFixture, TestBed} from '@angular/core/testing';
2
+
3
+ import {SearchBarComponent} from './search-bar.component';
4
+
5
+ describe('SearchBarComponent', () => {
6
+ let component: SearchBarComponent;
7
+ let fixture: ComponentFixture<SearchBarComponent>;
8
+
9
+ beforeEach(async(() => {
10
+ TestBed.configureTestingModule({
11
+ declarations: [ SearchBarComponent ]
12
+ })
13
+ .compileComponents();
14
+ }));
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(SearchBarComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -1,70 +1,68 @@
1
- import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
2
- import {MatFormField, MatLabel} from "@angular/material/form-field";
3
- import {MatOption, MatSelect} from "@angular/material/select";
4
- import {FormsModule} from "@angular/forms";
5
- import {MatIcon} from "@angular/material/icon";
6
- import {FlexModule} from "@angular/flex-layout";
7
- import {MatInput} from "@angular/material/input";
8
- import {MatIconButton} from "@angular/material/button";
9
- import {NgForOf} from "@angular/common";
10
- import {TableColumn} from "../../base-model";
11
- import {TranslateModule} from "@ngx-translate/core";
12
- type SearchType = 'exact' | 'like';
13
- type SortType = 'ASC' | 'DESC';
14
- @Component({
15
- selector: 'ag-search-bar',
16
- templateUrl: './search-bar.component.html',
17
- standalone: true,
18
- imports: [
19
- MatFormField,
20
- MatSelect,
21
- MatOption,
22
- FormsModule,
23
- MatIcon,
24
- FlexModule,
25
- MatInput,
26
- MatIconButton,
27
- NgForOf,
28
- TranslateModule
29
- ],
30
- styleUrls: ['./search-bar.component.scss']
31
- })
32
- export class SearchBarComponent implements OnInit {
33
- @Input() columns: TableColumn<any>[];
34
- @Input() defaultSortKey: string = '';
35
-
36
- searchValue: string = '';
37
- searchType: SearchType = 'like';
38
- selectedSortKey: string = '';
39
- selectedSortType: SortType = 'ASC';
40
- @Output() searchTriggered = new EventEmitter<{
41
- searchValue: string;
42
- searchType: SearchType;
43
- sortKey: string;
44
- sortType: string;
45
- }>();
46
-
47
- onSearch() {
48
- this.selectedSortKey ||= this.defaultSortKey || this.columns[0]?.property;
49
-
50
- this.searchTriggered.emit({
51
- searchValue: this.searchValue,
52
- searchType: this.searchType,
53
- sortKey: this.selectedSortKey,
54
- sortType: this.selectedSortType
55
- });
56
- }
57
-
58
- labelKey(column: { label?: string; property: string }): string {
59
- return column.label || column.property;
60
- }
61
-
62
- ngOnInit(): void {
63
- }
64
-
65
- getColumns() {
66
- return this.columns.filter(
67
- (column) => ['text', 'date', 'localDateTime'].includes(column.type)
68
- );
69
- }
70
- }
1
+ import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
2
+ import {MatFormField, MatLabel} from "@angular/material/form-field";
3
+ import {MatOption, MatSelect} from "@angular/material/select";
4
+ import {FormsModule} from "@angular/forms";
5
+ import {MatIcon} from "@angular/material/icon";
6
+ import {MatInput} from "@angular/material/input";
7
+ import {MatIconButton} from "@angular/material/button";
8
+ import {NgForOf} from "@angular/common";
9
+ import {TableColumn} from "../../base-model";
10
+ import {TranslateModule} from "@ngx-translate/core";
11
+ type SearchType = 'exact' | 'like';
12
+ type SortType = 'ASC' | 'DESC';
13
+ @Component({
14
+ selector: 'ag-search-bar',
15
+ templateUrl: './search-bar.component.html',
16
+ standalone: true,
17
+ imports: [
18
+ MatFormField,
19
+ MatSelect,
20
+ MatOption,
21
+ FormsModule,
22
+ MatIcon,
23
+ MatInput,
24
+ MatIconButton,
25
+ NgForOf,
26
+ TranslateModule
27
+ ],
28
+ styleUrls: ['./search-bar.component.scss']
29
+ })
30
+ export class SearchBarComponent implements OnInit {
31
+ @Input() columns: TableColumn<any>[];
32
+ @Input() defaultSortKey: string = '';
33
+
34
+ searchValue: string = '';
35
+ searchType: SearchType = 'like';
36
+ selectedSortKey: string = '';
37
+ selectedSortType: SortType = 'ASC';
38
+ @Output() searchTriggered = new EventEmitter<{
39
+ searchValue: string;
40
+ searchType: SearchType;
41
+ sortKey: string;
42
+ sortType: string;
43
+ }>();
44
+
45
+ onSearch() {
46
+ this.selectedSortKey ||= this.defaultSortKey || this.columns[0]?.property;
47
+
48
+ this.searchTriggered.emit({
49
+ searchValue: this.searchValue,
50
+ searchType: this.searchType,
51
+ sortKey: this.selectedSortKey,
52
+ sortType: this.selectedSortType
53
+ });
54
+ }
55
+
56
+ labelKey(column: { label?: string; property: string }): string {
57
+ return column.label || column.property;
58
+ }
59
+
60
+ ngOnInit(): void {
61
+ }
62
+
63
+ getColumns() {
64
+ return this.columns.filter(
65
+ (column) => ['text', 'date', 'localDateTime'].includes(column.type)
66
+ );
67
+ }
68
+ }
@@ -0,0 +1,43 @@
1
+ <mat-expansion-panel class="location-card"
2
+ #panel="matExpansionPanel"
3
+ [expanded]="isExpanded"
4
+ [hideToggle]="hideToggle"
5
+ (opened)="alwaysOpen ? panel.open() : null"
6
+ (closed)="alwaysOpen ? panel.open() : null">
7
+ <mat-expansion-panel-header class="card-header" (click)="toggleExpand()">
8
+ <mat-panel-title>
9
+ <h3 class="card-title" *ngIf="isTranslateTitle">
10
+ {{ pageInfo.labelsSection + '.' + title | translate }}
11
+ </h3>
12
+ <h3 class="card-title" *ngIf="!isTranslateTitle">{{ title }}</h3>
13
+ </mat-panel-title>
14
+
15
+ <mat-panel-description class="panel-description">
16
+ <div class="row flex-auto buttons-wrapper">
17
+ <button
18
+ mat-flat-button
19
+ *ngFor="let btn of buttons"
20
+ [color]="btn.color || 'primary'"
21
+ (click)="onButtonClick(btn , key); $event.stopPropagation()"
22
+ class="btn-none-background-primary action"
23
+ [attr.id]="btn.id || ('section-btn-' + (btn.action || btn.label || btn.key))"
24
+ >
25
+ <div class="button-text">
26
+ <mat-icon *ngIf="btn.icon">{{ btn.icon }}</mat-icon>
27
+ <span>{{ btn.label | translate }}</span>
28
+ </div>
29
+ </button>
30
+ </div>
31
+ </mat-panel-description>
32
+ </mat-expansion-panel-header>
33
+ <div class="panel-body">
34
+ <hr class="divider"/>
35
+ <app-base-form-canvas
36
+ [pageInfo]="pageInfo"
37
+ [fields]="fields"
38
+ [editable]="editable"
39
+ [item]="item"
40
+ (formUpdated)="formUpdated($event)"
41
+ ></app-base-form-canvas>
42
+ </div>
43
+ </mat-expansion-panel>
@@ -0,0 +1,81 @@
1
+ .location-card {
2
+ border: 1px solid #dcdcdc;
3
+ border-radius: 8px;
4
+ background: #fff;
5
+ margin: 18px auto;
6
+ overflow: hidden;
7
+
8
+ .mat-expansion-panel-header {
9
+ padding: 0 15px;
10
+ }
11
+ .panel-body {
12
+ padding: 0 15px;
13
+ }
14
+ .panel-description {
15
+ justify-content: end !important;
16
+ margin: 0 !important;
17
+ }
18
+
19
+ .card-header {
20
+ display: flex;
21
+ justify-content: space-between;
22
+ align-items: center;
23
+
24
+ .card-title {
25
+ margin: 0;
26
+ font-size: 18px;
27
+ font-weight: 600;
28
+ color: #222;
29
+ }
30
+
31
+ .btn-edit {
32
+ width: 120px;
33
+ min-height: 32px !important;
34
+ border-radius: 9999px !important;
35
+ font-size: 16px !important;
36
+ }
37
+
38
+ .expand-icon {
39
+ color: #339dff;
40
+ font-size: 16px;
41
+ }
42
+ }
43
+
44
+ .divider {
45
+ border: none;
46
+ border-top: 2px solid var(--primary-color-3nd);
47
+ margin: 0 ;
48
+ }
49
+ }
50
+ .flex-auto {
51
+ flex: 1 1 auto;
52
+ display: flex;
53
+ flex-direction: column;
54
+ }
55
+ .row {
56
+ display: flex;
57
+ flex-direction: row;
58
+ width: 100%;
59
+ }
60
+ .gap-20 {
61
+ gap: 20px;
62
+ }
63
+ .buttons-wrapper {
64
+ display: inline-block;
65
+ text-align-last: end;
66
+ margin: 0 !important;
67
+
68
+ }
69
+ .buttons-wrapper .action {
70
+ min-height: 44px !important;
71
+ min-width: 135px !important;
72
+ width: auto !important;
73
+ }
74
+ .button-text {
75
+ span{
76
+ font-size: 18px;
77
+ }
78
+ mat-icon {
79
+ font-size: 18px !important;
80
+ }
81
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { SectionFormCanvasComponent } from './section-form-canvas.component';
4
+
5
+ describe('SectionFormCanvasComponent', () => {
6
+ let component: SectionFormCanvasComponent;
7
+ let fixture: ComponentFixture<SectionFormCanvasComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [SectionFormCanvasComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(SectionFormCanvasComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,67 @@
1
+ import {Component, EventEmitter, Input, Output} from '@angular/core';
2
+ import {MatIcon} from "@angular/material/icon";
3
+ import {MatButton} from "@angular/material/button";
4
+ import {ButtonActionSettings, FieldInfo, PageInfo} from "../../base-model";
5
+ import {BaseFormComponent} from "../base-form/base-form.component";
6
+ import {BaseFormCanvasComponent} from "../base-form-canvas/base-form-canvas.component";
7
+ import {NgForOf, NgIf} from "@angular/common";
8
+ import {TranslateModule} from "@ngx-translate/core";
9
+ import {FormGroup} from "@angular/forms";
10
+ import {
11
+ MatExpansionPanel,
12
+ MatExpansionPanelHeader,
13
+ MatExpansionPanelDescription,
14
+ MatExpansionPanelTitle
15
+ } from "@angular/material/expansion";
16
+
17
+ @Component({
18
+ selector: 'lib-section-form-canvas',
19
+ standalone: true,
20
+ imports: [
21
+ MatIcon,
22
+ MatButton,
23
+ BaseFormComponent,
24
+ BaseFormCanvasComponent,
25
+ NgIf,
26
+ TranslateModule,
27
+ MatExpansionPanel,
28
+ MatExpansionPanelTitle,
29
+ MatExpansionPanelDescription,
30
+ MatExpansionPanelHeader,
31
+ NgForOf
32
+ ],
33
+ templateUrl: './section-form-canvas.component.html',
34
+ styleUrl: './section-form-canvas.component.scss'
35
+ })
36
+ export class SectionFormCanvasComponent {
37
+
38
+ @Input() pageInfo: PageInfo;
39
+ @Input() fields: FieldInfo[];
40
+ @Input() itemId: number;
41
+ @Input() editable: boolean;
42
+ @Input() hideBackButton: boolean;
43
+ @Input() item: any;
44
+ @Input() title: string;
45
+ @Input() isTranslateTitle: boolean;
46
+ @Input() key: number;
47
+ @Input() hideToggle: boolean = true;
48
+ @Input() isExpanded: boolean = true;
49
+ @Input() alwaysOpen: boolean = true;
50
+ @Output() actionEdit: EventEmitter<any> = new EventEmitter();
51
+ @Output() formEdit: EventEmitter<FormGroup> = new EventEmitter();
52
+ @Input() buttons: ButtonActionSettings[] = [];
53
+ @Output() buttonClicked = new EventEmitter<any>();
54
+
55
+ formUpdated($event) {
56
+ this.formEdit.emit($event);
57
+
58
+ }
59
+
60
+ toggleExpand() {
61
+ this.isExpanded = !this.isExpanded;
62
+ }
63
+
64
+ onButtonClick(btn: ButtonActionSettings, sectionKey: number): void {
65
+ this.buttonClicked.emit({...btn , sectionKey: sectionKey});
66
+ }
67
+ }
@@ -0,0 +1,12 @@
1
+ <button
2
+ class="action-button"
3
+ (click)="onButtonClick()"
4
+ [style.background]="buttonGradient"
5
+ [attr.id]="id || (buttonTextKey ? ('action-button-' + buttonTextKey) : 'action-button')"
6
+ type="button">
7
+ <span class="button-texts">
8
+ <span *ngIf="buttonTextKey">{{ buttonTextKey | translate }}</span>
9
+ <span *ngIf="!buttonTextKey">{{ buttonText }}</span>
10
+ </span>
11
+ <mat-icon class="arrow-icon" [class.arrow-rtl]="isArabic">arrow_forward</mat-icon>
12
+ </button>
@@ -0,0 +1,45 @@
1
+ .action-button {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ gap: 16px;
6
+ height: 62px;
7
+ border-radius: 16px;
8
+ border: none;
9
+ position: relative;
10
+ overflow: hidden;
11
+ cursor: pointer;
12
+ width: 100%;
13
+ padding: 0;
14
+ background-size: cover;
15
+ background-position: center;
16
+ margin-top: 15px;
17
+
18
+ .button-texts {
19
+ font-family: 'lusail-medium', sans-serif !important;
20
+ font-weight: 500 !important;
21
+ font-size: 24px !important;
22
+ line-height: 1.2 !important;
23
+ color: #2e2e2e !important;
24
+ white-space: nowrap;
25
+ position: relative;
26
+ z-index: 1;
27
+ }
28
+
29
+ .arrow-icon {
30
+ font-size: 24px !important;
31
+ width: 24px;
32
+ height: 30px;
33
+ color: #2e2e2e;
34
+ position: relative;
35
+ z-index: 1;
36
+
37
+ &.arrow-rtl {
38
+ transform: rotate(180deg);
39
+ }
40
+ }
41
+
42
+ &:hover {
43
+ opacity: 0.9;
44
+ }
45
+ }