@onecx/angular-accelerator 4.43.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/{esm2020 → esm2022}/lib/angular-accelerator-primeng.module.mjs +53 -53
  2. package/esm2022/lib/angular-accelerator.module.mjs +168 -0
  3. package/esm2022/lib/components/column-group-selection/column-group-selection.component.mjs +72 -0
  4. package/esm2022/lib/components/custom-group-column-selector/custom-group-column-selector.component.mjs +109 -0
  5. package/esm2022/lib/components/data-layout-selection/data-layout-selection.component.mjs +46 -0
  6. package/esm2022/lib/components/data-list-grid/data-list-grid.component.mjs +399 -0
  7. package/esm2022/lib/components/data-list-grid-sorting/data-list-grid-sorting.component.mjs +92 -0
  8. package/esm2022/lib/components/data-sort-base/data-sort-base.mjs +110 -0
  9. package/esm2022/lib/components/data-table/data-table.component.mjs +401 -0
  10. package/esm2022/lib/components/data-view/data-view.component.mjs +407 -0
  11. package/esm2022/lib/components/diagram/diagram.component.mjs +137 -0
  12. package/esm2022/lib/components/group-by-count-diagram/group-by-count-diagram.component.mjs +109 -0
  13. package/esm2022/lib/components/interactive-data-view/interactive-data-view.component.mjs +375 -0
  14. package/esm2022/lib/components/page-header/page-header.component.mjs +232 -0
  15. package/{esm2020 → esm2022}/lib/components/search-config/search-config.component.mjs +4 -4
  16. package/esm2022/lib/components/search-header/search-header.component.mjs +136 -0
  17. package/esm2022/lib/directives/advanced.directive.mjs +36 -0
  18. package/esm2022/lib/directives/if-breakpoint.directive.mjs +39 -0
  19. package/esm2022/lib/directives/if-permission.directive.mjs +80 -0
  20. package/esm2022/lib/directives/src.directive.mjs +59 -0
  21. package/esm2022/lib/functions/flatten-object.mjs +20 -0
  22. package/{esm2020 → esm2022}/lib/model/breadcrumb-menu-item.model.mjs +1 -1
  23. package/esm2022/lib/pipes/dynamic.pipe.mjs +58 -0
  24. package/esm2022/lib/pipes/ocxtimeago.pipe.mjs +107 -0
  25. package/esm2022/lib/services/app-config-service.mjs +43 -0
  26. package/esm2022/lib/services/breadcrumb.service.mjs +113 -0
  27. package/esm2022/lib/services/translation-cache.service.mjs +41 -0
  28. package/esm2022/lib/utils/async-translate-loader.utils.mjs +12 -0
  29. package/esm2022/lib/utils/caching-translate-loader.utils.mjs +15 -0
  30. package/{esm2020 → esm2022}/lib/utils/colorutils.mjs +1 -1
  31. package/{esm2020 → esm2022}/lib/utils/dateutils.mjs +6 -6
  32. package/esm2022/lib/utils/objectutils.mjs +30 -0
  33. package/{esm2020 → esm2022}/lib/utils/translate.combined.loader.mjs +1 -1
  34. package/{esm2020 → esm2022}/testing/column-group-selection.harness.mjs +2 -2
  35. package/esm2022/testing/custom-group-column-selector.harness.mjs +31 -0
  36. package/esm2022/testing/data-layout-selection.harness.mjs +33 -0
  37. package/esm2022/testing/data-list-grid.harness.mjs +47 -0
  38. package/esm2022/testing/data-table.harness.mjs +63 -0
  39. package/{esm2020 → esm2022}/testing/data-view.harness.mjs +2 -2
  40. package/esm2022/testing/default-grid-item.harness.mjs +24 -0
  41. package/esm2022/testing/default-list-item.harness.mjs +24 -0
  42. package/esm2022/testing/diagram.harness.mjs +22 -0
  43. package/{esm2020 → esm2022}/testing/group-by-count-diagram.harness.mjs +2 -2
  44. package/{esm2020 → esm2022}/testing/interactive-data-view.harness.mjs +2 -2
  45. package/esm2022/testing/more-actions-menu-button.harness.mjs +35 -0
  46. package/esm2022/testing/page-header.harness.mjs +78 -0
  47. package/{esm2020 → esm2022}/testing/search-config.harness.mjs +2 -2
  48. package/{esm2020 → esm2022}/testing/search-header.harness.mjs +2 -2
  49. package/{fesm2020 → fesm2022}/onecx-angular-accelerator-testing.mjs +34 -28
  50. package/fesm2022/onecx-angular-accelerator-testing.mjs.map +1 -0
  51. package/{fesm2020 → fesm2022}/onecx-angular-accelerator.mjs +244 -224
  52. package/fesm2022/onecx-angular-accelerator.mjs.map +1 -0
  53. package/lib/components/column-group-selection/column-group-selection.component.d.ts +1 -1
  54. package/lib/components/custom-group-column-selector/custom-group-column-selector.component.d.ts +1 -1
  55. package/lib/components/data-layout-selection/data-layout-selection.component.d.ts +1 -1
  56. package/lib/components/data-list-grid/data-list-grid.component.d.ts +1 -1
  57. package/lib/components/data-list-grid-sorting/data-list-grid-sorting.component.d.ts +1 -1
  58. package/lib/components/data-table/data-table.component.d.ts +1 -1
  59. package/lib/components/data-view/data-view.component.d.ts +2 -2
  60. package/lib/components/diagram/diagram.component.d.ts +2 -2
  61. package/lib/components/group-by-count-diagram/group-by-count-diagram.component.d.ts +1 -1
  62. package/lib/components/interactive-data-view/interactive-data-view.component.d.ts +1 -1
  63. package/lib/components/page-header/page-header.component.d.ts +1 -1
  64. package/lib/components/search-config/search-config.component.d.ts +1 -1
  65. package/lib/components/search-header/search-header.component.d.ts +1 -1
  66. package/lib/directives/if-breakpoint.directive.d.ts +1 -1
  67. package/lib/directives/if-permission.directive.d.ts +14 -5
  68. package/lib/directives/src.directive.d.ts +1 -1
  69. package/lib/model/breadcrumb-menu-item.model.d.ts +2 -2
  70. package/package.json +20 -28
  71. package/testing/data-list-grid.harness.d.ts +1 -1
  72. package/esm2020/lib/angular-accelerator.module.mjs +0 -160
  73. package/esm2020/lib/components/column-group-selection/column-group-selection.component.mjs +0 -72
  74. package/esm2020/lib/components/custom-group-column-selector/custom-group-column-selector.component.mjs +0 -109
  75. package/esm2020/lib/components/data-layout-selection/data-layout-selection.component.mjs +0 -45
  76. package/esm2020/lib/components/data-list-grid/data-list-grid.component.mjs +0 -399
  77. package/esm2020/lib/components/data-list-grid-sorting/data-list-grid-sorting.component.mjs +0 -92
  78. package/esm2020/lib/components/data-sort-base/data-sort-base.mjs +0 -110
  79. package/esm2020/lib/components/data-table/data-table.component.mjs +0 -401
  80. package/esm2020/lib/components/data-view/data-view.component.mjs +0 -407
  81. package/esm2020/lib/components/diagram/diagram.component.mjs +0 -137
  82. package/esm2020/lib/components/group-by-count-diagram/group-by-count-diagram.component.mjs +0 -109
  83. package/esm2020/lib/components/interactive-data-view/interactive-data-view.component.mjs +0 -375
  84. package/esm2020/lib/components/page-header/page-header.component.mjs +0 -232
  85. package/esm2020/lib/components/search-header/search-header.component.mjs +0 -136
  86. package/esm2020/lib/directives/advanced.directive.mjs +0 -36
  87. package/esm2020/lib/directives/if-breakpoint.directive.mjs +0 -39
  88. package/esm2020/lib/directives/if-permission.directive.mjs +0 -70
  89. package/esm2020/lib/directives/src.directive.mjs +0 -59
  90. package/esm2020/lib/functions/flatten-object.mjs +0 -20
  91. package/esm2020/lib/pipes/dynamic.pipe.mjs +0 -58
  92. package/esm2020/lib/pipes/ocxtimeago.pipe.mjs +0 -107
  93. package/esm2020/lib/services/app-config-service.mjs +0 -43
  94. package/esm2020/lib/services/breadcrumb.service.mjs +0 -113
  95. package/esm2020/lib/services/translation-cache.service.mjs +0 -41
  96. package/esm2020/lib/utils/async-translate-loader.utils.mjs +0 -12
  97. package/esm2020/lib/utils/caching-translate-loader.utils.mjs +0 -15
  98. package/esm2020/lib/utils/objectutils.mjs +0 -30
  99. package/esm2020/testing/custom-group-column-selector.harness.mjs +0 -31
  100. package/esm2020/testing/data-layout-selection.harness.mjs +0 -33
  101. package/esm2020/testing/data-list-grid.harness.mjs +0 -47
  102. package/esm2020/testing/data-table.harness.mjs +0 -57
  103. package/esm2020/testing/default-grid-item.harness.mjs +0 -24
  104. package/esm2020/testing/default-list-item.harness.mjs +0 -24
  105. package/esm2020/testing/diagram.harness.mjs +0 -22
  106. package/esm2020/testing/more-actions-menu-button.harness.mjs +0 -35
  107. package/esm2020/testing/page-header.harness.mjs +0 -78
  108. package/fesm2015/onecx-angular-accelerator-testing.mjs +0 -541
  109. package/fesm2015/onecx-angular-accelerator-testing.mjs.map +0 -1
  110. package/fesm2015/onecx-angular-accelerator.mjs +0 -3563
  111. package/fesm2015/onecx-angular-accelerator.mjs.map +0 -1
  112. package/fesm2020/onecx-angular-accelerator-testing.mjs.map +0 -1
  113. package/fesm2020/onecx-angular-accelerator.mjs.map +0 -1
  114. /package/{esm2020 → esm2022}/index.mjs +0 -0
  115. /package/{esm2020 → esm2022}/lib/model/column-type.model.mjs +0 -0
  116. /package/{esm2020 → esm2022}/lib/model/data-action.mjs +0 -0
  117. /package/{esm2020 → esm2022}/lib/model/data-column-name-id.model.mjs +0 -0
  118. /package/{esm2020 → esm2022}/lib/model/data-sort-direction.mjs +0 -0
  119. /package/{esm2020 → esm2022}/lib/model/data-table-column.model.mjs +0 -0
  120. /package/{esm2020 → esm2022}/lib/model/diagram-column.mjs +0 -0
  121. /package/{esm2020 → esm2022}/lib/model/diagram-data.mjs +0 -0
  122. /package/{esm2020 → esm2022}/lib/model/diagram-type.mjs +0 -0
  123. /package/{esm2020 → esm2022}/lib/model/search-config-info.mjs +0 -0
  124. /package/{esm2020 → esm2022}/lib/utils/create-remote-component-translate-loader.utils.mjs +0 -0
  125. /package/{esm2020 → esm2022}/lib/utils/create-translate-loader.utils.mjs +0 -0
  126. /package/{esm2020 → esm2022}/lib/utils/enum-to-dropdown-options.utils.mjs +0 -0
  127. /package/{esm2020 → esm2022}/lib/utils/primeicon.utils.mjs +0 -0
  128. /package/{esm2020 → esm2022}/onecx-angular-accelerator.mjs +0 -0
  129. /package/{esm2020 → esm2022}/testing/index.mjs +0 -0
  130. /package/{esm2020 → esm2022}/testing/onecx-angular-accelerator-testing.mjs +0 -0
@@ -1,3563 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Directive, Optional, Input, HostListener, EventEmitter, Output, Component, Injectable, Injector, LOCALE_ID, Pipe, Inject, ViewEncapsulation, ContentChild, ViewChild, NgModule, inject } from '@angular/core';
3
- import * as i3 from '@onecx/angular-integration-interface';
4
- import { UserService } from '@onecx/angular-integration-interface';
5
- import * as i1 from '@angular/common/http';
6
- import * as i4 from '@angular/common';
7
- import { CurrencyPipe, DecimalPipe, DatePipe, Location, CommonModule } from '@angular/common';
8
- import * as i6 from 'primeng/button';
9
- import { ButtonModule } from 'primeng/button';
10
- import * as i3$1 from '@angular/forms';
11
- import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
12
- import * as i2 from 'primeng/dropdown';
13
- import { DropdownModule } from 'primeng/dropdown';
14
- import * as i1$1 from '@ngx-translate/core';
15
- import { TranslateService, TranslatePipe, TranslateModule } from '@ngx-translate/core';
16
- import * as i2$1 from 'primeng/api';
17
- import { PrimeIcons } from 'primeng/api';
18
- import { BehaviorSubject, filter, concat, of, map, combineLatest, mergeMap, first, tap, firstValueFrom, defaultIfEmpty, forkJoin } from 'rxjs';
19
- import { __decorate, __metadata, __awaiter } from 'tslib';
20
- import * as i1$2 from '@angular/router';
21
- import { NavigationEnd, Router, ActivatedRoute, RouterModule } from '@angular/router';
22
- import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
23
- import * as i5 from 'primeng/breadcrumb';
24
- import { BreadcrumbModule } from 'primeng/breadcrumb';
25
- import * as i8 from 'primeng/menu';
26
- import { MenuModule } from 'primeng/menu';
27
- import * as i8$1 from 'primeng/skeleton';
28
- import { SkeletonModule } from 'primeng/skeleton';
29
- import * as i4$1 from 'primeng/dialog';
30
- import { DialogModule } from 'primeng/dialog';
31
- import * as i5$1 from 'primeng/picklist';
32
- import { PickListModule } from 'primeng/picklist';
33
- import * as i6$1 from 'primeng/selectbutton';
34
- import { SelectButtonModule } from 'primeng/selectbutton';
35
- import * as i7 from 'primeng/dataview';
36
- import { DataViewModule } from 'primeng/dataview';
37
- import * as i7$1 from 'primeng/table';
38
- import { TableModule } from 'primeng/table';
39
- import * as i9 from 'primeng/multiselect';
40
- import { MultiSelectModule } from 'primeng/multiselect';
41
- import * as d3 from 'd3-scale-chromatic';
42
- import * as i5$2 from 'primeng/chart';
43
- import { ChartModule } from 'primeng/chart';
44
- import * as i6$2 from 'primeng/message';
45
- import { MessageModule } from 'primeng/message';
46
- import { SyncableTopic } from '@onecx/accelerator';
47
- import { TranslateHttpLoader } from '@ngx-translate/http-loader';
48
-
49
- class IfPermissionDirective {
50
- set notPermission(value) {
51
- this.permission = value;
52
- this.negate = true;
53
- }
54
- set ocxIfNotPermissionPermissions(value) {
55
- this.ocxIfPermissionPermissions = value;
56
- }
57
- constructor(renderer, el, viewContainer, userService, templateRef) {
58
- this.renderer = renderer;
59
- this.el = el;
60
- this.viewContainer = viewContainer;
61
- this.userService = userService;
62
- this.templateRef = templateRef;
63
- this.onMissingPermission = 'hide';
64
- this.negate = false;
65
- }
66
- ngOnInit() {
67
- if (this.permission) {
68
- if (this.negate === this.hasPermission(this.permission)) {
69
- if (this.onMissingPermission === 'disable') {
70
- this.renderer.setAttribute(this.el.nativeElement, 'disabled', 'disabled');
71
- }
72
- else {
73
- this.viewContainer.clear();
74
- }
75
- }
76
- else {
77
- if (this.templateRef) {
78
- this.viewContainer.createEmbeddedView(this.templateRef);
79
- }
80
- }
81
- }
82
- }
83
- hasPermission(permission) {
84
- if (this.ocxIfPermissionPermissions) {
85
- const result = this.ocxIfPermissionPermissions.includes(permission);
86
- if (!result) {
87
- console.log('👮‍♀️ No permission in overwrites for: `', permission);
88
- }
89
- return result;
90
- }
91
- return this.userService.hasPermission(permission);
92
- }
93
- }
94
- IfPermissionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IfPermissionDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: i3.UserService }, { token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
95
- IfPermissionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: IfPermissionDirective, selector: "[ocxIfPermission], [ocxIfNotPermission]", inputs: { permission: ["ocxIfPermission", "permission"], notPermission: ["ocxIfNotPermission", "notPermission"], onMissingPermission: "onMissingPermission", ocxIfPermissionPermissions: "ocxIfPermissionPermissions", ocxIfNotPermissionPermissions: "ocxIfNotPermissionPermissions" }, ngImport: i0 });
96
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IfPermissionDirective, decorators: [{
97
- type: Directive,
98
- args: [{ selector: '[ocxIfPermission], [ocxIfNotPermission]' }]
99
- }], ctorParameters: function () {
100
- return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i3.UserService }, { type: i0.TemplateRef, decorators: [{
101
- type: Optional
102
- }] }];
103
- }, propDecorators: { permission: [{
104
- type: Input,
105
- args: ['ocxIfPermission']
106
- }], notPermission: [{
107
- type: Input,
108
- args: ['ocxIfNotPermission']
109
- }], onMissingPermission: [{
110
- type: Input
111
- }], ocxIfPermissionPermissions: [{
112
- type: Input
113
- }], ocxIfNotPermissionPermissions: [{
114
- type: Input
115
- }] } });
116
-
117
- class IfBreakpointDirective {
118
- constructor(viewContainer, templateRef) {
119
- this.viewContainer = viewContainer;
120
- this.templateRef = templateRef;
121
- }
122
- ngOnInit() {
123
- this.onResize();
124
- }
125
- onResize() {
126
- const mobileBreakpointVar = getComputedStyle(document.documentElement).getPropertyValue('--mobile-break-point');
127
- const isMobile = window.matchMedia(`(max-width: ${mobileBreakpointVar})`).matches;
128
- const isDesktop = !isMobile;
129
- if ((this.breakpoint === 'mobile' && isMobile) || (this.breakpoint === 'desktop' && isDesktop)) {
130
- if (this.templateRef && !this.viewContainer.length) {
131
- this.viewContainer.createEmbeddedView(this.templateRef);
132
- }
133
- }
134
- else {
135
- this.viewContainer.clear();
136
- }
137
- }
138
- }
139
- IfBreakpointDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IfBreakpointDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
140
- IfBreakpointDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: IfBreakpointDirective, selector: "[ocxIfBreakpoint]", inputs: { breakpoint: ["ocxIfBreakpoint", "breakpoint"] }, host: { listeners: { "window:resize": "onResize()" } }, ngImport: i0 });
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IfBreakpointDirective, decorators: [{
142
- type: Directive,
143
- args: [{ selector: '[ocxIfBreakpoint]' }]
144
- }], ctorParameters: function () {
145
- return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef, decorators: [{
146
- type: Optional
147
- }] }];
148
- }, propDecorators: { breakpoint: [{
149
- type: Input,
150
- args: ['ocxIfBreakpoint']
151
- }], onResize: [{
152
- type: HostListener,
153
- args: ['window:resize']
154
- }] } });
155
-
156
- class SrcDirective {
157
- get ocxSrc() {
158
- return this._src;
159
- }
160
- set ocxSrc(value) {
161
- if (value && this._src !== value) {
162
- try {
163
- if (new URL(value, window.location.origin).hostname === window.location.hostname) {
164
- this.httpClient.get(value, { responseType: 'blob' }).subscribe({
165
- next: (blob) => {
166
- const url = URL.createObjectURL(blob);
167
- this.el.nativeElement.onload = () => {
168
- URL.revokeObjectURL(url);
169
- };
170
- this.el.nativeElement.src = url;
171
- this.el.nativeElement.style.visibility = 'initial';
172
- },
173
- error: () => {
174
- this.error.emit();
175
- this.el.nativeElement.style.visibility = 'initial';
176
- },
177
- });
178
- }
179
- else {
180
- this.el.nativeElement.src = value;
181
- this.el.nativeElement.style.visibility = 'initial';
182
- }
183
- }
184
- catch (error) {
185
- console.log('Cannot parse URL ', value, error);
186
- this.el.nativeElement.src = value;
187
- this.el.nativeElement.style.visibility = 'initial';
188
- }
189
- this._src = value;
190
- }
191
- }
192
- constructor(el, httpClient) {
193
- this.el = el;
194
- this.httpClient = httpClient;
195
- // eslint-disable-next-line @angular-eslint/no-output-native
196
- this.error = new EventEmitter();
197
- this.el.nativeElement.style.visibility = 'hidden';
198
- }
199
- }
200
- SrcDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SrcDirective, deps: [{ token: i0.ElementRef }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Directive });
201
- SrcDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: SrcDirective, selector: "[ocxSrc]", inputs: { ocxSrc: "ocxSrc" }, outputs: { error: "error" }, ngImport: i0 });
202
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SrcDirective, decorators: [{
203
- type: Directive,
204
- args: [{ selector: '[ocxSrc]' }]
205
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.HttpClient }]; }, propDecorators: { error: [{
206
- type: Output
207
- }], ocxSrc: [{
208
- type: Input
209
- }] } });
210
-
211
- class SearchConfigComponent {
212
- constructor() {
213
- this.placeholderKey = 'OCX_SEARCH_HEADER.OCX_SEARCH_CONFIG.DROPDOWN_DEFAULT';
214
- this.selectedSearchConfigChanged = new EventEmitter();
215
- }
216
- ngOnInit() {
217
- this.formGroup = new FormGroup({
218
- searchConfigForm: new FormControl(null),
219
- });
220
- }
221
- onSearchConfigChange(event) {
222
- var _a;
223
- (_a = this.selectedSearchConfigChanged) === null || _a === void 0 ? void 0 : _a.emit(event.value);
224
- }
225
- }
226
- SearchConfigComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SearchConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
227
- SearchConfigComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SearchConfigComponent, selector: "ocx-search-config", inputs: { searchConfigs: "searchConfigs", placeholderKey: "placeholderKey" }, outputs: { selectedSearchConfigChanged: "selectedSearchConfigChanged" }, ngImport: i0, template: "<div *ngIf=\"formGroup\">\n <form [formGroup]=\"formGroup\">\n <div *ngIf=\"searchConfigs !== undefined\">\n <div *ngIf=\"searchConfigs.length > 0\">\n <p-dropdown\n id=\"searchConfig\"\n formControlName=\"searchConfigForm\"\n [options]=\"searchConfigs\"\n optionLabel=\"name\"\n [placeholder]=\"placeholderKey | translate\"\n [showClear]=\"true\"\n (onChange)=\"onSearchConfigChange($event)\"\n ></p-dropdown>\n </div>\n </div>\n </form>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "overlayDirection", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
228
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SearchConfigComponent, decorators: [{
229
- type: Component,
230
- args: [{ selector: 'ocx-search-config', template: "<div *ngIf=\"formGroup\">\n <form [formGroup]=\"formGroup\">\n <div *ngIf=\"searchConfigs !== undefined\">\n <div *ngIf=\"searchConfigs.length > 0\">\n <p-dropdown\n id=\"searchConfig\"\n formControlName=\"searchConfigForm\"\n [options]=\"searchConfigs\"\n optionLabel=\"name\"\n [placeholder]=\"placeholderKey | translate\"\n [showClear]=\"true\"\n (onChange)=\"onSearchConfigChange($event)\"\n ></p-dropdown>\n </div>\n </div>\n </form>\n</div>\n" }]
231
- }], propDecorators: { searchConfigs: [{
232
- type: Input
233
- }], placeholderKey: [{
234
- type: Input
235
- }], selectedSearchConfigChanged: [{
236
- type: Output
237
- }] } });
238
-
239
- let BreadcrumbService = class BreadcrumbService {
240
- constructor(router, activeRoute, translateService) {
241
- this.router = router;
242
- this.activeRoute = activeRoute;
243
- this.translateService = translateService;
244
- this.itemsSource = new BehaviorSubject([]);
245
- this.generatedItemsSource = new BehaviorSubject([]);
246
- this.itemsHandler = this.itemsSource.asObservable();
247
- this.generateBreadcrumbs(this.activeRoute.snapshot);
248
- this.router.events
249
- .pipe(untilDestroyed(this), filter((e) => e instanceof NavigationEnd))
250
- .subscribe(() => {
251
- const root = this.router.routerState.snapshot.root;
252
- this.generateBreadcrumbs(root);
253
- });
254
- }
255
- generateBreadcrumbs(route) {
256
- if (route === null || route === void 0 ? void 0 : route.data['mfeInfo']) {
257
- const breadcrumbs = [
258
- {
259
- label: route.data['mfeInfo'].productName,
260
- routerLink: route.data['mfeInfo'].baseHref,
261
- },
262
- ];
263
- const baseUrl = route.data['mfeInfo'].baseHref.split('/').filter((value) => value);
264
- const parentUrl = route.url.map((url) => url.path);
265
- const isUsingMatcher = !parentUrl.every((item) => baseUrl.includes(item));
266
- if (isUsingMatcher) {
267
- this.createBreadcrumb(route, parentUrl, breadcrumbs);
268
- }
269
- this.addBreadcrumb(route.firstChild, parentUrl, breadcrumbs);
270
- this.generatedItemsSource.next(breadcrumbs);
271
- }
272
- else if (route === null || route === void 0 ? void 0 : route.data['breadcrumb']) {
273
- const breadcrumbs = [];
274
- this.addBreadcrumb(route, [], breadcrumbs);
275
- this.generatedItemsSource.next(breadcrumbs);
276
- }
277
- else if (route) {
278
- this.generateBreadcrumbs(route.firstChild);
279
- }
280
- }
281
- addBreadcrumb(route, parentUrl, breadcrumbs) {
282
- var _a;
283
- if (route && route.url) {
284
- const routeUrl = parentUrl.concat(route.url.map((url) => url.path));
285
- if ((_a = route.routeConfig) === null || _a === void 0 ? void 0 : _a.path) {
286
- this.createBreadcrumb(route, routeUrl, breadcrumbs);
287
- }
288
- this.addBreadcrumb(route.firstChild, routeUrl, breadcrumbs);
289
- }
290
- }
291
- createBreadcrumb(route, routeUrl, breadcrumbs) {
292
- if (route.data['breadcrumb']) {
293
- const breadcrumb = {
294
- label: this.getLabel(route.data, route.paramMap),
295
- routerLink: '/' + routeUrl.join('/'),
296
- };
297
- breadcrumbs.push(breadcrumb);
298
- }
299
- else {
300
- const breadcrumb = {
301
- label: 'NA',
302
- routerLink: '/' + routeUrl.join('/'),
303
- };
304
- breadcrumbs.push(breadcrumb);
305
- }
306
- }
307
- getLabel(data, params) {
308
- if (typeof data['breadcrumbFn'] === 'function') {
309
- return data['breadcrumbFn'](data, params);
310
- }
311
- return data['breadcrumb'];
312
- }
313
- setItems(items) {
314
- const translationKeys = [
315
- ...items.map((i) => i.labelKey || '').filter((l) => !!l),
316
- ...items.map((i) => i.titleKey || '').filter((l) => !!l),
317
- ];
318
- if (translationKeys.length) {
319
- this.translateService.get(translationKeys).subscribe((translations) => {
320
- this.itemsSource.next(items.map((i) => (Object.assign(Object.assign({}, i), { label: translations[i.labelKey || ''] || i.label, title: translations[i.titleKey || ''] || i.title }))));
321
- });
322
- }
323
- else {
324
- this.itemsSource.next(items);
325
- }
326
- }
327
- };
328
- BreadcrumbService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BreadcrumbService, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
329
- BreadcrumbService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BreadcrumbService, providedIn: 'any' });
330
- BreadcrumbService = __decorate([
331
- UntilDestroy(),
332
- __metadata("design:paramtypes", [Router, ActivatedRoute, TranslateService])
333
- ], BreadcrumbService);
334
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BreadcrumbService, decorators: [{
335
- type: Injectable,
336
- args: [{ providedIn: 'any' }]
337
- }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: i1$1.TranslateService }]; } });
338
-
339
- class DynamicPipe {
340
- constructor(locale, injector) {
341
- this.injector = injector;
342
- this.knownPipes = {};
343
- this.knownPipes = {
344
- currency: new CurrencyPipe(locale),
345
- decimal: new DecimalPipe(locale),
346
- date: new DatePipe(locale),
347
- };
348
- }
349
- transform(value, requiredPipe, pipeArgs) {
350
- if (!requiredPipe) {
351
- return value;
352
- }
353
- const injector = Injector.create({
354
- name: 'DynamicPipe',
355
- parent: this.injector,
356
- providers: [{ provide: requiredPipe }],
357
- });
358
- const pipe = injector.get(requiredPipe);
359
- return pipe.transform(value, pipeArgs);
360
- }
361
- transform2(value, pipeToken, ...pipeArgs) {
362
- if (!pipeToken) {
363
- return value;
364
- }
365
- else {
366
- // eslint-disable-next-line no-prototype-builtins
367
- if (pipeToken && this.knownPipes.hasOwnProperty(pipeToken)) {
368
- const pipe = this.knownPipes[pipeToken];
369
- if (Array.isArray(pipeArgs)) {
370
- return pipe.transform(value, ...pipeArgs);
371
- }
372
- else {
373
- return pipe.transform(value, pipeArgs);
374
- }
375
- }
376
- else {
377
- return value;
378
- }
379
- }
380
- }
381
- }
382
- DynamicPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicPipe, deps: [{ token: LOCALE_ID }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Pipe });
383
- DynamicPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: DynamicPipe, name: "dynamicPipe" });
384
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicPipe, decorators: [{
385
- type: Pipe,
386
- args: [{
387
- name: 'dynamicPipe',
388
- }]
389
- }], ctorParameters: function () {
390
- return [{ type: undefined, decorators: [{
391
- type: Inject,
392
- args: [LOCALE_ID]
393
- }] }, { type: i0.Injector }];
394
- } });
395
-
396
- class PageHeaderComponent {
397
- get actions() {
398
- return this._actions;
399
- }
400
- set actions(value) {
401
- this._actions = value;
402
- this.generateInlineActions();
403
- this.generateOverflowActions();
404
- }
405
- constructor(breadcrumbs, translateService, appStateService, userService) {
406
- this.translateService = translateService;
407
- this.appStateService = appStateService;
408
- this.userService = userService;
409
- this.loading = false;
410
- this.figureBackground = true;
411
- this.showFigure = true;
412
- this.disableDefaultActions = false;
413
- this.showBreadcrumbs = true;
414
- this.manualBreadcrumbs = false;
415
- this.save = new EventEmitter();
416
- this.overflowActions = [];
417
- this.dd = new Date();
418
- this.figureImageLoadError = false;
419
- this.objectPanelGridLayoutClasses = 'grid row-gap-2 m-0';
420
- this.objectPanelColumnLayoutClasses = 'flex flex-row justify-content-between overflow-x-auto';
421
- this.objectPanelDefaultLayoutClasses = 'flex flex-column row-gap-2 md:flex-row md:justify-content-between';
422
- this.objectInfoGridLayoutClasses = 'col-12 flex gap-4 md:col-6 align-items-center p-0';
423
- this.objectInfoColumnLayoutClasses = 'flex flex-column align-items-center gap-2 min-w-120';
424
- this.objectInfoDefaultLayoutClasses = 'flex flex-row md:flex-column md:align-items-center md:gap-2';
425
- this.breadcrumbs = breadcrumbs;
426
- this.home$ = concat(of({ menuItem: { icon: PrimeIcons.HOME, routerLink: '/' } }), this.appStateService.currentPortal$.pipe(map((portal) => ({
427
- menuItem: {
428
- icon: PrimeIcons.HOME,
429
- routerLink: portal.baseUrl,
430
- },
431
- page: portal.portalName,
432
- }))));
433
- }
434
- ngOnChanges(changes) {
435
- if (changes['actions']) {
436
- this.generateInlineActions();
437
- this.generateOverflowActions();
438
- }
439
- }
440
- ngOnInit() {
441
- if (!this.manualBreadcrumbs) {
442
- this.breadcrumbs$ = this.breadcrumbs.generatedItemsSource;
443
- }
444
- else {
445
- this.breadcrumbs$ = this.breadcrumbs.itemsHandler;
446
- }
447
- this.generateInlineActions();
448
- this.generateOverflowActions();
449
- }
450
- onAction(action) {
451
- switch (action) {
452
- case 'save':
453
- this.save.emit();
454
- break;
455
- default:
456
- break;
457
- }
458
- }
459
- handleImageError() {
460
- this.figureImageLoadError = true;
461
- }
462
- generateItemStyle(item) {
463
- let style = '';
464
- if (item.icon)
465
- style = style.concat(style, ' ', 'gap-1 align-items-center');
466
- if (item.valueCssClass)
467
- style = style.concat(style, ' ', item.valueCssClass);
468
- return style;
469
- }
470
- getObjectPanelLayoutClasses() {
471
- if (this.enableGridView) {
472
- return this.objectPanelGridLayoutClasses;
473
- }
474
- if (this.enableGridView === false) {
475
- return this.objectPanelColumnLayoutClasses;
476
- }
477
- return this.objectPanelDefaultLayoutClasses;
478
- }
479
- getObjectInfoLayoutClasses() {
480
- if (this.enableGridView) {
481
- return `${this.objectInfoGridLayoutClasses} lg:col-${this.gridLayoutDesktopColumns ? 12 / this.gridLayoutDesktopColumns : 4}`;
482
- }
483
- if (this.enableGridView === false) {
484
- return this.objectInfoColumnLayoutClasses;
485
- }
486
- return this.objectInfoDefaultLayoutClasses;
487
- }
488
- /**
489
- * Generates a list of actions that should be rendered in an overflow menu
490
- */
491
- generateOverflowActions() {
492
- if (this.actions) {
493
- const translationKeys = [
494
- ...this.actions.map((a) => a.labelKey || '').filter((a) => !!a),
495
- ...this.actions.map((a) => a.titleKey || '').filter((a) => !!a),
496
- ];
497
- const translations$ = translationKeys.length ? this.translateService.get(translationKeys) : of([]);
498
- translations$.subscribe((translations) => {
499
- const allowedActions = [];
500
- if (this.actions) {
501
- this.actions
502
- .filter((a) => a.show === 'asOverflow')
503
- .filter((a) => {
504
- if (a.conditional) {
505
- if (a.showCondition)
506
- return a;
507
- return null;
508
- }
509
- else
510
- return a;
511
- })
512
- .forEach((action) => {
513
- this.checkActionPermission(allowedActions, action);
514
- });
515
- this.overflowActions = [
516
- ...allowedActions.map((a) => ({
517
- label: a.labelKey ? translations[a.labelKey] : a.label,
518
- icon: a.icon,
519
- title: (a.titleKey ? translations[a.titleKey] : a.title) || (a.labelKey ? translations[a.labelKey] : a.label),
520
- command: a.actionCallback,
521
- disabled: a.disabled,
522
- })),
523
- ];
524
- }
525
- });
526
- }
527
- }
528
- /**
529
- * Generates a list of actions that should be rendered as inline buttons
530
- */
531
- generateInlineActions() {
532
- if (this.actions) {
533
- // Temp array to hold all inline actions that should be visible to the current user
534
- const allowedActions = [];
535
- // Check permissions for all actions that should be rendered 'always'
536
- this.actions
537
- .filter((a) => a.show === 'always')
538
- .filter((a) => {
539
- if (a.conditional) {
540
- return a.showCondition ? a : null;
541
- }
542
- else
543
- return a;
544
- })
545
- .forEach((action) => {
546
- this.checkActionPermission(allowedActions, action);
547
- });
548
- this.inlineActions = [...allowedActions];
549
- }
550
- }
551
- /**
552
- * Adds a given action to a given array if the current user is allowed to see it
553
- * @param allowedActions Array that the action should be added to if the current user is allowed to see it
554
- * @param action Action for which a permission check should be executed
555
- */
556
- checkActionPermission(allowedActions, action) {
557
- if (action.permission) {
558
- if (this.userService.hasPermission(action.permission)) {
559
- // Push action to allowed array if user has sufficient permissions
560
- allowedActions.push(action);
561
- }
562
- }
563
- else {
564
- // Push action to allowed array if no permission was specified
565
- allowedActions.push(action);
566
- }
567
- }
568
- }
569
- PageHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PageHeaderComponent, deps: [{ token: BreadcrumbService }, { token: i1$1.TranslateService }, { token: i3.AppStateService }, { token: i3.UserService }], target: i0.ɵɵFactoryTarget.Component });
570
- PageHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PageHeaderComponent, selector: "ocx-page-header", inputs: { header: "header", loading: "loading", figureBackground: "figureBackground", showFigure: "showFigure", figureImage: "figureImage", disableDefaultActions: "disableDefaultActions", subheader: "subheader", actions: "actions", objectDetails: "objectDetails", showBreadcrumbs: "showBreadcrumbs", manualBreadcrumbs: "manualBreadcrumbs", enableGridView: "enableGridView", gridLayoutDesktopColumns: "gridLayoutDesktopColumns" }, outputs: { save: "save" }, queries: [{ propertyName: "additionalToolbarContent", first: true, predicate: ["additionalToolbarContent"], descendants: true }, { propertyName: "additionalToolbarContentLeft", first: true, predicate: ["additionalToolbarContentLeft"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"onecx-page-header mb-4\" name=\"ocx-page-header-wrapper\">\n <ng-container *ngIf=\"showBreadcrumbs\">\n <p-breadcrumb\n [model]=\"items\"\n *ngIf=\"breadcrumbs$ | async as items\"\n [home]=\"(home$ | async)?.menuItem ?? {}\"\n [homeAriaLabel]=\"(home$ | async)?.page ? ('OCX_PAGE_HEADER.HOME_ARIA_LABEL' | translate: { page: (home$ | async)?.page}) : ('OCX_PAGE_HEADER.HOME_DEFAULT_ARIA_LABEL' | translate)\"\n [attr.manual]=\"manualBreadcrumbs\"\n ></p-breadcrumb>\n </ng-container>\n <div class=\"title-bar flex flex-row md:justify-content-between p-2 md:p-3\">\n <div class=\"title-wrap\">\n <div class=\"figure flex h-2rem w-2rem md:h-3rem md:w-3rem\" *ngIf=\"showFigure\">\n <div #previewImage class=\"figure-image absolute top-0 left-0 right-0 bottom-0\">\n <ng-content select=\"[figureImage]\"></ng-content>\n <img\n *ngIf=\"figureImage && !figureImageLoadError\"\n [ocxSrc]=\"figureImage\"\n alt=\"Figure image\"\n class=\"w-full\"\n (error)=\"handleImageError()\"\n />\n </div>\n <div\n class=\"colorblob flex-1 border-round\"\n *ngIf=\"previewImage.children.length === 0 || figureImageLoadError\"\n ></div>\n </div>\n <ng-template #skeletonBar>\n <div class=\"header justify-content-evenly\">\n <p-skeleton width=\"10rem\"></p-skeleton>\n <p-skeleton width=\"10rem\"></p-skeleton>\n </div>\n </ng-template>\n <div class=\"header\" *ngIf=\"!loading; else skeletonBar\">\n <h1 id=\"page-header\" *ngIf=\"!!header\">{{ header }}</h1>\n <h2 id=\"page-subheader\" *ngIf=\"!!subheader\">{{ subheader }}</h2>\n </div>\n </div>\n <div class=\"action-items-wrap mt-2 md:mt-0\">\n <ng-container *ngIf=\"additionalToolbarContentLeft\" [ngTemplateOutlet]=\"additionalToolbarContentLeft\">\n </ng-container>\n\n <ng-container *ngIf=\"!disableDefaultActions\"> </ng-container>\n <ng-template #skeletonActions>\n <div class=\"flex\">\n <p-skeleton width=\"5rem\" height=\"2rem\" styleClass=\"mr-2\"></p-skeleton>\n <p-skeleton width=\"2rem\" height=\"2rem\" styleClass=\"mb-2\"></p-skeleton>\n </div>\n </ng-template>\n <ng-container *ngIf=\"!loading; else skeletonActions\">\n <div *ngIf=\"inlineActions && inlineActions.length > 0\" class=\"toolbar flex flex-wrap gap-1 sm:gap-2\">\n <ng-container *ngFor=\"let action of inlineActions\">\n <p-button\n id=\"{{ action.id }}\"\n [icon]=\"action.icon ?? ''\"\n type=\"button\"\n class=\"action-button\"\n [label]=\"action.labelKey ? (action.labelKey | translate) : action.label\"\n (onClick)=\"action.actionCallback()\"\n [title]=\"(action.titleKey ? (action.titleKey | translate) : action.title) || (action.labelKey ? (action.labelKey | translate) : action.label)\"\n [disabled]=\"action.disabled ? action.disabled : false\"\n [attr.name]=\"action.icon ? 'ocx-page-header-inline-action-icon-button' : 'ocx-page-header-inline-action-button'\"\n [ariaLabel]=\"(action.titleKey ? (action.titleKey | translate) : action.title) || (action.labelKey ? (action.labelKey | translate) : action.label)\"\n ></p-button>\n </ng-container>\n </div>\n <ng-content select=\"[toolbarItems]\"></ng-content>\n <ng-container>\n <div *ngIf=\"overflowActions.length !== 0\">\n <button\n id=\"pageHeaderMenuButton\"\n type=\"button\"\n pButton\n icon=\"pi pi-ellipsis-v\"\n title=\"{{ 'OCX_PAGE_HEADER.MORE_ACTIONS' | translate }}\"\n class=\"more-actions-menu-button action-button ml-2\"\n (click)=\"menu.toggle($event)\"\n name=\"ocx-page-header-overflow-action-button\"\n [ariaLabel]=\"('OCX_PAGE_HEADER.MORE_ACTIONS' | translate)\"\n ></button>\n <p-menu #menu [popup]=\"true\" [model]=\"overflowActions\" appendTo=\"body\"></p-menu>\n </div>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"additionalToolbarContent\" [ngTemplateOutlet]=\"additionalToolbarContent\"> </ng-container>\n </div>\n </div>\n\n <div\n class=\"object-panel\"\n [ngClass]=\"getObjectPanelLayoutClasses()\"\n >\n <ng-container *ngIf=\"objectDetails\">\n <div\n class=\"object-info\"\n [ngClass]=\"getObjectInfoLayoutClasses()\"\n *ngFor=\"let item of objectDetails\"\n >\n <span\n class=\"flex font-medium text-600 object-info-grid-label\"\n name=\"object-detail-label\"\n [title]=\"item.labelTooltip || ''\"\n >{{ item.label | dynamicPipe:item.labelPipe }}</span\n >\n <span\n *ngIf=\"item.icon || item.value\"\n class=\"object-info-grid-value\"\n [title]=\"item.valueTooltip || item.tooltip || ''\"\n >\n <span\n class=\"flex text-900 align-items-center gap-2 w-max\"\n [ngClass]=\"generateItemStyle(item)\"\n name=\"object-detail-value\"\n >\n <i *ngIf=\"item.icon\" class='{{item.icon + \" \" + (item.iconStyleClass || \"\")}}' name=\"object-detail-icon\"></i>\n {{ item.value | dynamicPipe:item.valuePipe:item.valuePipeArgs}}\n <p-button\n *ngIf=\"item.actionItemIcon && item.actionItemCallback\"\n [icon]=\"item.actionItemIcon\"\n styleClass=\"p-button-text p-0 w-full\"\n [title]=\"item.actionItemTooltip || ''\"\n (onClick)=\"item.actionItemCallback()\"\n ></p-button>\n </span>\n </span>\n </div>\n </ng-container>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host(.p-button-label){font-weight:400}:host ::ng-deep .action-button{padding:.5rem;font-weight:400}.onecx-page-header{display:flex;flex-flow:column;border-radius:.25rem;overflow:hidden;background:#fff;box-shadow:0 2px 2px #0000001a;border:1px solid #cdd0d3}.onecx-page-header .title-bar{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:.5rem;background-color:#f8f9fa;border-top-right-radius:inherit;border-top-left-radius:inherit}.onecx-page-header .title-bar .figure{width:3rem;height:3rem;margin-right:.5rem;position:relative}.onecx-page-header .title-bar .figure .figure-image img{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.onecx-page-header .title-bar .figure .colorblob{background-color:var(--primary-color);position:absolute;inset:0}.onecx-page-header .title-bar .title-wrap{display:flex;flex-flow:row;align-items:center;gap:.25rem}.onecx-page-header .title-bar .title-wrap .header{display:flex;align-items:flex-start;justify-content:center;flex-direction:column}.onecx-page-header .title-bar .title-wrap h1{font-size:1em;font-weight:700;margin:0;padding:0}.onecx-page-header .title-bar .title-wrap h2{font-size:1em;font-weight:400;margin:0;padding:0}.onecx-page-header .title-bar .action-items-wrap{display:flex;height:-moz-fit-content;height:fit-content;gap:.5rem;align-items:center;justify-content:space-between}.onecx-page-header .title-bar .action-items-wrap button{padding:.5rem}.onecx-page-header .object-panel{border-top:1px solid #cdd0d3;padding:1rem}.onecx-page-header .object-panel:empty{display:none!important}.badge-container{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.scale{transform:scale(2)}.object-info-grid-label{flex:1}.object-info-grid-value{flex:3}.min-w-120{min-width:120px!important}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.Breadcrumb, selector: "p-breadcrumb", inputs: ["model", "style", "styleClass", "home", "homeAriaLabel"], outputs: ["onItemClick"] }, { kind: "directive", type: i6.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i6.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i8.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "appendTo", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: i8$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: SrcDirective, selector: "[ocxSrc]", inputs: ["ocxSrc"], outputs: ["error"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: DynamicPipe, name: "dynamicPipe" }], encapsulation: i0.ViewEncapsulation.None });
571
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PageHeaderComponent, decorators: [{
572
- type: Component,
573
- args: [{ selector: 'ocx-page-header', encapsulation: ViewEncapsulation.None, template: "<div class=\"onecx-page-header mb-4\" name=\"ocx-page-header-wrapper\">\n <ng-container *ngIf=\"showBreadcrumbs\">\n <p-breadcrumb\n [model]=\"items\"\n *ngIf=\"breadcrumbs$ | async as items\"\n [home]=\"(home$ | async)?.menuItem ?? {}\"\n [homeAriaLabel]=\"(home$ | async)?.page ? ('OCX_PAGE_HEADER.HOME_ARIA_LABEL' | translate: { page: (home$ | async)?.page}) : ('OCX_PAGE_HEADER.HOME_DEFAULT_ARIA_LABEL' | translate)\"\n [attr.manual]=\"manualBreadcrumbs\"\n ></p-breadcrumb>\n </ng-container>\n <div class=\"title-bar flex flex-row md:justify-content-between p-2 md:p-3\">\n <div class=\"title-wrap\">\n <div class=\"figure flex h-2rem w-2rem md:h-3rem md:w-3rem\" *ngIf=\"showFigure\">\n <div #previewImage class=\"figure-image absolute top-0 left-0 right-0 bottom-0\">\n <ng-content select=\"[figureImage]\"></ng-content>\n <img\n *ngIf=\"figureImage && !figureImageLoadError\"\n [ocxSrc]=\"figureImage\"\n alt=\"Figure image\"\n class=\"w-full\"\n (error)=\"handleImageError()\"\n />\n </div>\n <div\n class=\"colorblob flex-1 border-round\"\n *ngIf=\"previewImage.children.length === 0 || figureImageLoadError\"\n ></div>\n </div>\n <ng-template #skeletonBar>\n <div class=\"header justify-content-evenly\">\n <p-skeleton width=\"10rem\"></p-skeleton>\n <p-skeleton width=\"10rem\"></p-skeleton>\n </div>\n </ng-template>\n <div class=\"header\" *ngIf=\"!loading; else skeletonBar\">\n <h1 id=\"page-header\" *ngIf=\"!!header\">{{ header }}</h1>\n <h2 id=\"page-subheader\" *ngIf=\"!!subheader\">{{ subheader }}</h2>\n </div>\n </div>\n <div class=\"action-items-wrap mt-2 md:mt-0\">\n <ng-container *ngIf=\"additionalToolbarContentLeft\" [ngTemplateOutlet]=\"additionalToolbarContentLeft\">\n </ng-container>\n\n <ng-container *ngIf=\"!disableDefaultActions\"> </ng-container>\n <ng-template #skeletonActions>\n <div class=\"flex\">\n <p-skeleton width=\"5rem\" height=\"2rem\" styleClass=\"mr-2\"></p-skeleton>\n <p-skeleton width=\"2rem\" height=\"2rem\" styleClass=\"mb-2\"></p-skeleton>\n </div>\n </ng-template>\n <ng-container *ngIf=\"!loading; else skeletonActions\">\n <div *ngIf=\"inlineActions && inlineActions.length > 0\" class=\"toolbar flex flex-wrap gap-1 sm:gap-2\">\n <ng-container *ngFor=\"let action of inlineActions\">\n <p-button\n id=\"{{ action.id }}\"\n [icon]=\"action.icon ?? ''\"\n type=\"button\"\n class=\"action-button\"\n [label]=\"action.labelKey ? (action.labelKey | translate) : action.label\"\n (onClick)=\"action.actionCallback()\"\n [title]=\"(action.titleKey ? (action.titleKey | translate) : action.title) || (action.labelKey ? (action.labelKey | translate) : action.label)\"\n [disabled]=\"action.disabled ? action.disabled : false\"\n [attr.name]=\"action.icon ? 'ocx-page-header-inline-action-icon-button' : 'ocx-page-header-inline-action-button'\"\n [ariaLabel]=\"(action.titleKey ? (action.titleKey | translate) : action.title) || (action.labelKey ? (action.labelKey | translate) : action.label)\"\n ></p-button>\n </ng-container>\n </div>\n <ng-content select=\"[toolbarItems]\"></ng-content>\n <ng-container>\n <div *ngIf=\"overflowActions.length !== 0\">\n <button\n id=\"pageHeaderMenuButton\"\n type=\"button\"\n pButton\n icon=\"pi pi-ellipsis-v\"\n title=\"{{ 'OCX_PAGE_HEADER.MORE_ACTIONS' | translate }}\"\n class=\"more-actions-menu-button action-button ml-2\"\n (click)=\"menu.toggle($event)\"\n name=\"ocx-page-header-overflow-action-button\"\n [ariaLabel]=\"('OCX_PAGE_HEADER.MORE_ACTIONS' | translate)\"\n ></button>\n <p-menu #menu [popup]=\"true\" [model]=\"overflowActions\" appendTo=\"body\"></p-menu>\n </div>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"additionalToolbarContent\" [ngTemplateOutlet]=\"additionalToolbarContent\"> </ng-container>\n </div>\n </div>\n\n <div\n class=\"object-panel\"\n [ngClass]=\"getObjectPanelLayoutClasses()\"\n >\n <ng-container *ngIf=\"objectDetails\">\n <div\n class=\"object-info\"\n [ngClass]=\"getObjectInfoLayoutClasses()\"\n *ngFor=\"let item of objectDetails\"\n >\n <span\n class=\"flex font-medium text-600 object-info-grid-label\"\n name=\"object-detail-label\"\n [title]=\"item.labelTooltip || ''\"\n >{{ item.label | dynamicPipe:item.labelPipe }}</span\n >\n <span\n *ngIf=\"item.icon || item.value\"\n class=\"object-info-grid-value\"\n [title]=\"item.valueTooltip || item.tooltip || ''\"\n >\n <span\n class=\"flex text-900 align-items-center gap-2 w-max\"\n [ngClass]=\"generateItemStyle(item)\"\n name=\"object-detail-value\"\n >\n <i *ngIf=\"item.icon\" class='{{item.icon + \" \" + (item.iconStyleClass || \"\")}}' name=\"object-detail-icon\"></i>\n {{ item.value | dynamicPipe:item.valuePipe:item.valuePipeArgs}}\n <p-button\n *ngIf=\"item.actionItemIcon && item.actionItemCallback\"\n [icon]=\"item.actionItemIcon\"\n styleClass=\"p-button-text p-0 w-full\"\n [title]=\"item.actionItemTooltip || ''\"\n (onClick)=\"item.actionItemCallback()\"\n ></p-button>\n </span>\n </span>\n </div>\n </ng-container>\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host(.p-button-label){font-weight:400}:host ::ng-deep .action-button{padding:.5rem;font-weight:400}.onecx-page-header{display:flex;flex-flow:column;border-radius:.25rem;overflow:hidden;background:#fff;box-shadow:0 2px 2px #0000001a;border:1px solid #cdd0d3}.onecx-page-header .title-bar{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:.5rem;background-color:#f8f9fa;border-top-right-radius:inherit;border-top-left-radius:inherit}.onecx-page-header .title-bar .figure{width:3rem;height:3rem;margin-right:.5rem;position:relative}.onecx-page-header .title-bar .figure .figure-image img{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.onecx-page-header .title-bar .figure .colorblob{background-color:var(--primary-color);position:absolute;inset:0}.onecx-page-header .title-bar .title-wrap{display:flex;flex-flow:row;align-items:center;gap:.25rem}.onecx-page-header .title-bar .title-wrap .header{display:flex;align-items:flex-start;justify-content:center;flex-direction:column}.onecx-page-header .title-bar .title-wrap h1{font-size:1em;font-weight:700;margin:0;padding:0}.onecx-page-header .title-bar .title-wrap h2{font-size:1em;font-weight:400;margin:0;padding:0}.onecx-page-header .title-bar .action-items-wrap{display:flex;height:-moz-fit-content;height:fit-content;gap:.5rem;align-items:center;justify-content:space-between}.onecx-page-header .title-bar .action-items-wrap button{padding:.5rem}.onecx-page-header .object-panel{border-top:1px solid #cdd0d3;padding:1rem}.onecx-page-header .object-panel:empty{display:none!important}.badge-container{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.scale{transform:scale(2)}.object-info-grid-label{flex:1}.object-info-grid-value{flex:3}.min-w-120{min-width:120px!important}\n"] }]
574
- }], ctorParameters: function () { return [{ type: BreadcrumbService }, { type: i1$1.TranslateService }, { type: i3.AppStateService }, { type: i3.UserService }]; }, propDecorators: { header: [{
575
- type: Input
576
- }], loading: [{
577
- type: Input
578
- }], figureBackground: [{
579
- type: Input
580
- }], showFigure: [{
581
- type: Input
582
- }], figureImage: [{
583
- type: Input
584
- }], disableDefaultActions: [{
585
- type: Input
586
- }], subheader: [{
587
- type: Input
588
- }], actions: [{
589
- type: Input
590
- }], objectDetails: [{
591
- type: Input
592
- }], showBreadcrumbs: [{
593
- type: Input
594
- }], manualBreadcrumbs: [{
595
- type: Input
596
- }], enableGridView: [{
597
- type: Input
598
- }], gridLayoutDesktopColumns: [{
599
- type: Input
600
- }], save: [{
601
- type: Output
602
- }], additionalToolbarContent: [{
603
- type: ContentChild,
604
- args: ['additionalToolbarContent']
605
- }], additionalToolbarContentLeft: [{
606
- type: ContentChild,
607
- args: ['additionalToolbarContentLeft']
608
- }] } });
609
-
610
- /**
611
- * To trigger the search when Enter key is pressed inside a search parameter field,
612
- * an EventListener for keyup enter event is added for HTML elements which have an input.
613
- * Please add the EventListener yourself manually, if you want to have that functionality for some other elements
614
- * which do not have an input element.
615
- */
616
- class SearchHeaderComponent {
617
- constructor() {
618
- this.header = '';
619
- this.viewMode = 'basic';
620
- this.manualBreadcrumbs = false;
621
- this._actions = [];
622
- this.searched = new EventEmitter();
623
- this.resetted = new EventEmitter();
624
- this.selectedSearchConfigChanged = new EventEmitter();
625
- this.viewModeChanged = new EventEmitter();
626
- this.hasAdvanced = false;
627
- this.headerActions = [];
628
- }
629
- /**
630
- * @deprecated Will be replaced by header
631
- */
632
- get headline() {
633
- return this.header;
634
- }
635
- set headline(value) {
636
- this.header = value;
637
- }
638
- get actions() {
639
- return this._actions;
640
- }
641
- set actions(value) {
642
- this._actions = value;
643
- this.updateHeaderActions();
644
- }
645
- get _additionalToolbarContent() {
646
- return this.additionalToolbarContent;
647
- }
648
- get _additionalToolbarContentLeft() {
649
- return this.additionalToolbarContentLeft;
650
- }
651
- ngAfterViewInit() {
652
- this.addKeyUpEventListener();
653
- }
654
- toggleViewMode() {
655
- var _a;
656
- this.viewMode = this.viewMode === 'basic' ? 'advanced' : 'basic';
657
- (_a = this.viewModeChanged) === null || _a === void 0 ? void 0 : _a.emit(this.viewMode);
658
- this.updateHeaderActions();
659
- setTimeout(() => this.addKeyUpEventListener());
660
- }
661
- onResetClicked() {
662
- this.resetted.emit();
663
- }
664
- onSearchClicked() {
665
- this.searched.emit();
666
- }
667
- updateHeaderActions() {
668
- const headerActions = [];
669
- if (this.hasAdvanced) {
670
- headerActions.push({
671
- id: 'simpleAdvancedButton',
672
- labelKey: this.viewMode === 'basic'
673
- ? 'OCX_SEARCH_HEADER.TOGGLE_BUTTON.ADVANCED.TEXT'
674
- : 'OCX_SEARCH_HEADER.TOGGLE_BUTTON.SIMPLE.TEXT',
675
- actionCallback: () => this.toggleViewMode(),
676
- show: 'always',
677
- titleKey: this.viewMode === 'basic'
678
- ? 'OCX_SEARCH_HEADER.TOGGLE_BUTTON.ADVANCED.DETAIL'
679
- : 'OCX_SEARCH_HEADER.TOGGLE_BUTTON.SIMPLE.DETAIL',
680
- });
681
- }
682
- this.headerActions = headerActions.concat(this.actions);
683
- }
684
- addKeyUpEventListener() {
685
- var _a;
686
- const inputElements = (_a = this.searchParameterFields) === null || _a === void 0 ? void 0 : _a.nativeElement.querySelectorAll('input');
687
- inputElements.forEach((inputElement) => {
688
- if (!inputElement.listenerAdded) {
689
- inputElement.addEventListener('keyup', (event) => this.onSearchKeyup(event));
690
- inputElement.listenerAdded = true;
691
- }
692
- });
693
- }
694
- onSearchKeyup(event) {
695
- if (event.code === 'Enter') {
696
- this.onSearchClicked();
697
- }
698
- }
699
- confirmSearchConfig(searchConfig) {
700
- var _a;
701
- (_a = this.selectedSearchConfigChanged) === null || _a === void 0 ? void 0 : _a.emit(searchConfig);
702
- }
703
- }
704
- SearchHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SearchHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
705
- SearchHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SearchHeaderComponent, selector: "ocx-search-header", inputs: { searchConfigs: "searchConfigs", header: "header", headline: "headline", subheader: "subheader", viewMode: "viewMode", manualBreadcrumbs: "manualBreadcrumbs", actions: "actions" }, outputs: { searched: "searched", resetted: "resetted", selectedSearchConfigChanged: "selectedSearchConfigChanged", viewModeChanged: "viewModeChanged" }, queries: [{ propertyName: "additionalToolbarContent", first: true, predicate: ["additionalToolbarContent"], descendants: true }, { propertyName: "additionalToolbarContentLeft", first: true, predicate: ["additionalToolbarContentLeft"], descendants: true }], viewQueries: [{ propertyName: "searchParameterFields", first: true, predicate: ["searchParameterFields"], descendants: true }], ngImport: i0, template: "<ocx-page-header\n [header]=\"header || ('OCX_SEARCH_HEADER.HEADER' | translate)\"\n [subheader]=\"subheader\"\n [manualBreadcrumbs]=\"manualBreadcrumbs\"\n [actions]=\"headerActions\"\n>\n <ng-template #additionalToolbarContentLeft>\n <ocx-search-config [searchConfigs]=\"searchConfigs\" (selectedSearchConfigChanged)=\"confirmSearchConfig($event)\">\n </ocx-search-config>\n <ng-container *ngIf=\"_additionalToolbarContentLeft\" [ngTemplateOutlet]=\"_additionalToolbarContentLeft\"></ng-container>\n </ng-template>\n <ng-template #additionalToolbarContent>\n <ng-container *ngIf=\"_additionalToolbarContent\" [ngTemplateOutlet]=\"_additionalToolbarContent\"></ng-container>\n </ng-template>\n <div class=\"search-criteria-container\">\n <div #searchParameterFields>\n <ng-content></ng-content>\n <div class=\"search-criteria-buttons\">\n <p-button\n id=\"resetButton\"\n *ngIf=\"resetted.observed\"\n (onClick)=\"onResetClicked()\"\n label=\"{{ 'OCX_SEARCH_HEADER.RESET_BUTTON.TEXT' | translate }}\"\n icon=\"pi pi-eraser\"\n [ariaLabel]=\"'OCX_SEARCH_HEADER.RESET_BUTTON.DETAIL' | translate\"\n title=\"{{ 'OCX_SEARCH_HEADER.RESET_BUTTON.DETAIL' | translate }}\"\n >\n </p-button>\n\n <p-button\n id=\"searchButton\"\n (onClick)=\"onSearchClicked()\"\n label=\"{{ 'OCX_SEARCH_HEADER.SEARCH_BUTTON.TEXT' | translate }}\"\n icon=\"pi pi-search\"\n [ariaLabel]=\"'OCX_SEARCH_HEADER.SEARCH_BUTTON.DETAIL' | translate\"\n title=\"{{ 'OCX_SEARCH_HEADER.SEARCH_BUTTON.DETAIL' | translate }}\"\n >\n </p-button>\n </div>\n </div>\n </div>\n</ocx-page-header>\n", styles: [".search-criteria-buttons{display:flex;flex-flow:row;align-items:flex-start;gap:.5rem;margin-top:.5rem}.search-criteria-container{width:100%;display:flex}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i6.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: SearchConfigComponent, selector: "ocx-search-config", inputs: ["searchConfigs", "placeholderKey"], outputs: ["selectedSearchConfigChanged"] }, { kind: "component", type: PageHeaderComponent, selector: "ocx-page-header", inputs: ["header", "loading", "figureBackground", "showFigure", "figureImage", "disableDefaultActions", "subheader", "actions", "objectDetails", "showBreadcrumbs", "manualBreadcrumbs", "enableGridView", "gridLayoutDesktopColumns"], outputs: ["save"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
706
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SearchHeaderComponent, decorators: [{
707
- type: Component,
708
- args: [{ selector: 'ocx-search-header', template: "<ocx-page-header\n [header]=\"header || ('OCX_SEARCH_HEADER.HEADER' | translate)\"\n [subheader]=\"subheader\"\n [manualBreadcrumbs]=\"manualBreadcrumbs\"\n [actions]=\"headerActions\"\n>\n <ng-template #additionalToolbarContentLeft>\n <ocx-search-config [searchConfigs]=\"searchConfigs\" (selectedSearchConfigChanged)=\"confirmSearchConfig($event)\">\n </ocx-search-config>\n <ng-container *ngIf=\"_additionalToolbarContentLeft\" [ngTemplateOutlet]=\"_additionalToolbarContentLeft\"></ng-container>\n </ng-template>\n <ng-template #additionalToolbarContent>\n <ng-container *ngIf=\"_additionalToolbarContent\" [ngTemplateOutlet]=\"_additionalToolbarContent\"></ng-container>\n </ng-template>\n <div class=\"search-criteria-container\">\n <div #searchParameterFields>\n <ng-content></ng-content>\n <div class=\"search-criteria-buttons\">\n <p-button\n id=\"resetButton\"\n *ngIf=\"resetted.observed\"\n (onClick)=\"onResetClicked()\"\n label=\"{{ 'OCX_SEARCH_HEADER.RESET_BUTTON.TEXT' | translate }}\"\n icon=\"pi pi-eraser\"\n [ariaLabel]=\"'OCX_SEARCH_HEADER.RESET_BUTTON.DETAIL' | translate\"\n title=\"{{ 'OCX_SEARCH_HEADER.RESET_BUTTON.DETAIL' | translate }}\"\n >\n </p-button>\n\n <p-button\n id=\"searchButton\"\n (onClick)=\"onSearchClicked()\"\n label=\"{{ 'OCX_SEARCH_HEADER.SEARCH_BUTTON.TEXT' | translate }}\"\n icon=\"pi pi-search\"\n [ariaLabel]=\"'OCX_SEARCH_HEADER.SEARCH_BUTTON.DETAIL' | translate\"\n title=\"{{ 'OCX_SEARCH_HEADER.SEARCH_BUTTON.DETAIL' | translate }}\"\n >\n </p-button>\n </div>\n </div>\n </div>\n</ocx-page-header>\n", styles: [".search-criteria-buttons{display:flex;flex-flow:row;align-items:flex-start;gap:.5rem;margin-top:.5rem}.search-criteria-container{width:100%;display:flex}\n"] }]
709
- }], propDecorators: { searchConfigs: [{
710
- type: Input
711
- }], header: [{
712
- type: Input
713
- }], headline: [{
714
- type: Input
715
- }], subheader: [{
716
- type: Input
717
- }], viewMode: [{
718
- type: Input
719
- }], manualBreadcrumbs: [{
720
- type: Input
721
- }], actions: [{
722
- type: Input
723
- }], searched: [{
724
- type: Output
725
- }], resetted: [{
726
- type: Output
727
- }], selectedSearchConfigChanged: [{
728
- type: Output
729
- }], viewModeChanged: [{
730
- type: Output
731
- }], additionalToolbarContent: [{
732
- type: ContentChild,
733
- args: ['additionalToolbarContent']
734
- }], additionalToolbarContentLeft: [{
735
- type: ContentChild,
736
- args: ['additionalToolbarContentLeft']
737
- }], searchParameterFields: [{
738
- type: ViewChild,
739
- args: ['searchParameterFields']
740
- }] } });
741
-
742
- class AdvancedDirective {
743
- constructor(viewContainer, templateRef, searchHeader) {
744
- this.viewContainer = viewContainer;
745
- this.templateRef = templateRef;
746
- this.searchHeader = searchHeader;
747
- if (!searchHeader) {
748
- throw 'Advanced directive can only be used inside search header component';
749
- }
750
- searchHeader.hasAdvanced = true;
751
- }
752
- ngDoCheck() {
753
- var _a;
754
- if (((_a = this.searchHeader) === null || _a === void 0 ? void 0 : _a.viewMode) === 'advanced') {
755
- if (this.templateRef && !this.viewContainer.length) {
756
- this.viewContainer.createEmbeddedView(this.templateRef);
757
- }
758
- }
759
- else {
760
- this.viewContainer.clear();
761
- }
762
- }
763
- }
764
- AdvancedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AdvancedDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef, optional: true }, { token: SearchHeaderComponent, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
765
- AdvancedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: AdvancedDirective, selector: "[ocxAdvanced]", ngImport: i0 });
766
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AdvancedDirective, decorators: [{
767
- type: Directive,
768
- args: [{ selector: '[ocxAdvanced]' }]
769
- }], ctorParameters: function () {
770
- return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef, decorators: [{
771
- type: Optional
772
- }] }, { type: SearchHeaderComponent, decorators: [{
773
- type: Optional
774
- }] }];
775
- } });
776
-
777
- class ColumnGroupSelectionComponent {
778
- constructor() {
779
- this.selectedGroupKey$ = new BehaviorSubject('');
780
- this.columns$ = new BehaviorSubject([]);
781
- this.placeholderKey = '';
782
- this.defaultGroupKey = '';
783
- this.customGroupKey = '';
784
- this.groupSelectionChanged = new EventEmitter();
785
- }
786
- get selectedGroupKey() {
787
- return this.selectedGroupKey$.getValue();
788
- }
789
- set selectedGroupKey(value) {
790
- this.selectedGroupKey$.next(value);
791
- }
792
- get columns() {
793
- return this.columns$.getValue();
794
- }
795
- set columns(value) {
796
- this.columns$.next(value);
797
- }
798
- ngOnInit() {
799
- this.allGroupKeys$ = combineLatest([this.columns$, this.selectedGroupKey$]).pipe(map(([columns, selectedGroupKey]) => columns
800
- .map((keys) => keys.predefinedGroupKeys || [])
801
- .flat()
802
- .concat([this.defaultGroupKey])
803
- .concat([selectedGroupKey])
804
- .filter((value) => !!value)
805
- .filter((value, index, self) => self.indexOf(value) === index && value != null)));
806
- }
807
- changeGroupSelection(event) {
808
- if (event.value === this.customGroupKey) {
809
- return;
810
- }
811
- const activeColumns = this.columns.filter((c) => { var _a; return (_a = c.predefinedGroupKeys) === null || _a === void 0 ? void 0 : _a.includes(event.value); });
812
- this.groupSelectionChanged.emit({ activeColumns, groupKey: event.value });
813
- }
814
- clearGroupSelection() {
815
- let activeColumns = this.columns;
816
- if (this.defaultGroupKey) {
817
- activeColumns = this.columns.filter((column) => { var _a; return (_a = column.predefinedGroupKeys) === null || _a === void 0 ? void 0 : _a.includes(this.defaultGroupKey); });
818
- }
819
- this.groupSelectionChanged.emit({ activeColumns, groupKey: this.defaultGroupKey });
820
- }
821
- }
822
- ColumnGroupSelectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ColumnGroupSelectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
823
- ColumnGroupSelectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ColumnGroupSelectionComponent, selector: "ocx-column-group-selection", inputs: { selectedGroupKey: "selectedGroupKey", columns: "columns", placeholderKey: "placeholderKey", defaultGroupKey: "defaultGroupKey", customGroupKey: "customGroupKey" }, outputs: { groupSelectionChanged: "groupSelectionChanged" }, ngImport: i0, template: "<span class=\"p-float-label\">\n <p-dropdown\n id=\"columnGroupSelectionDropdown\"\n *ngIf=\"(allGroupKeys$ | async)?.length\"\n (onClear)=\"clearGroupSelection()\"\n (onChange)=\"changeGroupSelection($event)\"\n [options]=\"(allGroupKeys$ | async) || []\"\n [placeholder]=\"placeholderKey | translate\"\n [showClear]=\"selectedGroupKey !== defaultGroupKey\"\n [(ngModel)]=\"selectedGroupKey\"\n >\n <ng-template let-item pTemplate=\"item\"> {{ item ? (item | translate) : ''}} </ng-template>\n <ng-template let-item pTemplate=\"selectedItem\"> {{ item ? (item | translate) : ''}} </ng-template>\n </p-dropdown>\n <label *ngIf=\"(allGroupKeys$ | async)?.length\" for=\"columnGroupSelectionDropdown\"\n >{{ (\"OCX_CUSTOM_GROUP_COLUMN_SELECTOR.DROPDOWN_LABEL\" | translate) }}</label\n >\n</span>\n", styles: [":host ::ng-deep .p-dropdown{min-width:12rem}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "overlayDirection", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
824
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ColumnGroupSelectionComponent, decorators: [{
825
- type: Component,
826
- args: [{ selector: 'ocx-column-group-selection', template: "<span class=\"p-float-label\">\n <p-dropdown\n id=\"columnGroupSelectionDropdown\"\n *ngIf=\"(allGroupKeys$ | async)?.length\"\n (onClear)=\"clearGroupSelection()\"\n (onChange)=\"changeGroupSelection($event)\"\n [options]=\"(allGroupKeys$ | async) || []\"\n [placeholder]=\"placeholderKey | translate\"\n [showClear]=\"selectedGroupKey !== defaultGroupKey\"\n [(ngModel)]=\"selectedGroupKey\"\n >\n <ng-template let-item pTemplate=\"item\"> {{ item ? (item | translate) : ''}} </ng-template>\n <ng-template let-item pTemplate=\"selectedItem\"> {{ item ? (item | translate) : ''}} </ng-template>\n </p-dropdown>\n <label *ngIf=\"(allGroupKeys$ | async)?.length\" for=\"columnGroupSelectionDropdown\"\n >{{ (\"OCX_CUSTOM_GROUP_COLUMN_SELECTOR.DROPDOWN_LABEL\" | translate) }}</label\n >\n</span>\n", styles: [":host ::ng-deep .p-dropdown{min-width:12rem}\n"] }]
827
- }], propDecorators: { selectedGroupKey: [{
828
- type: Input
829
- }], columns: [{
830
- type: Input
831
- }], placeholderKey: [{
832
- type: Input
833
- }], defaultGroupKey: [{
834
- type: Input
835
- }], customGroupKey: [{
836
- type: Input
837
- }], groupSelectionChanged: [{
838
- type: Output
839
- }] } });
840
-
841
- class CustomGroupColumnSelectorComponent {
842
- constructor(translate) {
843
- this.translate = translate;
844
- this.columns = [];
845
- this.displayedColumns = [];
846
- this.dialogTitle = '';
847
- this.openButtonTitle = '';
848
- this.saveButtonLabel = '';
849
- this.cancelButtonLabel = '';
850
- this.activeColumnsLabel = '';
851
- this.inactiveColumnsLabel = '';
852
- this.frozenActionColumn = false;
853
- this.actionColumnPosition = 'right';
854
- this.columnSelectionChanged = new EventEmitter();
855
- this.actionColumnConfigChanged = new EventEmitter();
856
- this.hiddenColumnsModel = [];
857
- this.displayedColumnsModel = [];
858
- this.frozenActionColumnModel = false;
859
- this.actionColumnPositionModel = 'right';
860
- this.visible = false;
861
- this.alignmentOptions = [
862
- {
863
- label: 'OCX_CUSTOM_GROUP_COLUMN_SELECTOR.CONFIGURE_ACTION_COLUMN.LEFT',
864
- value: 'left',
865
- },
866
- {
867
- label: 'OCX_CUSTOM_GROUP_COLUMN_SELECTOR.CONFIGURE_ACTION_COLUMN.RIGHT',
868
- value: 'right',
869
- },
870
- ];
871
- this.frozenOptions = [
872
- {
873
- label: 'OCX_CUSTOM_GROUP_COLUMN_SELECTOR.CONFIGURE_ACTION_COLUMN.YES',
874
- value: true,
875
- },
876
- {
877
- label: 'OCX_CUSTOM_GROUP_COLUMN_SELECTOR.CONFIGURE_ACTION_COLUMN.NO',
878
- value: false,
879
- },
880
- ];
881
- }
882
- onOpenCustomGroupColumnSelectionDialogClick() {
883
- this.displayedColumnsModel = [...this.displayedColumns];
884
- this.hiddenColumnsModel = this.columns.filter((column) => !this.displayedColumnsModel.map((c) => c.id).includes(column.id));
885
- this.frozenActionColumnModel = this.frozenActionColumn;
886
- this.actionColumnPositionModel = this.actionColumnPosition;
887
- this.visible = true;
888
- }
889
- onSaveClick() {
890
- this.visible = false;
891
- const colIdsBefore = this.displayedColumns.map((column) => column.id);
892
- const colIdsAfter = this.displayedColumnsModel.map((column) => column.id);
893
- if ((!colIdsAfter.every((colId, i) => colId === colIdsBefore[i])) ||
894
- colIdsAfter.length != colIdsBefore.length) {
895
- this.columnSelectionChanged.emit({ activeColumns: [...this.displayedColumnsModel] });
896
- }
897
- if (this.frozenActionColumn != this.frozenActionColumnModel ||
898
- this.actionColumnPosition != this.actionColumnPositionModel) {
899
- this.actionColumnConfigChanged.emit({
900
- frozenActionColumn: this.frozenActionColumnModel,
901
- actionColumnPosition: this.actionColumnPositionModel,
902
- });
903
- }
904
- }
905
- onCancelClick() {
906
- this.visible = false;
907
- }
908
- }
909
- CustomGroupColumnSelectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomGroupColumnSelectorComponent, deps: [{ token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
910
- CustomGroupColumnSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CustomGroupColumnSelectorComponent, selector: "ocx-custom-group-column-selector", inputs: { columns: "columns", displayedColumns: "displayedColumns", dialogTitle: "dialogTitle", openButtonTitle: "openButtonTitle", saveButtonLabel: "saveButtonLabel", cancelButtonLabel: "cancelButtonLabel", activeColumnsLabel: "activeColumnsLabel", inactiveColumnsLabel: "inactiveColumnsLabel", frozenActionColumn: "frozenActionColumn", actionColumnPosition: "actionColumnPosition" }, outputs: { columnSelectionChanged: "columnSelectionChanged", actionColumnConfigChanged: "actionColumnConfigChanged" }, ngImport: i0, template: "<p-button\n id=\"customGroupColumnSelectorButton\"\n type=\"button\"\n (click)=\"onOpenCustomGroupColumnSelectionDialogClick()\"\n [title]=\"openButtonTitle || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.OPEN_BUTTON_DETAIL' | translate)\"\n icon=\"pi pi-cog\"\n styleClass=\"p-button\"\n [ariaLabel]=\"openButtonTitle || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.OPEN_BUTTON_DETAIL' | translate)\"\n></p-button>\n\n<p-dialog header=\"Header\" [(visible)]=\"visible\" [style]=\"{ width: '70%' }\" [modal]=\"true\" [closeAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.CLOSE' | translate)\">\n <ng-template pTemplate=\"header\">\n <span class=\"text-xl font-bold\"\n >{{ dialogTitle || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.DIALOG_TITLE' | translate) }}</span\n >\n </ng-template>\n\n <p-pickList\n [source]=\"displayedColumnsModel\"\n [target]=\"hiddenColumnsModel\"\n [sourceHeader]=\"activeColumnsLabel || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ACTIVE_COLUMNS_LABEL' | translate)\"\n [targetHeader]=\"inactiveColumnsLabel || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.INACTIVE_COLUMNS_LABEL' | translate)\"\n [dragdrop]=\"true\"\n [responsive]=\"false\"\n [sourceStyle]=\"{ height: '300px' }\"\n [targetStyle]=\"{ height: '300px' }\"\n [upButtonAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.UP' | translate)\"\n [topButtonAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.TOP' | translate)\"\n [downButtonAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.DOWN' | translate)\"\n [bottomButtonAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.BOTTOM' | translate)\"\n [rightButtonAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.RIGHT' | translate)\"\n [allRightButtonAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.ALL_RIGHT' | translate)\"\n [leftButtonAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.LEFT' | translate)\"\n [allLeftButtonAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.ALL_LEFT' | translate)\"\n >\n <ng-template let-item pTemplate=\"item\">\n <div>{{ item.nameKey | translate }}</div>\n </ng-template>\n </p-pickList>\n\n <div class=\"pt-4\">\n <p class=\"text-xl font-bold\">{{'OCX_CUSTOM_GROUP_COLUMN_SELECTOR.CONFIGURE_ACTION_COLUMN.TITLE' | translate}}</p>\n <div class=\"flex gap-6 px-3\">\n <div>\n <p class=\"mb-1\">{{'OCX_CUSTOM_GROUP_COLUMN_SELECTOR.CONFIGURE_ACTION_COLUMN.FREEZE' | translate}}</p>\n <p-selectButton\n [options]=\"frozenOptions\"\n [(ngModel)]=\"frozenActionColumnModel\"\n optionLabel=\"label\"\n optionValue=\"value\"\n id=\"frozenActionColumn\"\n name=\"frozen-action-column-select-button\"\n >\n <ng-template let-option pTemplate> {{option.label | translate}} </ng-template>\n </p-selectButton>\n </div>\n <div>\n <p class=\"mb-1\">{{'OCX_CUSTOM_GROUP_COLUMN_SELECTOR.CONFIGURE_ACTION_COLUMN.POSITION' | translate}}</p>\n <p-selectButton\n [options]=\"alignmentOptions\"\n [(ngModel)]=\"actionColumnPositionModel\"\n optionLabel=\"label\"\n optionValue=\"value\"\n id=\"actionColumnPosition\"\n class=\"mt-2\"\n name=\"action-column-position-select-button\"\n >\n <ng-template let-option pTemplate> {{option.label | translate}} </ng-template>\n </p-selectButton>\n </div>\n </div>\n </div>\n\n <ng-template pTemplate=\"footer\">\n <p-button\n id=\"cancelButton\"\n (onClick)=\"onCancelClick()\"\n [label]=\"cancelButtonLabel || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.CANCEL_BUTTON_LABEL' | translate)\"\n styleClass=\"p-button\"\n ></p-button>\n <p-button\n id=\"saveButton\"\n (onClick)=\"onSaveClick()\"\n [label]=\"saveButtonLabel || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.SAVE_BUTTON_LABEL' | translate)\"\n ></p-button>\n </ng-template>\n</p-dialog>\n", styles: ["::ng-deep .p-buttonset .p-button{min-width:auto}::ng-deep .p-buttonset{display:flex}::ng-deep .p-picklist-item.cdk-drag-preview{z-index:2000!important}.p-button{height:100%}\n"], dependencies: [{ kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i4$1.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "component", type: i5$1.PickList, selector: "p-pickList", inputs: ["source", "target", "sourceHeader", "rightButtonAriaLabel", "leftButtonAriaLabel", "allRightButtonAriaLabel", "allLeftButtonAriaLabel", "upButtonAriaLabel", "downButtonAriaLabel", "topButtonAriaLabel", "bottomButtonAriaLabel", "targetHeader", "responsive", "filterBy", "filterLocale", "trackBy", "sourceTrackBy", "targetTrackBy", "showSourceFilter", "showTargetFilter", "metaKeySelection", "dragdrop", "style", "styleClass", "sourceStyle", "targetStyle", "showSourceControls", "showTargetControls", "sourceFilterPlaceholder", "targetFilterPlaceholder", "disabled", "ariaSourceFilterLabel", "ariaTargetFilterLabel", "filterMatchMode", "breakpoint", "stripedRows", "keepSelection"], outputs: ["onMoveToSource", "onMoveAllToSource", "onMoveAllToTarget", "onMoveToTarget", "onSourceReorder", "onTargetReorder", "onSourceSelect", "onTargetSelect", "onSourceFilter", "onTargetFilter"] }, { kind: "component", type: i6$1.SelectButton, selector: "p-selectButton", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "tabindex", "multiple", "style", "styleClass", "ariaLabelledBy", "disabled", "dataKey"], outputs: ["onOptionClick", "onChange"] }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
911
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomGroupColumnSelectorComponent, decorators: [{
912
- type: Component,
913
- args: [{ selector: 'ocx-custom-group-column-selector', template: "<p-button\n id=\"customGroupColumnSelectorButton\"\n type=\"button\"\n (click)=\"onOpenCustomGroupColumnSelectionDialogClick()\"\n [title]=\"openButtonTitle || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.OPEN_BUTTON_DETAIL' | translate)\"\n icon=\"pi pi-cog\"\n styleClass=\"p-button\"\n [ariaLabel]=\"openButtonTitle || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.OPEN_BUTTON_DETAIL' | translate)\"\n></p-button>\n\n<p-dialog header=\"Header\" [(visible)]=\"visible\" [style]=\"{ width: '70%' }\" [modal]=\"true\" [closeAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.CLOSE' | translate)\">\n <ng-template pTemplate=\"header\">\n <span class=\"text-xl font-bold\"\n >{{ dialogTitle || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.DIALOG_TITLE' | translate) }}</span\n >\n </ng-template>\n\n <p-pickList\n [source]=\"displayedColumnsModel\"\n [target]=\"hiddenColumnsModel\"\n [sourceHeader]=\"activeColumnsLabel || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ACTIVE_COLUMNS_LABEL' | translate)\"\n [targetHeader]=\"inactiveColumnsLabel || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.INACTIVE_COLUMNS_LABEL' | translate)\"\n [dragdrop]=\"true\"\n [responsive]=\"false\"\n [sourceStyle]=\"{ height: '300px' }\"\n [targetStyle]=\"{ height: '300px' }\"\n [upButtonAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.UP' | translate)\"\n [topButtonAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.TOP' | translate)\"\n [downButtonAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.DOWN' | translate)\"\n [bottomButtonAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.BOTTOM' | translate)\"\n [rightButtonAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.RIGHT' | translate)\"\n [allRightButtonAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.ALL_RIGHT' | translate)\"\n [leftButtonAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.LEFT' | translate)\"\n [allLeftButtonAriaLabel]=\"('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.ARIA_LABELS.ALL_LEFT' | translate)\"\n >\n <ng-template let-item pTemplate=\"item\">\n <div>{{ item.nameKey | translate }}</div>\n </ng-template>\n </p-pickList>\n\n <div class=\"pt-4\">\n <p class=\"text-xl font-bold\">{{'OCX_CUSTOM_GROUP_COLUMN_SELECTOR.CONFIGURE_ACTION_COLUMN.TITLE' | translate}}</p>\n <div class=\"flex gap-6 px-3\">\n <div>\n <p class=\"mb-1\">{{'OCX_CUSTOM_GROUP_COLUMN_SELECTOR.CONFIGURE_ACTION_COLUMN.FREEZE' | translate}}</p>\n <p-selectButton\n [options]=\"frozenOptions\"\n [(ngModel)]=\"frozenActionColumnModel\"\n optionLabel=\"label\"\n optionValue=\"value\"\n id=\"frozenActionColumn\"\n name=\"frozen-action-column-select-button\"\n >\n <ng-template let-option pTemplate> {{option.label | translate}} </ng-template>\n </p-selectButton>\n </div>\n <div>\n <p class=\"mb-1\">{{'OCX_CUSTOM_GROUP_COLUMN_SELECTOR.CONFIGURE_ACTION_COLUMN.POSITION' | translate}}</p>\n <p-selectButton\n [options]=\"alignmentOptions\"\n [(ngModel)]=\"actionColumnPositionModel\"\n optionLabel=\"label\"\n optionValue=\"value\"\n id=\"actionColumnPosition\"\n class=\"mt-2\"\n name=\"action-column-position-select-button\"\n >\n <ng-template let-option pTemplate> {{option.label | translate}} </ng-template>\n </p-selectButton>\n </div>\n </div>\n </div>\n\n <ng-template pTemplate=\"footer\">\n <p-button\n id=\"cancelButton\"\n (onClick)=\"onCancelClick()\"\n [label]=\"cancelButtonLabel || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.CANCEL_BUTTON_LABEL' | translate)\"\n styleClass=\"p-button\"\n ></p-button>\n <p-button\n id=\"saveButton\"\n (onClick)=\"onSaveClick()\"\n [label]=\"saveButtonLabel || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.SAVE_BUTTON_LABEL' | translate)\"\n ></p-button>\n </ng-template>\n</p-dialog>\n", styles: ["::ng-deep .p-buttonset .p-button{min-width:auto}::ng-deep .p-buttonset{display:flex}::ng-deep .p-picklist-item.cdk-drag-preview{z-index:2000!important}.p-button{height:100%}\n"] }]
914
- }], ctorParameters: function () { return [{ type: i1$1.TranslateService }]; }, propDecorators: { columns: [{
915
- type: Input
916
- }], displayedColumns: [{
917
- type: Input
918
- }], dialogTitle: [{
919
- type: Input
920
- }], openButtonTitle: [{
921
- type: Input
922
- }], saveButtonLabel: [{
923
- type: Input
924
- }], cancelButtonLabel: [{
925
- type: Input
926
- }], activeColumnsLabel: [{
927
- type: Input
928
- }], inactiveColumnsLabel: [{
929
- type: Input
930
- }], frozenActionColumn: [{
931
- type: Input
932
- }], actionColumnPosition: [{
933
- type: Input
934
- }], columnSelectionChanged: [{
935
- type: Output
936
- }], actionColumnConfigChanged: [{
937
- type: Output
938
- }] } });
939
-
940
- const ALL_VIEW_LAYOUTS = [
941
- { icon: PrimeIcons.LIST, layout: 'list', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.LIST' },
942
- { icon: PrimeIcons.TH_LARGE, layout: 'grid', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.GRID' },
943
- { icon: PrimeIcons.TABLE, layout: 'table', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.TABLE' },
944
- ];
945
- class DataLayoutSelectionComponent {
946
- constructor() {
947
- this.supportedViewLayouts = [];
948
- this.dataViewLayoutChange = new EventEmitter();
949
- this.viewingLayouts = [];
950
- }
951
- set layout(value) {
952
- this.selectedViewLayout = this.viewingLayouts.find((v) => v.layout === value);
953
- }
954
- get layout() {
955
- var _a;
956
- return ((_a = this.selectedViewLayout) === null || _a === void 0 ? void 0 : _a.layout) || 'table';
957
- }
958
- ngOnInit() {
959
- this.viewingLayouts = ALL_VIEW_LAYOUTS.filter((vl) => this.supportedViewLayouts.includes(vl.layout));
960
- this.layout = 'table';
961
- }
962
- onDataViewLayoutChange(event) {
963
- this.dataViewLayoutChange.emit(event.layout);
964
- }
965
- }
966
- DataLayoutSelectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataLayoutSelectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
967
- DataLayoutSelectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DataLayoutSelectionComponent, selector: "ocx-data-layout-selection", inputs: { supportedViewLayouts: "supportedViewLayouts", layout: "layout" }, outputs: { dataViewLayoutChange: "dataViewLayoutChange" }, ngImport: i0, template: "<div class=\"flex flex-wrap justify-content-between align-items-center py-1 gap-2\">\n <p-selectButton\n *ngIf=\"viewingLayouts.length > 1\"\n [options]=\"viewingLayouts\"\n [(ngModel)]=\"selectedViewLayout\"\n optionLabel=\"icon\"\n (onChange)=\"onDataViewLayoutChange($event.value)\"\n >\n <ng-template let-item>\n <i [class]=\"item.icon\" [title]=\"item.title || (item.titleKey | translate)\"></i>\n </ng-template>\n </p-selectButton>\n</div>\n", styles: ["::ng-deep .p-buttonset .p-button{min-width:auto}::ng-deep .p-buttonset{display:flex}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.SelectButton, selector: "p-selectButton", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "tabindex", "multiple", "style", "styleClass", "ariaLabelledBy", "disabled", "dataKey"], outputs: ["onOptionClick", "onChange"] }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
968
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataLayoutSelectionComponent, decorators: [{
969
- type: Component,
970
- args: [{ selector: 'ocx-data-layout-selection', template: "<div class=\"flex flex-wrap justify-content-between align-items-center py-1 gap-2\">\n <p-selectButton\n *ngIf=\"viewingLayouts.length > 1\"\n [options]=\"viewingLayouts\"\n [(ngModel)]=\"selectedViewLayout\"\n optionLabel=\"icon\"\n (onChange)=\"onDataViewLayoutChange($event.value)\"\n >\n <ng-template let-item>\n <i [class]=\"item.icon\" [title]=\"item.title || (item.titleKey | translate)\"></i>\n </ng-template>\n </p-selectButton>\n</div>\n", styles: ["::ng-deep .p-buttonset .p-button{min-width:auto}::ng-deep .p-buttonset{display:flex}\n"] }]
971
- }], propDecorators: { supportedViewLayouts: [{
972
- type: Input
973
- }], layout: [{
974
- type: Input
975
- }], dataViewLayoutChange: [{
976
- type: Output
977
- }] } });
978
-
979
- class ObjectUtils {
980
- static resolveFieldData(data, field) {
981
- if (data && field) {
982
- if (this.isFunction(field)) {
983
- return field(data);
984
- }
985
- else if (field.indexOf('.') == -1) {
986
- return data[field];
987
- }
988
- else {
989
- const fields = field.split('.');
990
- let value = data;
991
- for (let i = 0, len = fields.length; i < len; ++i) {
992
- if (value == null) {
993
- return null;
994
- }
995
- value = value[fields[i]];
996
- }
997
- return value;
998
- }
999
- }
1000
- else {
1001
- return null;
1002
- }
1003
- }
1004
- static isFunction(obj) {
1005
- return !!(obj && obj.constructor && obj.call && obj.apply);
1006
- }
1007
- }
1008
-
1009
- function flattenObject(ob) {
1010
- const toReturn = {};
1011
- for (const i in ob) {
1012
- if (!Object.prototype.hasOwnProperty.call(ob, i))
1013
- continue;
1014
- if (!!ob[i] && typeof ob[i] == 'object' && !(ob[i] instanceof Date) && !Array.isArray(ob[i])) {
1015
- const flatObject = flattenObject(ob[i]);
1016
- for (const x in flatObject) {
1017
- if (!Object.prototype.hasOwnProperty.call(flatObject, x))
1018
- continue;
1019
- toReturn[i + '.' + x] = flatObject[x];
1020
- }
1021
- }
1022
- else {
1023
- toReturn[i] = ob[i];
1024
- }
1025
- }
1026
- return toReturn;
1027
- }
1028
-
1029
- var ColumnType;
1030
- (function (ColumnType) {
1031
- ColumnType["STRING"] = "STRING";
1032
- ColumnType["NUMBER"] = "NUMBER";
1033
- ColumnType["DATE"] = "DATE";
1034
- ColumnType["RELATIVE_DATE"] = "RELATIVE_DATE";
1035
- ColumnType["TRANSLATION_KEY"] = "TRANSLATION_KEY";
1036
- ColumnType["CUSTOM"] = "CUSTOM";
1037
- })(ColumnType || (ColumnType = {}));
1038
-
1039
- class DataSortBase {
1040
- constructor(locale, translateService) {
1041
- this.locale = locale;
1042
- this.translateService = translateService;
1043
- }
1044
- translateItems([items, filters, sortColumn, sortDirection], columns, clientSideFiltering, clientSideSorting) {
1045
- if (clientSideFiltering || clientSideSorting) {
1046
- let translationKeys = [];
1047
- const translatedColumns = columns.filter((c) => c.columnType === ColumnType.TRANSLATION_KEY);
1048
- translatedColumns.forEach((c) => {
1049
- translationKeys = [...translationKeys, ...items.map((i) => { var _a; return (_a = ObjectUtils.resolveFieldData(i, c.id)) === null || _a === void 0 ? void 0 : _a.toString(); })];
1050
- });
1051
- if (translationKeys.length) {
1052
- return this.translateService.get(translationKeys).pipe(map((translatedValues) => {
1053
- const translations = {};
1054
- translatedColumns.forEach((c) => {
1055
- translations[c.id] = Object.fromEntries(items.map((i) => {
1056
- var _a, _b;
1057
- return [
1058
- ((_a = ObjectUtils.resolveFieldData(i, c.id)) === null || _a === void 0 ? void 0 : _a.toString()) || '',
1059
- translatedValues[(_b = ObjectUtils.resolveFieldData(i, c.id)) === null || _b === void 0 ? void 0 : _b.toString()],
1060
- ];
1061
- }));
1062
- });
1063
- return [items, filters, sortColumn, sortDirection, translations];
1064
- }));
1065
- }
1066
- }
1067
- return of([items, filters, sortColumn, sortDirection, {}]);
1068
- }
1069
- filterItems([items, filters, sortColumn, sortDirection, translations], clientSideFiltering) {
1070
- if (!clientSideFiltering) {
1071
- return [items, filters, sortColumn, sortDirection, translations];
1072
- }
1073
- return [
1074
- items.filter((item) => filters
1075
- .map((filter) => filter.columnId)
1076
- .filter((value, index, self) => self.indexOf(value) === index && value != null)
1077
- .every((filterColumnId) => filters
1078
- .filter((filter) => filter.columnId === filterColumnId)
1079
- .some((filter) => {
1080
- var _a;
1081
- return (((_a = translations[filter.columnId]) === null || _a === void 0 ? void 0 : _a[ObjectUtils.resolveFieldData(item, filter.columnId).toString()]) ||
1082
- ObjectUtils.resolveFieldData(item, filter.columnId)).toString() === filter.value.toString();
1083
- }))),
1084
- filters,
1085
- sortColumn,
1086
- sortDirection,
1087
- translations,
1088
- ];
1089
- }
1090
- sortItems([items, filters, sortColumn, sortDirection, translations], columns, clientSideSorting) {
1091
- var _a;
1092
- if (!clientSideSorting || sortColumn === '') {
1093
- return [items, filters, sortColumn, sortDirection, translations];
1094
- }
1095
- let translatedColValues = Object.fromEntries(items.map((i) => {
1096
- var _a, _b;
1097
- return [
1098
- (_a = ObjectUtils.resolveFieldData(i, sortColumn)) === null || _a === void 0 ? void 0 : _a.toString(),
1099
- (_b = ObjectUtils.resolveFieldData(i, sortColumn)) === null || _b === void 0 ? void 0 : _b.toString(),
1100
- ];
1101
- }));
1102
- if (((_a = columns.find((h) => h.id === sortColumn)) === null || _a === void 0 ? void 0 : _a.columnType) === ColumnType.TRANSLATION_KEY) {
1103
- translatedColValues = translations[sortColumn];
1104
- }
1105
- return [
1106
- [...items].sort(this.createCompareFunction(translatedColValues, sortColumn, sortDirection)),
1107
- filters,
1108
- sortColumn,
1109
- sortDirection,
1110
- translations,
1111
- ];
1112
- }
1113
- flattenItems(items) {
1114
- return items.map((i) => flattenObject(i));
1115
- }
1116
- createCompareFunction(translatedColValues, sortColumn, sortDirection) {
1117
- let direction = 0;
1118
- if (sortDirection === "ASCENDING" /* DataSortDirection.ASCENDING */) {
1119
- direction = 1;
1120
- }
1121
- else if (sortDirection === "DESCENDING" /* DataSortDirection.DESCENDING */) {
1122
- direction = -1;
1123
- }
1124
- return (data1, data2) => {
1125
- if (direction === 0) {
1126
- return 0;
1127
- }
1128
- let result;
1129
- const value1 = translatedColValues[ObjectUtils.resolveFieldData(data1, sortColumn)];
1130
- const value2 = translatedColValues[ObjectUtils.resolveFieldData(data2, sortColumn)];
1131
- if (value1 == null && value2 != null)
1132
- result = -1;
1133
- else if (value1 != null && value2 == null)
1134
- result = 1;
1135
- else if (value1 == null && value2 == null)
1136
- result = 0;
1137
- else if (typeof value1 === 'string' && typeof value2 === 'string')
1138
- result = value1.localeCompare(value2, [this.locale, 'en', 'de'], { numeric: true });
1139
- else {
1140
- if (value1 < value2) {
1141
- result = -1;
1142
- }
1143
- else if (value1 > value2) {
1144
- result = 1;
1145
- }
1146
- else {
1147
- result = 0;
1148
- }
1149
- }
1150
- return direction * result;
1151
- };
1152
- }
1153
- }
1154
-
1155
- class DataListGridComponent extends DataSortBase {
1156
- get pageSizes() {
1157
- return this._pageSizes$.getValue();
1158
- }
1159
- set pageSizes(value) {
1160
- this._pageSizes$.next(value);
1161
- }
1162
- get pageSize() {
1163
- return this._pageSize$.getValue();
1164
- }
1165
- set pageSize(value) {
1166
- this._pageSize$.next(value);
1167
- }
1168
- get totalRecordsOnServer() {
1169
- return this.params['totalRecordsOnServer'] ? Number(this.params['totalRecordsOnServer']) : undefined;
1170
- }
1171
- set totalRecordsOnServer(value) {
1172
- var _a;
1173
- this.params['totalRecordsOnServer'] = (_a = value === null || value === void 0 ? void 0 : value.toString()) !== null && _a !== void 0 ? _a : '0';
1174
- }
1175
- get data() {
1176
- return this._data$.getValue();
1177
- }
1178
- set data(value) {
1179
- this._originalData = [...value];
1180
- this._data$.next([...value]);
1181
- }
1182
- get filters() {
1183
- return this._filters$.getValue();
1184
- }
1185
- set filters(value) {
1186
- this._filters$.next(value);
1187
- }
1188
- get sortDirection() {
1189
- return this._sortDirection$.getValue();
1190
- }
1191
- set sortDirection(value) {
1192
- if (value === "NONE" /* DataSortDirection.NONE */) {
1193
- this._data$.next([...this._originalData]);
1194
- }
1195
- this._sortDirection$.next(value);
1196
- }
1197
- get sortField() {
1198
- return this === null || this === void 0 ? void 0 : this._sortField$.getValue();
1199
- }
1200
- set sortField(value) {
1201
- this._sortField$.next(value);
1202
- }
1203
- get _gridItemSubtitleLines() {
1204
- return this.gridItemSubtitleLinesTemplate || this.gridItemSubtitleLinesChildTemplate;
1205
- }
1206
- get _listItemSubtitleLines() {
1207
- return this.listItemSubtitleLinesTemplate || this.listItemSubtitleLinesChildTemplate;
1208
- }
1209
- get _listItem() {
1210
- return this.listItemTemplate || this.listItemChildTemplate;
1211
- }
1212
- get _gridItem() {
1213
- return this.gridItemTemplate || this.gridItemChildTemplate;
1214
- }
1215
- get additionalActions() {
1216
- return this._additionalActions;
1217
- }
1218
- set additionalActions(value) {
1219
- this._additionalActions = value;
1220
- this.updateGridMenuItems();
1221
- this.additionalListActions = value.filter((action) => !action.showAsOverflow);
1222
- this.additionalListOverflowActions = value.filter((action) => action.showAsOverflow);
1223
- }
1224
- get viewItemObserved() {
1225
- const dv = this.injector.get('DataViewComponent', null);
1226
- return (dv === null || dv === void 0 ? void 0 : dv.viewItemObserved) || (dv === null || dv === void 0 ? void 0 : dv.viewItem.observed) || this.viewItem.observed;
1227
- }
1228
- get editItemObserved() {
1229
- const dv = this.injector.get('DataViewComponent', null);
1230
- return (dv === null || dv === void 0 ? void 0 : dv.editItemObserved) || (dv === null || dv === void 0 ? void 0 : dv.editItem.observed) || this.editItem.observed;
1231
- }
1232
- get deleteItemObserved() {
1233
- const dv = this.injector.get('DataViewComponent', null);
1234
- return (dv === null || dv === void 0 ? void 0 : dv.deleteItemObserved) || (dv === null || dv === void 0 ? void 0 : dv.deleteItem.observed) || this.deleteItem.observed;
1235
- }
1236
- get sortDirectionNumber() {
1237
- if (this.sortDirection === "ASCENDING" /* DataSortDirection.ASCENDING */)
1238
- return 1;
1239
- if (this.sortDirection === "DESCENDING" /* DataSortDirection.DESCENDING */)
1240
- return -1;
1241
- return 0;
1242
- }
1243
- constructor(locale, translateService, userService, router, injector, appStateService) {
1244
- super(locale, translateService);
1245
- this.userService = userService;
1246
- this.router = router;
1247
- this.injector = injector;
1248
- this.appStateService = appStateService;
1249
- this.subtitleLineIds = [];
1250
- this.clientSideSorting = true;
1251
- this.clientSideFiltering = true;
1252
- this.sortStates = [];
1253
- this._pageSizes$ = new BehaviorSubject([10, 25, 50]);
1254
- this._pageSize$ = new BehaviorSubject(undefined);
1255
- this.fallbackImage = 'placeholder.png';
1256
- this.layout = 'grid';
1257
- this.paginator = true;
1258
- this.page = 0;
1259
- this.columns = [];
1260
- this.name = '';
1261
- this.currentPageShowingKey = 'OCX_DATA_TABLE.SHOWING';
1262
- this.currentPageShowingWithTotalOnServerKey = 'OCX_DATA_TABLE.SHOWING_WITH_TOTAL_ON_SERVER';
1263
- this.params = {
1264
- currentPage: '{currentPage}',
1265
- totalPages: '{totalPages}',
1266
- rows: '{rows}',
1267
- first: '{first}',
1268
- last: '{last}',
1269
- totalRecords: '{totalRecords}',
1270
- };
1271
- this._data$ = new BehaviorSubject([]);
1272
- this._filters$ = new BehaviorSubject([]);
1273
- this._originalData = [];
1274
- this._sortDirection$ = new BehaviorSubject("NONE" /* DataSortDirection.NONE */);
1275
- this._sortField$ = new BehaviorSubject('');
1276
- this.additionalListActions = [];
1277
- this.additionalListOverflowActions = [];
1278
- this._additionalActions = [];
1279
- this.viewItem = new EventEmitter();
1280
- this.editItem = new EventEmitter();
1281
- this.deleteItem = new EventEmitter();
1282
- this.pageChanged = new EventEmitter();
1283
- this.showMenu = false;
1284
- this.gridMenuItems = [];
1285
- this.observedOutputs = 0;
1286
- this.name = this.name || this.router.url.replace(/[^A-Za-z0-9]/, '_');
1287
- this.fallbackImagePath$ = this.appStateService.currentMfe$.pipe(map((currentMfe) => this.getFallbackImagePath(currentMfe)));
1288
- this.displayedPageSizes$ = combineLatest([this._pageSizes$, this.translateService.get('OCX_DATA_TABLE.ALL')]).pipe(map(([pageSizes, translation]) => pageSizes.concat({ showAll: translation })));
1289
- this.displayedPageSize$ = combineLatest([this._pageSize$, this._pageSizes$]).pipe(map(([pageSize, pageSizes]) => { var _a; return (_a = pageSize !== null && pageSize !== void 0 ? pageSize : pageSizes.find((val) => typeof val === 'number')) !== null && _a !== void 0 ? _a : 50; }));
1290
- }
1291
- ngDoCheck() {
1292
- const observedOutputs = this.viewItem.observed + this.deleteItem.observed + this.editItem.observed;
1293
- if (this.observedOutputs !== observedOutputs) {
1294
- this.updateGridMenuItems();
1295
- this.observedOutputs = observedOutputs;
1296
- }
1297
- }
1298
- ngOnInit() {
1299
- this.displayedItems$ = combineLatest([this._data$, this._filters$, this._sortField$, this._sortDirection$]).pipe(mergeMap((params) => this.translateItems(params, this.columns, this.clientSideFiltering, this.clientSideSorting)), map((params) => this.filterItems(params, this.clientSideFiltering)), map((params) => this.sortItems(params, this.columns, this.clientSideSorting)), map(([items]) => items));
1300
- this.showMenu =
1301
- (!!this.viewPermission && this.userService.hasPermission(this.viewPermission)) ||
1302
- (!!this.editPermission && this.userService.hasPermission(this.editPermission)) ||
1303
- (!!this.deletePermission && this.userService.hasPermission(this.deletePermission));
1304
- }
1305
- onDeleteRow(element) {
1306
- this.deleteItem.emit(element);
1307
- }
1308
- onViewRow(element) {
1309
- if (!!this.viewPermission && this.userService.hasPermission(this.viewPermission)) {
1310
- this.viewItem.emit(element);
1311
- }
1312
- }
1313
- onEditRow(element) {
1314
- this.editItem.emit(element);
1315
- }
1316
- imgError(item) {
1317
- item.imagePath = '';
1318
- }
1319
- getFallbackImagePath(mfeInfo) {
1320
- return (mfeInfo === null || mfeInfo === void 0 ? void 0 : mfeInfo.remoteBaseUrl)
1321
- ? `${mfeInfo.remoteBaseUrl}/onecx-portal-lib/assets/images/${this.fallbackImage}`
1322
- : `./onecx-portal-lib/assets/images/${this.fallbackImage}`;
1323
- }
1324
- updateGridMenuItems(useSelectedItem = false) {
1325
- let deleteDisabled = false;
1326
- let editDisabled = false;
1327
- let viewDisabled = false;
1328
- let deleteVisible = true;
1329
- let editVisible = true;
1330
- let viewVisible = true;
1331
- if (useSelectedItem && this.selectedItem) {
1332
- viewDisabled =
1333
- !!this.viewActionEnabledField && !this.fieldIsTruthy(this.selectedItem, this.viewActionEnabledField);
1334
- editDisabled =
1335
- !!this.editActionEnabledField && !this.fieldIsTruthy(this.selectedItem, this.editActionEnabledField);
1336
- deleteDisabled =
1337
- !!this.deleteActionEnabledField && !this.fieldIsTruthy(this.selectedItem, this.deleteActionEnabledField);
1338
- viewVisible = !this.viewActionVisibleField || this.fieldIsTruthy(this.selectedItem, this.viewActionVisibleField);
1339
- editVisible = !this.editActionVisibleField || this.fieldIsTruthy(this.selectedItem, this.editActionVisibleField);
1340
- deleteVisible =
1341
- !this.deleteActionVisibleField || this.fieldIsTruthy(this.selectedItem, this.deleteActionVisibleField);
1342
- }
1343
- this.translateService
1344
- .get([
1345
- this.viewMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.VIEW',
1346
- this.editMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.EDIT',
1347
- this.deleteMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.DELETE',
1348
- ...this.additionalActions.map((a) => a.labelKey || ''),
1349
- ])
1350
- .subscribe((translations) => {
1351
- let menuItems = [];
1352
- const automationId = 'data-grid-action-button';
1353
- const automationIdHidden = 'data-grid-action-button-hidden';
1354
- if (this.viewItem.observed && this.userService.hasPermission(this.viewPermission || '')) {
1355
- menuItems.push({
1356
- label: translations[this.viewMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.VIEW'],
1357
- icon: PrimeIcons.EYE,
1358
- command: () => this.viewItem.emit(this.selectedItem),
1359
- disabled: viewDisabled,
1360
- visible: viewVisible,
1361
- automationId: viewVisible ? automationId : automationIdHidden,
1362
- });
1363
- }
1364
- if (this.editItem.observed && this.userService.hasPermission(this.editPermission || '')) {
1365
- menuItems.push({
1366
- label: translations[this.editMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.EDIT'],
1367
- icon: PrimeIcons.PENCIL,
1368
- command: () => this.editItem.emit(this.selectedItem),
1369
- disabled: editDisabled,
1370
- visible: editVisible,
1371
- automationId: editVisible ? automationId : automationIdHidden,
1372
- });
1373
- }
1374
- if (this.deleteItem.observed && this.userService.hasPermission(this.deletePermission || '')) {
1375
- menuItems.push({
1376
- label: translations[this.deleteMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.DELETE'],
1377
- icon: PrimeIcons.TRASH,
1378
- command: () => this.deleteItem.emit(this.selectedItem),
1379
- disabled: deleteDisabled,
1380
- visible: deleteVisible,
1381
- automationId: deleteVisible ? automationId : automationIdHidden,
1382
- });
1383
- }
1384
- menuItems = menuItems.concat(this.additionalActions
1385
- .filter((a) => this.userService.hasPermission(a.permission))
1386
- .map((a) => ({
1387
- label: translations[a.labelKey || ''],
1388
- icon: a.icon,
1389
- styleClass: (a.classes || []).join(' '),
1390
- disabled: a.disabled || (!!a.actionEnabledField && !this.fieldIsTruthy(this.selectedItem, a.actionEnabledField)),
1391
- visible: !a.actionVisibleField || this.fieldIsTruthy(this.selectedItem, a.actionVisibleField),
1392
- command: () => a.callback(this.selectedItem),
1393
- })));
1394
- this.gridMenuItems = menuItems;
1395
- });
1396
- }
1397
- setSelectedItem(item) {
1398
- this.selectedItem = item;
1399
- }
1400
- resolveFieldData(object, key) {
1401
- return ObjectUtils.resolveFieldData(object, key);
1402
- }
1403
- onPageChange(event) {
1404
- const page = event.first / event.rows;
1405
- this.page = page;
1406
- this.pageChanged.emit(page);
1407
- }
1408
- fieldIsTruthy(object, key) {
1409
- return !!this.resolveFieldData(object, key);
1410
- }
1411
- hasVisibleOverflowMenuItems(item) {
1412
- return this.additionalListOverflowActions.some((a) => (!a.actionVisibleField || this.fieldIsTruthy(item, a.actionVisibleField)) &&
1413
- this.userService.hasPermission(a.permission));
1414
- }
1415
- getOverflowMenuItems(item) {
1416
- return this.translateService.get([...this.additionalListOverflowActions.map((a) => a.labelKey || '')]).pipe(map((translations) => {
1417
- return this.additionalListOverflowActions
1418
- .filter((a) => this.userService.hasPermission(a.permission))
1419
- .map((a) => ({
1420
- label: translations[a.labelKey || ''],
1421
- icon: a.icon,
1422
- styleClass: (a.classes || []).join(' '),
1423
- disabled: a.disabled || (!!a.actionEnabledField && !this.fieldIsTruthy(item, a.actionEnabledField)),
1424
- visible: !a.actionVisibleField || this.fieldIsTruthy(item, a.actionVisibleField),
1425
- command: () => a.callback(item),
1426
- }));
1427
- }));
1428
- }
1429
- }
1430
- DataListGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataListGridComponent, deps: [{ token: LOCALE_ID }, { token: i1$1.TranslateService }, { token: i3.UserService }, { token: i1$2.Router }, { token: i0.Injector }, { token: i3.AppStateService }], target: i0.ɵɵFactoryTarget.Component });
1431
- DataListGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DataListGridComponent, selector: "ocx-data-list-grid", inputs: { titleLineId: "titleLineId", subtitleLineIds: "subtitleLineIds", clientSideSorting: "clientSideSorting", clientSideFiltering: "clientSideFiltering", sortStates: "sortStates", pageSizes: "pageSizes", pageSize: "pageSize", emptyResultsMessage: "emptyResultsMessage", fallbackImage: "fallbackImage", layout: "layout", viewPermission: "viewPermission", editPermission: "editPermission", deletePermission: "deletePermission", deleteActionVisibleField: "deleteActionVisibleField", deleteActionEnabledField: "deleteActionEnabledField", viewActionVisibleField: "viewActionVisibleField", viewActionEnabledField: "viewActionEnabledField", editActionVisibleField: "editActionVisibleField", editActionEnabledField: "editActionEnabledField", viewMenuItemKey: "viewMenuItemKey", editMenuItemKey: "editMenuItemKey", deleteMenuItemKey: "deleteMenuItemKey", paginator: "paginator", page: "page", columns: "columns", name: "name", totalRecordsOnServer: "totalRecordsOnServer", currentPageShowingKey: "currentPageShowingKey", currentPageShowingWithTotalOnServerKey: "currentPageShowingWithTotalOnServerKey", data: "data", filters: "filters", sortDirection: "sortDirection", sortField: "sortField", gridItemSubtitleLinesTemplate: "gridItemSubtitleLinesTemplate", listItemSubtitleLinesTemplate: "listItemSubtitleLinesTemplate", listItemTemplate: "listItemTemplate", gridItemTemplate: "gridItemTemplate", additionalActions: "additionalActions" }, outputs: { viewItem: "viewItem", editItem: "editItem", deleteItem: "deleteItem", pageChanged: "pageChanged" }, queries: [{ propertyName: "gridItemSubtitleLinesChildTemplate", first: true, predicate: ["gridItemSubtitleLines"], descendants: true }, { propertyName: "listItemSubtitleLinesChildTemplate", first: true, predicate: ["listItemSubtitleLines"], descendants: true }, { propertyName: "listItemChildTemplate", first: true, predicate: ["listItem"], descendants: true }, { propertyName: "gridItemChildTemplate", first: true, predicate: ["gridItem"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<p-dataView\n *ngIf=\"displayedPageSize$ | async as displayedPageSize\"\n [value]=\"(displayedItems$ | async) ?? []\"\n [paginator]=\"paginator\"\n [first]=\"page * displayedPageSize\"\n (onPage)=\"onPageChange($event)\"\n [rows]=\"displayedPageSize\"\n [layout]=\"layout\"\n [showCurrentPageReport]=\"true\"\n currentPageReportTemplate=\"{{ (totalRecordsOnServer ? currentPageShowingWithTotalOnServerKey : currentPageShowingKey) | translate:params }}\"\n [rowsPerPageOptions]=\"(displayedPageSizes$ | async) ?? []\"\n id=\"dataListGrid_{{name}}\"\n paginatorDropdownAppendTo=\"body\"\n>\n <ng-template #gridItem let-item pTemplate=\"gridItem\">\n <ng-container\n [ngTemplateOutlet]=\"_gridItem ? _gridItem : defaultGridItem\"\n [ngTemplateOutletContext]=\"{$implicit:item}\"\n ></ng-container>\n </ng-template>\n\n <ng-template #listItem let-item pTemplate=\"listItem\">\n <ng-container\n [ngTemplateOutlet]=\"_listItem ? _listItem : defaultListItem\"\n [ngTemplateOutletContext]=\"{$implicit:item}\"\n ></ng-container>\n </ng-template>\n <ng-template pTemplate=\"empty\">\n <span>{{ emptyResultsMessage || (\"OCX_DATA_LIST_GRID.EMPTY_RESULT\" | translate) }}</span>\n </ng-template>\n</p-dataView>\n\n<ng-template #defaultGridItem let-item>\n <div class=\"col-12 lg:col-6 xl:col-4 flex\">\n <div class=\"data-grid-item card flex flex-column justify-content-between w-12 lg:w-11 mb-4 mt-4 align-self-stretch\">\n <div class=\"flex justify-content-center mb-3\">\n <img\n class=\"image\"\n src=\"{{ item.imagePath || (fallbackImagePath$ | async) }}\"\n (error)=\"imgError(item)\"\n alt=\"{{resolveFieldData(item, titleLineId)|| ''}}\"\n />\n </div>\n <div class=\"flex flex-row justify-content-between align-items-center\">\n <div class=\"data-grid-items flex-row\">\n <div class=\"item-name font-medium mr-3 text-2xl\">\n <a [routerLink]=\"\" (click)=\"onViewRow\">{{ resolveFieldData(item, titleLineId) || '' }}</a>\n </div>\n <ng-container\n [ngTemplateOutlet]=\"_gridItemSubtitleLines ? _gridItemSubtitleLines : defaultGridItemSubtitleLines\"\n [ngTemplateOutletContext]=\"{$implicit:item}\"\n ></ng-container>\n </div>\n <div>\n <p-menu #menu [model]=\"gridMenuItems\" [popup]=\"true\" appendTo=\"body\"></p-menu>\n <button\n pButton\n (click)=\"setSelectedItem(item); updateGridMenuItems(true); menu.toggle($event)\"\n icon=\"pi pi-ellipsis-v\"\n [ariaLabel]=\"'OCX_DATA_LIST_GRID.MORE_ACTIONS' | translate\"\n class=\"more-actions-menu-button menu-btn\"\n [attr.name]=\"'data-grid-item-menu-button'\"\n ></button>\n </div>\n </div>\n </div>\n </div>\n</ng-template>\n<ng-template #defaultGridItemSubtitleLines let-item>\n <div *ngFor=\"let subtitleLineId of subtitleLineIds\" class=\"subtitleLine edit-time text-xl my-3\">\n {{ resolveFieldData(item, subtitleLineId) }}\n </div>\n</ng-template>\n<ng-template #defaultListItem let-item>\n <div class=\"col-12\">\n <div class=\"flex flex-1 align-items-center p-3 w-full\">\n <div class=\"data-list-items flex-1\">\n <div class=\"item-name-row flex flex-row justify-content-between\">\n <div class=\"item-name mr-3 text-2xl font-medium\">\n <a [routerLink]=\"\" (click)=\"onViewRow(item)\">{{ resolveFieldData(item, titleLineId) || '' }}</a>\n </div>\n <div class=\"flex flex-column md:flex-row md:justify-content-between\">\n <ng-container *ngIf=\"viewItemObserved && (!viewActionVisibleField || fieldIsTruthy(item, viewActionVisibleField))\">\n <button\n type=\"button\"\n icon=\"pi pi-eye\"\n pButton\n class=\"p-button-rounded p-button-text mb-1 mr-2 viewListItemButton\"\n title=\"{{ (viewMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.VIEW') | translate }}\"\n [attr.aria-label]=\"(viewMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.VIEW') | translate\"\n (click)=\"onViewRow(item)\"\n *ocxIfPermission=\"viewPermission\"\n [disabled]=\"!!viewActionEnabledField && !fieldIsTruthy(item, viewActionEnabledField)\"\n [attr.name]=\"'data-list-action-button'\"\n ></button>\n </ng-container>\n <ng-container *ngIf=\"editItemObserved && (!editActionVisibleField || fieldIsTruthy(item, editActionVisibleField))\">\n <button\n type=\"button\"\n class=\"p-button-rounded p-button-text mb-1 mr-2 editListItemButton\"\n icon=\"pi pi-pencil\"\n pButton\n title=\"{{ (editMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.EDIT') | translate }}\"\n [attr.aria-label]=\"(editMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.EDIT') | translate\"\n (click)=\"onEditRow(item)\"\n *ocxIfPermission=\"editPermission\"\n [disabled]=\"!!editActionEnabledField && !fieldIsTruthy(item, editActionEnabledField)\"\n [attr.name]=\"'data-list-action-button'\"\n ></button>\n </ng-container>\n <ng-container *ngIf=\"deleteItemObserved && (!deleteActionVisibleField || fieldIsTruthy(item, deleteActionVisibleField))\">\n <button\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-text p-button-danger mb-1 mr-2 deleteListItemButton\"\n pButton\n title=\"{{ (deleteMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.DELETE') | translate }}\"\n [attr.aria-label]=\"(deleteMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.DELETE') | translate\"\n (click)=\"onDeleteRow(item)\"\n *ocxIfPermission=\"deletePermission\"\n [disabled]=\"!!deleteActionEnabledField && !fieldIsTruthy(item, deleteActionEnabledField)\"\n [attr.name]=\"'data-list-action-button'\"\n ></button>\n </ng-container>\n <ng-container *ngFor=\"let action of additionalListActions\">\n <ng-container *ngIf=\"(!action.actionVisibleField || fieldIsTruthy(item, action.actionVisibleField))\">\n <button\n *ocxIfPermission=\"action.permission\"\n pButton\n class=\"p-button-rounded p-button-text\"\n [ngClass]=\"action.classes\"\n [icon]=\"action.icon || ''\"\n (click)=\"action.callback(item)\"\n [title]=\"action.labelKey ? (action.labelKey | translate) : ''\"\n [attr.aria-label]=\"action.labelKey ? (action.labelKey | translate) : ''\"\n [disabled]=\"action.disabled || (!!action.actionEnabledField && !fieldIsTruthy(item, action.actionEnabledField))\"\n ></button>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"hasVisibleOverflowMenuItems(item)\">\n <p-menu #menu [model]=\"(getOverflowMenuItems(item) | async) || []\" [popup]=\"true\" appendTo=\"body\"></p-menu>\n <button\n pButton\n class=\"p-button-rounded p-button-text\"\n [icon]=\"'pi pi-ellipsis-v'\"\n (click)=\"menu.toggle($event)\"\n [ariaLabel]=\"'OCX_DATA_TABLE.MORE_ACTIONS' | translate\"\n [title]=\"'OCX_DATA_TABLE.MORE_ACTIONS' | translate\"\n ></button>\n </ng-container>\n </div>\n </div>\n <div class=\"text-base font-light my-1\">\n <ng-container\n [ngTemplateOutlet]=\"_listItemSubtitleLines ? _listItemSubtitleLines : defaultListItemSubtitleLines\"\n [ngTemplateOutletContext]=\"{$implicit:item}\"\n ></ng-container>\n </div>\n </div>\n </div>\n </div>\n</ng-template>\n<ng-template #defaultListItemSubtitleLines let-item=\"$implicit\">\n <div *ngFor=\"let subtitleLineId of subtitleLineIds\" class=\"subtitleLine text-xl my-3\">{{ resolveFieldData(item, subtitleLineId) }}</div>\n</ng-template>\n", styles: [".image{width:100%;height:100%}.menu-btn{color:var(--primary-text-color);background-color:var(--primary-color);border:var(--button-border);border-radius:var(--border-radius);padding:var(--button-padding);cursor:pointer;min-width:4rem}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i6.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i7.DataView, selector: "p-dataView", inputs: ["paginator", "rows", "totalRecords", "pageLinks", "rowsPerPageOptions", "paginatorPosition", "alwaysShowPaginator", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showFirstLastIcon", "showPageLinks", "lazy", "emptyMessage", "style", "styleClass", "gridStyleClass", "trackBy", "filterBy", "filterLocale", "loading", "loadingIcon", "first", "sortField", "sortOrder", "value", "layout"], outputs: ["onLazyLoad", "onPage", "onSort", "onChangeLayout"] }, { kind: "component", type: i8.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "appendTo", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { kind: "directive", type: IfPermissionDirective, selector: "[ocxIfPermission], [ocxIfNotPermission]", inputs: ["ocxIfPermission", "ocxIfNotPermission", "onMissingPermission", "ocxIfPermissionPermissions", "ocxIfNotPermissionPermissions"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
1432
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataListGridComponent, decorators: [{
1433
- type: Component,
1434
- args: [{ selector: 'ocx-data-list-grid', template: "<p-dataView\n *ngIf=\"displayedPageSize$ | async as displayedPageSize\"\n [value]=\"(displayedItems$ | async) ?? []\"\n [paginator]=\"paginator\"\n [first]=\"page * displayedPageSize\"\n (onPage)=\"onPageChange($event)\"\n [rows]=\"displayedPageSize\"\n [layout]=\"layout\"\n [showCurrentPageReport]=\"true\"\n currentPageReportTemplate=\"{{ (totalRecordsOnServer ? currentPageShowingWithTotalOnServerKey : currentPageShowingKey) | translate:params }}\"\n [rowsPerPageOptions]=\"(displayedPageSizes$ | async) ?? []\"\n id=\"dataListGrid_{{name}}\"\n paginatorDropdownAppendTo=\"body\"\n>\n <ng-template #gridItem let-item pTemplate=\"gridItem\">\n <ng-container\n [ngTemplateOutlet]=\"_gridItem ? _gridItem : defaultGridItem\"\n [ngTemplateOutletContext]=\"{$implicit:item}\"\n ></ng-container>\n </ng-template>\n\n <ng-template #listItem let-item pTemplate=\"listItem\">\n <ng-container\n [ngTemplateOutlet]=\"_listItem ? _listItem : defaultListItem\"\n [ngTemplateOutletContext]=\"{$implicit:item}\"\n ></ng-container>\n </ng-template>\n <ng-template pTemplate=\"empty\">\n <span>{{ emptyResultsMessage || (\"OCX_DATA_LIST_GRID.EMPTY_RESULT\" | translate) }}</span>\n </ng-template>\n</p-dataView>\n\n<ng-template #defaultGridItem let-item>\n <div class=\"col-12 lg:col-6 xl:col-4 flex\">\n <div class=\"data-grid-item card flex flex-column justify-content-between w-12 lg:w-11 mb-4 mt-4 align-self-stretch\">\n <div class=\"flex justify-content-center mb-3\">\n <img\n class=\"image\"\n src=\"{{ item.imagePath || (fallbackImagePath$ | async) }}\"\n (error)=\"imgError(item)\"\n alt=\"{{resolveFieldData(item, titleLineId)|| ''}}\"\n />\n </div>\n <div class=\"flex flex-row justify-content-between align-items-center\">\n <div class=\"data-grid-items flex-row\">\n <div class=\"item-name font-medium mr-3 text-2xl\">\n <a [routerLink]=\"\" (click)=\"onViewRow\">{{ resolveFieldData(item, titleLineId) || '' }}</a>\n </div>\n <ng-container\n [ngTemplateOutlet]=\"_gridItemSubtitleLines ? _gridItemSubtitleLines : defaultGridItemSubtitleLines\"\n [ngTemplateOutletContext]=\"{$implicit:item}\"\n ></ng-container>\n </div>\n <div>\n <p-menu #menu [model]=\"gridMenuItems\" [popup]=\"true\" appendTo=\"body\"></p-menu>\n <button\n pButton\n (click)=\"setSelectedItem(item); updateGridMenuItems(true); menu.toggle($event)\"\n icon=\"pi pi-ellipsis-v\"\n [ariaLabel]=\"'OCX_DATA_LIST_GRID.MORE_ACTIONS' | translate\"\n class=\"more-actions-menu-button menu-btn\"\n [attr.name]=\"'data-grid-item-menu-button'\"\n ></button>\n </div>\n </div>\n </div>\n </div>\n</ng-template>\n<ng-template #defaultGridItemSubtitleLines let-item>\n <div *ngFor=\"let subtitleLineId of subtitleLineIds\" class=\"subtitleLine edit-time text-xl my-3\">\n {{ resolveFieldData(item, subtitleLineId) }}\n </div>\n</ng-template>\n<ng-template #defaultListItem let-item>\n <div class=\"col-12\">\n <div class=\"flex flex-1 align-items-center p-3 w-full\">\n <div class=\"data-list-items flex-1\">\n <div class=\"item-name-row flex flex-row justify-content-between\">\n <div class=\"item-name mr-3 text-2xl font-medium\">\n <a [routerLink]=\"\" (click)=\"onViewRow(item)\">{{ resolveFieldData(item, titleLineId) || '' }}</a>\n </div>\n <div class=\"flex flex-column md:flex-row md:justify-content-between\">\n <ng-container *ngIf=\"viewItemObserved && (!viewActionVisibleField || fieldIsTruthy(item, viewActionVisibleField))\">\n <button\n type=\"button\"\n icon=\"pi pi-eye\"\n pButton\n class=\"p-button-rounded p-button-text mb-1 mr-2 viewListItemButton\"\n title=\"{{ (viewMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.VIEW') | translate }}\"\n [attr.aria-label]=\"(viewMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.VIEW') | translate\"\n (click)=\"onViewRow(item)\"\n *ocxIfPermission=\"viewPermission\"\n [disabled]=\"!!viewActionEnabledField && !fieldIsTruthy(item, viewActionEnabledField)\"\n [attr.name]=\"'data-list-action-button'\"\n ></button>\n </ng-container>\n <ng-container *ngIf=\"editItemObserved && (!editActionVisibleField || fieldIsTruthy(item, editActionVisibleField))\">\n <button\n type=\"button\"\n class=\"p-button-rounded p-button-text mb-1 mr-2 editListItemButton\"\n icon=\"pi pi-pencil\"\n pButton\n title=\"{{ (editMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.EDIT') | translate }}\"\n [attr.aria-label]=\"(editMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.EDIT') | translate\"\n (click)=\"onEditRow(item)\"\n *ocxIfPermission=\"editPermission\"\n [disabled]=\"!!editActionEnabledField && !fieldIsTruthy(item, editActionEnabledField)\"\n [attr.name]=\"'data-list-action-button'\"\n ></button>\n </ng-container>\n <ng-container *ngIf=\"deleteItemObserved && (!deleteActionVisibleField || fieldIsTruthy(item, deleteActionVisibleField))\">\n <button\n type=\"button\"\n icon=\"pi pi-trash\"\n class=\"p-button-rounded p-button-text p-button-danger mb-1 mr-2 deleteListItemButton\"\n pButton\n title=\"{{ (deleteMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.DELETE') | translate }}\"\n [attr.aria-label]=\"(deleteMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.DELETE') | translate\"\n (click)=\"onDeleteRow(item)\"\n *ocxIfPermission=\"deletePermission\"\n [disabled]=\"!!deleteActionEnabledField && !fieldIsTruthy(item, deleteActionEnabledField)\"\n [attr.name]=\"'data-list-action-button'\"\n ></button>\n </ng-container>\n <ng-container *ngFor=\"let action of additionalListActions\">\n <ng-container *ngIf=\"(!action.actionVisibleField || fieldIsTruthy(item, action.actionVisibleField))\">\n <button\n *ocxIfPermission=\"action.permission\"\n pButton\n class=\"p-button-rounded p-button-text\"\n [ngClass]=\"action.classes\"\n [icon]=\"action.icon || ''\"\n (click)=\"action.callback(item)\"\n [title]=\"action.labelKey ? (action.labelKey | translate) : ''\"\n [attr.aria-label]=\"action.labelKey ? (action.labelKey | translate) : ''\"\n [disabled]=\"action.disabled || (!!action.actionEnabledField && !fieldIsTruthy(item, action.actionEnabledField))\"\n ></button>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"hasVisibleOverflowMenuItems(item)\">\n <p-menu #menu [model]=\"(getOverflowMenuItems(item) | async) || []\" [popup]=\"true\" appendTo=\"body\"></p-menu>\n <button\n pButton\n class=\"p-button-rounded p-button-text\"\n [icon]=\"'pi pi-ellipsis-v'\"\n (click)=\"menu.toggle($event)\"\n [ariaLabel]=\"'OCX_DATA_TABLE.MORE_ACTIONS' | translate\"\n [title]=\"'OCX_DATA_TABLE.MORE_ACTIONS' | translate\"\n ></button>\n </ng-container>\n </div>\n </div>\n <div class=\"text-base font-light my-1\">\n <ng-container\n [ngTemplateOutlet]=\"_listItemSubtitleLines ? _listItemSubtitleLines : defaultListItemSubtitleLines\"\n [ngTemplateOutletContext]=\"{$implicit:item}\"\n ></ng-container>\n </div>\n </div>\n </div>\n </div>\n</ng-template>\n<ng-template #defaultListItemSubtitleLines let-item=\"$implicit\">\n <div *ngFor=\"let subtitleLineId of subtitleLineIds\" class=\"subtitleLine text-xl my-3\">{{ resolveFieldData(item, subtitleLineId) }}</div>\n</ng-template>\n", styles: [".image{width:100%;height:100%}.menu-btn{color:var(--primary-text-color);background-color:var(--primary-color);border:var(--button-border);border-radius:var(--border-radius);padding:var(--button-padding);cursor:pointer;min-width:4rem}\n"] }]
1435
- }], ctorParameters: function () {
1436
- return [{ type: undefined, decorators: [{
1437
- type: Inject,
1438
- args: [LOCALE_ID]
1439
- }] }, { type: i1$1.TranslateService }, { type: i3.UserService }, { type: i1$2.Router }, { type: i0.Injector }, { type: i3.AppStateService }];
1440
- }, propDecorators: { titleLineId: [{
1441
- type: Input
1442
- }], subtitleLineIds: [{
1443
- type: Input
1444
- }], clientSideSorting: [{
1445
- type: Input
1446
- }], clientSideFiltering: [{
1447
- type: Input
1448
- }], sortStates: [{
1449
- type: Input
1450
- }], pageSizes: [{
1451
- type: Input
1452
- }], pageSize: [{
1453
- type: Input
1454
- }], emptyResultsMessage: [{
1455
- type: Input
1456
- }], fallbackImage: [{
1457
- type: Input
1458
- }], layout: [{
1459
- type: Input
1460
- }], viewPermission: [{
1461
- type: Input
1462
- }], editPermission: [{
1463
- type: Input
1464
- }], deletePermission: [{
1465
- type: Input
1466
- }], deleteActionVisibleField: [{
1467
- type: Input
1468
- }], deleteActionEnabledField: [{
1469
- type: Input
1470
- }], viewActionVisibleField: [{
1471
- type: Input
1472
- }], viewActionEnabledField: [{
1473
- type: Input
1474
- }], editActionVisibleField: [{
1475
- type: Input
1476
- }], editActionEnabledField: [{
1477
- type: Input
1478
- }], viewMenuItemKey: [{
1479
- type: Input
1480
- }], editMenuItemKey: [{
1481
- type: Input
1482
- }], deleteMenuItemKey: [{
1483
- type: Input
1484
- }], paginator: [{
1485
- type: Input
1486
- }], page: [{
1487
- type: Input
1488
- }], columns: [{
1489
- type: Input
1490
- }], name: [{
1491
- type: Input
1492
- }], totalRecordsOnServer: [{
1493
- type: Input
1494
- }], currentPageShowingKey: [{
1495
- type: Input
1496
- }], currentPageShowingWithTotalOnServerKey: [{
1497
- type: Input
1498
- }], data: [{
1499
- type: Input
1500
- }], filters: [{
1501
- type: Input
1502
- }], sortDirection: [{
1503
- type: Input
1504
- }], sortField: [{
1505
- type: Input
1506
- }], gridItemSubtitleLinesTemplate: [{
1507
- type: Input
1508
- }], gridItemSubtitleLinesChildTemplate: [{
1509
- type: ContentChild,
1510
- args: ['gridItemSubtitleLines']
1511
- }], listItemSubtitleLinesTemplate: [{
1512
- type: Input
1513
- }], listItemSubtitleLinesChildTemplate: [{
1514
- type: ContentChild,
1515
- args: ['listItemSubtitleLines']
1516
- }], listItemTemplate: [{
1517
- type: Input
1518
- }], listItemChildTemplate: [{
1519
- type: ContentChild,
1520
- args: ['listItem']
1521
- }], gridItemTemplate: [{
1522
- type: Input
1523
- }], gridItemChildTemplate: [{
1524
- type: ContentChild,
1525
- args: ['gridItem']
1526
- }], additionalActions: [{
1527
- type: Input
1528
- }], viewItem: [{
1529
- type: Output
1530
- }], editItem: [{
1531
- type: Output
1532
- }], deleteItem: [{
1533
- type: Output
1534
- }], pageChanged: [{
1535
- type: Output
1536
- }] } });
1537
-
1538
- class DataListGridSortingComponent {
1539
- constructor() {
1540
- this.columns = [];
1541
- this.sortStates = ["ASCENDING" /* DataSortDirection.ASCENDING */, "DESCENDING" /* DataSortDirection.DESCENDING */];
1542
- this._sortDirection$ = new BehaviorSubject("NONE" /* DataSortDirection.NONE */);
1543
- this._sortField$ = new BehaviorSubject('');
1544
- this.sortChange = new EventEmitter();
1545
- this.sortDirectionChange = new EventEmitter();
1546
- this.columnsChange = new EventEmitter();
1547
- this.dropdownOptions = [];
1548
- }
1549
- get sortDirection() {
1550
- return this._sortDirection$.getValue();
1551
- }
1552
- set sortDirection(value) {
1553
- this._sortDirection$.next(value);
1554
- }
1555
- get sortField() {
1556
- return this === null || this === void 0 ? void 0 : this._sortField$.getValue();
1557
- }
1558
- set sortField(value) {
1559
- this._sortField$.next(value);
1560
- }
1561
- ngOnInit() {
1562
- this.columns.forEach((element) => this.dropdownOptions.push({ columnId: element.id, columnName: element.nameKey }));
1563
- this.selectedSortingOption = this.dropdownOptions.find((e) => e.columnId === (this === null || this === void 0 ? void 0 : this.sortField));
1564
- }
1565
- selectSorting(event) {
1566
- this._sortField$.next(event.value);
1567
- this.sortChange.emit(event.value.columnId);
1568
- }
1569
- sortDirectionChanged() {
1570
- const newSortDirection = this.nextSortDirection();
1571
- this._sortDirection$.next(newSortDirection);
1572
- this.sortDirectionChange.emit(newSortDirection);
1573
- }
1574
- nextSortDirection() {
1575
- return this.sortStates[(this.sortStates.indexOf(this.sortDirection) + 1) % this.sortStates.length];
1576
- }
1577
- sortIcon() {
1578
- switch (this.sortDirection) {
1579
- case "ASCENDING" /* DataSortDirection.ASCENDING */:
1580
- return 'pi-sort-amount-up';
1581
- case "DESCENDING" /* DataSortDirection.DESCENDING */:
1582
- return 'pi-sort-amount-down';
1583
- default:
1584
- return 'pi-sort-alt';
1585
- }
1586
- }
1587
- sortIconTitle() {
1588
- return this.sortDirectionToTitle(this.sortDirection);
1589
- }
1590
- sortDirectionToTitle(sortDirection) {
1591
- switch (sortDirection) {
1592
- case "ASCENDING" /* DataSortDirection.ASCENDING */:
1593
- return 'OCX_LIST_GRID_SORT.TOGGLE_BUTTON.ASCENDING_TITLE';
1594
- case "DESCENDING" /* DataSortDirection.DESCENDING */:
1595
- return 'OCX_LIST_GRID_SORT.TOGGLE_BUTTON.DESCENDING_TITLE';
1596
- default:
1597
- return 'OCX_LIST_GRID_SORT.TOGGLE_BUTTON.DEFAULT_TITLE';
1598
- }
1599
- }
1600
- }
1601
- DataListGridSortingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataListGridSortingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1602
- DataListGridSortingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DataListGridSortingComponent, selector: "ocx-data-list-grid-sorting", inputs: { columns: "columns", sortStates: "sortStates", sortDirection: "sortDirection", sortField: "sortField" }, outputs: { sortChange: "sortChange", sortDirectionChange: "sortDirectionChange", columnsChange: "columnsChange" }, ngImport: i0, template: "<div class=\"flex align-items-center gap-2\">\n <p-dropdown\n id=\"dataListGridSortingDropdown\"\n [(ngModel)]=\"selectedSortingOption\"\n class=\"sort-dropdown\"\n [options]=\"dropdownOptions\"\n [placeholder]=\"('OCX_LIST_GRID_SORT.DROPDOWN.PLACEHOLDER' | translate)\"\n (onChange)=\"selectSorting($event)\"\n [title]=\"('OCX_LIST_GRID_SORT.DROPDOWN.TITLE' | translate)\"\n >\n <ng-template let-item pTemplate=\"item\"> {{ item?.columnName ? (item.columnName | translate) : ''}} </ng-template>\n <ng-template let-item pTemplate=\"selectedItem\">\n {{ item?.columnName ? (item.columnName | translate) : ''}}\n </ng-template></p-dropdown\n >\n <p-button\n id=\"dataListGridSortingButton\"\n icon=\"pi {{sortIcon()}}\"\n styleClass=\"p-button-outlined\"\n (onClick)=\"sortDirectionChanged()\"\n [title]=\"(sortIconTitle() | translate)\"\n [ariaLabel]=\"('OCX_LIST_GRID_SORT.SORTING_BUTTON_ARIA_LABEL' | translate:{direction: (sortDirectionToTitle(nextSortDirection())) | translate})\"\n ></p-button>\n</div>\n", styles: [".pi{border-radius:var(--border-radius);border-width:thin;background:none;cursor:pointer}\n"], dependencies: [{ kind: "component", type: i2.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "overlayDirection", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
1603
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataListGridSortingComponent, decorators: [{
1604
- type: Component,
1605
- args: [{ selector: 'ocx-data-list-grid-sorting', template: "<div class=\"flex align-items-center gap-2\">\n <p-dropdown\n id=\"dataListGridSortingDropdown\"\n [(ngModel)]=\"selectedSortingOption\"\n class=\"sort-dropdown\"\n [options]=\"dropdownOptions\"\n [placeholder]=\"('OCX_LIST_GRID_SORT.DROPDOWN.PLACEHOLDER' | translate)\"\n (onChange)=\"selectSorting($event)\"\n [title]=\"('OCX_LIST_GRID_SORT.DROPDOWN.TITLE' | translate)\"\n >\n <ng-template let-item pTemplate=\"item\"> {{ item?.columnName ? (item.columnName | translate) : ''}} </ng-template>\n <ng-template let-item pTemplate=\"selectedItem\">\n {{ item?.columnName ? (item.columnName | translate) : ''}}\n </ng-template></p-dropdown\n >\n <p-button\n id=\"dataListGridSortingButton\"\n icon=\"pi {{sortIcon()}}\"\n styleClass=\"p-button-outlined\"\n (onClick)=\"sortDirectionChanged()\"\n [title]=\"(sortIconTitle() | translate)\"\n [ariaLabel]=\"('OCX_LIST_GRID_SORT.SORTING_BUTTON_ARIA_LABEL' | translate:{direction: (sortDirectionToTitle(nextSortDirection())) | translate})\"\n ></p-button>\n</div>\n", styles: [".pi{border-radius:var(--border-radius);border-width:thin;background:none;cursor:pointer}\n"] }]
1606
- }], propDecorators: { columns: [{
1607
- type: Input
1608
- }], sortStates: [{
1609
- type: Input
1610
- }], sortDirection: [{
1611
- type: Input
1612
- }], sortField: [{
1613
- type: Input
1614
- }], sortChange: [{
1615
- type: Output
1616
- }], sortDirectionChange: [{
1617
- type: Output
1618
- }], columnsChange: [{
1619
- type: Output
1620
- }] } });
1621
-
1622
- // eslint-disable-next-line @angular-eslint/use-pipe-transform-interface
1623
- class OcxTimeAgoPipe extends TranslatePipe {
1624
- constructor(changeDetectorRef, ngZone, translateService) {
1625
- super(translateService, changeDetectorRef);
1626
- this.changeDetectorRef = changeDetectorRef;
1627
- this.ngZone = ngZone;
1628
- this.translateService = translateService;
1629
- }
1630
- transform(value) {
1631
- this.removeTimer();
1632
- const d = new Date(value);
1633
- const now = new Date();
1634
- const seconds = Math.round(Math.abs((now.getTime() - d.getTime()) / 1000));
1635
- const timeToUpdate = Number.isNaN(seconds) ? 1000 : this.getSecondsUntilUpdate(seconds) * 1000;
1636
- this.timer = this.ngZone.runOutsideAngular(() => {
1637
- if (typeof window !== 'undefined') {
1638
- return window.setTimeout(() => {
1639
- this.ngZone.run(() => this.changeDetectorRef.markForCheck());
1640
- }, timeToUpdate);
1641
- }
1642
- return null;
1643
- });
1644
- const minutes = Math.round(Math.abs(seconds / 60));
1645
- const hours = Math.round(Math.abs(minutes / 60));
1646
- const days = Math.round(Math.abs(hours / 24));
1647
- const months = Math.round(Math.abs(days / 30.416));
1648
- const years = Math.round(Math.abs(days / 365));
1649
- let translationKey = 'UNKNOWN';
1650
- if (Number.isNaN(seconds)) {
1651
- translationKey = 'NAN';
1652
- }
1653
- else if (seconds <= 45) {
1654
- translationKey = 'A_FEW_SECONDS_AGO';
1655
- }
1656
- else if (seconds <= 90) {
1657
- translationKey = 'A_MINUTE_AGO';
1658
- }
1659
- else if (minutes <= 45) {
1660
- translationKey = 'MINUTES_AGO';
1661
- }
1662
- else if (minutes <= 90) {
1663
- translationKey = 'AN_HOUR_AGO';
1664
- }
1665
- else if (hours <= 22) {
1666
- translationKey = 'HOURS_AGO';
1667
- }
1668
- else if (hours <= 36) {
1669
- translationKey = 'A_DAY_AGO';
1670
- }
1671
- else if (days <= 25) {
1672
- translationKey = 'DAYS_AGO';
1673
- }
1674
- else if (days <= 45) {
1675
- translationKey = 'A_MONTH_AGO';
1676
- }
1677
- else if (days <= 345) {
1678
- translationKey = 'MONTHS_AGO';
1679
- }
1680
- else if (days <= 545) {
1681
- translationKey = 'A_YEAR_AGO';
1682
- }
1683
- else {
1684
- translationKey = 'YEARS_AGO';
1685
- }
1686
- return super.transform('OCX_TIMEAGO.' + translationKey, { minutes, hours, days, months, years });
1687
- }
1688
- ngOnDestroy() {
1689
- this.removeTimer();
1690
- super.ngOnDestroy();
1691
- }
1692
- removeTimer() {
1693
- if (this.timer) {
1694
- window.clearTimeout(this.timer);
1695
- this.timer = null;
1696
- }
1697
- }
1698
- getSecondsUntilUpdate(seconds) {
1699
- const min = 60;
1700
- const hr = min * 60;
1701
- const day = hr * 24;
1702
- if (seconds < min) {
1703
- return 2;
1704
- }
1705
- else if (seconds < hr) {
1706
- return 30;
1707
- }
1708
- else if (seconds < day) {
1709
- return 300;
1710
- }
1711
- else {
1712
- return 3600;
1713
- }
1714
- }
1715
- }
1716
- OcxTimeAgoPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: OcxTimeAgoPipe, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Pipe });
1717
- OcxTimeAgoPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: OcxTimeAgoPipe, name: "timeago" });
1718
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: OcxTimeAgoPipe, decorators: [{
1719
- type: Pipe,
1720
- args: [{
1721
- name: 'timeago',
1722
- }]
1723
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i1$1.TranslateService }]; } });
1724
-
1725
- class DataTableComponent extends DataSortBase {
1726
- get rows() {
1727
- return this._rows$.getValue();
1728
- }
1729
- set rows(value) {
1730
- this._rows$.next(value);
1731
- }
1732
- get selectedRows() {
1733
- return this._selection$.getValue();
1734
- }
1735
- set selectedRows(value) {
1736
- this._selection$.next(value);
1737
- }
1738
- get filters() {
1739
- return this._filters$.getValue();
1740
- }
1741
- set filters(value) {
1742
- this._filters$.next(value);
1743
- }
1744
- get sortDirection() {
1745
- return this._sortDirection$.getValue();
1746
- }
1747
- set sortDirection(value) {
1748
- this._sortDirection$.next(value);
1749
- }
1750
- get sortColumn() {
1751
- return this === null || this === void 0 ? void 0 : this._sortColumn$.getValue();
1752
- }
1753
- set sortColumn(value) {
1754
- this === null || this === void 0 ? void 0 : this._sortColumn$.next(value);
1755
- }
1756
- get pageSizes() {
1757
- return this._pageSizes$.getValue();
1758
- }
1759
- set pageSizes(value) {
1760
- this._pageSizes$.next(value);
1761
- }
1762
- get pageSize() {
1763
- return this._pageSize$.getValue();
1764
- }
1765
- set pageSize(value) {
1766
- this._pageSize$.next(value);
1767
- }
1768
- get totalRecordsOnServer() {
1769
- return this.params['totalRecordsOnServer'] ? Number(this.params['totalRecordsOnServer']) : undefined;
1770
- }
1771
- set totalRecordsOnServer(value) {
1772
- var _a;
1773
- this.params['totalRecordsOnServer'] = (_a = value === null || value === void 0 ? void 0 : value.toString()) !== null && _a !== void 0 ? _a : '0';
1774
- }
1775
- get _stringCell() {
1776
- return this.stringCellTemplate || this.stringCellChildTemplate;
1777
- }
1778
- get _numberCell() {
1779
- return this.numberCellTemplate || this.numberCellChildTemplate;
1780
- }
1781
- get _customCell() {
1782
- return this.customCellTemplate || this.customCellChildTemplate;
1783
- }
1784
- get _dateCell() {
1785
- return this.dateCellTemplate || this.dateCellChildTemplate;
1786
- }
1787
- get _relativeDateCell() {
1788
- return this.relativeDateCellTemplate || this.relativeDateCellChildTemplate;
1789
- }
1790
- get _cell() {
1791
- return this.cellTemplate || this.cellChildTemplate;
1792
- }
1793
- get _translationKeyCell() {
1794
- return this.translationKeyCellTemplate || this.translationKeyCellChildTemplate;
1795
- }
1796
- get additionalActions() {
1797
- return this._additionalActions;
1798
- }
1799
- set additionalActions(value) {
1800
- this._additionalActions = value.filter((action) => !action.showAsOverflow);
1801
- this.overflowActions = value.filter((action) => action.showAsOverflow);
1802
- }
1803
- get viewTableRowObserved() {
1804
- const dv = this.injector.get('DataViewComponent', null);
1805
- return (dv === null || dv === void 0 ? void 0 : dv.viewItemObserved) || (dv === null || dv === void 0 ? void 0 : dv.viewItem.observed) || this.viewTableRow.observed;
1806
- }
1807
- get editTableRowObserved() {
1808
- const dv = this.injector.get('DataViewComponent', null);
1809
- return (dv === null || dv === void 0 ? void 0 : dv.editItemObserved) || (dv === null || dv === void 0 ? void 0 : dv.editItem.observed) || this.editTableRow.observed;
1810
- }
1811
- get deleteTableRowObserved() {
1812
- const dv = this.injector.get('DataViewComponent', null);
1813
- return (dv === null || dv === void 0 ? void 0 : dv.deleteItemObserved) || (dv === null || dv === void 0 ? void 0 : dv.deleteItem.observed) || this.deleteTableRow.observed;
1814
- }
1815
- get anyRowActionObserved() {
1816
- return this.viewTableRowObserved || this.editTableRowObserved || this.deleteTableRowObserved;
1817
- }
1818
- get selectionChangedObserved() {
1819
- const dv = this.injector.get('DataViewComponent', null);
1820
- return (dv === null || dv === void 0 ? void 0 : dv.selectionChangedObserved) || (dv === null || dv === void 0 ? void 0 : dv.selectionChanged.observed) || this.selectionChanged.observed;
1821
- }
1822
- constructor(locale, translateService, router, injector, userService) {
1823
- super(locale, translateService);
1824
- this.router = router;
1825
- this.injector = injector;
1826
- this.userService = userService;
1827
- this._rows$ = new BehaviorSubject([]);
1828
- this._selection$ = new BehaviorSubject([]);
1829
- this._filters$ = new BehaviorSubject([]);
1830
- this._sortDirection$ = new BehaviorSubject("NONE" /* DataSortDirection.NONE */);
1831
- this._sortColumn$ = new BehaviorSubject('');
1832
- this.columns = [];
1833
- this.clientSideFiltering = true;
1834
- this.clientSideSorting = true;
1835
- this.sortStates = ["ASCENDING" /* DataSortDirection.ASCENDING */, "DESCENDING" /* DataSortDirection.DESCENDING */];
1836
- this._pageSizes$ = new BehaviorSubject([10, 25, 50]);
1837
- this._pageSize$ = new BehaviorSubject(undefined);
1838
- this.name = '';
1839
- this.paginator = true;
1840
- this.page = 0;
1841
- this.currentPageShowingKey = 'OCX_DATA_TABLE.SHOWING';
1842
- this.currentPageShowingWithTotalOnServerKey = 'OCX_DATA_TABLE.SHOWING_WITH_TOTAL_ON_SERVER';
1843
- this.params = {
1844
- currentPage: '{currentPage}',
1845
- totalPages: '{totalPages}',
1846
- rows: '{rows}',
1847
- first: '{first}',
1848
- last: '{last}',
1849
- totalRecords: '{totalRecords}',
1850
- };
1851
- this._additionalActions = [];
1852
- this.frozenActionColumn = false;
1853
- this.actionColumnPosition = 'right';
1854
- this.filtered = new EventEmitter();
1855
- this.sorted = new EventEmitter();
1856
- this.viewTableRow = new EventEmitter();
1857
- this.editTableRow = new EventEmitter();
1858
- this.deleteTableRow = new EventEmitter();
1859
- this.selectionChanged = new EventEmitter();
1860
- this.pageChanged = new EventEmitter();
1861
- this.currentFilterColumn$ = new BehaviorSubject(null);
1862
- this.overflowActions = [];
1863
- this.name = this.name || this.router.url.replace(/[^A-Za-z0-9]/, '_');
1864
- this.displayedPageSizes$ = combineLatest([this._pageSizes$, this.translateService.get('OCX_DATA_TABLE.ALL')]).pipe(map(([pageSizes, translation]) => pageSizes.concat({ showAll: translation })));
1865
- this.displayedPageSize$ = combineLatest([this._pageSize$, this._pageSizes$]).pipe(map(([pageSize, pageSizes]) => { var _a; return (_a = pageSize !== null && pageSize !== void 0 ? pageSize : pageSizes.find((val) => typeof val === 'number')) !== null && _a !== void 0 ? _a : 50; }));
1866
- }
1867
- ngOnInit() {
1868
- this.displayedRows$ = combineLatest([this._rows$, this._filters$, this._sortColumn$, this._sortDirection$]).pipe(mergeMap((params) => this.translateItems(params, this.columns, this.clientSideFiltering, this.clientSideSorting)), map((params) => this.filterItems(params, this.clientSideFiltering)), map((params) => this.sortItems(params, this.columns, this.clientSideSorting)), map(([rows]) => this.flattenItems(rows)));
1869
- this.currentSelectedFilters$ = combineLatest([this._filters$, this.currentFilterColumn$]).pipe(map(([filters, currentFilterColumn]) => {
1870
- return filters.filter((filter) => filter.columnId === (currentFilterColumn === null || currentFilterColumn === void 0 ? void 0 : currentFilterColumn.id)).map((filter) => filter.value);
1871
- }));
1872
- this.currentFilterOptions$ = combineLatest([this._rows$, this.currentFilterColumn$, this._filters$]).pipe(mergeMap(([rows, currentFilterColumn, filters]) => {
1873
- var _a;
1874
- if (!(currentFilterColumn === null || currentFilterColumn === void 0 ? void 0 : currentFilterColumn.id)) {
1875
- return of([]);
1876
- }
1877
- const currentFilters = filters
1878
- .filter((filter) => filter.columnId === (currentFilterColumn === null || currentFilterColumn === void 0 ? void 0 : currentFilterColumn.id))
1879
- .map((filter) => filter.value);
1880
- const columnValues = rows.map((row) => row[currentFilterColumn === null || currentFilterColumn === void 0 ? void 0 : currentFilterColumn.id]);
1881
- const translateObservable = ((_a = this.columns.find((c) => c.id === (currentFilterColumn === null || currentFilterColumn === void 0 ? void 0 : currentFilterColumn.id))) === null || _a === void 0 ? void 0 : _a.columnType) === ColumnType.TRANSLATION_KEY
1882
- ? this.translateService.get(columnValues)
1883
- : of(Object.fromEntries(columnValues.map((cv) => [cv, cv])));
1884
- return translateObservable.pipe(map((translatedValues) => {
1885
- return Object.values(translatedValues)
1886
- .concat(currentFilters)
1887
- .filter((value, index, self) => self.indexOf(value) === index && value != null)
1888
- .map((filterOption) => ({
1889
- label: filterOption,
1890
- value: filterOption,
1891
- }));
1892
- }));
1893
- }));
1894
- this.filterAmounts$ = this._filters$.pipe(map((filters) => filters
1895
- .map((filter) => filter.columnId)
1896
- .map((columnId) => [columnId, filters.filter((filter) => filter.columnId === columnId).length])), map((amounts) => Object.fromEntries(amounts)));
1897
- this.mapSelectionToRows();
1898
- }
1899
- onSortColumnClick(sortColumn) {
1900
- const newSortDirection = this.columnNextSortDirection(sortColumn);
1901
- this._sortColumn$.next(sortColumn);
1902
- this._sortDirection$.next(newSortDirection);
1903
- this.sorted.emit({ sortColumn: sortColumn, sortDirection: newSortDirection });
1904
- }
1905
- columnNextSortDirection(sortColumn) {
1906
- return sortColumn !== this.sortColumn
1907
- ? this.sortStates[0]
1908
- : this.sortStates[(this.sortStates.indexOf(this.sortDirection) + 1) % this.sortStates.length];
1909
- }
1910
- onDeleteRow(selectedTableRow) {
1911
- this.deleteTableRow.emit(selectedTableRow);
1912
- }
1913
- onViewRow(selectedTableRow) {
1914
- this.viewTableRow.emit(selectedTableRow);
1915
- }
1916
- onEditRow(selectedTableRow) {
1917
- this.editTableRow.emit(selectedTableRow);
1918
- }
1919
- onFilterClick(column) {
1920
- this.currentFilterColumn$.next(column);
1921
- }
1922
- onFilterChange(column, event) {
1923
- const filters = this.filters
1924
- .filter((filter) => filter.columnId !== column.id)
1925
- .concat(event.value.map((value) => ({
1926
- columnId: column.id,
1927
- value,
1928
- })));
1929
- if (this.clientSideFiltering) {
1930
- this.filters = filters;
1931
- }
1932
- this.filtered.emit(filters);
1933
- }
1934
- getSelectedFilters(columnId) {
1935
- return this.filters.filter((filter) => filter.columnId === columnId).map((filter) => filter.value);
1936
- }
1937
- sortIconTitle(sortColumn) {
1938
- return this.sortDirectionToTitle(sortColumn !== this.sortDirection
1939
- ? "NONE" /* DataSortDirection.NONE */
1940
- : this.sortStates[this.sortStates.indexOf(this.sortDirection) % this.sortStates.length]);
1941
- }
1942
- sortDirectionToTitle(sortDirection) {
1943
- switch (sortDirection) {
1944
- case "ASCENDING" /* DataSortDirection.ASCENDING */:
1945
- return 'OCX_DATA_TABLE.TOGGLE_BUTTON.ASCENDING_TITLE';
1946
- case "DESCENDING" /* DataSortDirection.DESCENDING */:
1947
- return 'OCX_DATA_TABLE.TOGGLE_BUTTON.DESCENDING_TITLE';
1948
- default:
1949
- return 'OCX_DATA_TABLE.TOGGLE_BUTTON.DEFAULT_TITLE';
1950
- }
1951
- }
1952
- mapSelectionToRows() {
1953
- this.selectedRows$ = combineLatest([this._selection$, this._rows$]).pipe(map(([selectedRows, rows]) => {
1954
- return selectedRows.map((row) => {
1955
- return rows.find((r) => r.id === row.id);
1956
- });
1957
- }));
1958
- }
1959
- onSelectionChange(event) {
1960
- this.selectionChanged.emit(event);
1961
- }
1962
- onPageChange(event) {
1963
- const page = event.first / event.rows;
1964
- this.page = page;
1965
- this.pageChanged.emit(page);
1966
- }
1967
- fieldIsTruthy(object, key) {
1968
- return !!ObjectUtils.resolveFieldData(object, key);
1969
- }
1970
- hasVisibleOverflowMenuItems(row) {
1971
- return this.overflowActions.some((a) => !a.actionVisibleField || this.fieldIsTruthy(row, a.actionVisibleField));
1972
- }
1973
- getOverflowMenuItems(row) {
1974
- return this.translateService.get([...this.overflowActions.map((a) => a.labelKey || '')]).pipe(map((translations) => {
1975
- return this.overflowActions
1976
- .filter((a) => this.userService.hasPermission(a.permission))
1977
- .map((a) => ({
1978
- label: translations[a.labelKey || ''],
1979
- icon: a.icon,
1980
- styleClass: (a.classes || []).join(' '),
1981
- disabled: a.disabled || (!!a.actionEnabledField && !this.fieldIsTruthy(row, a.actionEnabledField)),
1982
- visible: !a.actionVisibleField || this.fieldIsTruthy(row, a.actionVisibleField),
1983
- command: () => a.callback(row),
1984
- }));
1985
- }));
1986
- }
1987
- }
1988
- DataTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataTableComponent, deps: [{ token: LOCALE_ID }, { token: i1$1.TranslateService }, { token: i1$2.Router }, { token: i0.Injector }, { token: i3.UserService }], target: i0.ɵɵFactoryTarget.Component });
1989
- DataTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DataTableComponent, selector: "ocx-data-table", inputs: { rows: "rows", selectedRows: "selectedRows", filters: "filters", sortDirection: "sortDirection", sortColumn: "sortColumn", columns: "columns", clientSideFiltering: "clientSideFiltering", clientSideSorting: "clientSideSorting", sortStates: "sortStates", pageSizes: "pageSizes", pageSize: "pageSize", emptyResultsMessage: "emptyResultsMessage", name: "name", deletePermission: "deletePermission", viewPermission: "viewPermission", editPermission: "editPermission", deleteActionVisibleField: "deleteActionVisibleField", deleteActionEnabledField: "deleteActionEnabledField", viewActionVisibleField: "viewActionVisibleField", viewActionEnabledField: "viewActionEnabledField", editActionVisibleField: "editActionVisibleField", editActionEnabledField: "editActionEnabledField", paginator: "paginator", page: "page", totalRecordsOnServer: "totalRecordsOnServer", currentPageShowingKey: "currentPageShowingKey", currentPageShowingWithTotalOnServerKey: "currentPageShowingWithTotalOnServerKey", stringCellTemplate: "stringCellTemplate", numberCellTemplate: "numberCellTemplate", customCellTemplate: "customCellTemplate", dateCellTemplate: "dateCellTemplate", relativeDateCellTemplate: "relativeDateCellTemplate", cellTemplate: "cellTemplate", translationKeyCellTemplate: "translationKeyCellTemplate", additionalActions: "additionalActions", frozenActionColumn: "frozenActionColumn", actionColumnPosition: "actionColumnPosition" }, outputs: { filtered: "filtered", sorted: "sorted", viewTableRow: "viewTableRow", editTableRow: "editTableRow", deleteTableRow: "deleteTableRow", selectionChanged: "selectionChanged", pageChanged: "pageChanged" }, queries: [{ propertyName: "stringCellChildTemplate", first: true, predicate: ["stringCell"], descendants: true }, { propertyName: "numberCellChildTemplate", first: true, predicate: ["numberCell"], descendants: true }, { propertyName: "customCellChildTemplate", first: true, predicate: ["customCell"], descendants: true }, { propertyName: "dateCellChildTemplate", first: true, predicate: ["dateCell"], descendants: true }, { propertyName: "relativeDateCellChildTemplate", first: true, predicate: ["relativeDateCell"], descendants: true }, { propertyName: "cellChildTemplate", first: true, predicate: ["cell"], descendants: true }, { propertyName: "translationKeyCellChildTemplate", first: true, predicate: ["translationKeyCell"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #actionColumn let-rowObject=\"localRowObject\">\n <ng-container *ngIf=\"anyRowActionObserved || this.additionalActions.length > 0 || this.overflowActions.length > 0\">\n <td\n class=\"actions\"\n pFrozenColumn\n [frozen]=\"frozenActionColumn\"\n [alignFrozen]=\"actionColumnPosition\"\n [attr.name]=\"actionColumnPosition === 'left' ? 'action-column-left' : 'action-column-right'\"\n [ngClass]=\"(frozenActionColumn && actionColumnPosition === 'left') ? 'border-right-1' : (frozenActionColumn && actionColumnPosition === 'right') ? 'border-left-1' : ''\"\n >\n <div class=\"icon-button-row-wrapper\">\n <ng-container\n *ngIf=\"viewTableRowObserved && (!viewActionVisibleField || fieldIsTruthy(rowObject, viewActionVisibleField))\"\n >\n <button\n *ocxIfPermission=\"viewPermission\"\n [disabled]=\"!!viewActionEnabledField && !fieldIsTruthy(rowObject, viewActionEnabledField)\"\n pButton\n class=\"p-button-rounded p-button-text viewTableRowButton\"\n title=\"{{ 'OCX_DATA_TABLE.ACTIONS.VIEW' | translate }}\"\n [attr.aria-label]=\"'OCX_DATA_TABLE.ACTIONS.VIEW' | translate\"\n icon=\"pi pi-eye\"\n (click)=\"onViewRow(rowObject)\"\n [attr.name]=\"'data-table-action-button'\"\n ></button>\n </ng-container>\n <ng-container\n *ngIf=\"editTableRowObserved && (!editActionVisibleField || fieldIsTruthy(rowObject, editActionVisibleField))\"\n >\n <button\n *ocxIfPermission=\"editPermission\"\n [disabled]=\"!!editActionEnabledField && !fieldIsTruthy(rowObject, editActionEnabledField)\"\n pButton\n class=\"p-button-rounded p-button-text editTableRowButton\"\n title=\"{{ 'OCX_DATA_TABLE.ACTIONS.EDIT' | translate }}\"\n [attr.aria-label]=\"'OCX_DATA_TABLE.ACTIONS.EDIT' | translate\"\n icon=\"pi pi-pencil\"\n (click)=\"onEditRow(rowObject)\"\n [attr.name]=\"'data-table-action-button'\"\n ></button>\n </ng-container>\n <ng-container\n *ngIf=\"deleteTableRowObserved && (!deleteActionVisibleField || fieldIsTruthy(rowObject, deleteActionVisibleField))\"\n >\n <button\n *ocxIfPermission=\"deletePermission\"\n [disabled]=\"!!deleteActionEnabledField && !fieldIsTruthy(rowObject, deleteActionEnabledField)\"\n pButton\n class=\"p-button-rounded p-button-text p-button-danger deleteTableRowButton\"\n title=\"{{ 'OCX_DATA_TABLE.ACTIONS.DELETE' | translate }}\"\n [attr.aria-label]=\"'OCX_DATA_TABLE.ACTIONS.DELETE' | translate\"\n icon=\"pi pi-trash\"\n (click)=\"onDeleteRow(rowObject)\"\n [attr.name]=\"'data-table-action-button'\"\n ></button>\n </ng-container>\n <ng-container *ngFor=\"let action of additionalActions\">\n <ng-container\n *ngIf=\"(!action.actionVisibleField || fieldIsTruthy(rowObject, action.actionVisibleField))\"\n >\n <button\n *ocxIfPermission=\"action.permission\"\n pButton\n class=\"p-button-rounded p-button-text\"\n [ngClass]=\"action.classes\"\n [icon]=\"action.icon || ''\"\n (click)=\"action.callback(rowObject)\"\n [title]=\"action.labelKey ? (action.labelKey | translate) : ''\"\n [attr.aria-label]=\"action.labelKey ? (action.labelKey | translate) : ''\"\n [disabled]=\"action.disabled || (!!action.actionEnabledField && !fieldIsTruthy(rowObject, action.actionEnabledField))\"\n ></button>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"hasVisibleOverflowMenuItems(rowObject)\">\n <p-menu #menu [model]=\"(getOverflowMenuItems(rowObject) | async) || []\" [popup]=\"true\" appendTo=\"body\"></p-menu>\n <button\n pButton\n class=\"p-button-rounded p-button-text\"\n [icon]=\"'pi pi-ellipsis-v'\"\n (click)=\"menu.toggle($event)\"\n [ariaLabel]=\"'OCX_DATA_TABLE.MORE_ACTIONS' | translate\"\n [title]=\"'OCX_DATA_TABLE.MORE_ACTIONS' | translate\"\n ></button>\n </ng-container>\n </div>\n </td>\n </ng-container>\n</ng-template>\n\n<ng-template #actionColumnHeader>\n <ng-container *ngIf=\"anyRowActionObserved || this.additionalActions.length > 0 || this.overflowActions.length > 0\">\n <th\n pFrozenColumn\n [frozen]=\"frozenActionColumn\"\n [alignFrozen]=\"actionColumnPosition\"\n [ngClass]=\"(frozenActionColumn && actionColumnPosition === 'left') ? 'border-right-1' : (frozenActionColumn && actionColumnPosition === 'right') ? 'border-left-1' : ''\"\n [attr.name]=\"actionColumnPosition === 'left' ? 'action-column-header-left' : 'action-column-header-right'\"\n >\n {{ 'OCX_DATA_TABLE.ACTIONS_COLUMN_NAME' | translate }}\n </th>\n </ng-container>\n</ng-template>\n\n<p-table\n *ngIf=\"displayedPageSize$ | async as displayedPageSize\"\n [value]=\"(displayedRows$ | async) ?? []\"\n responsiveLayout=\"scroll\"\n [paginator]=\"paginator\"\n [first]=\"page * displayedPageSize\"\n (onPage)=\"onPageChange($event)\"\n [rows]=\"displayedPageSize\"\n [showCurrentPageReport]=\"true\"\n currentPageReportTemplate=\"{{ (totalRecordsOnServer ? currentPageShowingWithTotalOnServerKey : currentPageShowingKey) | translate:params }}\"\n [rowsPerPageOptions]=\"(displayedPageSizes$ | async) ?? []\"\n id=\"dataTable_{{name}}\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selection]=\"(selectedRows$ | async) ?? []\"\n [scrollable]=\"true\"\n paginatorDropdownAppendTo=\"body\"\n>\n <ng-template pTemplate=\"header\">\n <tr>\n <th style=\"width: 4rem\" scope=\"col\" *ngIf=\"selectionChangedObserved\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <ng-container *ngIf=\"actionColumnPosition === 'left';\">\n <ng-container *ngTemplateOutlet=\"actionColumnHeader\"></ng-container>\n </ng-container>\n <ng-container *ngFor=\"let column of columns\">\n <th *ngIf=\"column.sortable || column.filterable; else simpleHeader\" scope=\"col\">\n <div class=\"table-header-wrapper\">\n <span id=\"{{column.id}}-header-name\">{{ column.nameKey | translate }}</span>\n <span class=\"icon-button-header-wrapper\">\n <button\n *ngIf=\"column.sortable\"\n class=\"pi sortButton\"\n [class.pi-sort-alt]=\"(column?.id === sortColumn && sortDirection === 'NONE') || column?.id !== sortColumn\"\n [class.pi-sort-amount-up]=\"column?.id === sortColumn && sortDirection === 'ASCENDING'\"\n [class.pi-sort-amount-down]=\"column?.id === sortColumn && sortDirection === 'DESCENDING'\"\n (click)=\"onSortColumnClick(column.id)\"\n [title]=\"(sortIconTitle(column.id) | translate)\"\n [attr.aria-label]=\"('OCX_DATA_TABLE.TOGGLE_BUTTON.ARIA_LABEL' | translate: { column: (column.nameKey | translate), direction: (sortDirectionToTitle(columnNextSortDirection(column.id)) | translate)})\"\n ></button>\n <p-multiSelect\n class=\"filterMultiSelect\"\n *ngIf=\"column.filterable\"\n [options]=\"(currentFilterOptions$ | async) || []\"\n [ngModel]=\"(currentSelectedFilters$ | async) || []\"\n [showToggleAll]=\"true\"\n emptyFilterMessage=\"{{ 'OCX_DATA_TABLE.EMPTY_FILTER_MESSAGE' | translate }}\"\n [displaySelectedLabel]=\"false\"\n [resetFilterOnHide]=\"true\"\n (onChange)=\"onFilterChange(column, $event)\"\n placeholder=\"Icon\"\n appendTo=\"body\"\n (onClick)=\"onFilterClick(column)\"\n [title]=\"'OCX_DATA_TABLE.FILTER_TITLE' | translate\"\n [attr.aria-label]=\"('OCX_DATA_TABLE.FILTER_ARIA_LABEL' | translate: { column: column.nameKey | translate})\"\n >\n <ng-template pTemplate=\"selectedItems\" let-value>\n <div\n class=\"pi\"\n [class.pi-filter]=\"!((filterAmounts$ | async) || {})[column.id]\"\n [class.pi-filter-fill]=\"((filterAmounts$ | async) || {})[column.id] > 0\"\n ></div>\n </ng-template>\n <ng-template pTemplate=\"item\" let-value>\n <ng-container [ngSwitch]=\"(currentFilterColumn$ | async)?.columnType\">\n <span *ngSwitchCase=\"'DATE'\">{{ value.label | date }}</span>\n <span *ngSwitchDefault> {{ value.label }} </span>\n </ng-container>\n </ng-template>\n </p-multiSelect>\n </span>\n </div>\n </th>\n <ng-template #simpleHeader>\n <th scope=\"col\">{{ column.nameKey | translate }}</th>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"actionColumnPosition === 'right';\">\n <ng-container *ngTemplateOutlet=\"actionColumnHeader\"></ng-container>\n </ng-container>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowObject>\n <tr>\n <td *ngIf=\"selectionChangedObserved\">\n <p-tableCheckbox [value]=\"rowObject\"></p-tableCheckbox>\n </td>\n <ng-container *ngIf=\"actionColumnPosition === 'left';\">\n <ng-container *ngTemplateOutlet=\"actionColumn; context: {localRowObject: rowObject}\"></ng-container>\n </ng-container>\n <td *ngFor=\"let column of columns\">\n <ng-container\n [ngTemplateOutlet]=\"\n _cell ? _cell: defaultCell\n \"\n [ngTemplateOutletContext]=\"{\n rowObject: rowObject,\n column: column\n }\"\n ></ng-container>\n </td>\n <ng-container *ngIf=\"actionColumnPosition === 'right';\">\n <ng-container *ngTemplateOutlet=\"actionColumn; context: {localRowObject: rowObject}\"></ng-container>\n </ng-container>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\">\n <tr>\n <td [colSpan]=\"columns.length + ((anyRowActionObserved || this.additionalActions.length > 0) ? 1 : 0)\">\n {{ emptyResultsMessage || (\"OCX_DATA_TABLE.EMPTY_RESULT\" | translate) }}\n </td>\n </tr>\n </ng-template>\n</p-table>\n\n<ng-template #defaultCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container [ngSwitch]=\"column.columnType\">\n <ng-container *ngSwitchCase=\"'CUSTOM'\">\n <ng-container\n [ngTemplateOutlet]=\"\n _customCell ? _customCell: defaultCustomCell\n \"\n [ngTemplateOutletContext]=\"{\n rowObject: rowObject,\n column: column\n }\"\n >\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'DATE'\">\n <ng-container\n [ngTemplateOutlet]=\"\n _dateCell ? _dateCell : defaultDateCell\n \"\n [ngTemplateOutletContext]=\"{\n rowObject: rowObject,\n column: column\n }\"\n >\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'RELATIVE_DATE'\">\n <ng-container\n [ngTemplateOutlet]=\"\n _relativeDateCell ? _relativeDateCell : defaultRelativeDateCell\n \"\n [ngTemplateOutletContext]=\"{\n rowObject: rowObject,\n column: column\n }\"\n >\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'TRANSLATION_KEY'\">\n <ng-container\n [ngTemplateOutlet]=\"\n _translationKeyCell ? _translationKeyCell: defaultTranslationKeyCell\n \"\n [ngTemplateOutletContext]=\"{\n rowObject: rowObject,\n column: column\n }\"\n >\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'NUMBER'\">\n <ng-container\n [ngTemplateOutlet]=\"\n _numberCell ? _numberCell: defaultNumberCell\n \"\n [ngTemplateOutletContext]=\"{\n rowObject: rowObject,\n column: column\n }\"\n >\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container\n [ngTemplateOutlet]=\"\n _stringCell ? _stringCell: defaultStringCell\n \"\n [ngTemplateOutletContext]=\"{\n rowObject: rowObject,\n column: column\n }\"\n >\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #defaultStringCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container> {{ rowObject[column.id] }} </ng-container>\n</ng-template>\n\n<ng-template #defaultNumberCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container> {{ rowObject[column.id] | number }} </ng-container>\n</ng-template>\n\n<ng-template #defaultCustomCell let-rowObject=\"rowObject\" let-column=\"column\"> </ng-template>\n\n<ng-template #defaultDateCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container> {{ rowObject[column.id] | date: 'medium' }} </ng-container>\n</ng-template>\n\n<ng-template #defaultRelativeDateCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container> {{ 'OCX_DATA_TABLE.EDITED' | translate }} {{ rowObject[column.id] | timeago }} </ng-container>\n</ng-template>\n\n<ng-template #defaultTranslationKeyCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container> {{ rowObject[column.id] | translate }} </ng-container>\n</ng-template>\n", styles: [":host ::ng-deep .p-multiselect{padding:0;background:#f7f7f7;border:none}:host ::ng-deep .p-multiselect .p-multiselect-container{height:20px;width:20px}:host ::ng-deep .p-multiselect .p-multiselect-trigger{display:none}:host ::ng-deep .p-multiselect .p-multiselect-label.p-placeholder{color:#262626;font-size:.9rem;font-family:Bold,sans-serif;font-weight:700;padding:0}:host ::ng-deep .p-multiselect:focus-within{box-shadow:none;background:#979797}.pi{border:none;background:none;cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i6.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i7$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i7$1.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "component", type: i7$1.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i7$1.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i8.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "appendTo", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: i9.MultiSelect, selector: "p-multiSelect", inputs: ["style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "appendTo", "dataKey", "name", "label", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove"] }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: IfPermissionDirective, selector: "[ocxIfPermission], [ocxIfNotPermission]", inputs: ["ocxIfPermission", "ocxIfNotPermission", "onMissingPermission", "ocxIfPermissionPermissions", "ocxIfNotPermissionPermissions"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.DecimalPipe, name: "number" }, { kind: "pipe", type: i4.DatePipe, name: "date" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: OcxTimeAgoPipe, name: "timeago" }] });
1990
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataTableComponent, decorators: [{
1991
- type: Component,
1992
- args: [{ selector: 'ocx-data-table', template: "<ng-template #actionColumn let-rowObject=\"localRowObject\">\n <ng-container *ngIf=\"anyRowActionObserved || this.additionalActions.length > 0 || this.overflowActions.length > 0\">\n <td\n class=\"actions\"\n pFrozenColumn\n [frozen]=\"frozenActionColumn\"\n [alignFrozen]=\"actionColumnPosition\"\n [attr.name]=\"actionColumnPosition === 'left' ? 'action-column-left' : 'action-column-right'\"\n [ngClass]=\"(frozenActionColumn && actionColumnPosition === 'left') ? 'border-right-1' : (frozenActionColumn && actionColumnPosition === 'right') ? 'border-left-1' : ''\"\n >\n <div class=\"icon-button-row-wrapper\">\n <ng-container\n *ngIf=\"viewTableRowObserved && (!viewActionVisibleField || fieldIsTruthy(rowObject, viewActionVisibleField))\"\n >\n <button\n *ocxIfPermission=\"viewPermission\"\n [disabled]=\"!!viewActionEnabledField && !fieldIsTruthy(rowObject, viewActionEnabledField)\"\n pButton\n class=\"p-button-rounded p-button-text viewTableRowButton\"\n title=\"{{ 'OCX_DATA_TABLE.ACTIONS.VIEW' | translate }}\"\n [attr.aria-label]=\"'OCX_DATA_TABLE.ACTIONS.VIEW' | translate\"\n icon=\"pi pi-eye\"\n (click)=\"onViewRow(rowObject)\"\n [attr.name]=\"'data-table-action-button'\"\n ></button>\n </ng-container>\n <ng-container\n *ngIf=\"editTableRowObserved && (!editActionVisibleField || fieldIsTruthy(rowObject, editActionVisibleField))\"\n >\n <button\n *ocxIfPermission=\"editPermission\"\n [disabled]=\"!!editActionEnabledField && !fieldIsTruthy(rowObject, editActionEnabledField)\"\n pButton\n class=\"p-button-rounded p-button-text editTableRowButton\"\n title=\"{{ 'OCX_DATA_TABLE.ACTIONS.EDIT' | translate }}\"\n [attr.aria-label]=\"'OCX_DATA_TABLE.ACTIONS.EDIT' | translate\"\n icon=\"pi pi-pencil\"\n (click)=\"onEditRow(rowObject)\"\n [attr.name]=\"'data-table-action-button'\"\n ></button>\n </ng-container>\n <ng-container\n *ngIf=\"deleteTableRowObserved && (!deleteActionVisibleField || fieldIsTruthy(rowObject, deleteActionVisibleField))\"\n >\n <button\n *ocxIfPermission=\"deletePermission\"\n [disabled]=\"!!deleteActionEnabledField && !fieldIsTruthy(rowObject, deleteActionEnabledField)\"\n pButton\n class=\"p-button-rounded p-button-text p-button-danger deleteTableRowButton\"\n title=\"{{ 'OCX_DATA_TABLE.ACTIONS.DELETE' | translate }}\"\n [attr.aria-label]=\"'OCX_DATA_TABLE.ACTIONS.DELETE' | translate\"\n icon=\"pi pi-trash\"\n (click)=\"onDeleteRow(rowObject)\"\n [attr.name]=\"'data-table-action-button'\"\n ></button>\n </ng-container>\n <ng-container *ngFor=\"let action of additionalActions\">\n <ng-container\n *ngIf=\"(!action.actionVisibleField || fieldIsTruthy(rowObject, action.actionVisibleField))\"\n >\n <button\n *ocxIfPermission=\"action.permission\"\n pButton\n class=\"p-button-rounded p-button-text\"\n [ngClass]=\"action.classes\"\n [icon]=\"action.icon || ''\"\n (click)=\"action.callback(rowObject)\"\n [title]=\"action.labelKey ? (action.labelKey | translate) : ''\"\n [attr.aria-label]=\"action.labelKey ? (action.labelKey | translate) : ''\"\n [disabled]=\"action.disabled || (!!action.actionEnabledField && !fieldIsTruthy(rowObject, action.actionEnabledField))\"\n ></button>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"hasVisibleOverflowMenuItems(rowObject)\">\n <p-menu #menu [model]=\"(getOverflowMenuItems(rowObject) | async) || []\" [popup]=\"true\" appendTo=\"body\"></p-menu>\n <button\n pButton\n class=\"p-button-rounded p-button-text\"\n [icon]=\"'pi pi-ellipsis-v'\"\n (click)=\"menu.toggle($event)\"\n [ariaLabel]=\"'OCX_DATA_TABLE.MORE_ACTIONS' | translate\"\n [title]=\"'OCX_DATA_TABLE.MORE_ACTIONS' | translate\"\n ></button>\n </ng-container>\n </div>\n </td>\n </ng-container>\n</ng-template>\n\n<ng-template #actionColumnHeader>\n <ng-container *ngIf=\"anyRowActionObserved || this.additionalActions.length > 0 || this.overflowActions.length > 0\">\n <th\n pFrozenColumn\n [frozen]=\"frozenActionColumn\"\n [alignFrozen]=\"actionColumnPosition\"\n [ngClass]=\"(frozenActionColumn && actionColumnPosition === 'left') ? 'border-right-1' : (frozenActionColumn && actionColumnPosition === 'right') ? 'border-left-1' : ''\"\n [attr.name]=\"actionColumnPosition === 'left' ? 'action-column-header-left' : 'action-column-header-right'\"\n >\n {{ 'OCX_DATA_TABLE.ACTIONS_COLUMN_NAME' | translate }}\n </th>\n </ng-container>\n</ng-template>\n\n<p-table\n *ngIf=\"displayedPageSize$ | async as displayedPageSize\"\n [value]=\"(displayedRows$ | async) ?? []\"\n responsiveLayout=\"scroll\"\n [paginator]=\"paginator\"\n [first]=\"page * displayedPageSize\"\n (onPage)=\"onPageChange($event)\"\n [rows]=\"displayedPageSize\"\n [showCurrentPageReport]=\"true\"\n currentPageReportTemplate=\"{{ (totalRecordsOnServer ? currentPageShowingWithTotalOnServerKey : currentPageShowingKey) | translate:params }}\"\n [rowsPerPageOptions]=\"(displayedPageSizes$ | async) ?? []\"\n id=\"dataTable_{{name}}\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selection]=\"(selectedRows$ | async) ?? []\"\n [scrollable]=\"true\"\n paginatorDropdownAppendTo=\"body\"\n>\n <ng-template pTemplate=\"header\">\n <tr>\n <th style=\"width: 4rem\" scope=\"col\" *ngIf=\"selectionChangedObserved\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <ng-container *ngIf=\"actionColumnPosition === 'left';\">\n <ng-container *ngTemplateOutlet=\"actionColumnHeader\"></ng-container>\n </ng-container>\n <ng-container *ngFor=\"let column of columns\">\n <th *ngIf=\"column.sortable || column.filterable; else simpleHeader\" scope=\"col\">\n <div class=\"table-header-wrapper\">\n <span id=\"{{column.id}}-header-name\">{{ column.nameKey | translate }}</span>\n <span class=\"icon-button-header-wrapper\">\n <button\n *ngIf=\"column.sortable\"\n class=\"pi sortButton\"\n [class.pi-sort-alt]=\"(column?.id === sortColumn && sortDirection === 'NONE') || column?.id !== sortColumn\"\n [class.pi-sort-amount-up]=\"column?.id === sortColumn && sortDirection === 'ASCENDING'\"\n [class.pi-sort-amount-down]=\"column?.id === sortColumn && sortDirection === 'DESCENDING'\"\n (click)=\"onSortColumnClick(column.id)\"\n [title]=\"(sortIconTitle(column.id) | translate)\"\n [attr.aria-label]=\"('OCX_DATA_TABLE.TOGGLE_BUTTON.ARIA_LABEL' | translate: { column: (column.nameKey | translate), direction: (sortDirectionToTitle(columnNextSortDirection(column.id)) | translate)})\"\n ></button>\n <p-multiSelect\n class=\"filterMultiSelect\"\n *ngIf=\"column.filterable\"\n [options]=\"(currentFilterOptions$ | async) || []\"\n [ngModel]=\"(currentSelectedFilters$ | async) || []\"\n [showToggleAll]=\"true\"\n emptyFilterMessage=\"{{ 'OCX_DATA_TABLE.EMPTY_FILTER_MESSAGE' | translate }}\"\n [displaySelectedLabel]=\"false\"\n [resetFilterOnHide]=\"true\"\n (onChange)=\"onFilterChange(column, $event)\"\n placeholder=\"Icon\"\n appendTo=\"body\"\n (onClick)=\"onFilterClick(column)\"\n [title]=\"'OCX_DATA_TABLE.FILTER_TITLE' | translate\"\n [attr.aria-label]=\"('OCX_DATA_TABLE.FILTER_ARIA_LABEL' | translate: { column: column.nameKey | translate})\"\n >\n <ng-template pTemplate=\"selectedItems\" let-value>\n <div\n class=\"pi\"\n [class.pi-filter]=\"!((filterAmounts$ | async) || {})[column.id]\"\n [class.pi-filter-fill]=\"((filterAmounts$ | async) || {})[column.id] > 0\"\n ></div>\n </ng-template>\n <ng-template pTemplate=\"item\" let-value>\n <ng-container [ngSwitch]=\"(currentFilterColumn$ | async)?.columnType\">\n <span *ngSwitchCase=\"'DATE'\">{{ value.label | date }}</span>\n <span *ngSwitchDefault> {{ value.label }} </span>\n </ng-container>\n </ng-template>\n </p-multiSelect>\n </span>\n </div>\n </th>\n <ng-template #simpleHeader>\n <th scope=\"col\">{{ column.nameKey | translate }}</th>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"actionColumnPosition === 'right';\">\n <ng-container *ngTemplateOutlet=\"actionColumnHeader\"></ng-container>\n </ng-container>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowObject>\n <tr>\n <td *ngIf=\"selectionChangedObserved\">\n <p-tableCheckbox [value]=\"rowObject\"></p-tableCheckbox>\n </td>\n <ng-container *ngIf=\"actionColumnPosition === 'left';\">\n <ng-container *ngTemplateOutlet=\"actionColumn; context: {localRowObject: rowObject}\"></ng-container>\n </ng-container>\n <td *ngFor=\"let column of columns\">\n <ng-container\n [ngTemplateOutlet]=\"\n _cell ? _cell: defaultCell\n \"\n [ngTemplateOutletContext]=\"{\n rowObject: rowObject,\n column: column\n }\"\n ></ng-container>\n </td>\n <ng-container *ngIf=\"actionColumnPosition === 'right';\">\n <ng-container *ngTemplateOutlet=\"actionColumn; context: {localRowObject: rowObject}\"></ng-container>\n </ng-container>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\">\n <tr>\n <td [colSpan]=\"columns.length + ((anyRowActionObserved || this.additionalActions.length > 0) ? 1 : 0)\">\n {{ emptyResultsMessage || (\"OCX_DATA_TABLE.EMPTY_RESULT\" | translate) }}\n </td>\n </tr>\n </ng-template>\n</p-table>\n\n<ng-template #defaultCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container [ngSwitch]=\"column.columnType\">\n <ng-container *ngSwitchCase=\"'CUSTOM'\">\n <ng-container\n [ngTemplateOutlet]=\"\n _customCell ? _customCell: defaultCustomCell\n \"\n [ngTemplateOutletContext]=\"{\n rowObject: rowObject,\n column: column\n }\"\n >\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'DATE'\">\n <ng-container\n [ngTemplateOutlet]=\"\n _dateCell ? _dateCell : defaultDateCell\n \"\n [ngTemplateOutletContext]=\"{\n rowObject: rowObject,\n column: column\n }\"\n >\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'RELATIVE_DATE'\">\n <ng-container\n [ngTemplateOutlet]=\"\n _relativeDateCell ? _relativeDateCell : defaultRelativeDateCell\n \"\n [ngTemplateOutletContext]=\"{\n rowObject: rowObject,\n column: column\n }\"\n >\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'TRANSLATION_KEY'\">\n <ng-container\n [ngTemplateOutlet]=\"\n _translationKeyCell ? _translationKeyCell: defaultTranslationKeyCell\n \"\n [ngTemplateOutletContext]=\"{\n rowObject: rowObject,\n column: column\n }\"\n >\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'NUMBER'\">\n <ng-container\n [ngTemplateOutlet]=\"\n _numberCell ? _numberCell: defaultNumberCell\n \"\n [ngTemplateOutletContext]=\"{\n rowObject: rowObject,\n column: column\n }\"\n >\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container\n [ngTemplateOutlet]=\"\n _stringCell ? _stringCell: defaultStringCell\n \"\n [ngTemplateOutletContext]=\"{\n rowObject: rowObject,\n column: column\n }\"\n >\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #defaultStringCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container> {{ rowObject[column.id] }} </ng-container>\n</ng-template>\n\n<ng-template #defaultNumberCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container> {{ rowObject[column.id] | number }} </ng-container>\n</ng-template>\n\n<ng-template #defaultCustomCell let-rowObject=\"rowObject\" let-column=\"column\"> </ng-template>\n\n<ng-template #defaultDateCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container> {{ rowObject[column.id] | date: 'medium' }} </ng-container>\n</ng-template>\n\n<ng-template #defaultRelativeDateCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container> {{ 'OCX_DATA_TABLE.EDITED' | translate }} {{ rowObject[column.id] | timeago }} </ng-container>\n</ng-template>\n\n<ng-template #defaultTranslationKeyCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container> {{ rowObject[column.id] | translate }} </ng-container>\n</ng-template>\n", styles: [":host ::ng-deep .p-multiselect{padding:0;background:#f7f7f7;border:none}:host ::ng-deep .p-multiselect .p-multiselect-container{height:20px;width:20px}:host ::ng-deep .p-multiselect .p-multiselect-trigger{display:none}:host ::ng-deep .p-multiselect .p-multiselect-label.p-placeholder{color:#262626;font-size:.9rem;font-family:Bold,sans-serif;font-weight:700;padding:0}:host ::ng-deep .p-multiselect:focus-within{box-shadow:none;background:#979797}.pi{border:none;background:none;cursor:pointer}\n"] }]
1993
- }], ctorParameters: function () {
1994
- return [{ type: undefined, decorators: [{
1995
- type: Inject,
1996
- args: [LOCALE_ID]
1997
- }] }, { type: i1$1.TranslateService }, { type: i1$2.Router }, { type: i0.Injector }, { type: i3.UserService }];
1998
- }, propDecorators: { rows: [{
1999
- type: Input
2000
- }], selectedRows: [{
2001
- type: Input
2002
- }], filters: [{
2003
- type: Input
2004
- }], sortDirection: [{
2005
- type: Input
2006
- }], sortColumn: [{
2007
- type: Input
2008
- }], columns: [{
2009
- type: Input
2010
- }], clientSideFiltering: [{
2011
- type: Input
2012
- }], clientSideSorting: [{
2013
- type: Input
2014
- }], sortStates: [{
2015
- type: Input
2016
- }], pageSizes: [{
2017
- type: Input
2018
- }], pageSize: [{
2019
- type: Input
2020
- }], emptyResultsMessage: [{
2021
- type: Input
2022
- }], name: [{
2023
- type: Input
2024
- }], deletePermission: [{
2025
- type: Input
2026
- }], viewPermission: [{
2027
- type: Input
2028
- }], editPermission: [{
2029
- type: Input
2030
- }], deleteActionVisibleField: [{
2031
- type: Input
2032
- }], deleteActionEnabledField: [{
2033
- type: Input
2034
- }], viewActionVisibleField: [{
2035
- type: Input
2036
- }], viewActionEnabledField: [{
2037
- type: Input
2038
- }], editActionVisibleField: [{
2039
- type: Input
2040
- }], editActionEnabledField: [{
2041
- type: Input
2042
- }], paginator: [{
2043
- type: Input
2044
- }], page: [{
2045
- type: Input
2046
- }], totalRecordsOnServer: [{
2047
- type: Input
2048
- }], currentPageShowingKey: [{
2049
- type: Input
2050
- }], currentPageShowingWithTotalOnServerKey: [{
2051
- type: Input
2052
- }], stringCellTemplate: [{
2053
- type: Input
2054
- }], stringCellChildTemplate: [{
2055
- type: ContentChild,
2056
- args: ['stringCell']
2057
- }], numberCellTemplate: [{
2058
- type: Input
2059
- }], numberCellChildTemplate: [{
2060
- type: ContentChild,
2061
- args: ['numberCell']
2062
- }], customCellTemplate: [{
2063
- type: Input
2064
- }], customCellChildTemplate: [{
2065
- type: ContentChild,
2066
- args: ['customCell']
2067
- }], dateCellTemplate: [{
2068
- type: Input
2069
- }], dateCellChildTemplate: [{
2070
- type: ContentChild,
2071
- args: ['dateCell']
2072
- }], relativeDateCellTemplate: [{
2073
- type: Input
2074
- }], relativeDateCellChildTemplate: [{
2075
- type: ContentChild,
2076
- args: ['relativeDateCell']
2077
- }], cellTemplate: [{
2078
- type: Input
2079
- }], cellChildTemplate: [{
2080
- type: ContentChild,
2081
- args: ['cell']
2082
- }], translationKeyCellTemplate: [{
2083
- type: Input
2084
- }], translationKeyCellChildTemplate: [{
2085
- type: ContentChild,
2086
- args: ['translationKeyCell']
2087
- }], additionalActions: [{
2088
- type: Input
2089
- }], frozenActionColumn: [{
2090
- type: Input
2091
- }], actionColumnPosition: [{
2092
- type: Input
2093
- }], filtered: [{
2094
- type: Output
2095
- }], sorted: [{
2096
- type: Output
2097
- }], viewTableRow: [{
2098
- type: Output
2099
- }], editTableRow: [{
2100
- type: Output
2101
- }], deleteTableRow: [{
2102
- type: Output
2103
- }], selectionChanged: [{
2104
- type: Output
2105
- }], pageChanged: [{
2106
- type: Output
2107
- }] } });
2108
-
2109
- class DataViewComponent {
2110
- set listGrid(ref) {
2111
- this._dataListGridComponent = ref;
2112
- this.registerEventListenerForListGrid();
2113
- }
2114
- get listGrid() {
2115
- return this._dataListGridComponent;
2116
- }
2117
- set dataTable(ref) {
2118
- this._dataTableComponent = ref;
2119
- this.registerEventListenerForDataTable();
2120
- }
2121
- get dataTable() {
2122
- return this._dataTableComponent;
2123
- }
2124
- get paginator() {
2125
- return this.listGridPaginator && this.tablePaginator;
2126
- }
2127
- set paginator(value) {
2128
- this.listGridPaginator = value;
2129
- this.tablePaginator = value;
2130
- }
2131
- get _stringTableCell() {
2132
- return this.stringTableCellTemplate || this.stringTableCellChildTemplate;
2133
- }
2134
- get _numberTableCell() {
2135
- return this.numberTableCellTemplate || this.numberTableCellChildTemplate;
2136
- }
2137
- get _customTableCell() {
2138
- return this.customTableCellTemplate || this.customTableCellChildTemplate;
2139
- }
2140
- /**
2141
- * @deprecated Will be replaced by dateTableCellTemplate
2142
- */
2143
- get tableDateCellTemplate() {
2144
- return this.dateTableCellTemplate;
2145
- }
2146
- set tableDateCellTemplate(value) {
2147
- this.dateTableCellTemplate = value;
2148
- }
2149
- get _dateTableCell() {
2150
- return this.dateTableCellTemplate || this.dateTableCellChildTemplate || this.tableDateCellChildTemplate;
2151
- }
2152
- get _tableCell() {
2153
- return this.tableCellTemplate || this.tableCellChildTemplate;
2154
- }
2155
- /**
2156
- * @deprecated Will be replaced by translationKeyTableCellTemplate
2157
- */
2158
- get tableTranslationKeyCellTemplate() {
2159
- return this.translationKeyTableCellTemplate;
2160
- }
2161
- set tableTranslationKeyCellTemplate(value) {
2162
- this.translationKeyTableCellTemplate = value;
2163
- }
2164
- get _translationKeyTableCell() {
2165
- return this.translationKeyTableCellTemplate || this.translationKeyTableCellChildTemplate || this.tableTranslationKeyCellChildTemplate;
2166
- }
2167
- get _gridItemSubtitleLines() {
2168
- return this.gridItemSubtitleLinesTemplate || this.gridItemSubtitleLinesChildTemplate;
2169
- }
2170
- get _listItemSubtitleLines() {
2171
- return this.listItemSubtitleLinesTemplate || this.listItemSubtitleLinesChildTemplate;
2172
- }
2173
- get _gridItem() {
2174
- return this.gridItemTemplate || this.gridItemChildTemplate;
2175
- }
2176
- get _listItem() {
2177
- return this.listItemTemplate || this.listItemChildTemplate;
2178
- }
2179
- /**
2180
- * @deprecated Will be replaced by relativeDateTableCellTemplate
2181
- */
2182
- get tableRelativeDateCellTemplate() {
2183
- return this.relativeDateTableCellTemplate;
2184
- }
2185
- set tableRelativeDateCellTemplate(value) {
2186
- this.relativeDateTableCellTemplate = value;
2187
- }
2188
- get _tableRelativeDateCell() {
2189
- return this.relativeDateTableCellTemplate || this.relativeDateTableCellChildTemplate || this.tableRelativeDateCellChildTemplate;
2190
- }
2191
- get viewItemObserved() {
2192
- var _a;
2193
- return ((_a = this.injector.get('InteractiveDataViewComponent', null)) === null || _a === void 0 ? void 0 : _a.viewItem.observed) || this.viewItem.observed;
2194
- }
2195
- get editItemObserved() {
2196
- var _a;
2197
- return ((_a = this.injector.get('InteractiveDataViewComponent', null)) === null || _a === void 0 ? void 0 : _a.editItem.observed) || this.editItem.observed;
2198
- }
2199
- get deleteItemObserved() {
2200
- var _a;
2201
- return ((_a = this.injector.get('InteractiveDataViewComponent', null)) === null || _a === void 0 ? void 0 : _a.deleteItem.observed) || this.deleteItem.observed;
2202
- }
2203
- get selectionChangedObserved() {
2204
- var _a;
2205
- return (((_a = this.injector.get('InteractiveDataViewComponent', null)) === null || _a === void 0 ? void 0 : _a.selectionChanged.observed) ||
2206
- this.selectionChanged.observed);
2207
- }
2208
- constructor(injector) {
2209
- this.injector = injector;
2210
- this.data = [];
2211
- this.name = 'Data table';
2212
- this.subtitleLineIds = [];
2213
- this.layout = ['grid', 'list', 'table'];
2214
- this.columns = [];
2215
- this.clientSideSorting = true;
2216
- this.clientSideFiltering = true;
2217
- this.fallbackImage = 'placeholder.png';
2218
- this.filters = [];
2219
- this.sortField = '';
2220
- this.sortDirection = "NONE" /* DataSortDirection.NONE */;
2221
- this.listGridPaginator = true;
2222
- this.tablePaginator = true;
2223
- this.page = 0;
2224
- this.currentPageShowingKey = 'OCX_DATA_TABLE.SHOWING';
2225
- this.currentPageShowingWithTotalOnServerKey = 'OCX_DATA_TABLE.SHOWING_WITH_TOTAL_ON_SERVER';
2226
- this.selectedRows = [];
2227
- this.frozenActionColumn = false;
2228
- this.actionColumnPosition = 'right';
2229
- this.sortStates = ["ASCENDING" /* DataSortDirection.ASCENDING */, "DESCENDING" /* DataSortDirection.DESCENDING */];
2230
- this.pageSizes = [10, 25, 50];
2231
- this.additionalActions = [];
2232
- this.filtered = new EventEmitter();
2233
- this.sorted = new EventEmitter();
2234
- this.deleteItem = new EventEmitter();
2235
- this.viewItem = new EventEmitter();
2236
- this.editItem = new EventEmitter();
2237
- this.selectionChanged = new EventEmitter();
2238
- this.pageChanged = new EventEmitter();
2239
- }
2240
- ngOnInit() {
2241
- var _a;
2242
- this.firstColumnId = (_a = this.columns[0]) === null || _a === void 0 ? void 0 : _a.id;
2243
- }
2244
- ngDoCheck() {
2245
- this.registerEventListenerForDataTable();
2246
- this.registerEventListenerForListGrid();
2247
- }
2248
- registerEventListenerForListGrid() {
2249
- var _a, _b, _c, _d, _e, _f;
2250
- if (this.layout !== 'table') {
2251
- if (this.deleteItem.observed) {
2252
- this.isDeleteItemObserved = true;
2253
- if (!((_a = this._dataListGridComponent) === null || _a === void 0 ? void 0 : _a.deleteItem.observed)) {
2254
- (_b = this._dataListGridComponent) === null || _b === void 0 ? void 0 : _b.deleteItem.subscribe((event) => {
2255
- this.deletingElement(event);
2256
- });
2257
- }
2258
- }
2259
- if (this.viewItem.observed) {
2260
- this.isViewItemObserved = true;
2261
- if (!((_c = this._dataListGridComponent) === null || _c === void 0 ? void 0 : _c.viewItem.observed)) {
2262
- (_d = this._dataListGridComponent) === null || _d === void 0 ? void 0 : _d.viewItem.subscribe((event) => {
2263
- this.viewingElement(event);
2264
- });
2265
- }
2266
- }
2267
- if (this.editItem.observed) {
2268
- this.IsEditItemObserved = true;
2269
- if (!((_e = this._dataListGridComponent) === null || _e === void 0 ? void 0 : _e.editItem.observed)) {
2270
- (_f = this._dataListGridComponent) === null || _f === void 0 ? void 0 : _f.editItem.subscribe((event) => {
2271
- this.editingElement(event);
2272
- });
2273
- }
2274
- }
2275
- }
2276
- }
2277
- registerEventListenerForDataTable() {
2278
- var _a, _b, _c, _d, _e, _f, _g, _h;
2279
- if (this.layout === 'table') {
2280
- if (this.deleteItem.observed) {
2281
- this.isDeleteItemObserved = true;
2282
- if (!((_a = this._dataTableComponent) === null || _a === void 0 ? void 0 : _a.deleteTableRow.observed)) {
2283
- (_b = this._dataTableComponent) === null || _b === void 0 ? void 0 : _b.deleteTableRow.subscribe((event) => {
2284
- this.deletingElement(event);
2285
- });
2286
- }
2287
- }
2288
- if (this.viewItem.observed) {
2289
- this.isViewItemObserved = true;
2290
- if (!((_c = this._dataTableComponent) === null || _c === void 0 ? void 0 : _c.viewTableRow.observed)) {
2291
- (_d = this._dataTableComponent) === null || _d === void 0 ? void 0 : _d.viewTableRow.subscribe((event) => {
2292
- this.viewingElement(event);
2293
- });
2294
- }
2295
- }
2296
- if (this.editItem.observed) {
2297
- this.IsEditItemObserved = true;
2298
- if (!((_e = this._dataTableComponent) === null || _e === void 0 ? void 0 : _e.editTableRow.observed)) {
2299
- (_f = this._dataTableComponent) === null || _f === void 0 ? void 0 : _f.editTableRow.subscribe((event) => {
2300
- this.editingElement(event);
2301
- });
2302
- }
2303
- }
2304
- if (this.selectionChangedObserved) {
2305
- if (!((_g = this._dataTableComponent) === null || _g === void 0 ? void 0 : _g.selectionChanged.observed)) {
2306
- (_h = this._dataTableComponent) === null || _h === void 0 ? void 0 : _h.selectionChanged.subscribe((event) => {
2307
- this.onRowSelectionChange(event);
2308
- });
2309
- }
2310
- }
2311
- }
2312
- }
2313
- filtering(event) {
2314
- this.filters = event;
2315
- this.filtered.emit(event);
2316
- }
2317
- sorting(event) {
2318
- this.sortDirection = event.sortDirection;
2319
- this.sortField = event.sortColumn;
2320
- this.sorted.emit(event);
2321
- }
2322
- deletingElement(event) {
2323
- if (this.isDeleteItemObserved) {
2324
- this.deleteItem.emit(event);
2325
- }
2326
- }
2327
- viewingElement(event) {
2328
- if (this.isViewItemObserved) {
2329
- this.viewItem.emit(event);
2330
- }
2331
- }
2332
- editingElement(event) {
2333
- if (this.IsEditItemObserved) {
2334
- this.editItem.emit(event);
2335
- }
2336
- }
2337
- onRowSelectionChange(event) {
2338
- if (this.selectionChangedObserved) {
2339
- this.selectionChanged.emit(event);
2340
- }
2341
- }
2342
- onPageChange(event) {
2343
- this.page = event;
2344
- this.pageChanged.emit(event);
2345
- }
2346
- }
2347
- DataViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataViewComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
2348
- DataViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DataViewComponent, selector: "ocx-data-view", inputs: { deletePermission: "deletePermission", editPermission: "editPermission", viewPermission: "viewPermission", deleteActionVisibleField: "deleteActionVisibleField", deleteActionEnabledField: "deleteActionEnabledField", viewActionVisibleField: "viewActionVisibleField", viewActionEnabledField: "viewActionEnabledField", editActionVisibleField: "editActionVisibleField", editActionEnabledField: "editActionEnabledField", data: "data", name: "name", titleLineId: "titleLineId", subtitleLineIds: "subtitleLineIds", layout: "layout", columns: "columns", emptyResultsMessage: "emptyResultsMessage", clientSideSorting: "clientSideSorting", clientSideFiltering: "clientSideFiltering", fallbackImage: "fallbackImage", filters: "filters", sortField: "sortField", sortDirection: "sortDirection", listGridPaginator: "listGridPaginator", tablePaginator: "tablePaginator", page: "page", totalRecordsOnServer: "totalRecordsOnServer", currentPageShowingKey: "currentPageShowingKey", currentPageShowingWithTotalOnServerKey: "currentPageShowingWithTotalOnServerKey", selectedRows: "selectedRows", frozenActionColumn: "frozenActionColumn", actionColumnPosition: "actionColumnPosition", paginator: "paginator", sortStates: "sortStates", pageSizes: "pageSizes", pageSize: "pageSize", stringTableCellTemplate: "stringTableCellTemplate", numberTableCellTemplate: "numberTableCellTemplate", customTableCellTemplate: "customTableCellTemplate", dateTableCellTemplate: "dateTableCellTemplate", tableDateCellTemplate: "tableDateCellTemplate", tableCellTemplate: "tableCellTemplate", translationKeyTableCellTemplate: "translationKeyTableCellTemplate", tableTranslationKeyCellTemplate: "tableTranslationKeyCellTemplate", gridItemSubtitleLinesTemplate: "gridItemSubtitleLinesTemplate", listItemSubtitleLinesTemplate: "listItemSubtitleLinesTemplate", gridItemTemplate: "gridItemTemplate", listItemTemplate: "listItemTemplate", relativeDateTableCellTemplate: "relativeDateTableCellTemplate", tableRelativeDateCellTemplate: "tableRelativeDateCellTemplate", additionalActions: "additionalActions" }, outputs: { filtered: "filtered", sorted: "sorted", deleteItem: "deleteItem", viewItem: "viewItem", editItem: "editItem", selectionChanged: "selectionChanged", pageChanged: "pageChanged" }, providers: [{ provide: 'DataViewComponent', useExisting: DataViewComponent }], queries: [{ propertyName: "stringTableCellChildTemplate", first: true, predicate: ["stringTableCell"], descendants: true }, { propertyName: "numberTableCellChildTemplate", first: true, predicate: ["numberTableCell"], descendants: true }, { propertyName: "customTableCellChildTemplate", first: true, predicate: ["customTableCell"], descendants: true }, { propertyName: "tableDateCellChildTemplate", first: true, predicate: ["tableDateCell"], descendants: true }, { propertyName: "dateTableCellChildTemplate", first: true, predicate: ["dateTableCell"], descendants: true }, { propertyName: "tableCellChildTemplate", first: true, predicate: ["tableCell"], descendants: true }, { propertyName: "tableTranslationKeyCellChildTemplate", first: true, predicate: ["tableTranslationKeyCell"], descendants: true }, { propertyName: "translationKeyTableCellChildTemplate", first: true, predicate: ["translationKeyTableCell"], descendants: true }, { propertyName: "gridItemSubtitleLinesChildTemplate", first: true, predicate: ["gridItemSubtitleLines"], descendants: true }, { propertyName: "listItemSubtitleLinesChildTemplate", first: true, predicate: ["listItemSubtitleLines"], descendants: true }, { propertyName: "gridItemChildTemplate", first: true, predicate: ["gridItem"], descendants: true }, { propertyName: "listItemChildTemplate", first: true, predicate: ["listItem"], descendants: true }, { propertyName: "tableRelativeDateCellChildTemplate", first: true, predicate: ["tableRelativeDateCell"], descendants: true }, { propertyName: "relativeDateTableCellChildTemplate", first: true, predicate: ["relativeDateTableCell"], descendants: true }], viewQueries: [{ propertyName: "listGrid", first: true, predicate: DataListGridComponent, descendants: true }, { propertyName: "dataTable", first: true, predicate: DataTableComponent, descendants: true }], ngImport: i0, template: "<div *ngIf=\"layout !== 'table'\">\n <ocx-data-list-grid\n #ocxdatalistgrid\n [name]=\"name\"\n [data]=\"data\"\n [columns]=\"columns\"\n [filters]=\"filters\"\n [sortDirection]=\"sortDirection\"\n [sortField]=\"sortField\"\n [sortStates]=\"sortStates\"\n [clientSideFiltering]=\"clientSideFiltering\"\n [clientSideSorting]=\"clientSideSorting\"\n [titleLineId]=\"titleLineId || firstColumnId\"\n [subtitleLineIds]=\"subtitleLineIds\"\n [clientSideSorting]=\"true\"\n [pageSizes]=\"pageSizes\"\n [pageSize]=\"pageSize\"\n [paginator]=\"listGridPaginator\"\n [page]=\"page\"\n (pageChanged)=\"onPageChange($event)\"\n [emptyResultsMessage]=\"emptyResultsMessage\"\n [layout]=\"layout\"\n [deletePermission]=\"deletePermission\"\n [editPermission]=\"editPermission\"\n [viewPermission]=\"viewPermission\"\n [deleteActionEnabledField]=\"deleteActionEnabledField\"\n [deleteActionVisibleField]=\"deleteActionVisibleField\"\n [editActionEnabledField]=\"editActionEnabledField\"\n [editActionVisibleField]=\"editActionVisibleField\"\n [viewActionEnabledField]=\"viewActionEnabledField\"\n [viewActionVisibleField]=\"viewActionVisibleField\"\n [additionalActions]=\"additionalActions\"\n [gridItemSubtitleLinesTemplate]=\"_gridItemSubtitleLines ? gridItemSubtitleLines : undefined\"\n [listItemSubtitleLinesTemplate]=\"_listItemSubtitleLines ? listItemSubtitleLines : undefined\"\n [listItemTemplate]=\"_listItem ? listItem : undefined\"\n [gridItemTemplate]=\"_gridItem ? gridItem : undefined\"\n [totalRecordsOnServer]=\"totalRecordsOnServer\"\n >\n </ocx-data-list-grid>\n <ng-template #listItemSubtitleLines let-item>\n <ng-container\n *ngIf=\"_listItemSubtitleLines\"\n [ngTemplateOutlet]=\"_listItemSubtitleLines\"\n [ngTemplateOutletContext]=\"{$implicit:item}\"\n >\n </ng-container\n ></ng-template>\n <ng-template #gridItemSubtitleLines let-item>\n <ng-container\n *ngIf=\"_gridItemSubtitleLines\"\n [ngTemplateOutlet]=\"_gridItemSubtitleLines\"\n [ngTemplateOutletContext]=\"{$implicit:item}\"\n >\n </ng-container\n ></ng-template>\n <ng-template #gridItem let-item>\n <ng-container *ngIf=\"_gridItem\" [ngTemplateOutlet]=\"_gridItem\" [ngTemplateOutletContext]=\"{$implicit:item}\">\n </ng-container\n ></ng-template>\n <ng-template #listItem let-item>\n <ng-container *ngIf=\"_listItem\" [ngTemplateOutlet]=\"_listItem\" [ngTemplateOutletContext]=\"{$implicit:item}\">\n </ng-container\n ></ng-template>\n</div>\n\n<div *ngIf=\"layout === 'table'\">\n <ocx-data-table\n #ocxdatatable\n [rows]=\"data\"\n [columns]=\"columns\"\n [filters]=\"filters\"\n [sortDirection]=\"sortDirection\"\n [sortColumn]=\"sortField\"\n [sortStates]=\"sortStates\"\n [clientSideFiltering]=\"clientSideFiltering\"\n [clientSideSorting]=\"clientSideSorting\"\n [pageSizes]=\"pageSizes\"\n [pageSize]=\"pageSize\"\n [paginator]=\"tablePaginator\"\n [page]=\"page\"\n (pageChanged)=\"onPageChange($event)\"\n [selectedRows]=\"selectedRows\"\n [frozenActionColumn]=\"frozenActionColumn\"\n [actionColumnPosition]=\"actionColumnPosition\"\n [emptyResultsMessage]=\"emptyResultsMessage\"\n [name]=\"name\"\n [deletePermission]=\"deletePermission\"\n [editPermission]=\"editPermission\"\n [viewPermission]=\"viewPermission\"\n [deleteActionEnabledField]=\"deleteActionEnabledField\"\n [deleteActionVisibleField]=\"deleteActionVisibleField\"\n [editActionEnabledField]=\"editActionEnabledField\"\n [editActionVisibleField]=\"editActionVisibleField\"\n [viewActionEnabledField]=\"viewActionEnabledField\"\n [viewActionVisibleField]=\"viewActionVisibleField\"\n [additionalActions]=\"additionalActions\"\n [stringCellTemplate]=\"_stringTableCell ? stringCell : undefined\"\n [numberCellTemplate]=\"_numberTableCell ? numberCell : undefined\"\n [customCellTemplate]=\"_customTableCell ? customCell : undefined\"\n [dateCellTemplate]=\"_tableDateCell ? dateCell : undefined\"\n [relativeDateCellTemplate]=\"_tableRelativeDateCell ? relativeDateCell : undefined\"\n [cellTemplate]=\"_tableCell ? cell : undefined\"\n [translationKeyCellTemplate]=\"_tableTranslationKeyCell ? translationKeyCell : undefined\"\n (sorted)=\"sorting($event)\"\n (filtered)=\"filtering($event)\"\n [totalRecordsOnServer]=\"totalRecordsOnServer\"\n [currentPageShowingKey]=\"currentPageShowingKey\"\n [currentPageShowingWithTotalOnServerKey]=\"currentPageShowingWithTotalOnServerKey\"\n >\n </ocx-data-table>\n <ng-template #stringCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_stringTableCell\"\n [ngTemplateOutlet]=\"_stringTableCell\"\n [ngTemplateOutletContext]=\"{rowObject: rowObject, column:column}\"\n >\n </ng-container\n ></ng-template>\n <ng-template #numberCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_numberTableCell\"\n [ngTemplateOutlet]=\"_numberTableCell\"\n [ngTemplateOutletContext]=\"{rowObject: rowObject, column:column}\"\n >\n </ng-container\n ></ng-template>\n <ng-template #customCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_customTableCell\"\n [ngTemplateOutlet]=\"_customTableCell\"\n [ngTemplateOutletContext]=\"{rowObject: rowObject, column:column}\"\n >\n </ng-container\n ></ng-template>\n <ng-template #dateCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_dateTableCell\"\n [ngTemplateOutlet]=\"_dateTableCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n ></ng-template>\n <ng-template #relativeDateCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_relativeDateTableCell\"\n [ngTemplateOutlet]=\"_relativeDateTableCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n ></ng-template>\n <ng-template #cell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_tableCell\"\n [ngTemplateOutlet]=\"_tableCell\"\n [ngTemplateOutletContext]=\"{rowObject: rowObject, column:column}\"\n >\n </ng-container\n ></ng-template>\n <ng-template #translationKeyCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_translationKeyTableCell\"\n [ngTemplateOutlet]=\"_translationKeyTableCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n ></ng-template>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DataListGridComponent, selector: "ocx-data-list-grid", inputs: ["titleLineId", "subtitleLineIds", "clientSideSorting", "clientSideFiltering", "sortStates", "pageSizes", "pageSize", "emptyResultsMessage", "fallbackImage", "layout", "viewPermission", "editPermission", "deletePermission", "deleteActionVisibleField", "deleteActionEnabledField", "viewActionVisibleField", "viewActionEnabledField", "editActionVisibleField", "editActionEnabledField", "viewMenuItemKey", "editMenuItemKey", "deleteMenuItemKey", "paginator", "page", "columns", "name", "totalRecordsOnServer", "currentPageShowingKey", "currentPageShowingWithTotalOnServerKey", "data", "filters", "sortDirection", "sortField", "gridItemSubtitleLinesTemplate", "listItemSubtitleLinesTemplate", "listItemTemplate", "gridItemTemplate", "additionalActions"], outputs: ["viewItem", "editItem", "deleteItem", "pageChanged"] }, { kind: "component", type: DataTableComponent, selector: "ocx-data-table", inputs: ["rows", "selectedRows", "filters", "sortDirection", "sortColumn", "columns", "clientSideFiltering", "clientSideSorting", "sortStates", "pageSizes", "pageSize", "emptyResultsMessage", "name", "deletePermission", "viewPermission", "editPermission", "deleteActionVisibleField", "deleteActionEnabledField", "viewActionVisibleField", "viewActionEnabledField", "editActionVisibleField", "editActionEnabledField", "paginator", "page", "totalRecordsOnServer", "currentPageShowingKey", "currentPageShowingWithTotalOnServerKey", "stringCellTemplate", "numberCellTemplate", "customCellTemplate", "dateCellTemplate", "relativeDateCellTemplate", "cellTemplate", "translationKeyCellTemplate", "additionalActions", "frozenActionColumn", "actionColumnPosition"], outputs: ["filtered", "sorted", "viewTableRow", "editTableRow", "deleteTableRow", "selectionChanged", "pageChanged"] }] });
2349
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataViewComponent, decorators: [{
2350
- type: Component,
2351
- args: [{ selector: 'ocx-data-view', providers: [{ provide: 'DataViewComponent', useExisting: DataViewComponent }], template: "<div *ngIf=\"layout !== 'table'\">\n <ocx-data-list-grid\n #ocxdatalistgrid\n [name]=\"name\"\n [data]=\"data\"\n [columns]=\"columns\"\n [filters]=\"filters\"\n [sortDirection]=\"sortDirection\"\n [sortField]=\"sortField\"\n [sortStates]=\"sortStates\"\n [clientSideFiltering]=\"clientSideFiltering\"\n [clientSideSorting]=\"clientSideSorting\"\n [titleLineId]=\"titleLineId || firstColumnId\"\n [subtitleLineIds]=\"subtitleLineIds\"\n [clientSideSorting]=\"true\"\n [pageSizes]=\"pageSizes\"\n [pageSize]=\"pageSize\"\n [paginator]=\"listGridPaginator\"\n [page]=\"page\"\n (pageChanged)=\"onPageChange($event)\"\n [emptyResultsMessage]=\"emptyResultsMessage\"\n [layout]=\"layout\"\n [deletePermission]=\"deletePermission\"\n [editPermission]=\"editPermission\"\n [viewPermission]=\"viewPermission\"\n [deleteActionEnabledField]=\"deleteActionEnabledField\"\n [deleteActionVisibleField]=\"deleteActionVisibleField\"\n [editActionEnabledField]=\"editActionEnabledField\"\n [editActionVisibleField]=\"editActionVisibleField\"\n [viewActionEnabledField]=\"viewActionEnabledField\"\n [viewActionVisibleField]=\"viewActionVisibleField\"\n [additionalActions]=\"additionalActions\"\n [gridItemSubtitleLinesTemplate]=\"_gridItemSubtitleLines ? gridItemSubtitleLines : undefined\"\n [listItemSubtitleLinesTemplate]=\"_listItemSubtitleLines ? listItemSubtitleLines : undefined\"\n [listItemTemplate]=\"_listItem ? listItem : undefined\"\n [gridItemTemplate]=\"_gridItem ? gridItem : undefined\"\n [totalRecordsOnServer]=\"totalRecordsOnServer\"\n >\n </ocx-data-list-grid>\n <ng-template #listItemSubtitleLines let-item>\n <ng-container\n *ngIf=\"_listItemSubtitleLines\"\n [ngTemplateOutlet]=\"_listItemSubtitleLines\"\n [ngTemplateOutletContext]=\"{$implicit:item}\"\n >\n </ng-container\n ></ng-template>\n <ng-template #gridItemSubtitleLines let-item>\n <ng-container\n *ngIf=\"_gridItemSubtitleLines\"\n [ngTemplateOutlet]=\"_gridItemSubtitleLines\"\n [ngTemplateOutletContext]=\"{$implicit:item}\"\n >\n </ng-container\n ></ng-template>\n <ng-template #gridItem let-item>\n <ng-container *ngIf=\"_gridItem\" [ngTemplateOutlet]=\"_gridItem\" [ngTemplateOutletContext]=\"{$implicit:item}\">\n </ng-container\n ></ng-template>\n <ng-template #listItem let-item>\n <ng-container *ngIf=\"_listItem\" [ngTemplateOutlet]=\"_listItem\" [ngTemplateOutletContext]=\"{$implicit:item}\">\n </ng-container\n ></ng-template>\n</div>\n\n<div *ngIf=\"layout === 'table'\">\n <ocx-data-table\n #ocxdatatable\n [rows]=\"data\"\n [columns]=\"columns\"\n [filters]=\"filters\"\n [sortDirection]=\"sortDirection\"\n [sortColumn]=\"sortField\"\n [sortStates]=\"sortStates\"\n [clientSideFiltering]=\"clientSideFiltering\"\n [clientSideSorting]=\"clientSideSorting\"\n [pageSizes]=\"pageSizes\"\n [pageSize]=\"pageSize\"\n [paginator]=\"tablePaginator\"\n [page]=\"page\"\n (pageChanged)=\"onPageChange($event)\"\n [selectedRows]=\"selectedRows\"\n [frozenActionColumn]=\"frozenActionColumn\"\n [actionColumnPosition]=\"actionColumnPosition\"\n [emptyResultsMessage]=\"emptyResultsMessage\"\n [name]=\"name\"\n [deletePermission]=\"deletePermission\"\n [editPermission]=\"editPermission\"\n [viewPermission]=\"viewPermission\"\n [deleteActionEnabledField]=\"deleteActionEnabledField\"\n [deleteActionVisibleField]=\"deleteActionVisibleField\"\n [editActionEnabledField]=\"editActionEnabledField\"\n [editActionVisibleField]=\"editActionVisibleField\"\n [viewActionEnabledField]=\"viewActionEnabledField\"\n [viewActionVisibleField]=\"viewActionVisibleField\"\n [additionalActions]=\"additionalActions\"\n [stringCellTemplate]=\"_stringTableCell ? stringCell : undefined\"\n [numberCellTemplate]=\"_numberTableCell ? numberCell : undefined\"\n [customCellTemplate]=\"_customTableCell ? customCell : undefined\"\n [dateCellTemplate]=\"_tableDateCell ? dateCell : undefined\"\n [relativeDateCellTemplate]=\"_tableRelativeDateCell ? relativeDateCell : undefined\"\n [cellTemplate]=\"_tableCell ? cell : undefined\"\n [translationKeyCellTemplate]=\"_tableTranslationKeyCell ? translationKeyCell : undefined\"\n (sorted)=\"sorting($event)\"\n (filtered)=\"filtering($event)\"\n [totalRecordsOnServer]=\"totalRecordsOnServer\"\n [currentPageShowingKey]=\"currentPageShowingKey\"\n [currentPageShowingWithTotalOnServerKey]=\"currentPageShowingWithTotalOnServerKey\"\n >\n </ocx-data-table>\n <ng-template #stringCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_stringTableCell\"\n [ngTemplateOutlet]=\"_stringTableCell\"\n [ngTemplateOutletContext]=\"{rowObject: rowObject, column:column}\"\n >\n </ng-container\n ></ng-template>\n <ng-template #numberCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_numberTableCell\"\n [ngTemplateOutlet]=\"_numberTableCell\"\n [ngTemplateOutletContext]=\"{rowObject: rowObject, column:column}\"\n >\n </ng-container\n ></ng-template>\n <ng-template #customCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_customTableCell\"\n [ngTemplateOutlet]=\"_customTableCell\"\n [ngTemplateOutletContext]=\"{rowObject: rowObject, column:column}\"\n >\n </ng-container\n ></ng-template>\n <ng-template #dateCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_dateTableCell\"\n [ngTemplateOutlet]=\"_dateTableCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n ></ng-template>\n <ng-template #relativeDateCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_relativeDateTableCell\"\n [ngTemplateOutlet]=\"_relativeDateTableCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n ></ng-template>\n <ng-template #cell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_tableCell\"\n [ngTemplateOutlet]=\"_tableCell\"\n [ngTemplateOutletContext]=\"{rowObject: rowObject, column:column}\"\n >\n </ng-container\n ></ng-template>\n <ng-template #translationKeyCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_translationKeyTableCell\"\n [ngTemplateOutlet]=\"_translationKeyTableCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n ></ng-template>\n</div>\n" }]
2352
- }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { listGrid: [{
2353
- type: ViewChild,
2354
- args: [DataListGridComponent]
2355
- }], dataTable: [{
2356
- type: ViewChild,
2357
- args: [DataTableComponent]
2358
- }], deletePermission: [{
2359
- type: Input
2360
- }], editPermission: [{
2361
- type: Input
2362
- }], viewPermission: [{
2363
- type: Input
2364
- }], deleteActionVisibleField: [{
2365
- type: Input
2366
- }], deleteActionEnabledField: [{
2367
- type: Input
2368
- }], viewActionVisibleField: [{
2369
- type: Input
2370
- }], viewActionEnabledField: [{
2371
- type: Input
2372
- }], editActionVisibleField: [{
2373
- type: Input
2374
- }], editActionEnabledField: [{
2375
- type: Input
2376
- }], data: [{
2377
- type: Input
2378
- }], name: [{
2379
- type: Input
2380
- }], titleLineId: [{
2381
- type: Input
2382
- }], subtitleLineIds: [{
2383
- type: Input
2384
- }], layout: [{
2385
- type: Input
2386
- }], columns: [{
2387
- type: Input
2388
- }], emptyResultsMessage: [{
2389
- type: Input
2390
- }], clientSideSorting: [{
2391
- type: Input
2392
- }], clientSideFiltering: [{
2393
- type: Input
2394
- }], fallbackImage: [{
2395
- type: Input
2396
- }], filters: [{
2397
- type: Input
2398
- }], sortField: [{
2399
- type: Input
2400
- }], sortDirection: [{
2401
- type: Input
2402
- }], listGridPaginator: [{
2403
- type: Input
2404
- }], tablePaginator: [{
2405
- type: Input
2406
- }], page: [{
2407
- type: Input
2408
- }], totalRecordsOnServer: [{
2409
- type: Input
2410
- }], currentPageShowingKey: [{
2411
- type: Input
2412
- }], currentPageShowingWithTotalOnServerKey: [{
2413
- type: Input
2414
- }], selectedRows: [{
2415
- type: Input
2416
- }], frozenActionColumn: [{
2417
- type: Input
2418
- }], actionColumnPosition: [{
2419
- type: Input
2420
- }], paginator: [{
2421
- type: Input
2422
- }], sortStates: [{
2423
- type: Input
2424
- }], pageSizes: [{
2425
- type: Input
2426
- }], pageSize: [{
2427
- type: Input
2428
- }], stringTableCellTemplate: [{
2429
- type: Input
2430
- }], stringTableCellChildTemplate: [{
2431
- type: ContentChild,
2432
- args: ['stringTableCell']
2433
- }], numberTableCellTemplate: [{
2434
- type: Input
2435
- }], numberTableCellChildTemplate: [{
2436
- type: ContentChild,
2437
- args: ['numberTableCell']
2438
- }], customTableCellTemplate: [{
2439
- type: Input
2440
- }], customTableCellChildTemplate: [{
2441
- type: ContentChild,
2442
- args: ['customTableCell']
2443
- }], dateTableCellTemplate: [{
2444
- type: Input
2445
- }], tableDateCellTemplate: [{
2446
- type: Input
2447
- }], tableDateCellChildTemplate: [{
2448
- type: ContentChild,
2449
- args: ['tableDateCell']
2450
- }], dateTableCellChildTemplate: [{
2451
- type: ContentChild,
2452
- args: ['dateTableCell']
2453
- }], tableCellTemplate: [{
2454
- type: Input
2455
- }], tableCellChildTemplate: [{
2456
- type: ContentChild,
2457
- args: ['tableCell']
2458
- }], translationKeyTableCellTemplate: [{
2459
- type: Input
2460
- }], tableTranslationKeyCellTemplate: [{
2461
- type: Input
2462
- }], tableTranslationKeyCellChildTemplate: [{
2463
- type: ContentChild,
2464
- args: ['tableTranslationKeyCell']
2465
- }], translationKeyTableCellChildTemplate: [{
2466
- type: ContentChild,
2467
- args: ['translationKeyTableCell']
2468
- }], gridItemSubtitleLinesTemplate: [{
2469
- type: Input
2470
- }], gridItemSubtitleLinesChildTemplate: [{
2471
- type: ContentChild,
2472
- args: ['gridItemSubtitleLines']
2473
- }], listItemSubtitleLinesTemplate: [{
2474
- type: Input
2475
- }], listItemSubtitleLinesChildTemplate: [{
2476
- type: ContentChild,
2477
- args: ['listItemSubtitleLines']
2478
- }], gridItemTemplate: [{
2479
- type: Input
2480
- }], gridItemChildTemplate: [{
2481
- type: ContentChild,
2482
- args: ['gridItem']
2483
- }], listItemTemplate: [{
2484
- type: Input
2485
- }], listItemChildTemplate: [{
2486
- type: ContentChild,
2487
- args: ['listItem']
2488
- }], relativeDateTableCellTemplate: [{
2489
- type: Input
2490
- }], tableRelativeDateCellTemplate: [{
2491
- type: Input
2492
- }], tableRelativeDateCellChildTemplate: [{
2493
- type: ContentChild,
2494
- args: ['tableRelativeDateCell']
2495
- }], relativeDateTableCellChildTemplate: [{
2496
- type: ContentChild,
2497
- args: ['relativeDateTableCell']
2498
- }], additionalActions: [{
2499
- type: Input
2500
- }], filtered: [{
2501
- type: Output
2502
- }], sorted: [{
2503
- type: Output
2504
- }], deleteItem: [{
2505
- type: Output
2506
- }], viewItem: [{
2507
- type: Output
2508
- }], editItem: [{
2509
- type: Output
2510
- }], selectionChanged: [{
2511
- type: Output
2512
- }], pageChanged: [{
2513
- type: Output
2514
- }] } });
2515
-
2516
- class ColorUtils {
2517
- static calculatePoint(i, intervalSize, colorRangeInfo) {
2518
- const { colorStart, colorEnd, useEndAsStart } = colorRangeInfo;
2519
- return useEndAsStart ? colorEnd - i * intervalSize : colorStart + i * intervalSize;
2520
- }
2521
- static interpolateColors(dataLength, colorScale, colorRangeInfo) {
2522
- const { colorStart, colorEnd } = colorRangeInfo;
2523
- const colorRange = colorEnd - colorStart;
2524
- const intervalSize = colorRange / dataLength;
2525
- let i, colorPoint;
2526
- const colorArray = [];
2527
- for (i = 0; i < dataLength; i++) {
2528
- colorPoint = this.calculatePoint(i, intervalSize, colorRangeInfo);
2529
- colorArray.push(colorScale(colorPoint));
2530
- }
2531
- return colorArray;
2532
- }
2533
- }
2534
-
2535
- const allDiagramTypes = [
2536
- { icon: PrimeIcons.CHART_PIE, layout: "PIE" /* DiagramType.PIE */, titleKey: 'OCX_DIAGRAM.SWITCH_DIAGRAM_TYPE.PIE' },
2537
- {
2538
- icon: PrimeIcons.BARS,
2539
- layout: "HORIZONTAL_BAR" /* DiagramType.HORIZONTAL_BAR */,
2540
- titleKey: 'OCX_DIAGRAM.SWITCH_DIAGRAM_TYPE.HORIZONTAL_BAR',
2541
- },
2542
- {
2543
- icon: PrimeIcons.CHART_BAR,
2544
- layout: "VERTICAL_BAR" /* DiagramType.VERTICAL_BAR */,
2545
- titleKey: 'OCX_DIAGRAM.SWITCH_DIAGRAM_TYPE.VERTICAL_BAR',
2546
- },
2547
- ];
2548
- class DiagramComponent {
2549
- get diagramType() {
2550
- return this._diagramType;
2551
- }
2552
- set diagramType(value) {
2553
- this._diagramType = value;
2554
- this.selectedDiagramType = allDiagramTypes.find((v) => v.layout === value);
2555
- this.chartType = this.diagramTypeToChartType(value);
2556
- }
2557
- get supportedDiagramTypes() {
2558
- return this._supportedDiagramTypes;
2559
- }
2560
- set supportedDiagramTypes(value) {
2561
- this._supportedDiagramTypes = value;
2562
- this.shownDiagramTypes = allDiagramTypes.filter((vl) => this.supportedDiagramTypes.includes(vl.layout));
2563
- }
2564
- constructor(translateService) {
2565
- this.translateService = translateService;
2566
- this.sumKey = 'OCX_DIAGRAM.SUM';
2567
- this._diagramType = "PIE" /* DiagramType.PIE */;
2568
- this.chartType = 'pie';
2569
- this._supportedDiagramTypes = [];
2570
- this.dataSelected = new EventEmitter();
2571
- this.diagramTypeChanged = new EventEmitter();
2572
- this.shownDiagramTypes = [];
2573
- // Changing the colorRangeInfo, will change the range of the color palette of the diagram.
2574
- this.colorRangeInfo = {
2575
- colorStart: 0,
2576
- colorEnd: 1,
2577
- useEndAsStart: false,
2578
- };
2579
- // Changing the colorScale, will change the thematic color appearance of the diagram.
2580
- this.colorScale = d3.interpolateCool;
2581
- }
2582
- ngOnChanges() {
2583
- this.generateChart(this.colorScale, this.colorRangeInfo);
2584
- }
2585
- ngOnInit() {
2586
- this.generateChart(this.colorScale, this.colorRangeInfo);
2587
- }
2588
- generateChart(colorScale, colorRangeInfo) {
2589
- if (this.data) {
2590
- const inputData = this.data.map((diagramData) => diagramData.value);
2591
- this.amountOfData = this.data.reduce((acc, current) => acc + current.value, 0);
2592
- const COLORS = interpolateColors(this.data.length, colorScale, colorRangeInfo);
2593
- this.chartData = {
2594
- labels: this.data.map((data) => data.label),
2595
- datasets: [
2596
- {
2597
- data: inputData,
2598
- backgroundColor: COLORS,
2599
- },
2600
- ],
2601
- };
2602
- }
2603
- this.chartOptions = Object.assign(Object.assign({ plugins: {
2604
- legend: {
2605
- position: 'bottom',
2606
- },
2607
- }, maintainAspectRatio: false }, (this._diagramType === "VERTICAL_BAR" /* DiagramType.VERTICAL_BAR */ && {
2608
- plugins: { legend: { display: false } },
2609
- scales: { y: { ticks: { precision: 0 } } },
2610
- })), (this._diagramType === "HORIZONTAL_BAR" /* DiagramType.HORIZONTAL_BAR */ && {
2611
- indexAxis: 'y',
2612
- plugins: { legend: { display: false } },
2613
- scales: { x: { ticks: { precision: 0 } } },
2614
- }));
2615
- }
2616
- diagramTypeToChartType(value) {
2617
- if (value === "PIE" /* DiagramType.PIE */)
2618
- return 'pie';
2619
- else if (value === "HORIZONTAL_BAR" /* DiagramType.HORIZONTAL_BAR */ || value === "VERTICAL_BAR" /* DiagramType.VERTICAL_BAR */)
2620
- return 'bar';
2621
- return 'pie';
2622
- }
2623
- dataClicked(event) {
2624
- this.dataSelected.emit(event.length);
2625
- }
2626
- onDiagramTypeChanged(event) {
2627
- this.diagramType = event.value.layout;
2628
- this.generateChart(this.colorScale, this.colorRangeInfo);
2629
- this.diagramTypeChanged.emit(event.value.layout);
2630
- }
2631
- }
2632
- DiagramComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DiagramComponent, deps: [{ token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
2633
- DiagramComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DiagramComponent, selector: "ocx-diagram", inputs: { data: "data", sumKey: "sumKey", diagramType: "diagramType", supportedDiagramTypes: "supportedDiagramTypes" }, outputs: { dataSelected: "dataSelected", diagramTypeChanged: "diagramTypeChanged" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"this.data\">\n <div class=\"flex justify-content-center pb-2\" *ngIf=\"shownDiagramTypes.length > 1\">\n <p-selectButton\n [options]=\"shownDiagramTypes\"\n [(ngModel)]=\"selectedDiagramType\"\n optionLabel=\"icon\"\n (onChange)=\"onDiagramTypeChanged($event)\"\n name=\"diagram-type-select-button\"\n >\n <ng-template let-item pTemplate>\n <i [class]=\"item.icon\" [title]=\"item.title || (item.titleKey | translate)\"></i>\n </ng-template>\n </p-selectButton>\n </div>\n <div class=\"w-full flex justify-content-center\">\n <p-chart\n id=\"diagram\"\n [type]=\"chartType\"\n [data]=\"chartData\"\n [responsive]=\"false\"\n [options]=\"chartOptions\"\n (onDataSelect)=\"dataClicked($event)\"\n ></p-chart>\n </div>\n <div class=\"w-full flex justify-content-center mt-2 sumKey\">\n <p class=\"text-md font-medium text-700\">\n <span name=\"sumLabel\"> {{ sumKey | translate }}</span> : <span name=\"amountOfData\">{{ amountOfData}}</span>\n </p>\n </div>\n</ng-container>\n\n<div *ngIf=\"!this.data\" class=\"w-full flex justify-content-center\">\n <p-message severity=\"info\" text=\"{{ 'OCX_DIAGRAM.NO_DATA' | translate }}\"></p-message>\n</div>\n", styles: ["::ng-deep .p-buttonset .p-button{min-width:auto}::ng-deep .p-buttonset{display:flex}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6$1.SelectButton, selector: "p-selectButton", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "tabindex", "multiple", "style", "styleClass", "ariaLabelledBy", "disabled", "dataKey"], outputs: ["onOptionClick", "onChange"] }, { kind: "component", type: i5$2.UIChart, selector: "p-chart", inputs: ["type", "plugins", "width", "height", "responsive", "data", "options"], outputs: ["onDataSelect"] }, { kind: "component", type: i6$2.UIMessage, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass"] }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
2634
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DiagramComponent, decorators: [{
2635
- type: Component,
2636
- args: [{ selector: 'ocx-diagram', template: "<ng-container *ngIf=\"this.data\">\n <div class=\"flex justify-content-center pb-2\" *ngIf=\"shownDiagramTypes.length > 1\">\n <p-selectButton\n [options]=\"shownDiagramTypes\"\n [(ngModel)]=\"selectedDiagramType\"\n optionLabel=\"icon\"\n (onChange)=\"onDiagramTypeChanged($event)\"\n name=\"diagram-type-select-button\"\n >\n <ng-template let-item pTemplate>\n <i [class]=\"item.icon\" [title]=\"item.title || (item.titleKey | translate)\"></i>\n </ng-template>\n </p-selectButton>\n </div>\n <div class=\"w-full flex justify-content-center\">\n <p-chart\n id=\"diagram\"\n [type]=\"chartType\"\n [data]=\"chartData\"\n [responsive]=\"false\"\n [options]=\"chartOptions\"\n (onDataSelect)=\"dataClicked($event)\"\n ></p-chart>\n </div>\n <div class=\"w-full flex justify-content-center mt-2 sumKey\">\n <p class=\"text-md font-medium text-700\">\n <span name=\"sumLabel\"> {{ sumKey | translate }}</span> : <span name=\"amountOfData\">{{ amountOfData}}</span>\n </p>\n </div>\n</ng-container>\n\n<div *ngIf=\"!this.data\" class=\"w-full flex justify-content-center\">\n <p-message severity=\"info\" text=\"{{ 'OCX_DIAGRAM.NO_DATA' | translate }}\"></p-message>\n</div>\n", styles: ["::ng-deep .p-buttonset .p-button{min-width:auto}::ng-deep .p-buttonset{display:flex}\n"] }]
2637
- }], ctorParameters: function () { return [{ type: i1$1.TranslateService }]; }, propDecorators: { data: [{
2638
- type: Input
2639
- }], sumKey: [{
2640
- type: Input
2641
- }], diagramType: [{
2642
- type: Input
2643
- }], supportedDiagramTypes: [{
2644
- type: Input
2645
- }], dataSelected: [{
2646
- type: Output
2647
- }], diagramTypeChanged: [{
2648
- type: Output
2649
- }] } });
2650
- function interpolateColors(amountOfData, colorScale, colorRangeInfo) {
2651
- return ColorUtils.interpolateColors(amountOfData, colorScale, colorRangeInfo);
2652
- }
2653
-
2654
- class GroupByCountDiagramComponent {
2655
- /**
2656
- * @deprecated Will be replaced by diagramType
2657
- */
2658
- get type() {
2659
- return this.diagramType;
2660
- }
2661
- set type(value) {
2662
- this.diagramType = value;
2663
- }
2664
- get data() {
2665
- return this._data$.getValue();
2666
- }
2667
- set data(value) {
2668
- this._data$.next(value);
2669
- }
2670
- get columnType() {
2671
- return this._columnType$.getValue();
2672
- }
2673
- set columnType(value) {
2674
- this._columnType$.next(value);
2675
- }
2676
- get columnField() {
2677
- return this._columnField$.getValue();
2678
- }
2679
- set columnField(value) {
2680
- this._columnField$.next(value);
2681
- }
2682
- get column() {
2683
- return { columnType: this.columnType, id: this.columnField };
2684
- }
2685
- set column(value) {
2686
- this.columnType = value.columnType;
2687
- this.columnField = value.id;
2688
- }
2689
- constructor(translateService) {
2690
- this.translateService = translateService;
2691
- this.sumKey = 'SEARCH.SUMMARY_TITLE';
2692
- this.diagramType = "PIE" /* DiagramType.PIE */;
2693
- this.supportedDiagramTypes = [];
2694
- this._data$ = new BehaviorSubject([]);
2695
- this._columnType$ = new BehaviorSubject(ColumnType.STRING);
2696
- this._columnField$ = new BehaviorSubject('');
2697
- this.dataSelected = new EventEmitter();
2698
- this.diagramTypeChanged = new EventEmitter();
2699
- }
2700
- ngOnInit() {
2701
- this.diagramData$ = combineLatest([this._data$, this._columnField$, this._columnType$]).pipe(mergeMap(([data, columnField, columnType]) => {
2702
- const columnData = data.map((d) => ObjectUtils.resolveFieldData(d, columnField));
2703
- const occurrences = columnData.reduce((acc, current) => {
2704
- return acc.some((e) => e.label === current)
2705
- ? (acc.find((e) => e.label === current).value++, acc)
2706
- : [...acc, { label: current, value: 1 }];
2707
- }, []);
2708
- if (columnType === ColumnType.TRANSLATION_KEY && occurrences.length > 0) {
2709
- return this.translateService.get(occurrences.map((o) => o.label)).pipe(map((translations) => occurrences.map((o) => ({
2710
- label: translations[o.label],
2711
- value: o.value,
2712
- }))));
2713
- }
2714
- else {
2715
- return of(occurrences);
2716
- }
2717
- }));
2718
- }
2719
- dataClicked(event) {
2720
- this.dataSelected.emit(event);
2721
- }
2722
- onDiagramTypeChanged(newDiagramType) {
2723
- this.diagramType = newDiagramType;
2724
- this.diagramTypeChanged.emit(newDiagramType);
2725
- }
2726
- }
2727
- GroupByCountDiagramComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GroupByCountDiagramComponent, deps: [{ token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
2728
- GroupByCountDiagramComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: GroupByCountDiagramComponent, selector: "ocx-group-by-count-diagram", inputs: { sumKey: "sumKey", diagramType: "diagramType", type: "type", supportedDiagramTypes: "supportedDiagramTypes", data: "data", columnType: "columnType", columnField: "columnField", column: "column" }, outputs: { dataSelected: "dataSelected", diagramTypeChanged: "diagramTypeChanged" }, ngImport: i0, template: "<ocx-diagram\n [data]=\"(diagramData$ | async) || []\"\n [sumKey]=\"sumKey\"\n [diagramType]=\"diagramType\"\n (onDataSelect)=\"dataClicked($event)\"\n [supportedDiagramTypes]=\"supportedDiagramTypes\"\n (diagramTypeChanged)=\"onDiagramTypeChanged($event)\"\n></ocx-diagram>\n", dependencies: [{ kind: "component", type: DiagramComponent, selector: "ocx-diagram", inputs: ["data", "sumKey", "diagramType", "supportedDiagramTypes"], outputs: ["dataSelected", "diagramTypeChanged"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
2729
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GroupByCountDiagramComponent, decorators: [{
2730
- type: Component,
2731
- args: [{ selector: 'ocx-group-by-count-diagram', template: "<ocx-diagram\n [data]=\"(diagramData$ | async) || []\"\n [sumKey]=\"sumKey\"\n [diagramType]=\"diagramType\"\n (onDataSelect)=\"dataClicked($event)\"\n [supportedDiagramTypes]=\"supportedDiagramTypes\"\n (diagramTypeChanged)=\"onDiagramTypeChanged($event)\"\n></ocx-diagram>\n" }]
2732
- }], ctorParameters: function () { return [{ type: i1$1.TranslateService }]; }, propDecorators: { sumKey: [{
2733
- type: Input
2734
- }], diagramType: [{
2735
- type: Input
2736
- }], type: [{
2737
- type: Input
2738
- }], supportedDiagramTypes: [{
2739
- type: Input
2740
- }], data: [{
2741
- type: Input
2742
- }], columnType: [{
2743
- type: Input
2744
- }], columnField: [{
2745
- type: Input
2746
- }], column: [{
2747
- type: Input
2748
- }], dataSelected: [{
2749
- type: Output
2750
- }], diagramTypeChanged: [{
2751
- type: Output
2752
- }] } });
2753
-
2754
- class InteractiveDataViewComponent {
2755
- constructor() {
2756
- this.name = 'Data';
2757
- this.subtitleLineIds = [];
2758
- this.supportedViewLayouts = ['grid', 'list', 'table'];
2759
- this.columns = [];
2760
- this.clientSideSorting = true;
2761
- this.clientSideFiltering = true;
2762
- this.fallbackImage = 'placeholder.png';
2763
- this.filters = [];
2764
- this.sortDirection = "NONE" /* DataSortDirection.NONE */;
2765
- this.sortField = '';
2766
- this.sortStates = [
2767
- "ASCENDING" /* DataSortDirection.ASCENDING */,
2768
- "DESCENDING" /* DataSortDirection.DESCENDING */,
2769
- "NONE" /* DataSortDirection.NONE */,
2770
- ];
2771
- this.pageSizes = [10, 25, 50];
2772
- this.layout = 'table';
2773
- this.defaultGroupKey = '';
2774
- this.customGroupKey = 'OCX_INTERACTIVE_DATA_VIEW.CUSTOM_GROUP';
2775
- this.groupSelectionNoGroupSelectedKey = 'OCX_INTERACTIVE_DATA_VIEW.NO_GROUP_SELECTED';
2776
- this.currentPageShowingKey = 'OCX_DATA_TABLE.SHOWING';
2777
- this.currentPageShowingWithTotalOnServerKey = 'OCX_DATA_TABLE.SHOWING_WITH_TOTAL_ON_SERVER';
2778
- this.additionalActions = [];
2779
- this.listGridPaginator = true;
2780
- this.tablePaginator = true;
2781
- this.page = 0;
2782
- this.selectedRows = [];
2783
- this.displayedColumns = [];
2784
- this.frozenActionColumn = false;
2785
- this.actionColumnPosition = 'right';
2786
- this.filtered = new EventEmitter();
2787
- this.sorted = new EventEmitter();
2788
- this.deleteItem = new EventEmitter();
2789
- this.viewItem = new EventEmitter();
2790
- this.editItem = new EventEmitter();
2791
- this.dataViewLayoutChange = new EventEmitter();
2792
- this.displayedColumnsChange = new EventEmitter();
2793
- this.selectionChanged = new EventEmitter();
2794
- this.pageChanged = new EventEmitter();
2795
- this.selectedGroupKey = '';
2796
- this._data = [];
2797
- }
2798
- set dataView(ref) {
2799
- this._dataViewComponent = ref;
2800
- this.registerEventListenerForDataView();
2801
- }
2802
- get dataView() {
2803
- return this._dataViewComponent;
2804
- }
2805
- get paginator() {
2806
- return this.listGridPaginator && this.tablePaginator;
2807
- }
2808
- set paginator(value) {
2809
- this.listGridPaginator = value;
2810
- this.tablePaginator = value;
2811
- }
2812
- get _gridItemSubtitleLines() {
2813
- return this.gridItemSubtitleLines;
2814
- }
2815
- get _listItemSubtitleLines() {
2816
- return this.listItemSubtitleLines;
2817
- }
2818
- get _tableCell() {
2819
- return this.tableCell;
2820
- }
2821
- get _stringTableCell() {
2822
- return this.stringTableCell;
2823
- }
2824
- get _numberTableCell() {
2825
- return this.numberTableCell;
2826
- }
2827
- get _customTableCell() {
2828
- return this.customTableCell;
2829
- }
2830
- get _tableDateCell() {
2831
- var _a;
2832
- return (_a = this.dateTableCell) !== null && _a !== void 0 ? _a : this.tableDateCell;
2833
- }
2834
- get _dateTableCell() {
2835
- return this.dateTableCell;
2836
- }
2837
- get _tableRelativeDateCell() {
2838
- var _a;
2839
- return (_a = this.relativeDateTableCell) !== null && _a !== void 0 ? _a : this.tableRelativeDateCell;
2840
- }
2841
- get _relativeDateTableCell() {
2842
- return this.relativeDateTableCell;
2843
- }
2844
- get _tableTranslationKeyCell() {
2845
- var _a;
2846
- return (_a = this.translationKeyTableCell) !== null && _a !== void 0 ? _a : this.tableTranslationKeyCell;
2847
- }
2848
- get _translationKeyTableCell() {
2849
- return this.translationKeyTableCell;
2850
- }
2851
- get _gridItem() {
2852
- return this.gridItem;
2853
- }
2854
- get _listItem() {
2855
- return this.listItem;
2856
- }
2857
- get data() {
2858
- return this._data;
2859
- }
2860
- set data(value) {
2861
- this._data = value;
2862
- }
2863
- ngOnInit() {
2864
- var _a;
2865
- this.selectedGroupKey = this.defaultGroupKey;
2866
- this.displayedColumns = this.columns;
2867
- if (this.defaultGroupKey) {
2868
- this.displayedColumns = this.columns.filter((column) => { var _a; return (_a = column.predefinedGroupKeys) === null || _a === void 0 ? void 0 : _a.includes(this.defaultGroupKey); });
2869
- }
2870
- this.displayedColumnsChange.emit(this.displayedColumns);
2871
- if (!this.groupSelectionNoGroupSelectedKey) {
2872
- this.groupSelectionNoGroupSelectedKey = 'OCX_INTERACTIVE_DATA_VIEW.NO_GROUP_SELECTED';
2873
- }
2874
- this.firstColumnId = (_a = this.columns[0]) === null || _a === void 0 ? void 0 : _a.id;
2875
- }
2876
- filtering(event) {
2877
- this.filters = event;
2878
- this.filtered.emit(event);
2879
- }
2880
- sorting(event) {
2881
- this.sortDirection = event.sortDirection;
2882
- this.sortField = event.sortColumn;
2883
- this.sorted.emit(event);
2884
- }
2885
- onDeleteElement(element) {
2886
- if (this.isDeleteItemObserved) {
2887
- this.deleteItem.emit(element);
2888
- }
2889
- }
2890
- onViewElement(element) {
2891
- if (this.isViewItemObserved) {
2892
- this.viewItem.emit(element);
2893
- }
2894
- }
2895
- onEditElement(element) {
2896
- if (this.isEditItemObserved) {
2897
- this.editItem.emit(element);
2898
- }
2899
- }
2900
- onDataViewLayoutChange(layout) {
2901
- this.layout = layout;
2902
- this.dataViewLayoutChange.emit(layout);
2903
- }
2904
- onSortChange($event) {
2905
- this.sortField = $event;
2906
- this.sorted.emit({ sortColumn: this.sortField, sortDirection: this.sortDirection });
2907
- }
2908
- onSortDirectionChange($event) {
2909
- this.sortDirection = $event;
2910
- this.sorted.emit({ sortColumn: this.sortField, sortDirection: this.sortDirection });
2911
- }
2912
- onColumnGroupSelectionChange(event) {
2913
- this.displayedColumns = event.activeColumns;
2914
- this.selectedGroupKey = event.groupKey;
2915
- this.displayedColumnsChange.emit(this.displayedColumns);
2916
- }
2917
- registerEventListenerForDataView() {
2918
- var _a, _b, _c, _d, _e, _f, _g, _h;
2919
- if (this.deleteItem.observed) {
2920
- this.isDeleteItemObserved = true;
2921
- if (!((_a = this._dataViewComponent) === null || _a === void 0 ? void 0 : _a.deleteItem.observed)) {
2922
- (_b = this._dataViewComponent) === null || _b === void 0 ? void 0 : _b.deleteItem.subscribe((event) => {
2923
- this.onDeleteElement(event);
2924
- });
2925
- }
2926
- }
2927
- if (this.viewItem.observed) {
2928
- this.isViewItemObserved = true;
2929
- if (!((_c = this._dataViewComponent) === null || _c === void 0 ? void 0 : _c.viewItem.observed)) {
2930
- (_d = this._dataViewComponent) === null || _d === void 0 ? void 0 : _d.viewItem.subscribe((event) => {
2931
- this.onViewElement(event);
2932
- });
2933
- }
2934
- }
2935
- if (this.editItem.observed) {
2936
- this.isEditItemObserved = true;
2937
- if (!((_e = this._dataViewComponent) === null || _e === void 0 ? void 0 : _e.editItem.observed)) {
2938
- (_f = this._dataViewComponent) === null || _f === void 0 ? void 0 : _f.editItem.subscribe((event) => {
2939
- this.onEditElement(event);
2940
- });
2941
- }
2942
- }
2943
- if (this.selectionChanged.observed) {
2944
- if (!((_g = this._dataViewComponent) === null || _g === void 0 ? void 0 : _g.selectionChanged.observed)) {
2945
- (_h = this._dataViewComponent) === null || _h === void 0 ? void 0 : _h.selectionChanged.subscribe((event) => {
2946
- this.onRowSelectionChange(event);
2947
- });
2948
- }
2949
- }
2950
- }
2951
- onColumnSelectionChange(event) {
2952
- this.displayedColumns = event.activeColumns;
2953
- this.selectedGroupKey = this.customGroupKey;
2954
- this.displayedColumnsChange.emit(this.displayedColumns);
2955
- }
2956
- onActionColumnConfigChange(event) {
2957
- this.frozenActionColumn = event.frozenActionColumn;
2958
- this.actionColumnPosition = event.actionColumnPosition;
2959
- }
2960
- onRowSelectionChange(event) {
2961
- if (this.selectionChanged.observed) {
2962
- this.selectionChanged.emit(event);
2963
- }
2964
- }
2965
- onPageChange(event) {
2966
- this.page = event;
2967
- this.pageChanged.emit(event);
2968
- }
2969
- }
2970
- InteractiveDataViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InteractiveDataViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2971
- InteractiveDataViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: InteractiveDataViewComponent, selector: "ocx-interactive-data-view", inputs: { deletePermission: "deletePermission", editPermission: "editPermission", viewPermission: "viewPermission", deleteActionVisibleField: "deleteActionVisibleField", deleteActionEnabledField: "deleteActionEnabledField", viewActionVisibleField: "viewActionVisibleField", viewActionEnabledField: "viewActionEnabledField", editActionVisibleField: "editActionVisibleField", editActionEnabledField: "editActionEnabledField", name: "name", titleLineId: "titleLineId", subtitleLineIds: "subtitleLineIds", supportedViewLayouts: "supportedViewLayouts", columns: "columns", emptyResultsMessage: "emptyResultsMessage", clientSideSorting: "clientSideSorting", clientSideFiltering: "clientSideFiltering", fallbackImage: "fallbackImage", filters: "filters", sortDirection: "sortDirection", sortField: "sortField", sortStates: "sortStates", pageSizes: "pageSizes", pageSize: "pageSize", totalRecordsOnServer: "totalRecordsOnServer", layout: "layout", defaultGroupKey: "defaultGroupKey", customGroupKey: "customGroupKey", groupSelectionNoGroupSelectedKey: "groupSelectionNoGroupSelectedKey", currentPageShowingKey: "currentPageShowingKey", currentPageShowingWithTotalOnServerKey: "currentPageShowingWithTotalOnServerKey", additionalActions: "additionalActions", listGridPaginator: "listGridPaginator", tablePaginator: "tablePaginator", page: "page", selectedRows: "selectedRows", displayedColumns: "displayedColumns", frozenActionColumn: "frozenActionColumn", actionColumnPosition: "actionColumnPosition", paginator: "paginator", data: "data" }, outputs: { filtered: "filtered", sorted: "sorted", deleteItem: "deleteItem", viewItem: "viewItem", editItem: "editItem", dataViewLayoutChange: "dataViewLayoutChange", displayedColumnsChange: "displayedColumnsChange", selectionChanged: "selectionChanged", pageChanged: "pageChanged" }, providers: [{ provide: 'InteractiveDataViewComponent', useExisting: InteractiveDataViewComponent }], queries: [{ propertyName: "tableCell", first: true, predicate: ["tableCell"], descendants: true }, { propertyName: "tableDateCell", first: true, predicate: ["tableDateCell"], descendants: true }, { propertyName: "dateTableCell", first: true, predicate: ["dateTableCell"], descendants: true }, { propertyName: "tableRelativeDateCell", first: true, predicate: ["tableRelativeDateCell"], descendants: true }, { propertyName: "relativeDateTableCell", first: true, predicate: ["relativeDateTableCell"], descendants: true }, { propertyName: "tableTranslationKeyCell", first: true, predicate: ["tableTranslationKeyCell"], descendants: true }, { propertyName: "translationKeyTableCell", first: true, predicate: ["translationKeyTableCell"], descendants: true }, { propertyName: "gridItemSubtitleLines", first: true, predicate: ["gridItemSubtitleLines"], descendants: true }, { propertyName: "listItemSubtitleLines", first: true, predicate: ["listItemSubtitleLines"], descendants: true }, { propertyName: "stringTableCell", first: true, predicate: ["stringTableCell"], descendants: true }, { propertyName: "numberTableCell", first: true, predicate: ["numberTableCell"], descendants: true }, { propertyName: "customTableCell", first: true, predicate: ["customTableCell"], descendants: true }, { propertyName: "gridItem", first: true, predicate: ["gridItem"], descendants: true }, { propertyName: "listItem", first: true, predicate: ["listItem"], descendants: true }, { propertyName: "topCenter", first: true, predicate: ["topCenter"], descendants: true }], viewQueries: [{ propertyName: "dataView", first: true, predicate: DataViewComponent, descendants: true }], ngImport: i0, template: "<div class=\"p-3 border-bottom-1 surface-border\">\n <div class=\"flex flex-wrap justify-content-between align-items-center py-1 gap-2\">\n <ocx-data-layout-selection\n [supportedViewLayouts]=\"supportedViewLayouts\"\n [layout]=\"layout\"\n (dataViewLayoutChange)=\"onDataViewLayoutChange($event)\"\n ></ocx-data-layout-selection>\n\n <div *ngIf=\"topCenter\">\n <ng-container [ngTemplateOutlet]=\"topCenter\"> </ng-container>\n </div>\n\n <div *ngIf=\"layout !== 'table'\" class=\"flex align-items-center gap-2\">\n <ocx-data-list-grid-sorting\n [sortDirection]=\"sortDirection\"\n [sortField]=\"sortField\"\n [columns]=\"columns\"\n [sortStates]=\"sortStates\"\n (sortChange)=\"onSortChange($event)\"\n (sortDirectionChange)=\"onSortDirectionChange($event)\"\n ></ocx-data-list-grid-sorting>\n </div>\n\n <div *ngIf=\"layout === 'table'\" class=\"flex flex-wrap justify-content-between align-items-center gap-2\">\n <ocx-column-group-selection\n [selectedGroupKey]=\"selectedGroupKey\"\n [columns]=\"columns\"\n [defaultGroupKey]=\"defaultGroupKey\"\n [customGroupKey]=\"customGroupKey\"\n [placeholderKey]=\"groupSelectionNoGroupSelectedKey\"\n (groupSelectionChanged)=\"onColumnGroupSelectionChange($event)\"\n ></ocx-column-group-selection>\n\n <ocx-custom-group-column-selector\n [columns]=\"columns\"\n [displayedColumns]=\"displayedColumns\"\n (columnSelectionChanged)=\"onColumnSelectionChange($event)\"\n [frozenActionColumn]=\"frozenActionColumn\"\n [actionColumnPosition]=\"actionColumnPosition\"\n (actionColumnConfigChanged)=\"onActionColumnConfigChange($event)\"\n ></ocx-custom-group-column-selector>\n </div>\n </div>\n</div>\n<div class=\"p-3\">\n <ocx-data-view\n [columns]=\"displayedColumns\"\n [sortStates]=\"sortStates\"\n [sortField]=\"sortField\"\n [filters]=\"filters\"\n [data]=\"data\"\n [sortDirection]=\"sortDirection\"\n [titleLineId]=\"titleLineId || firstColumnId\"\n [subtitleLineIds]=\"subtitleLineIds\"\n [clientSideSorting]=\"clientSideSorting\"\n [clientSideFiltering]=\"clientSideFiltering\"\n [pageSizes]=\"pageSizes\"\n [pageSize]=\"pageSize\"\n [emptyResultsMessage]=\"emptyResultsMessage\"\n [layout]=\"layout\"\n [name]=\"name\"\n [deletePermission]=\"deletePermission\"\n [editPermission]=\"editPermission\"\n [viewPermission]=\"viewPermission\"\n [deleteActionEnabledField]=\"deleteActionEnabledField\"\n [deleteActionVisibleField]=\"deleteActionVisibleField\"\n [editActionEnabledField]=\"editActionEnabledField\"\n [editActionVisibleField]=\"editActionVisibleField\"\n [viewActionEnabledField]=\"viewActionEnabledField\"\n [viewActionVisibleField]=\"viewActionVisibleField\"\n [additionalActions]=\"additionalActions\"\n [listGridPaginator]=\"listGridPaginator\"\n [tablePaginator]=\"tablePaginator\"\n [page]=\"page\"\n (pageChanged)=\"onPageChange($event)\"\n [selectedRows]=\"selectedRows\"\n [frozenActionColumn]=\"frozenActionColumn\"\n [actionColumnPosition]=\"actionColumnPosition\"\n [stringTableCellTemplate]=\"_stringTableCell ? stringTableCell : undefined\"\n [numberTableCellTemplate]=\"_numberTableCell ? numberTableCell : undefined\"\n [customTableCellTemplate]=\"_customTableCell ? customTableCell : undefined\"\n [dateTableCellTemplate]=\"_dateTableCell ? dateTableCell : _tableDateCell ? tableDateCell : undefined\"\n [relativeDateTableCellTemplate]=\"_relativeDateTableCell ? relativeDateTableCell : _tableRelativeDateCell ? tableRelativeDateCell : undefined\"\n [tableCellTemplate]=\"_tableCell ? tableCell : undefined\"\n [translationKeyTableCellTemplate]=\"_translationKeyTableCell ? translationKeyTableCell : _tableTranslationKeyCell ? tableTranslationKeyCell : undefined\"\n [gridItemSubtitleLinesTemplate]=\"_gridItemSubtitleLines ? gridItemSubtitleLines : undefined\"\n [listItemSubtitleLinesTemplate]=\"_listItemSubtitleLines ? listItemSubtitleLines : undefined\"\n [listItemTemplate]=\"_listItem? listItem : undefined\"\n [gridItemTemplate]=\"_gridItem? gridItem : undefined\"\n (sorted)=\"sorting($event)\"\n (filtered)=\"filtering($event)\"\n [totalRecordsOnServer]=\"totalRecordsOnServer\"\n [currentPageShowingKey]=\"currentPageShowingKey\"\n [currentPageShowingWithTotalOnServerKey]=\"currentPageShowingWithTotalOnServerKey\"\n >\n </ocx-data-view>\n</div>\n<ng-template #stringTableCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_stringTableCell\"\n [ngTemplateOutlet]=\"_stringTableCell\"\n [ngTemplateOutletContext]=\"{rowObject: rowObject, column:column}\"\n >\n </ng-container\n></ng-template>\n<ng-template #tableDateCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_tableDateCell\"\n [ngTemplateOutlet]=\"_tableDateCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n></ng-template>\n<ng-template #dateTableCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_dateTableCell\"\n [ngTemplateOutlet]=\"_dateTableCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n></ng-template>\n<ng-template #tableRelativeDateCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_tableRelativeDateCell\"\n [ngTemplateOutlet]=\"_tableRelativeDateCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n></ng-template>\n<ng-template #relativeDateTableCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_relativeDateTableCell\"\n [ngTemplateOutlet]=\"_relativeDateTableCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n></ng-template>\n<ng-template #tableCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_tableCell\"\n [ngTemplateOutlet]=\"_tableCell\"\n [ngTemplateOutletContext]=\"{rowObject: rowObject, column:column}\"\n >\n </ng-container\n></ng-template>\n<ng-template #tableTranslationKeyCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_tableTranslationKeyCell\"\n [ngTemplateOutlet]=\"_tableTranslationKeyCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n></ng-template>\n<ng-template #translationKeyTableCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_translationKeyTableCell\"\n [ngTemplateOutlet]=\"_translationKeyTableCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n></ng-template>\n<ng-template #gridItemSubtitleLines let-item>\n <ng-container\n *ngIf=\"_gridItemSubtitleLines\"\n [ngTemplateOutlet]=\"_gridItemSubtitleLines\"\n [ngTemplateOutletContext]=\"{$implicit:item}\"\n >\n </ng-container>\n</ng-template>\n<ng-template #listItemSubtitleLines let-item>\n <ng-container\n *ngIf=\"_listItemSubtitleLines\"\n [ngTemplateOutlet]=\"_listItemSubtitleLines\"\n [ngTemplateOutletContext]=\"{$implicit:item}\"\n >\n </ng-container\n></ng-template>\n<ng-template #gridItem let-item>\n <ng-container *ngIf=\"_gridItem\" [ngTemplateOutlet]=\"_gridItem\" [ngTemplateOutletContext]=\"{$implicit:item}\">\n </ng-container\n></ng-template>\n<ng-template #listItem let-item>\n <ng-container *ngIf=\"_listItem\" [ngTemplateOutlet]=\"_listItem\" [ngTemplateOutletContext]=\"{$implicit:item}\">\n </ng-container\n></ng-template>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ColumnGroupSelectionComponent, selector: "ocx-column-group-selection", inputs: ["selectedGroupKey", "columns", "placeholderKey", "defaultGroupKey", "customGroupKey"], outputs: ["groupSelectionChanged"] }, { kind: "component", type: CustomGroupColumnSelectorComponent, selector: "ocx-custom-group-column-selector", inputs: ["columns", "displayedColumns", "dialogTitle", "openButtonTitle", "saveButtonLabel", "cancelButtonLabel", "activeColumnsLabel", "inactiveColumnsLabel", "frozenActionColumn", "actionColumnPosition"], outputs: ["columnSelectionChanged", "actionColumnConfigChanged"] }, { kind: "component", type: DataLayoutSelectionComponent, selector: "ocx-data-layout-selection", inputs: ["supportedViewLayouts", "layout"], outputs: ["dataViewLayoutChange"] }, { kind: "component", type: DataListGridSortingComponent, selector: "ocx-data-list-grid-sorting", inputs: ["columns", "sortStates", "sortDirection", "sortField"], outputs: ["sortChange", "sortDirectionChange", "columnsChange"] }, { kind: "component", type: DataViewComponent, selector: "ocx-data-view", inputs: ["deletePermission", "editPermission", "viewPermission", "deleteActionVisibleField", "deleteActionEnabledField", "viewActionVisibleField", "viewActionEnabledField", "editActionVisibleField", "editActionEnabledField", "data", "name", "titleLineId", "subtitleLineIds", "layout", "columns", "emptyResultsMessage", "clientSideSorting", "clientSideFiltering", "fallbackImage", "filters", "sortField", "sortDirection", "listGridPaginator", "tablePaginator", "page", "totalRecordsOnServer", "currentPageShowingKey", "currentPageShowingWithTotalOnServerKey", "selectedRows", "frozenActionColumn", "actionColumnPosition", "paginator", "sortStates", "pageSizes", "pageSize", "stringTableCellTemplate", "numberTableCellTemplate", "customTableCellTemplate", "dateTableCellTemplate", "tableDateCellTemplate", "tableCellTemplate", "translationKeyTableCellTemplate", "tableTranslationKeyCellTemplate", "gridItemSubtitleLinesTemplate", "listItemSubtitleLinesTemplate", "gridItemTemplate", "listItemTemplate", "relativeDateTableCellTemplate", "tableRelativeDateCellTemplate", "additionalActions"], outputs: ["filtered", "sorted", "deleteItem", "viewItem", "editItem", "selectionChanged", "pageChanged"] }] });
2972
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InteractiveDataViewComponent, decorators: [{
2973
- type: Component,
2974
- args: [{ selector: 'ocx-interactive-data-view', providers: [{ provide: 'InteractiveDataViewComponent', useExisting: InteractiveDataViewComponent }], template: "<div class=\"p-3 border-bottom-1 surface-border\">\n <div class=\"flex flex-wrap justify-content-between align-items-center py-1 gap-2\">\n <ocx-data-layout-selection\n [supportedViewLayouts]=\"supportedViewLayouts\"\n [layout]=\"layout\"\n (dataViewLayoutChange)=\"onDataViewLayoutChange($event)\"\n ></ocx-data-layout-selection>\n\n <div *ngIf=\"topCenter\">\n <ng-container [ngTemplateOutlet]=\"topCenter\"> </ng-container>\n </div>\n\n <div *ngIf=\"layout !== 'table'\" class=\"flex align-items-center gap-2\">\n <ocx-data-list-grid-sorting\n [sortDirection]=\"sortDirection\"\n [sortField]=\"sortField\"\n [columns]=\"columns\"\n [sortStates]=\"sortStates\"\n (sortChange)=\"onSortChange($event)\"\n (sortDirectionChange)=\"onSortDirectionChange($event)\"\n ></ocx-data-list-grid-sorting>\n </div>\n\n <div *ngIf=\"layout === 'table'\" class=\"flex flex-wrap justify-content-between align-items-center gap-2\">\n <ocx-column-group-selection\n [selectedGroupKey]=\"selectedGroupKey\"\n [columns]=\"columns\"\n [defaultGroupKey]=\"defaultGroupKey\"\n [customGroupKey]=\"customGroupKey\"\n [placeholderKey]=\"groupSelectionNoGroupSelectedKey\"\n (groupSelectionChanged)=\"onColumnGroupSelectionChange($event)\"\n ></ocx-column-group-selection>\n\n <ocx-custom-group-column-selector\n [columns]=\"columns\"\n [displayedColumns]=\"displayedColumns\"\n (columnSelectionChanged)=\"onColumnSelectionChange($event)\"\n [frozenActionColumn]=\"frozenActionColumn\"\n [actionColumnPosition]=\"actionColumnPosition\"\n (actionColumnConfigChanged)=\"onActionColumnConfigChange($event)\"\n ></ocx-custom-group-column-selector>\n </div>\n </div>\n</div>\n<div class=\"p-3\">\n <ocx-data-view\n [columns]=\"displayedColumns\"\n [sortStates]=\"sortStates\"\n [sortField]=\"sortField\"\n [filters]=\"filters\"\n [data]=\"data\"\n [sortDirection]=\"sortDirection\"\n [titleLineId]=\"titleLineId || firstColumnId\"\n [subtitleLineIds]=\"subtitleLineIds\"\n [clientSideSorting]=\"clientSideSorting\"\n [clientSideFiltering]=\"clientSideFiltering\"\n [pageSizes]=\"pageSizes\"\n [pageSize]=\"pageSize\"\n [emptyResultsMessage]=\"emptyResultsMessage\"\n [layout]=\"layout\"\n [name]=\"name\"\n [deletePermission]=\"deletePermission\"\n [editPermission]=\"editPermission\"\n [viewPermission]=\"viewPermission\"\n [deleteActionEnabledField]=\"deleteActionEnabledField\"\n [deleteActionVisibleField]=\"deleteActionVisibleField\"\n [editActionEnabledField]=\"editActionEnabledField\"\n [editActionVisibleField]=\"editActionVisibleField\"\n [viewActionEnabledField]=\"viewActionEnabledField\"\n [viewActionVisibleField]=\"viewActionVisibleField\"\n [additionalActions]=\"additionalActions\"\n [listGridPaginator]=\"listGridPaginator\"\n [tablePaginator]=\"tablePaginator\"\n [page]=\"page\"\n (pageChanged)=\"onPageChange($event)\"\n [selectedRows]=\"selectedRows\"\n [frozenActionColumn]=\"frozenActionColumn\"\n [actionColumnPosition]=\"actionColumnPosition\"\n [stringTableCellTemplate]=\"_stringTableCell ? stringTableCell : undefined\"\n [numberTableCellTemplate]=\"_numberTableCell ? numberTableCell : undefined\"\n [customTableCellTemplate]=\"_customTableCell ? customTableCell : undefined\"\n [dateTableCellTemplate]=\"_dateTableCell ? dateTableCell : _tableDateCell ? tableDateCell : undefined\"\n [relativeDateTableCellTemplate]=\"_relativeDateTableCell ? relativeDateTableCell : _tableRelativeDateCell ? tableRelativeDateCell : undefined\"\n [tableCellTemplate]=\"_tableCell ? tableCell : undefined\"\n [translationKeyTableCellTemplate]=\"_translationKeyTableCell ? translationKeyTableCell : _tableTranslationKeyCell ? tableTranslationKeyCell : undefined\"\n [gridItemSubtitleLinesTemplate]=\"_gridItemSubtitleLines ? gridItemSubtitleLines : undefined\"\n [listItemSubtitleLinesTemplate]=\"_listItemSubtitleLines ? listItemSubtitleLines : undefined\"\n [listItemTemplate]=\"_listItem? listItem : undefined\"\n [gridItemTemplate]=\"_gridItem? gridItem : undefined\"\n (sorted)=\"sorting($event)\"\n (filtered)=\"filtering($event)\"\n [totalRecordsOnServer]=\"totalRecordsOnServer\"\n [currentPageShowingKey]=\"currentPageShowingKey\"\n [currentPageShowingWithTotalOnServerKey]=\"currentPageShowingWithTotalOnServerKey\"\n >\n </ocx-data-view>\n</div>\n<ng-template #stringTableCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_stringTableCell\"\n [ngTemplateOutlet]=\"_stringTableCell\"\n [ngTemplateOutletContext]=\"{rowObject: rowObject, column:column}\"\n >\n </ng-container\n></ng-template>\n<ng-template #tableDateCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_tableDateCell\"\n [ngTemplateOutlet]=\"_tableDateCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n></ng-template>\n<ng-template #dateTableCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_dateTableCell\"\n [ngTemplateOutlet]=\"_dateTableCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n></ng-template>\n<ng-template #tableRelativeDateCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_tableRelativeDateCell\"\n [ngTemplateOutlet]=\"_tableRelativeDateCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n></ng-template>\n<ng-template #relativeDateTableCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_relativeDateTableCell\"\n [ngTemplateOutlet]=\"_relativeDateTableCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n></ng-template>\n<ng-template #tableCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_tableCell\"\n [ngTemplateOutlet]=\"_tableCell\"\n [ngTemplateOutletContext]=\"{rowObject: rowObject, column:column}\"\n >\n </ng-container\n></ng-template>\n<ng-template #tableTranslationKeyCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_tableTranslationKeyCell\"\n [ngTemplateOutlet]=\"_tableTranslationKeyCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n></ng-template>\n<ng-template #translationKeyTableCell let-rowObject=\"rowObject\" let-column=\"column\">\n <ng-container\n *ngIf=\"_translationKeyTableCell\"\n [ngTemplateOutlet]=\"_translationKeyTableCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n></ng-template>\n<ng-template #gridItemSubtitleLines let-item>\n <ng-container\n *ngIf=\"_gridItemSubtitleLines\"\n [ngTemplateOutlet]=\"_gridItemSubtitleLines\"\n [ngTemplateOutletContext]=\"{$implicit:item}\"\n >\n </ng-container>\n</ng-template>\n<ng-template #listItemSubtitleLines let-item>\n <ng-container\n *ngIf=\"_listItemSubtitleLines\"\n [ngTemplateOutlet]=\"_listItemSubtitleLines\"\n [ngTemplateOutletContext]=\"{$implicit:item}\"\n >\n </ng-container\n></ng-template>\n<ng-template #gridItem let-item>\n <ng-container *ngIf=\"_gridItem\" [ngTemplateOutlet]=\"_gridItem\" [ngTemplateOutletContext]=\"{$implicit:item}\">\n </ng-container\n></ng-template>\n<ng-template #listItem let-item>\n <ng-container *ngIf=\"_listItem\" [ngTemplateOutlet]=\"_listItem\" [ngTemplateOutletContext]=\"{$implicit:item}\">\n </ng-container\n></ng-template>\n" }]
2975
- }], propDecorators: { dataView: [{
2976
- type: ViewChild,
2977
- args: [DataViewComponent]
2978
- }], deletePermission: [{
2979
- type: Input
2980
- }], editPermission: [{
2981
- type: Input
2982
- }], viewPermission: [{
2983
- type: Input
2984
- }], deleteActionVisibleField: [{
2985
- type: Input
2986
- }], deleteActionEnabledField: [{
2987
- type: Input
2988
- }], viewActionVisibleField: [{
2989
- type: Input
2990
- }], viewActionEnabledField: [{
2991
- type: Input
2992
- }], editActionVisibleField: [{
2993
- type: Input
2994
- }], editActionEnabledField: [{
2995
- type: Input
2996
- }], name: [{
2997
- type: Input
2998
- }], titleLineId: [{
2999
- type: Input
3000
- }], subtitleLineIds: [{
3001
- type: Input
3002
- }], supportedViewLayouts: [{
3003
- type: Input
3004
- }], columns: [{
3005
- type: Input
3006
- }], emptyResultsMessage: [{
3007
- type: Input
3008
- }], clientSideSorting: [{
3009
- type: Input
3010
- }], clientSideFiltering: [{
3011
- type: Input
3012
- }], fallbackImage: [{
3013
- type: Input
3014
- }], filters: [{
3015
- type: Input
3016
- }], sortDirection: [{
3017
- type: Input
3018
- }], sortField: [{
3019
- type: Input
3020
- }], sortStates: [{
3021
- type: Input
3022
- }], pageSizes: [{
3023
- type: Input
3024
- }], pageSize: [{
3025
- type: Input
3026
- }], totalRecordsOnServer: [{
3027
- type: Input
3028
- }], layout: [{
3029
- type: Input
3030
- }], defaultGroupKey: [{
3031
- type: Input
3032
- }], customGroupKey: [{
3033
- type: Input
3034
- }], groupSelectionNoGroupSelectedKey: [{
3035
- type: Input
3036
- }], currentPageShowingKey: [{
3037
- type: Input
3038
- }], currentPageShowingWithTotalOnServerKey: [{
3039
- type: Input
3040
- }], additionalActions: [{
3041
- type: Input
3042
- }], listGridPaginator: [{
3043
- type: Input
3044
- }], tablePaginator: [{
3045
- type: Input
3046
- }], page: [{
3047
- type: Input
3048
- }], selectedRows: [{
3049
- type: Input
3050
- }], displayedColumns: [{
3051
- type: Input
3052
- }], frozenActionColumn: [{
3053
- type: Input
3054
- }], actionColumnPosition: [{
3055
- type: Input
3056
- }], tableCell: [{
3057
- type: ContentChild,
3058
- args: ['tableCell']
3059
- }], tableDateCell: [{
3060
- type: ContentChild,
3061
- args: ['tableDateCell']
3062
- }], dateTableCell: [{
3063
- type: ContentChild,
3064
- args: ['dateTableCell']
3065
- }], tableRelativeDateCell: [{
3066
- type: ContentChild,
3067
- args: ['tableRelativeDateCell']
3068
- }], relativeDateTableCell: [{
3069
- type: ContentChild,
3070
- args: ['relativeDateTableCell']
3071
- }], tableTranslationKeyCell: [{
3072
- type: ContentChild,
3073
- args: ['tableTranslationKeyCell']
3074
- }], translationKeyTableCell: [{
3075
- type: ContentChild,
3076
- args: ['translationKeyTableCell']
3077
- }], gridItemSubtitleLines: [{
3078
- type: ContentChild,
3079
- args: ['gridItemSubtitleLines']
3080
- }], listItemSubtitleLines: [{
3081
- type: ContentChild,
3082
- args: ['listItemSubtitleLines']
3083
- }], stringTableCell: [{
3084
- type: ContentChild,
3085
- args: ['stringTableCell']
3086
- }], numberTableCell: [{
3087
- type: ContentChild,
3088
- args: ['numberTableCell']
3089
- }], customTableCell: [{
3090
- type: ContentChild,
3091
- args: ['customTableCell']
3092
- }], gridItem: [{
3093
- type: ContentChild,
3094
- args: ['gridItem']
3095
- }], listItem: [{
3096
- type: ContentChild,
3097
- args: ['listItem']
3098
- }], topCenter: [{
3099
- type: ContentChild,
3100
- args: ['topCenter']
3101
- }], filtered: [{
3102
- type: Output
3103
- }], sorted: [{
3104
- type: Output
3105
- }], deleteItem: [{
3106
- type: Output
3107
- }], viewItem: [{
3108
- type: Output
3109
- }], editItem: [{
3110
- type: Output
3111
- }], dataViewLayoutChange: [{
3112
- type: Output
3113
- }], displayedColumnsChange: [{
3114
- type: Output
3115
- }], selectionChanged: [{
3116
- type: Output
3117
- }], pageChanged: [{
3118
- type: Output
3119
- }], paginator: [{
3120
- type: Input
3121
- }], data: [{
3122
- type: Input
3123
- }] } });
3124
-
3125
- // This topic is defined here and not in integration-interface, because
3126
- // it is not used as framework independent integration but for improving
3127
- // angular specific things
3128
- class TranslationCacheTopic extends SyncableTopic {
3129
- constructor() {
3130
- super('translationCache', 2);
3131
- }
3132
- }
3133
- class TranslationCacheService {
3134
- constructor() {
3135
- var _a;
3136
- this.translationTopic$ = new TranslationCacheTopic();
3137
- (_a = window['onecxTranslations']) !== null && _a !== void 0 ? _a : (window['onecxTranslations'] = {});
3138
- }
3139
- ngOnDestroy() {
3140
- this.translationTopic$.destroy();
3141
- }
3142
- getTranslationFile(url, cacheMissFunction) {
3143
- if (window['onecxTranslations'][url]) {
3144
- return of(window['onecxTranslations'][url]);
3145
- }
3146
- if (window['onecxTranslations'][url] === null) {
3147
- return this.translationTopic$.pipe(filter((messageUrl) => messageUrl === url), map(() => window['onecxTranslations'][url]), first());
3148
- }
3149
- window['onecxTranslations'][url] = null;
3150
- return cacheMissFunction().pipe(tap((t) => {
3151
- window['onecxTranslations'][url] = t;
3152
- this.translationTopic$.publish(url);
3153
- }), map(() => window['onecxTranslations'][url]), first());
3154
- }
3155
- }
3156
- TranslationCacheService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TranslationCacheService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3157
- TranslationCacheService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TranslationCacheService, providedIn: 'root' });
3158
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TranslationCacheService, decorators: [{
3159
- type: Injectable,
3160
- args: [{ providedIn: 'root' }]
3161
- }], ctorParameters: function () { return []; } });
3162
-
3163
- class AppConfigService {
3164
- constructor(http) {
3165
- this.http = http;
3166
- this.config$ = new BehaviorSubject({});
3167
- }
3168
- init(baseUrl) {
3169
- return new Promise((resolve, reject) => {
3170
- const loadConfigPromise = firstValueFrom(this.http.get(Location.joinWithSlash(baseUrl, 'assets/env.json')));
3171
- loadConfigPromise
3172
- .then((config) => __awaiter(this, void 0, void 0, function* () {
3173
- if (config) {
3174
- this.config$.next(config);
3175
- resolve();
3176
- }
3177
- }))
3178
- .catch((e) => {
3179
- console.log(`Failed to load env configuration`);
3180
- reject(e);
3181
- });
3182
- });
3183
- }
3184
- getProperty(key) {
3185
- var _a;
3186
- return (_a = this.config$.getValue()) === null || _a === void 0 ? void 0 : _a[key];
3187
- }
3188
- setProperty(key, val) {
3189
- this.config$.next(Object.assign(Object.assign({}, this.config$.value), { [key]: val }));
3190
- }
3191
- getConfig() {
3192
- return this.config$.getValue();
3193
- }
3194
- }
3195
- AppConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppConfigService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
3196
- AppConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppConfigService });
3197
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppConfigService, decorators: [{
3198
- type: Injectable
3199
- }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
3200
-
3201
- class AngularAcceleratorPrimeNgModule {
3202
- }
3203
- AngularAcceleratorPrimeNgModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AngularAcceleratorPrimeNgModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3204
- AngularAcceleratorPrimeNgModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: AngularAcceleratorPrimeNgModule, imports: [BreadcrumbModule,
3205
- DropdownModule,
3206
- ButtonModule,
3207
- DialogModule,
3208
- PickListModule,
3209
- SelectButtonModule,
3210
- DataViewModule,
3211
- TableModule,
3212
- MenuModule,
3213
- ChartModule,
3214
- MultiSelectModule,
3215
- SkeletonModule,
3216
- MessageModule], exports: [BreadcrumbModule,
3217
- DropdownModule,
3218
- ButtonModule,
3219
- DialogModule,
3220
- PickListModule,
3221
- SelectButtonModule,
3222
- DataViewModule,
3223
- TableModule,
3224
- MenuModule,
3225
- ChartModule,
3226
- MultiSelectModule,
3227
- SkeletonModule,
3228
- MessageModule] });
3229
- AngularAcceleratorPrimeNgModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AngularAcceleratorPrimeNgModule, imports: [BreadcrumbModule,
3230
- DropdownModule,
3231
- ButtonModule,
3232
- DialogModule,
3233
- PickListModule,
3234
- SelectButtonModule,
3235
- DataViewModule,
3236
- TableModule,
3237
- MenuModule,
3238
- ChartModule,
3239
- MultiSelectModule,
3240
- SkeletonModule,
3241
- MessageModule, BreadcrumbModule,
3242
- DropdownModule,
3243
- ButtonModule,
3244
- DialogModule,
3245
- PickListModule,
3246
- SelectButtonModule,
3247
- DataViewModule,
3248
- TableModule,
3249
- MenuModule,
3250
- ChartModule,
3251
- MultiSelectModule,
3252
- SkeletonModule,
3253
- MessageModule] });
3254
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AngularAcceleratorPrimeNgModule, decorators: [{
3255
- type: NgModule,
3256
- args: [{
3257
- imports: [
3258
- BreadcrumbModule,
3259
- DropdownModule,
3260
- ButtonModule,
3261
- DialogModule,
3262
- PickListModule,
3263
- SelectButtonModule,
3264
- DataViewModule,
3265
- TableModule,
3266
- MenuModule,
3267
- ChartModule,
3268
- MultiSelectModule,
3269
- SkeletonModule,
3270
- MessageModule
3271
- ],
3272
- exports: [
3273
- BreadcrumbModule,
3274
- DropdownModule,
3275
- ButtonModule,
3276
- DialogModule,
3277
- PickListModule,
3278
- SelectButtonModule,
3279
- DataViewModule,
3280
- TableModule,
3281
- MenuModule,
3282
- ChartModule,
3283
- MultiSelectModule,
3284
- SkeletonModule,
3285
- MessageModule
3286
- ],
3287
- }]
3288
- }] });
3289
-
3290
- class AngularAcceleratorMissingTranslationHandler {
3291
- handle(params) {
3292
- console.log(`Missing translation for ${params.key}`, params);
3293
- return params.key;
3294
- }
3295
- }
3296
- class AngularAcceleratorModule {
3297
- }
3298
- AngularAcceleratorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AngularAcceleratorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3299
- AngularAcceleratorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: AngularAcceleratorModule, declarations: [ColumnGroupSelectionComponent,
3300
- CustomGroupColumnSelectorComponent,
3301
- DataLayoutSelectionComponent,
3302
- DataListGridSortingComponent,
3303
- DataListGridComponent,
3304
- DataTableComponent,
3305
- DataViewComponent,
3306
- InteractiveDataViewComponent,
3307
- SearchConfigComponent,
3308
- PageHeaderComponent,
3309
- DynamicPipe,
3310
- SearchHeaderComponent,
3311
- DiagramComponent,
3312
- GroupByCountDiagramComponent,
3313
- IfPermissionDirective,
3314
- IfBreakpointDirective,
3315
- SrcDirective,
3316
- OcxTimeAgoPipe,
3317
- SrcDirective,
3318
- AdvancedDirective], imports: [CommonModule,
3319
- AngularAcceleratorPrimeNgModule,
3320
- TranslateModule,
3321
- FormsModule,
3322
- RouterModule,
3323
- ReactiveFormsModule], exports: [ColumnGroupSelectionComponent,
3324
- CustomGroupColumnSelectorComponent,
3325
- DataLayoutSelectionComponent,
3326
- DataListGridComponent,
3327
- DataTableComponent,
3328
- DataViewComponent,
3329
- InteractiveDataViewComponent,
3330
- SearchConfigComponent,
3331
- PageHeaderComponent,
3332
- SearchHeaderComponent,
3333
- DiagramComponent,
3334
- GroupByCountDiagramComponent,
3335
- IfPermissionDirective,
3336
- IfBreakpointDirective,
3337
- SrcDirective,
3338
- OcxTimeAgoPipe,
3339
- SrcDirective,
3340
- AdvancedDirective] });
3341
- AngularAcceleratorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AngularAcceleratorModule, providers: [
3342
- {
3343
- provide: LOCALE_ID,
3344
- useFactory: (UserService) => {
3345
- return UserService.lang$.getValue();
3346
- },
3347
- deps: [UserService],
3348
- },
3349
- AppConfigService,
3350
- ], imports: [CommonModule,
3351
- AngularAcceleratorPrimeNgModule,
3352
- TranslateModule,
3353
- FormsModule,
3354
- RouterModule,
3355
- ReactiveFormsModule] });
3356
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AngularAcceleratorModule, decorators: [{
3357
- type: NgModule,
3358
- args: [{
3359
- imports: [
3360
- CommonModule,
3361
- AngularAcceleratorPrimeNgModule,
3362
- TranslateModule,
3363
- FormsModule,
3364
- RouterModule,
3365
- ReactiveFormsModule,
3366
- ],
3367
- declarations: [
3368
- ColumnGroupSelectionComponent,
3369
- CustomGroupColumnSelectorComponent,
3370
- DataLayoutSelectionComponent,
3371
- DataListGridSortingComponent,
3372
- DataListGridComponent,
3373
- DataTableComponent,
3374
- DataViewComponent,
3375
- InteractiveDataViewComponent,
3376
- SearchConfigComponent,
3377
- PageHeaderComponent,
3378
- DynamicPipe,
3379
- SearchHeaderComponent,
3380
- DiagramComponent,
3381
- GroupByCountDiagramComponent,
3382
- IfPermissionDirective,
3383
- IfBreakpointDirective,
3384
- SrcDirective,
3385
- OcxTimeAgoPipe,
3386
- SrcDirective,
3387
- AdvancedDirective,
3388
- ],
3389
- providers: [
3390
- {
3391
- provide: LOCALE_ID,
3392
- useFactory: (UserService) => {
3393
- return UserService.lang$.getValue();
3394
- },
3395
- deps: [UserService],
3396
- },
3397
- AppConfigService,
3398
- ],
3399
- exports: [
3400
- ColumnGroupSelectionComponent,
3401
- CustomGroupColumnSelectorComponent,
3402
- DataLayoutSelectionComponent,
3403
- DataListGridComponent,
3404
- DataTableComponent,
3405
- DataViewComponent,
3406
- InteractiveDataViewComponent,
3407
- SearchConfigComponent,
3408
- PageHeaderComponent,
3409
- SearchHeaderComponent,
3410
- DiagramComponent,
3411
- GroupByCountDiagramComponent,
3412
- IfPermissionDirective,
3413
- IfBreakpointDirective,
3414
- SrcDirective,
3415
- OcxTimeAgoPipe,
3416
- SrcDirective,
3417
- AdvancedDirective,
3418
- ],
3419
- }]
3420
- }] });
3421
-
3422
- class AsyncTranslateLoader {
3423
- constructor(translateLoader$) {
3424
- this.translateLoader$ = translateLoader$;
3425
- this.timerId = AsyncTranslateLoader.lastTimerId++;
3426
- }
3427
- getTranslation(lang) {
3428
- return this.translateLoader$.pipe(tap(() => console.time('AsyncTranslateLoader_' + this.timerId)), defaultIfEmpty(undefined), first(), mergeMap((translateLoader) => { var _a; return (_a = translateLoader === null || translateLoader === void 0 ? void 0 : translateLoader.getTranslation(lang)) !== null && _a !== void 0 ? _a : of({}); }), tap(() => console.timeEnd('AsyncTranslateLoader_' + this.timerId)));
3429
- }
3430
- }
3431
- AsyncTranslateLoader.lastTimerId = 0;
3432
-
3433
- class CachingTranslateLoader {
3434
- constructor(translationCache, http, prefix, suffix) {
3435
- this.translationCache = translationCache;
3436
- this.http = http;
3437
- this.prefix = prefix;
3438
- this.suffix = suffix;
3439
- this.translateLoader = new TranslateHttpLoader(this.http, this.prefix, this.suffix);
3440
- }
3441
- getTranslation(lang) {
3442
- const url = `${this.prefix}${lang}${this.suffix}`;
3443
- return this.translationCache.getTranslationFile(url, () => this.translateLoader.getTranslation(lang));
3444
- }
3445
- }
3446
-
3447
- class TranslateCombinedLoader {
3448
- constructor(...loaders) {
3449
- this._loaders = loaders;
3450
- }
3451
- getTranslation(lang) {
3452
- return forkJoin(this._loaders.map((l) => l.getTranslation(lang))).pipe(map((allTranslations) => {
3453
- let result = {};
3454
- allTranslations.forEach((translations) => {
3455
- result = this.mergeDeep(result, translations);
3456
- });
3457
- return result;
3458
- }));
3459
- }
3460
- isObject(item) {
3461
- return item && typeof item === 'object' && !Array.isArray(item);
3462
- }
3463
- mergeDeep(target, source) {
3464
- const output = Object.assign({}, target);
3465
- if (this.isObject(target) && this.isObject(source)) {
3466
- Object.keys(source).forEach((key) => {
3467
- if (this.isObject(source[key])) {
3468
- if (!(key in target))
3469
- Object.assign(output, { [key]: source[key] });
3470
- else
3471
- output[key] = this.mergeDeep(target[key], source[key]);
3472
- }
3473
- else {
3474
- Object.assign(output, { [key]: source[key] });
3475
- }
3476
- });
3477
- }
3478
- return output;
3479
- }
3480
- }
3481
-
3482
- let lastTranslateLoaderTimerId$1 = 0;
3483
- function createTranslateLoader(http, appStateService, translationCacheService) {
3484
- const ts = translationCacheService !== null && translationCacheService !== void 0 ? translationCacheService : inject(TranslationCacheService);
3485
- const timerId = lastTranslateLoaderTimerId$1++;
3486
- console.time('createTranslateLoader_' + timerId);
3487
- return new AsyncTranslateLoader(combineLatest([appStateService.currentMfe$.asObservable(), appStateService.globalLoading$.asObservable()]).pipe(filter(([, isLoading]) => !isLoading), map(([currentMfe]) => {
3488
- return new TranslateCombinedLoader(
3489
- // translations of shell or of app in standalone mode
3490
- new CachingTranslateLoader(ts, http, `./assets/i18n/`, '.json'),
3491
- // translations of portal-integration-angular of app
3492
- new CachingTranslateLoader(ts, http, Location.joinWithSlash(currentMfe.remoteBaseUrl, `onecx-portal-lib/assets/i18n/`), '.json'),
3493
- // translations of the app
3494
- new CachingTranslateLoader(ts, http, Location.joinWithSlash(currentMfe.remoteBaseUrl, `assets/i18n/`), '.json'));
3495
- }), tap(() => console.timeEnd('createTranslateLoader_' + timerId))));
3496
- }
3497
-
3498
- class DateUtils {
3499
- constructor(locale) {
3500
- this.locale = locale;
3501
- this.options = {
3502
- month: 'short',
3503
- day: '2-digit',
3504
- year: 'numeric',
3505
- hour: 'numeric',
3506
- minute: '2-digit',
3507
- second: '2-digit',
3508
- };
3509
- }
3510
- localizedDate(date) {
3511
- return date
3512
- ? new Intl.DateTimeFormat(this.locale, this.options).format(date instanceof Date ? date : new Date(date))
3513
- : '';
3514
- }
3515
- }
3516
- DateUtils.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DateUtils, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Injectable });
3517
- DateUtils.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DateUtils, providedIn: 'root' });
3518
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DateUtils, decorators: [{
3519
- type: Injectable,
3520
- args: [{
3521
- providedIn: 'root',
3522
- }]
3523
- }], ctorParameters: function () {
3524
- return [{ type: undefined, decorators: [{
3525
- type: Inject,
3526
- args: [LOCALE_ID]
3527
- }] }];
3528
- } });
3529
- function isValidDate(value) {
3530
- return value instanceof Date && !isNaN(value);
3531
- }
3532
-
3533
- let lastTranslateLoaderTimerId = 0;
3534
- function createRemoteComponentTranslateLoader(http, baseUrlReplaySubject$, translationCacheService) {
3535
- const ts = translationCacheService !== null && translationCacheService !== void 0 ? translationCacheService : inject(TranslationCacheService);
3536
- const timerId = lastTranslateLoaderTimerId++;
3537
- console.time('createRemoteComponentTranslateLoader_' + timerId);
3538
- return new AsyncTranslateLoader(baseUrlReplaySubject$.pipe(map((baseUrl) => {
3539
- return new TranslateCombinedLoader(
3540
- // translations of shell or of app in standalone mode
3541
- new CachingTranslateLoader(ts, http, `./assets/i18n/`, '.json'),
3542
- // translations of portal-integration-angular of app
3543
- new CachingTranslateLoader(ts, http, Location.joinWithSlash(baseUrl, `onecx-portal-lib/assets/i18n/`), '.json'),
3544
- // translations of the app
3545
- new CachingTranslateLoader(ts, http, Location.joinWithSlash(baseUrl, `assets/i18n/`), '.json'));
3546
- }), tap(() => console.timeEnd('createRemoteComponentTranslateLoader_' + timerId))));
3547
- }
3548
-
3549
- function enumToDropdownOptions(translateService, enumType, translationKeyPrefix) {
3550
- return translateService.get(Object.values(enumType).map((v) => translationKeyPrefix + v)).pipe(map((translations) => Object.values(enumType).map((v) => ({
3551
- label: translations[translationKeyPrefix + v],
3552
- value: v,
3553
- }))));
3554
- }
3555
-
3556
- // directives
3557
-
3558
- /**
3559
- * Generated bundle index. Do not edit.
3560
- */
3561
-
3562
- export { AdvancedDirective, AngularAcceleratorMissingTranslationHandler, AngularAcceleratorModule, AngularAcceleratorPrimeNgModule, AppConfigService, AsyncTranslateLoader, BreadcrumbService, CachingTranslateLoader, ColorUtils, ColumnGroupSelectionComponent, ColumnType, CustomGroupColumnSelectorComponent, DataLayoutSelectionComponent, DataListGridComponent, DataListGridSortingComponent, DataTableComponent, DataViewComponent, DateUtils, DiagramComponent, DynamicPipe, GroupByCountDiagramComponent, IfBreakpointDirective, IfPermissionDirective, InteractiveDataViewComponent, ObjectUtils, OcxTimeAgoPipe, PageHeaderComponent, SearchConfigComponent, SearchHeaderComponent, SrcDirective, TranslateCombinedLoader, TranslationCacheService, createRemoteComponentTranslateLoader, createTranslateLoader, enumToDropdownOptions, flattenObject, isValidDate };
3563
- //# sourceMappingURL=onecx-angular-accelerator.mjs.map