@onecx/angular-accelerator 4.11.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/README.md +7 -0
  2. package/assets/i18n/de.json +130 -0
  3. package/assets/i18n/en.json +130 -0
  4. package/assets/images/placeholder.png +0 -0
  5. package/assets/styles.scss +8 -0
  6. package/esm2020/index.mjs +49 -0
  7. package/esm2020/lib/angular-accelerator-primeng.module.mjs +83 -0
  8. package/esm2020/lib/angular-accelerator.module.mjs +209 -0
  9. package/esm2020/lib/components/column-group-selection/column-group-selection.component.mjs +72 -0
  10. package/esm2020/lib/components/custom-group-column-selector/custom-group-column-selector.component.mjs +108 -0
  11. package/esm2020/lib/components/data-layout-selection/data-layout-selection.component.mjs +45 -0
  12. package/esm2020/lib/components/data-list-grid/data-list-grid.component.mjs +358 -0
  13. package/esm2020/lib/components/data-list-grid-sorting/data-list-grid-sorting.component.mjs +92 -0
  14. package/esm2020/lib/components/data-sort-base/data-sort-base.mjs +110 -0
  15. package/esm2020/lib/components/data-table/data-table.component.mjs +350 -0
  16. package/esm2020/lib/components/data-view/data-view.component.mjs +355 -0
  17. package/esm2020/lib/components/diagram/diagram.component.mjs +136 -0
  18. package/esm2020/lib/components/group-by-count-diagram/group-by-count-diagram.component.mjs +109 -0
  19. package/esm2020/lib/components/interactive-data-view/interactive-data-view.component.mjs +342 -0
  20. package/esm2020/lib/components/page-header/page-header.component.mjs +189 -0
  21. package/esm2020/lib/components/search-config/search-config.component.mjs +34 -0
  22. package/esm2020/lib/components/search-header/search-header.component.mjs +136 -0
  23. package/esm2020/lib/directives/if-breakpoint.directive.mjs +39 -0
  24. package/esm2020/lib/directives/if-permission.directive.mjs +53 -0
  25. package/esm2020/lib/functions/flatten-object.mjs +20 -0
  26. package/esm2020/lib/model/breadcrumb-menu-item.model.mjs +2 -0
  27. package/esm2020/lib/model/column-type.model.mjs +9 -0
  28. package/esm2020/lib/model/data-action.mjs +2 -0
  29. package/esm2020/lib/model/data-column-name-id.model.mjs +2 -0
  30. package/esm2020/lib/model/data-sort-direction.mjs +2 -0
  31. package/esm2020/lib/model/data-table-column.model.mjs +2 -0
  32. package/esm2020/lib/model/diagram-column.mjs +2 -0
  33. package/esm2020/lib/model/diagram-data.mjs +2 -0
  34. package/esm2020/lib/model/diagram-type.mjs +2 -0
  35. package/esm2020/lib/model/search-config-info.mjs +2 -0
  36. package/esm2020/lib/pipes/dynamic.pipe.mjs +58 -0
  37. package/esm2020/lib/pipes/ocxtimeago.pipe.mjs +15 -0
  38. package/esm2020/lib/services/breadcrumb.service.mjs +79 -0
  39. package/esm2020/lib/services/translation-cache.service.mjs +54 -0
  40. package/esm2020/lib/utils/async-translate-loader.utils.mjs +12 -0
  41. package/esm2020/lib/utils/caching-translate-loader.utils.mjs +15 -0
  42. package/esm2020/lib/utils/colorutils.mjs +19 -0
  43. package/esm2020/lib/utils/create-translate-loader.utils.mjs +23 -0
  44. package/esm2020/lib/utils/dateutils.mjs +32 -0
  45. package/esm2020/lib/utils/objectutils.mjs +30 -0
  46. package/esm2020/lib/utils/ocxtimeagointl.utils.mjs +34 -0
  47. package/esm2020/lib/utils/primeicon.utils.mjs +2 -0
  48. package/esm2020/lib/utils/translate.combined.loader.mjs +36 -0
  49. package/esm2020/onecx-angular-accelerator.mjs +5 -0
  50. package/esm2020/testing/column-group-selection.harness.mjs +10 -0
  51. package/esm2020/testing/custom-group-column-selector.harness.mjs +31 -0
  52. package/esm2020/testing/data-layout-selection.harness.mjs +33 -0
  53. package/esm2020/testing/data-list-grid.harness.mjs +47 -0
  54. package/esm2020/testing/data-table.harness.mjs +57 -0
  55. package/esm2020/testing/data-view.harness.mjs +12 -0
  56. package/esm2020/testing/default-grid-item.harness.mjs +24 -0
  57. package/esm2020/testing/default-list-item.harness.mjs +24 -0
  58. package/esm2020/testing/diagram.harness.mjs +22 -0
  59. package/esm2020/testing/index.mjs +17 -0
  60. package/esm2020/testing/interactive-data-view.harness.mjs +19 -0
  61. package/esm2020/testing/more-actions-menu-button.harness.mjs +35 -0
  62. package/esm2020/testing/onecx-angular-accelerator-testing.mjs +5 -0
  63. package/esm2020/testing/page-header.harness.mjs +36 -0
  64. package/esm2020/testing/search-config.harness.mjs +10 -0
  65. package/fesm2015/onecx-angular-accelerator-testing.mjs +430 -0
  66. package/fesm2015/onecx-angular-accelerator-testing.mjs.map +1 -0
  67. package/fesm2015/onecx-angular-accelerator.mjs +3118 -0
  68. package/fesm2015/onecx-angular-accelerator.mjs.map +1 -0
  69. package/fesm2020/onecx-angular-accelerator-testing.mjs +338 -0
  70. package/fesm2020/onecx-angular-accelerator-testing.mjs.map +1 -0
  71. package/fesm2020/onecx-angular-accelerator.mjs +3085 -0
  72. package/fesm2020/onecx-angular-accelerator.mjs.map +1 -0
  73. package/index.d.ts +38 -0
  74. package/lib/angular-accelerator-primeng.module.d.ts +16 -0
  75. package/lib/angular-accelerator.module.d.ts +32 -0
  76. package/lib/components/column-group-selection/column-group-selection.component.d.ts +28 -0
  77. package/lib/components/custom-group-column-selector/custom-group-column-selector.component.d.ts +45 -0
  78. package/lib/components/data-layout-selection/data-layout-selection.component.d.ts +25 -0
  79. package/lib/components/data-list-grid/data-list-grid.component.d.ts +120 -0
  80. package/lib/components/data-list-grid-sorting/data-list-grid-sorting.component.d.ts +30 -0
  81. package/lib/components/data-sort-base/data-sort-base.d.ts +32 -0
  82. package/lib/components/data-table/data-table.component.d.ts +124 -0
  83. package/lib/components/data-view/data-view.component.d.ts +112 -0
  84. package/lib/components/diagram/diagram.component.d.ts +43 -0
  85. package/lib/components/group-by-count-diagram/group-by-count-diagram.component.d.ts +39 -0
  86. package/lib/components/interactive-data-view/interactive-data-view.component.d.ts +108 -0
  87. package/lib/components/page-header/page-header.component.d.ts +90 -0
  88. package/lib/components/search-config/search-config.component.d.ts +16 -0
  89. package/lib/components/search-header/search-header.component.d.ts +46 -0
  90. package/lib/directives/if-breakpoint.directive.d.ts +12 -0
  91. package/lib/directives/if-permission.directive.d.ts +18 -0
  92. package/lib/functions/flatten-object.d.ts +14 -0
  93. package/lib/model/breadcrumb-menu-item.model.d.ts +60 -0
  94. package/lib/model/column-type.model.d.ts +7 -0
  95. package/lib/model/data-action.d.ts +9 -0
  96. package/lib/model/data-column-name-id.model.d.ts +4 -0
  97. package/lib/model/data-sort-direction.d.ts +5 -0
  98. package/lib/model/data-table-column.model.d.ts +9 -0
  99. package/lib/model/diagram-column.d.ts +5 -0
  100. package/lib/model/diagram-data.d.ts +4 -0
  101. package/lib/model/diagram-type.d.ts +5 -0
  102. package/lib/model/search-config-info.d.ts +4 -0
  103. package/lib/pipes/dynamic.pipe.d.ts +13 -0
  104. package/lib/pipes/ocxtimeago.pipe.d.ts +6 -0
  105. package/lib/services/breadcrumb.service.d.ts +20 -0
  106. package/lib/services/translation-cache.service.d.ts +12 -0
  107. package/lib/utils/async-translate-loader.utils.d.ts +9 -0
  108. package/lib/utils/caching-translate-loader.utils.d.ts +13 -0
  109. package/lib/utils/colorutils.d.ts +12 -0
  110. package/lib/utils/create-translate-loader.utils.d.ts +5 -0
  111. package/lib/utils/dateutils.d.ts +9 -0
  112. package/lib/utils/objectutils.d.ts +4 -0
  113. package/lib/utils/ocxtimeagointl.utils.d.ts +9 -0
  114. package/lib/utils/primeicon.utils.d.ts +5 -0
  115. package/lib/utils/translate.combined.loader.d.ts +9 -0
  116. package/package.json +55 -0
  117. package/testing/column-group-selection.harness.d.ts +6 -0
  118. package/testing/custom-group-column-selector.harness.d.ts +14 -0
  119. package/testing/data-layout-selection.harness.d.ts +11 -0
  120. package/testing/data-list-grid.harness.d.ts +15 -0
  121. package/testing/data-table.harness.d.ts +17 -0
  122. package/testing/data-view.harness.d.ts +8 -0
  123. package/testing/default-grid-item.harness.d.ts +11 -0
  124. package/testing/default-list-item.harness.d.ts +12 -0
  125. package/testing/diagram.harness.d.ts +10 -0
  126. package/testing/index.d.ts +16 -0
  127. package/testing/interactive-data-view.harness.d.ts +15 -0
  128. package/testing/more-actions-menu-button.harness.d.ts +10 -0
  129. package/testing/page-header.harness.d.ts +13 -0
  130. package/testing/search-config.harness.d.ts +6 -0
@@ -0,0 +1,3085 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Directive, Optional, Input, HostListener, EventEmitter, Component, Output, LOCALE_ID, Inject, ContentChild, Pipe, ViewChild, Injectable, Injector, ViewEncapsulation, NgModule, inject, importProvidersFrom, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3
+ import * as i2 from '@onecx/angular-integration-interface';
4
+ import { UserService, AppStateService } from '@onecx/angular-integration-interface';
5
+ import { BehaviorSubject, combineLatest, map, of, mergeMap, filter, concat, withLatestFrom, tap, race, first, defaultIfEmpty, forkJoin } from 'rxjs';
6
+ import * as i3 from '@angular/common';
7
+ import { CurrencyPipe, DecimalPipe, DatePipe, Location, CommonModule } from '@angular/common';
8
+ import * as i2$1 from 'primeng/dropdown';
9
+ import { DropdownModule } from 'primeng/dropdown';
10
+ import * as i2$2 from 'primeng/api';
11
+ import { PrimeIcons } from 'primeng/api';
12
+ import * as i3$1 from '@angular/forms';
13
+ import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
14
+ import * as i1 from '@ngx-translate/core';
15
+ import { TranslateModule, TranslateLoader, MissingTranslationHandler } from '@ngx-translate/core';
16
+ import * as i5 from 'primeng/button';
17
+ import { ButtonModule } from 'primeng/button';
18
+ import * as i4 from 'primeng/dialog';
19
+ import { DialogModule } from 'primeng/dialog';
20
+ import * as i5$1 from 'primeng/picklist';
21
+ import { PickListModule } from 'primeng/picklist';
22
+ import * as i6 from 'primeng/selectbutton';
23
+ import { SelectButtonModule } from 'primeng/selectbutton';
24
+ import * as i1$1 from '@angular/router';
25
+ import { NavigationEnd, RouterModule } from '@angular/router';
26
+ import * as i7 from 'primeng/dataview';
27
+ import { DataViewModule } from 'primeng/dataview';
28
+ import * as i8 from 'primeng/menu';
29
+ import { MenuModule } from 'primeng/menu';
30
+ import * as i6$1 from 'primeng/table';
31
+ import { TableModule } from 'primeng/table';
32
+ import * as i7$1 from 'primeng/multiselect';
33
+ import { MultiSelectModule } from 'primeng/multiselect';
34
+ import { TimeagoPipe, TimeagoIntl, TimeagoModule, TimeagoFormatter, TimeagoCustomFormatter, TimeagoClock, TimeagoDefaultClock } from 'ngx-timeago';
35
+ import * as d3 from 'd3-scale-chromatic';
36
+ import * as i5$2 from 'primeng/chart';
37
+ import { ChartModule } from 'primeng/chart';
38
+ import { SyncableTopic } from '@onecx/accelerator';
39
+ import { HttpClient } from '@angular/common/http';
40
+ import { strings } from 'ngx-timeago/language-strings/en';
41
+ import { strings as strings$1 } from 'ngx-timeago/language-strings/de';
42
+ import { TranslateHttpLoader } from '@ngx-translate/http-loader';
43
+
44
+ class IfPermissionDirective {
45
+ set notPermission(value) {
46
+ this.permission = value;
47
+ this.negate = true;
48
+ }
49
+ constructor(renderer, el, viewContainer, userService, templateRef) {
50
+ this.renderer = renderer;
51
+ this.el = el;
52
+ this.viewContainer = viewContainer;
53
+ this.userService = userService;
54
+ this.templateRef = templateRef;
55
+ this.onMissingPermission = 'hide';
56
+ this.negate = false;
57
+ }
58
+ ngOnInit() {
59
+ if (this.permission) {
60
+ if (this.negate === this.userService.hasPermission(this.permission)) {
61
+ if (this.onMissingPermission === 'disable') {
62
+ this.renderer.setAttribute(this.el.nativeElement, 'disabled', 'disabled');
63
+ }
64
+ else {
65
+ this.viewContainer.clear();
66
+ }
67
+ }
68
+ else {
69
+ if (this.templateRef) {
70
+ this.viewContainer.createEmbeddedView(this.templateRef);
71
+ }
72
+ }
73
+ }
74
+ }
75
+ }
76
+ 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: i2.UserService }, { token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
77
+ 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" }, ngImport: i0 });
78
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IfPermissionDirective, decorators: [{
79
+ type: Directive,
80
+ args: [{ selector: '[ocxIfPermission], [ocxIfNotPermission]' }]
81
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i2.UserService }, { type: i0.TemplateRef, decorators: [{
82
+ type: Optional
83
+ }] }]; }, propDecorators: { permission: [{
84
+ type: Input,
85
+ args: ['ocxIfPermission']
86
+ }], notPermission: [{
87
+ type: Input,
88
+ args: ['ocxIfNotPermission']
89
+ }], onMissingPermission: [{
90
+ type: Input
91
+ }] } });
92
+
93
+ class IfBreakpointDirective {
94
+ constructor(viewContainer, templateRef) {
95
+ this.viewContainer = viewContainer;
96
+ this.templateRef = templateRef;
97
+ }
98
+ ngOnInit() {
99
+ this.onResize();
100
+ }
101
+ onResize() {
102
+ const mobileBreakpointVar = getComputedStyle(document.documentElement).getPropertyValue('--mobile-break-point');
103
+ const isMobile = window.matchMedia(`(max-width: ${mobileBreakpointVar})`).matches;
104
+ const isDesktop = !isMobile;
105
+ if ((this.breakpoint === 'mobile' && isMobile) || (this.breakpoint === 'desktop' && isDesktop)) {
106
+ if (this.templateRef && !this.viewContainer.length) {
107
+ this.viewContainer.createEmbeddedView(this.templateRef);
108
+ }
109
+ }
110
+ else {
111
+ this.viewContainer.clear();
112
+ }
113
+ }
114
+ }
115
+ 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 });
116
+ 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 });
117
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IfBreakpointDirective, decorators: [{
118
+ type: Directive,
119
+ args: [{ selector: '[ocxIfBreakpoint]' }]
120
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef, decorators: [{
121
+ type: Optional
122
+ }] }]; }, propDecorators: { breakpoint: [{
123
+ type: Input,
124
+ args: ['ocxIfBreakpoint']
125
+ }], onResize: [{
126
+ type: HostListener,
127
+ args: ['window:resize']
128
+ }] } });
129
+
130
+ class ColumnGroupSelectionComponent {
131
+ constructor() {
132
+ this.selectedGroupKey$ = new BehaviorSubject('');
133
+ this.columns$ = new BehaviorSubject([]);
134
+ this.placeholderKey = '';
135
+ this.defaultGroupKey = '';
136
+ this.customGroupKey = '';
137
+ this.groupSelectionChanged = new EventEmitter();
138
+ }
139
+ get selectedGroupKey() {
140
+ return this.selectedGroupKey$.getValue();
141
+ }
142
+ set selectedGroupKey(value) {
143
+ this.selectedGroupKey$.next(value);
144
+ }
145
+ get columns() {
146
+ return this.columns$.getValue();
147
+ }
148
+ set columns(value) {
149
+ this.columns$.next(value);
150
+ }
151
+ ngOnInit() {
152
+ this.allGroupKeys$ = combineLatest([this.columns$, this.selectedGroupKey$]).pipe(map(([columns, selectedGroupKey]) => columns
153
+ .map((keys) => keys.predefinedGroupKeys || [])
154
+ .flat()
155
+ .concat([this.defaultGroupKey])
156
+ .concat([selectedGroupKey])
157
+ .filter((value) => !!value)
158
+ .filter((value, index, self) => self.indexOf(value) === index && value != null)));
159
+ }
160
+ changeGroupSelection(event) {
161
+ if (event.value === this.customGroupKey) {
162
+ return;
163
+ }
164
+ const activeColumns = this.columns.filter((c) => c.predefinedGroupKeys?.includes(event.value));
165
+ this.groupSelectionChanged.emit({ activeColumns, groupKey: event.value });
166
+ }
167
+ clearGroupSelection() {
168
+ let activeColumns = this.columns;
169
+ if (this.defaultGroupKey) {
170
+ activeColumns = this.columns.filter((column) => column.predefinedGroupKeys?.includes(this.defaultGroupKey));
171
+ }
172
+ this.groupSelectionChanged.emit({ activeColumns, groupKey: this.defaultGroupKey });
173
+ }
174
+ }
175
+ ColumnGroupSelectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ColumnGroupSelectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
176
+ 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: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.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$2.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: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
177
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ColumnGroupSelectionComponent, decorators: [{
178
+ type: Component,
179
+ 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"] }]
180
+ }], propDecorators: { selectedGroupKey: [{
181
+ type: Input
182
+ }], columns: [{
183
+ type: Input
184
+ }], placeholderKey: [{
185
+ type: Input
186
+ }], defaultGroupKey: [{
187
+ type: Input
188
+ }], customGroupKey: [{
189
+ type: Input
190
+ }], groupSelectionChanged: [{
191
+ type: Output
192
+ }] } });
193
+
194
+ class CustomGroupColumnSelectorComponent {
195
+ constructor(translate) {
196
+ this.translate = translate;
197
+ this.columns = [];
198
+ this.displayedColumns = [];
199
+ this.dialogTitle = '';
200
+ this.openButtonTitle = '';
201
+ this.saveButtonLabel = '';
202
+ this.cancelButtonLabel = '';
203
+ this.activeColumnsLabel = '';
204
+ this.inactiveColumnsLabel = '';
205
+ this.frozenActionColumn = false;
206
+ this.actionColumnPosition = 'right';
207
+ this.columnSelectionChanged = new EventEmitter();
208
+ this.actionColumnConfigChanged = new EventEmitter();
209
+ this.hiddenColumnsModel = [];
210
+ this.displayedColumnsModel = [];
211
+ this.frozenActionColumnModel = false;
212
+ this.actionColumnPositionModel = 'right';
213
+ this.visible = false;
214
+ this.alignmentOptions = [
215
+ {
216
+ label: 'OCX_CUSTOM_GROUP_COLUMN_SELECTOR.CONFIGURE_ACTION_COLUMN.LEFT',
217
+ value: 'left',
218
+ },
219
+ {
220
+ label: 'OCX_CUSTOM_GROUP_COLUMN_SELECTOR.CONFIGURE_ACTION_COLUMN.RIGHT',
221
+ value: 'right',
222
+ },
223
+ ];
224
+ this.frozenOptions = [
225
+ {
226
+ label: 'OCX_CUSTOM_GROUP_COLUMN_SELECTOR.CONFIGURE_ACTION_COLUMN.YES',
227
+ value: true,
228
+ },
229
+ {
230
+ label: 'OCX_CUSTOM_GROUP_COLUMN_SELECTOR.CONFIGURE_ACTION_COLUMN.NO',
231
+ value: false,
232
+ },
233
+ ];
234
+ }
235
+ onOpenCustomGroupColumnSelectionDialogClick() {
236
+ this.displayedColumnsModel = [...this.displayedColumns];
237
+ this.hiddenColumnsModel = this.columns.filter((column) => !this.displayedColumnsModel.map((c) => c.id).includes(column.id));
238
+ this.frozenActionColumnModel = this.frozenActionColumn;
239
+ this.actionColumnPositionModel = this.actionColumnPosition;
240
+ this.visible = true;
241
+ }
242
+ onSaveClick() {
243
+ this.visible = false;
244
+ const colIdsBefore = this.displayedColumns.map((column) => column.id);
245
+ const colIdsAfter = this.displayedColumnsModel.map((column) => column.id);
246
+ if (!colIdsAfter.every((colId, i) => colId === colIdsBefore[i])) {
247
+ this.columnSelectionChanged.emit({ activeColumns: [...this.displayedColumnsModel] });
248
+ }
249
+ if (this.frozenActionColumn != this.frozenActionColumnModel ||
250
+ this.actionColumnPosition != this.actionColumnPositionModel) {
251
+ this.actionColumnConfigChanged.emit({
252
+ frozenActionColumn: this.frozenActionColumnModel,
253
+ actionColumnPosition: this.actionColumnPositionModel,
254
+ });
255
+ }
256
+ }
257
+ onCancelClick() {
258
+ this.visible = false;
259
+ }
260
+ }
261
+ CustomGroupColumnSelectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomGroupColumnSelectorComponent, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
262
+ 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$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i5.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.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.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.TranslatePipe, name: "translate" }] });
263
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomGroupColumnSelectorComponent, decorators: [{
264
+ type: Component,
265
+ 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"] }]
266
+ }], ctorParameters: function () { return [{ type: i1.TranslateService }]; }, propDecorators: { columns: [{
267
+ type: Input
268
+ }], displayedColumns: [{
269
+ type: Input
270
+ }], dialogTitle: [{
271
+ type: Input
272
+ }], openButtonTitle: [{
273
+ type: Input
274
+ }], saveButtonLabel: [{
275
+ type: Input
276
+ }], cancelButtonLabel: [{
277
+ type: Input
278
+ }], activeColumnsLabel: [{
279
+ type: Input
280
+ }], inactiveColumnsLabel: [{
281
+ type: Input
282
+ }], frozenActionColumn: [{
283
+ type: Input
284
+ }], actionColumnPosition: [{
285
+ type: Input
286
+ }], columnSelectionChanged: [{
287
+ type: Output
288
+ }], actionColumnConfigChanged: [{
289
+ type: Output
290
+ }] } });
291
+
292
+ const ALL_VIEW_LAYOUTS = [
293
+ { icon: PrimeIcons.LIST, layout: 'list', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.LIST' },
294
+ { icon: PrimeIcons.TH_LARGE, layout: 'grid', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.GRID' },
295
+ { icon: PrimeIcons.TABLE, layout: 'table', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.TABLE' },
296
+ ];
297
+ class DataLayoutSelectionComponent {
298
+ constructor() {
299
+ this.supportedViewLayouts = [];
300
+ this.dataViewLayoutChange = new EventEmitter();
301
+ this.viewingLayouts = [];
302
+ }
303
+ set layout(value) {
304
+ this.selectedViewLayout = this.viewingLayouts.find((v) => v.layout === value);
305
+ }
306
+ get layout() {
307
+ return this.selectedViewLayout?.layout || 'table';
308
+ }
309
+ ngOnInit() {
310
+ this.viewingLayouts = ALL_VIEW_LAYOUTS.filter((vl) => this.supportedViewLayouts.includes(vl.layout));
311
+ this.layout = 'table';
312
+ }
313
+ onDataViewLayoutChange(event) {
314
+ this.dataViewLayoutChange.emit(event.layout);
315
+ }
316
+ }
317
+ DataLayoutSelectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataLayoutSelectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
318
+ 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: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.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.TranslatePipe, name: "translate" }] });
319
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataLayoutSelectionComponent, decorators: [{
320
+ type: Component,
321
+ 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"] }]
322
+ }], propDecorators: { supportedViewLayouts: [{
323
+ type: Input
324
+ }], layout: [{
325
+ type: Input
326
+ }], dataViewLayoutChange: [{
327
+ type: Output
328
+ }] } });
329
+
330
+ class ObjectUtils {
331
+ static resolveFieldData(data, field) {
332
+ if (data && field) {
333
+ if (this.isFunction(field)) {
334
+ return field(data);
335
+ }
336
+ else if (field.indexOf('.') == -1) {
337
+ return data[field];
338
+ }
339
+ else {
340
+ const fields = field.split('.');
341
+ let value = data;
342
+ for (let i = 0, len = fields.length; i < len; ++i) {
343
+ if (value == null) {
344
+ return null;
345
+ }
346
+ value = value[fields[i]];
347
+ }
348
+ return value;
349
+ }
350
+ }
351
+ else {
352
+ return null;
353
+ }
354
+ }
355
+ static isFunction(obj) {
356
+ return !!(obj && obj.constructor && obj.call && obj.apply);
357
+ }
358
+ }
359
+
360
+ function flattenObject(ob) {
361
+ const toReturn = {};
362
+ for (const i in ob) {
363
+ if (!Object.prototype.hasOwnProperty.call(ob, i))
364
+ continue;
365
+ if (!!ob[i] && typeof ob[i] == 'object' && !(ob[i] instanceof Date) && !Array.isArray(ob[i])) {
366
+ const flatObject = flattenObject(ob[i]);
367
+ for (const x in flatObject) {
368
+ if (!Object.prototype.hasOwnProperty.call(flatObject, x))
369
+ continue;
370
+ toReturn[i + '.' + x] = flatObject[x];
371
+ }
372
+ }
373
+ else {
374
+ toReturn[i] = ob[i];
375
+ }
376
+ }
377
+ return toReturn;
378
+ }
379
+
380
+ var ColumnType;
381
+ (function (ColumnType) {
382
+ ColumnType["STRING"] = "STRING";
383
+ ColumnType["NUMBER"] = "NUMBER";
384
+ ColumnType["DATE"] = "DATE";
385
+ ColumnType["RELATIVE_DATE"] = "RELATIVE_DATE";
386
+ ColumnType["TRANSLATION_KEY"] = "TRANSLATION_KEY";
387
+ })(ColumnType || (ColumnType = {}));
388
+
389
+ class DataSortBase {
390
+ constructor(locale, translateService) {
391
+ this.locale = locale;
392
+ this.translateService = translateService;
393
+ }
394
+ translateItems([items, filters, sortColumn, sortDirection], columns, clientSideFiltering, clientSideSorting) {
395
+ if (clientSideFiltering || clientSideSorting) {
396
+ let translationKeys = [];
397
+ const translatedColumns = columns.filter((c) => c.columnType === ColumnType.TRANSLATION_KEY);
398
+ translatedColumns.forEach((c) => {
399
+ translationKeys = [...translationKeys, ...items.map((i) => ObjectUtils.resolveFieldData(i, c.id)?.toString())];
400
+ });
401
+ if (translationKeys.length) {
402
+ return this.translateService.get(translationKeys).pipe(map((translatedValues) => {
403
+ const translations = {};
404
+ translatedColumns.forEach((c) => {
405
+ translations[c.id] = Object.fromEntries(items.map((i) => [
406
+ ObjectUtils.resolveFieldData(i, c.id)?.toString() || '',
407
+ translatedValues[ObjectUtils.resolveFieldData(i, c.id)?.toString()],
408
+ ]));
409
+ });
410
+ return [items, filters, sortColumn, sortDirection, translations];
411
+ }));
412
+ }
413
+ }
414
+ return of([items, filters, sortColumn, sortDirection, {}]);
415
+ }
416
+ filterItems([items, filters, sortColumn, sortDirection, translations], clientSideFiltering) {
417
+ if (!clientSideFiltering) {
418
+ return [items, filters, sortColumn, sortDirection, translations];
419
+ }
420
+ return [
421
+ items.filter((item) => filters
422
+ .map((filter) => filter.columnId)
423
+ .filter((value, index, self) => self.indexOf(value) === index && value != null)
424
+ .every((filterColumnId) => filters
425
+ .filter((filter) => filter.columnId === filterColumnId)
426
+ .some((filter) => (translations[filter.columnId]?.[ObjectUtils.resolveFieldData(item, filter.columnId).toString()] ||
427
+ ObjectUtils.resolveFieldData(item, filter.columnId)).toString() === filter.value.toString()))),
428
+ filters,
429
+ sortColumn,
430
+ sortDirection,
431
+ translations,
432
+ ];
433
+ }
434
+ sortItems([items, filters, sortColumn, sortDirection, translations], columns, clientSideSorting) {
435
+ if (!clientSideSorting || sortColumn === '') {
436
+ return [items, filters, sortColumn, sortDirection, translations];
437
+ }
438
+ let translatedColValues = Object.fromEntries(items.map((i) => [
439
+ ObjectUtils.resolveFieldData(i, sortColumn)?.toString(),
440
+ ObjectUtils.resolveFieldData(i, sortColumn)?.toString(),
441
+ ]));
442
+ if (columns.find((h) => h.id === sortColumn)?.columnType === ColumnType.TRANSLATION_KEY) {
443
+ translatedColValues = translations[sortColumn];
444
+ }
445
+ return [
446
+ [...items].sort(this.createCompareFunction(translatedColValues, sortColumn, sortDirection)),
447
+ filters,
448
+ sortColumn,
449
+ sortDirection,
450
+ translations,
451
+ ];
452
+ }
453
+ flattenItems(items) {
454
+ return items.map((i) => flattenObject(i));
455
+ }
456
+ createCompareFunction(translatedColValues, sortColumn, sortDirection) {
457
+ let direction = 0;
458
+ if (sortDirection === "ASCENDING" /* DataSortDirection.ASCENDING */) {
459
+ direction = 1;
460
+ }
461
+ else if (sortDirection === "DESCENDING" /* DataSortDirection.DESCENDING */) {
462
+ direction = -1;
463
+ }
464
+ return (data1, data2) => {
465
+ if (direction === 0) {
466
+ return 0;
467
+ }
468
+ let result;
469
+ const value1 = translatedColValues[ObjectUtils.resolveFieldData(data1, sortColumn)];
470
+ const value2 = translatedColValues[ObjectUtils.resolveFieldData(data2, sortColumn)];
471
+ if (value1 == null && value2 != null)
472
+ result = -1;
473
+ else if (value1 != null && value2 == null)
474
+ result = 1;
475
+ else if (value1 == null && value2 == null)
476
+ result = 0;
477
+ else if (typeof value1 === 'string' && typeof value2 === 'string')
478
+ result = value1.localeCompare(value2, [this.locale, 'en', 'de'], { numeric: true });
479
+ else {
480
+ if (value1 < value2) {
481
+ result = -1;
482
+ }
483
+ else if (value1 > value2) {
484
+ result = 1;
485
+ }
486
+ else {
487
+ result = 0;
488
+ }
489
+ }
490
+ return direction * result;
491
+ };
492
+ }
493
+ }
494
+
495
+ class DataListGridComponent extends DataSortBase {
496
+ get totalRecordsOnServer() {
497
+ return this.params['totalRecordsOnServer'] ? Number(this.params['totalRecordsOnServer']) : undefined;
498
+ }
499
+ set totalRecordsOnServer(value) {
500
+ this.params['totalRecordsOnServer'] = value?.toString() ?? '0';
501
+ }
502
+ get data() {
503
+ return this._data$.getValue();
504
+ }
505
+ set data(value) {
506
+ this._originalData = [...value];
507
+ this._data$.next([...value]);
508
+ }
509
+ get filters() {
510
+ return this._filters$.getValue();
511
+ }
512
+ set filters(value) {
513
+ this._filters$.next(value);
514
+ }
515
+ get sortDirection() {
516
+ return this._sortDirection$.getValue();
517
+ }
518
+ set sortDirection(value) {
519
+ if (value === "NONE" /* DataSortDirection.NONE */) {
520
+ this._data$.next([...this._originalData]);
521
+ }
522
+ this._sortDirection$.next(value);
523
+ }
524
+ get sortField() {
525
+ return this?._sortField$.getValue();
526
+ }
527
+ set sortField(value) {
528
+ this._sortField$.next(value);
529
+ }
530
+ get _gridItemSubtitleLines() {
531
+ return this.gridItemSubtitleLinesTemplate || this.gridItemSubtitleLinesChildTemplate;
532
+ }
533
+ get _listItemSubtitleLines() {
534
+ return this.listItemSubtitleLinesTemplate || this.listItemSubtitleLinesChildTemplate;
535
+ }
536
+ get _listItem() {
537
+ return this.listItemTemplate || this.listItemChildTemplate;
538
+ }
539
+ get _gridItem() {
540
+ return this.gridItemTemplate || this.gridItemChildTemplate;
541
+ }
542
+ get additionalActions() {
543
+ return this._additionalActions;
544
+ }
545
+ set additionalActions(value) {
546
+ this._additionalActions = value;
547
+ this.updateGridMenuItems();
548
+ }
549
+ get viewItemObserved() {
550
+ const dv = this.injector.get('DataViewComponent', null);
551
+ return dv?.viewItemObserved || dv?.viewItem.observed || this.viewItem.observed;
552
+ }
553
+ get editItemObserved() {
554
+ const dv = this.injector.get('DataViewComponent', null);
555
+ return dv?.editItemObserved || dv?.editItem.observed || this.editItem.observed;
556
+ }
557
+ get deleteItemObserved() {
558
+ const dv = this.injector.get('DataViewComponent', null);
559
+ return dv?.deleteItemObserved || dv?.deleteItem.observed || this.deleteItem.observed;
560
+ }
561
+ get sortDirectionNumber() {
562
+ if (this.sortDirection === "ASCENDING" /* DataSortDirection.ASCENDING */)
563
+ return 1;
564
+ if (this.sortDirection === "DESCENDING" /* DataSortDirection.DESCENDING */)
565
+ return -1;
566
+ return 0;
567
+ }
568
+ constructor(locale, translateService, userService, router, injector, appStateService) {
569
+ super(locale, translateService);
570
+ this.userService = userService;
571
+ this.router = router;
572
+ this.injector = injector;
573
+ this.appStateService = appStateService;
574
+ this.subtitleLineIds = [];
575
+ this.clientSideSorting = true;
576
+ this.clientSideFiltering = true;
577
+ this.sortStates = [];
578
+ this.pageSizes = [10, 25, 50];
579
+ this.pageSize = this.pageSizes[0] || 50;
580
+ this.fallbackImage = 'placeholder.png';
581
+ this.layout = 'grid';
582
+ this.paginator = true;
583
+ this.page = 0;
584
+ this.columns = [];
585
+ this.name = '';
586
+ this.currentPageShowingKey = 'OCX_DATA_TABLE.SHOWING';
587
+ this.currentPageShowingWithTotalOnServerKey = 'OCX_DATA_TABLE.SHOWING_WITH_TOTAL_ON_SERVER';
588
+ this.params = {
589
+ currentPage: '{currentPage}',
590
+ totalPages: '{totalPages}',
591
+ rows: '{rows}',
592
+ first: '{first}',
593
+ last: '{last}',
594
+ totalRecords: '{totalRecords}',
595
+ };
596
+ this._data$ = new BehaviorSubject([]);
597
+ this._filters$ = new BehaviorSubject([]);
598
+ this._originalData = [];
599
+ this._sortDirection$ = new BehaviorSubject("NONE" /* DataSortDirection.NONE */);
600
+ this._sortField$ = new BehaviorSubject('');
601
+ this._additionalActions = [];
602
+ this.viewItem = new EventEmitter();
603
+ this.editItem = new EventEmitter();
604
+ this.deleteItem = new EventEmitter();
605
+ this.pageChanged = new EventEmitter();
606
+ this.showMenu = false;
607
+ this.gridMenuItems = [];
608
+ this.observedOutputs = 0;
609
+ this.name = this.name || this.router.url.replace(/[^A-Za-z0-9]/, '_');
610
+ this.fallbackImagePath$ = this.appStateService.currentMfe$.pipe(map((currentMfe) => this.getFallbackImagePath(currentMfe)));
611
+ }
612
+ ngDoCheck() {
613
+ const observedOutputs = this.viewItem.observed + this.deleteItem.observed + this.editItem.observed;
614
+ if (this.observedOutputs !== observedOutputs) {
615
+ this.updateGridMenuItems();
616
+ this.observedOutputs = observedOutputs;
617
+ }
618
+ }
619
+ ngOnInit() {
620
+ 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));
621
+ this.showMenu =
622
+ (!!this.viewPermission && this.userService.hasPermission(this.viewPermission)) ||
623
+ (!!this.editPermission && this.userService.hasPermission(this.editPermission)) ||
624
+ (!!this.deletePermission && this.userService.hasPermission(this.deletePermission));
625
+ }
626
+ onDeleteRow(element) {
627
+ this.deleteItem.emit(element);
628
+ }
629
+ onViewRow(element) {
630
+ if (!!this.viewPermission && this.userService.hasPermission(this.viewPermission)) {
631
+ this.viewItem.emit(element);
632
+ }
633
+ }
634
+ onEditRow(element) {
635
+ this.editItem.emit(element);
636
+ }
637
+ imgError(item) {
638
+ item.imagePath = '';
639
+ }
640
+ getFallbackImagePath(mfeInfo) {
641
+ return mfeInfo?.remoteBaseUrl
642
+ ? `${mfeInfo.remoteBaseUrl}/onecx-portal-lib/assets/images/${this.fallbackImage}`
643
+ : `./onecx-portal-lib/assets/images/${this.fallbackImage}`;
644
+ }
645
+ updateGridMenuItems(useSelectedItem = false) {
646
+ let deleteDisabled = false;
647
+ let editDisabled = false;
648
+ let viewDisabled = false;
649
+ let deleteVisible = true;
650
+ let editVisible = true;
651
+ let viewVisible = true;
652
+ if (useSelectedItem && this.selectedItem) {
653
+ viewDisabled = !!this.viewActionEnabledField && !this.fieldIsTruthy(this.selectedItem, this.viewActionEnabledField);
654
+ editDisabled = !!this.editActionEnabledField && !this.fieldIsTruthy(this.selectedItem, this.editActionEnabledField);
655
+ deleteDisabled = !!this.deleteActionEnabledField && !this.fieldIsTruthy(this.selectedItem, this.deleteActionEnabledField);
656
+ viewVisible = (!this.viewActionVisibleField || this.fieldIsTruthy(this.selectedItem, this.viewActionVisibleField));
657
+ editVisible = (!this.editActionVisibleField || this.fieldIsTruthy(this.selectedItem, this.editActionVisibleField));
658
+ deleteVisible = (!this.deleteActionVisibleField || this.fieldIsTruthy(this.selectedItem, this.deleteActionVisibleField));
659
+ }
660
+ this.translateService
661
+ .get([
662
+ this.viewMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.VIEW',
663
+ this.editMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.EDIT',
664
+ this.deleteMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.DELETE',
665
+ ...this.additionalActions.map((a) => a.labelKey || ''),
666
+ ])
667
+ .subscribe((translations) => {
668
+ let menuItems = [];
669
+ const automationId = 'data-grid-action-button';
670
+ const automationIdHidden = 'data-grid-action-button-hidden';
671
+ if (this.viewItem.observed && this.userService.hasPermission(this.viewPermission || '')) {
672
+ menuItems.push({
673
+ label: translations[this.viewMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.VIEW'],
674
+ icon: PrimeIcons.EYE,
675
+ command: () => this.viewItem.emit(this.selectedItem),
676
+ disabled: viewDisabled,
677
+ visible: viewVisible,
678
+ automationId: viewVisible ? automationId : automationIdHidden
679
+ });
680
+ }
681
+ if (this.editItem.observed && this.userService.hasPermission(this.editPermission || '')) {
682
+ menuItems.push({
683
+ label: translations[this.editMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.EDIT'],
684
+ icon: PrimeIcons.PENCIL,
685
+ command: () => this.editItem.emit(this.selectedItem),
686
+ disabled: editDisabled,
687
+ visible: editVisible,
688
+ automationId: editVisible ? automationId : automationIdHidden
689
+ });
690
+ }
691
+ if (this.deleteItem.observed && this.userService.hasPermission(this.deletePermission || '')) {
692
+ menuItems.push({
693
+ label: translations[this.deleteMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.DELETE'],
694
+ icon: PrimeIcons.TRASH,
695
+ command: () => this.deleteItem.emit(this.selectedItem),
696
+ disabled: deleteDisabled,
697
+ visible: deleteVisible,
698
+ automationId: deleteVisible ? automationId : automationIdHidden
699
+ });
700
+ }
701
+ menuItems = menuItems.concat(this.additionalActions
702
+ .filter((a) => this.userService.hasPermission(a.permission))
703
+ .map((a) => ({
704
+ label: translations[a.labelKey || ''],
705
+ icon: a.icon,
706
+ styleClass: (a.classes || []).join(' '),
707
+ disabled: a.disabled,
708
+ command: () => a.callback(this.selectedItem),
709
+ })));
710
+ this.gridMenuItems = menuItems;
711
+ });
712
+ }
713
+ setSelectedItem(item) {
714
+ this.selectedItem = item;
715
+ }
716
+ resolveFieldData(object, key) {
717
+ return ObjectUtils.resolveFieldData(object, key);
718
+ }
719
+ onPageChange(event) {
720
+ const page = event.first / event.rows;
721
+ this.page = page;
722
+ this.pageChanged.emit(page);
723
+ }
724
+ fieldIsTruthy(object, key) {
725
+ return !!this.resolveFieldData(object, key);
726
+ }
727
+ }
728
+ DataListGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataListGridComponent, deps: [{ token: LOCALE_ID }, { token: i1.TranslateService }, { token: i2.UserService }, { token: i1$1.Router }, { token: i0.Injector }, { token: i2.AppStateService }], target: i0.ɵɵFactoryTarget.Component });
729
+ 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 [value]=\"(displayedItems$ | async) || []\"\n [paginator]=\"paginator\"\n [first]=\"page * pageSize\"\n (onPage)=\"onPageChange($event)\"\n [rows]=\"pageSize\"\n [layout]=\"layout\"\n [showCurrentPageReport]=\"true\"\n currentPageReportTemplate=\"{{ (totalRecordsOnServer ? currentPageShowingWithTotalOnServerKey : currentPageShowingKey) | translate:params }}\"\n [rowsPerPageOptions]=\"[10, 25, 50, data?.length]\"\n id=\"dataListGrid_{{name}}\"\n>\n <ng-template let-item pTemplate=\"paginatordropdownitem\">\n {{ item.value === data?.length ? (\"OCX_DATA_TABLE.ALL\" | translate) : item.value }}\n </ng-template>\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 additionalActions\">\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\"\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: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i5.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: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: IfPermissionDirective, selector: "[ocxIfPermission], [ocxIfNotPermission]", inputs: ["ocxIfPermission", "ocxIfNotPermission", "onMissingPermission"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
730
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataListGridComponent, decorators: [{
731
+ type: Component,
732
+ args: [{ selector: 'ocx-data-list-grid', template: "<p-dataView\n [value]=\"(displayedItems$ | async) || []\"\n [paginator]=\"paginator\"\n [first]=\"page * pageSize\"\n (onPage)=\"onPageChange($event)\"\n [rows]=\"pageSize\"\n [layout]=\"layout\"\n [showCurrentPageReport]=\"true\"\n currentPageReportTemplate=\"{{ (totalRecordsOnServer ? currentPageShowingWithTotalOnServerKey : currentPageShowingKey) | translate:params }}\"\n [rowsPerPageOptions]=\"[10, 25, 50, data?.length]\"\n id=\"dataListGrid_{{name}}\"\n>\n <ng-template let-item pTemplate=\"paginatordropdownitem\">\n {{ item.value === data?.length ? (\"OCX_DATA_TABLE.ALL\" | translate) : item.value }}\n </ng-template>\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 additionalActions\">\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\"\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"] }]
733
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
734
+ type: Inject,
735
+ args: [LOCALE_ID]
736
+ }] }, { type: i1.TranslateService }, { type: i2.UserService }, { type: i1$1.Router }, { type: i0.Injector }, { type: i2.AppStateService }]; }, propDecorators: { titleLineId: [{
737
+ type: Input
738
+ }], subtitleLineIds: [{
739
+ type: Input
740
+ }], clientSideSorting: [{
741
+ type: Input
742
+ }], clientSideFiltering: [{
743
+ type: Input
744
+ }], sortStates: [{
745
+ type: Input
746
+ }], pageSizes: [{
747
+ type: Input
748
+ }], pageSize: [{
749
+ type: Input
750
+ }], emptyResultsMessage: [{
751
+ type: Input
752
+ }], fallbackImage: [{
753
+ type: Input
754
+ }], layout: [{
755
+ type: Input
756
+ }], viewPermission: [{
757
+ type: Input
758
+ }], editPermission: [{
759
+ type: Input
760
+ }], deletePermission: [{
761
+ type: Input
762
+ }], deleteActionVisibleField: [{
763
+ type: Input
764
+ }], deleteActionEnabledField: [{
765
+ type: Input
766
+ }], viewActionVisibleField: [{
767
+ type: Input
768
+ }], viewActionEnabledField: [{
769
+ type: Input
770
+ }], editActionVisibleField: [{
771
+ type: Input
772
+ }], editActionEnabledField: [{
773
+ type: Input
774
+ }], viewMenuItemKey: [{
775
+ type: Input
776
+ }], editMenuItemKey: [{
777
+ type: Input
778
+ }], deleteMenuItemKey: [{
779
+ type: Input
780
+ }], paginator: [{
781
+ type: Input
782
+ }], page: [{
783
+ type: Input
784
+ }], columns: [{
785
+ type: Input
786
+ }], name: [{
787
+ type: Input
788
+ }], totalRecordsOnServer: [{
789
+ type: Input
790
+ }], currentPageShowingKey: [{
791
+ type: Input
792
+ }], currentPageShowingWithTotalOnServerKey: [{
793
+ type: Input
794
+ }], data: [{
795
+ type: Input
796
+ }], filters: [{
797
+ type: Input
798
+ }], sortDirection: [{
799
+ type: Input
800
+ }], sortField: [{
801
+ type: Input
802
+ }], gridItemSubtitleLinesTemplate: [{
803
+ type: Input
804
+ }], gridItemSubtitleLinesChildTemplate: [{
805
+ type: ContentChild,
806
+ args: ['gridItemSubtitleLines']
807
+ }], listItemSubtitleLinesTemplate: [{
808
+ type: Input
809
+ }], listItemSubtitleLinesChildTemplate: [{
810
+ type: ContentChild,
811
+ args: ['listItemSubtitleLines']
812
+ }], listItemTemplate: [{
813
+ type: Input
814
+ }], listItemChildTemplate: [{
815
+ type: ContentChild,
816
+ args: ['listItem']
817
+ }], gridItemTemplate: [{
818
+ type: Input
819
+ }], gridItemChildTemplate: [{
820
+ type: ContentChild,
821
+ args: ['gridItem']
822
+ }], additionalActions: [{
823
+ type: Input
824
+ }], viewItem: [{
825
+ type: Output
826
+ }], editItem: [{
827
+ type: Output
828
+ }], deleteItem: [{
829
+ type: Output
830
+ }], pageChanged: [{
831
+ type: Output
832
+ }] } });
833
+
834
+ class DataListGridSortingComponent {
835
+ constructor() {
836
+ this.columns = [];
837
+ this.sortStates = ["ASCENDING" /* DataSortDirection.ASCENDING */, "DESCENDING" /* DataSortDirection.DESCENDING */];
838
+ this._sortDirection$ = new BehaviorSubject("NONE" /* DataSortDirection.NONE */);
839
+ this._sortField$ = new BehaviorSubject('');
840
+ this.sortChange = new EventEmitter();
841
+ this.sortDirectionChange = new EventEmitter();
842
+ this.columnsChange = new EventEmitter();
843
+ this.dropdownOptions = [];
844
+ }
845
+ get sortDirection() {
846
+ return this._sortDirection$.getValue();
847
+ }
848
+ set sortDirection(value) {
849
+ this._sortDirection$.next(value);
850
+ }
851
+ get sortField() {
852
+ return this?._sortField$.getValue();
853
+ }
854
+ set sortField(value) {
855
+ this._sortField$.next(value);
856
+ }
857
+ ngOnInit() {
858
+ this.columns.forEach((element) => this.dropdownOptions.push({ columnId: element.id, columnName: element.nameKey }));
859
+ this.selectedSortingOption = this.dropdownOptions.find((e) => e.columnId === this?.sortField);
860
+ }
861
+ selectSorting(event) {
862
+ this._sortField$.next(event.value);
863
+ this.sortChange.emit(event.value.columnId);
864
+ }
865
+ sortDirectionChanged() {
866
+ const newSortDirection = this.nextSortDirection();
867
+ this._sortDirection$.next(newSortDirection);
868
+ this.sortDirectionChange.emit(newSortDirection);
869
+ }
870
+ nextSortDirection() {
871
+ return this.sortStates[(this.sortStates.indexOf(this.sortDirection) + 1) % this.sortStates.length];
872
+ }
873
+ sortIcon() {
874
+ switch (this.sortDirection) {
875
+ case "ASCENDING" /* DataSortDirection.ASCENDING */:
876
+ return 'pi-sort-amount-up';
877
+ case "DESCENDING" /* DataSortDirection.DESCENDING */:
878
+ return 'pi-sort-amount-down';
879
+ default:
880
+ return 'pi-sort-alt-slash';
881
+ }
882
+ }
883
+ sortIconTitle() {
884
+ return this.sortDirectionToTitle(this.sortDirection);
885
+ }
886
+ sortDirectionToTitle(sortDirection) {
887
+ switch (sortDirection) {
888
+ case "ASCENDING" /* DataSortDirection.ASCENDING */:
889
+ return 'OCX_LIST_GRID_SORT.TOGGLE_BUTTON.ASCENDING_TITLE';
890
+ case "DESCENDING" /* DataSortDirection.DESCENDING */:
891
+ return 'OCX_LIST_GRID_SORT.TOGGLE_BUTTON.DESCENDING_TITLE';
892
+ default:
893
+ return 'OCX_LIST_GRID_SORT.TOGGLE_BUTTON.DEFAULT_TITLE';
894
+ }
895
+ }
896
+ }
897
+ DataListGridSortingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataListGridSortingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
898
+ 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$1.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$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i5.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.TranslatePipe, name: "translate" }] });
899
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataListGridSortingComponent, decorators: [{
900
+ type: Component,
901
+ 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"] }]
902
+ }], propDecorators: { columns: [{
903
+ type: Input
904
+ }], sortStates: [{
905
+ type: Input
906
+ }], sortDirection: [{
907
+ type: Input
908
+ }], sortField: [{
909
+ type: Input
910
+ }], sortChange: [{
911
+ type: Output
912
+ }], sortDirectionChange: [{
913
+ type: Output
914
+ }], columnsChange: [{
915
+ type: Output
916
+ }] } });
917
+
918
+ // eslint-disable-next-line @angular-eslint/use-pipe-transform-interface
919
+ class OcxTimeAgoPipe extends TimeagoPipe {
920
+ }
921
+ OcxTimeAgoPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: OcxTimeAgoPipe, deps: null, target: i0.ɵɵFactoryTarget.Pipe });
922
+ OcxTimeAgoPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: OcxTimeAgoPipe, name: "timeago" });
923
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: OcxTimeAgoPipe, decorators: [{
924
+ type: Pipe,
925
+ args: [{
926
+ name: 'timeago',
927
+ }]
928
+ }] });
929
+
930
+ class DataTableComponent extends DataSortBase {
931
+ get rows() {
932
+ return this._rows$.getValue();
933
+ }
934
+ set rows(value) {
935
+ this._rows$.next(value);
936
+ }
937
+ get selectedRows() {
938
+ return this._selection$.getValue();
939
+ }
940
+ set selectedRows(value) {
941
+ this._selection$.next(value);
942
+ }
943
+ get filters() {
944
+ return this._filters$.getValue();
945
+ }
946
+ set filters(value) {
947
+ this._filters$.next(value);
948
+ }
949
+ get sortDirection() {
950
+ return this._sortDirection$.getValue();
951
+ }
952
+ set sortDirection(value) {
953
+ this._sortDirection$.next(value);
954
+ }
955
+ get sortColumn() {
956
+ return this?._sortColumn$.getValue();
957
+ }
958
+ set sortColumn(value) {
959
+ this?._sortColumn$.next(value);
960
+ }
961
+ get totalRecordsOnServer() {
962
+ return this.params['totalRecordsOnServer'] ? Number(this.params['totalRecordsOnServer']) : undefined;
963
+ }
964
+ set totalRecordsOnServer(value) {
965
+ this.params['totalRecordsOnServer'] = value?.toString() ?? '0';
966
+ }
967
+ get _stringCell() {
968
+ return this.stringCellTemplate || this.stringCellChildTemplate;
969
+ }
970
+ get _numberCell() {
971
+ return this.numberCellTemplate || this.numberCellChildTemplate;
972
+ }
973
+ get _dateCell() {
974
+ return this.dateCellTemplate || this.dateCellChildTemplate;
975
+ }
976
+ get _relativeDateCell() {
977
+ return this.relativeDateCellTemplate || this.relativeDateCellChildTemplate;
978
+ }
979
+ get _cell() {
980
+ return this.cellTemplate || this.cellChildTemplate;
981
+ }
982
+ get _translationKeyCell() {
983
+ return this.translationKeyCellTemplate || this.translationKeyCellChildTemplate;
984
+ }
985
+ get viewTableRowObserved() {
986
+ const dv = this.injector.get('DataViewComponent', null);
987
+ return dv?.viewItemObserved || dv?.viewItem.observed || this.viewTableRow.observed;
988
+ }
989
+ get editTableRowObserved() {
990
+ const dv = this.injector.get('DataViewComponent', null);
991
+ return dv?.editItemObserved || dv?.editItem.observed || this.editTableRow.observed;
992
+ }
993
+ get deleteTableRowObserved() {
994
+ const dv = this.injector.get('DataViewComponent', null);
995
+ return dv?.deleteItemObserved || dv?.deleteItem.observed || this.deleteTableRow.observed;
996
+ }
997
+ get anyRowActionObserved() {
998
+ return this.viewTableRowObserved || this.editTableRowObserved || this.deleteTableRowObserved;
999
+ }
1000
+ get selectionChangedObserved() {
1001
+ const dv = this.injector.get('DataViewComponent', null);
1002
+ return dv?.selectionChangedObserved || dv?.selectionChanged.observed || this.selectionChanged.observed;
1003
+ }
1004
+ constructor(locale, translateService, router, injector) {
1005
+ super(locale, translateService);
1006
+ this.router = router;
1007
+ this.injector = injector;
1008
+ this._rows$ = new BehaviorSubject([]);
1009
+ this._selection$ = new BehaviorSubject([]);
1010
+ this._filters$ = new BehaviorSubject([]);
1011
+ this._sortDirection$ = new BehaviorSubject("NONE" /* DataSortDirection.NONE */);
1012
+ this._sortColumn$ = new BehaviorSubject('');
1013
+ this.columns = [];
1014
+ this.clientSideFiltering = true;
1015
+ this.clientSideSorting = true;
1016
+ this.sortStates = ["ASCENDING" /* DataSortDirection.ASCENDING */, "DESCENDING" /* DataSortDirection.DESCENDING */];
1017
+ this.pageSizes = [10, 25, 50];
1018
+ this.pageSize = this.pageSizes[0] || 50;
1019
+ this.name = '';
1020
+ this.paginator = true;
1021
+ this.page = 0;
1022
+ this.currentPageShowingKey = 'OCX_DATA_TABLE.SHOWING';
1023
+ this.currentPageShowingWithTotalOnServerKey = 'OCX_DATA_TABLE.SHOWING_WITH_TOTAL_ON_SERVER';
1024
+ this.params = {
1025
+ currentPage: '{currentPage}',
1026
+ totalPages: '{totalPages}',
1027
+ rows: '{rows}',
1028
+ first: '{first}',
1029
+ last: '{last}',
1030
+ totalRecords: '{totalRecords}',
1031
+ };
1032
+ this.additionalActions = [];
1033
+ this.frozenActionColumn = false;
1034
+ this.actionColumnPosition = 'right';
1035
+ this.filtered = new EventEmitter();
1036
+ this.sorted = new EventEmitter();
1037
+ this.viewTableRow = new EventEmitter();
1038
+ this.editTableRow = new EventEmitter();
1039
+ this.deleteTableRow = new EventEmitter();
1040
+ this.selectionChanged = new EventEmitter();
1041
+ this.pageChanged = new EventEmitter();
1042
+ this.currentFilterColumn$ = new BehaviorSubject(null);
1043
+ this.name = this.name || this.router.url.replace(/[^A-Za-z0-9]/, '_');
1044
+ }
1045
+ ngOnInit() {
1046
+ 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)));
1047
+ this.currentSelectedFilters$ = combineLatest([this._filters$, this.currentFilterColumn$]).pipe(map(([filters, currentFilterColumn]) => {
1048
+ return filters.filter((filter) => filter.columnId === currentFilterColumn?.id).map((filter) => filter.value);
1049
+ }));
1050
+ this.currentFilterOptions$ = combineLatest([this._rows$, this.currentFilterColumn$, this._filters$]).pipe(mergeMap(([rows, currentFilterColumn, filters]) => {
1051
+ if (!currentFilterColumn?.id) {
1052
+ return of([]);
1053
+ }
1054
+ const currentFilters = filters
1055
+ .filter((filter) => filter.columnId === currentFilterColumn?.id)
1056
+ .map((filter) => filter.value);
1057
+ const columnValues = rows.map((row) => row[currentFilterColumn?.id]);
1058
+ const translateObservable = this.columns.find((c) => c.id === currentFilterColumn?.id)?.columnType === ColumnType.TRANSLATION_KEY
1059
+ ? this.translateService.get(columnValues)
1060
+ : of(Object.fromEntries(columnValues.map((cv) => [cv, cv])));
1061
+ return translateObservable.pipe(map((translatedValues) => {
1062
+ return Object.values(translatedValues)
1063
+ .concat(currentFilters)
1064
+ .filter((value, index, self) => self.indexOf(value) === index && value != null)
1065
+ .map((filterOption) => ({
1066
+ label: filterOption,
1067
+ value: filterOption,
1068
+ }));
1069
+ }));
1070
+ }));
1071
+ this.filterAmounts$ = this._filters$.pipe(map((filters) => filters
1072
+ .map((filter) => filter.columnId)
1073
+ .map((columnId) => [columnId, filters.filter((filter) => filter.columnId === columnId).length])), map((amounts) => Object.fromEntries(amounts)));
1074
+ this.mapSelectionToRows();
1075
+ }
1076
+ onSortColumnClick(sortColumn) {
1077
+ const newSortDirection = this.columnNextSortDirection(sortColumn);
1078
+ this._sortColumn$.next(sortColumn);
1079
+ this._sortDirection$.next(newSortDirection);
1080
+ this.sorted.emit({ sortColumn: sortColumn, sortDirection: newSortDirection });
1081
+ }
1082
+ columnNextSortDirection(sortColumn) {
1083
+ return sortColumn !== this.sortColumn
1084
+ ? this.sortStates[0]
1085
+ : this.sortStates[(this.sortStates.indexOf(this.sortDirection) + 1) % this.sortStates.length];
1086
+ }
1087
+ onDeleteRow(selectedTableRow) {
1088
+ this.deleteTableRow.emit(selectedTableRow);
1089
+ }
1090
+ onViewRow(selectedTableRow) {
1091
+ this.viewTableRow.emit(selectedTableRow);
1092
+ }
1093
+ onEditRow(selectedTableRow) {
1094
+ this.editTableRow.emit(selectedTableRow);
1095
+ }
1096
+ onFilterClick(column) {
1097
+ this.currentFilterColumn$.next(column);
1098
+ }
1099
+ onFilterChange(column, event) {
1100
+ const filters = this.filters
1101
+ .filter((filter) => filter.columnId !== column.id)
1102
+ .concat(event.value.map((value) => ({
1103
+ columnId: column.id,
1104
+ value,
1105
+ })));
1106
+ if (this.clientSideFiltering) {
1107
+ this.filters = filters;
1108
+ }
1109
+ this.filtered.emit(filters);
1110
+ }
1111
+ getSelectedFilters(columnId) {
1112
+ return this.filters.filter((filter) => filter.columnId === columnId).map((filter) => filter.value);
1113
+ }
1114
+ sortIconTitle(sortColumn) {
1115
+ return this.sortDirectionToTitle(sortColumn !== this.sortDirection
1116
+ ? "NONE" /* DataSortDirection.NONE */
1117
+ : this.sortStates[this.sortStates.indexOf(this.sortDirection) % this.sortStates.length]);
1118
+ }
1119
+ sortDirectionToTitle(sortDirection) {
1120
+ switch (sortDirection) {
1121
+ case "ASCENDING" /* DataSortDirection.ASCENDING */:
1122
+ return 'OCX_DATA_TABLE.TOGGLE_BUTTON.ASCENDING_TITLE';
1123
+ case "DESCENDING" /* DataSortDirection.DESCENDING */:
1124
+ return 'OCX_DATA_TABLE.TOGGLE_BUTTON.DESCENDING_TITLE';
1125
+ default:
1126
+ return 'OCX_DATA_TABLE.TOGGLE_BUTTON.DEFAULT_TITLE';
1127
+ }
1128
+ }
1129
+ mapSelectionToRows() {
1130
+ this.selectedRows$ = combineLatest([this._selection$, this._rows$]).pipe(map(([selectedRows, rows]) => {
1131
+ return selectedRows.map((row) => {
1132
+ return rows.find((r) => r.id === row.id);
1133
+ });
1134
+ }));
1135
+ }
1136
+ onSelectionChange(event) {
1137
+ this.selectionChanged.emit(event);
1138
+ }
1139
+ onPageChange(event) {
1140
+ const page = event.first / event.rows;
1141
+ this.page = page;
1142
+ this.pageChanged.emit(page);
1143
+ }
1144
+ fieldIsTruthy(object, key) {
1145
+ return !!(ObjectUtils.resolveFieldData(object, key));
1146
+ }
1147
+ }
1148
+ DataTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataTableComponent, deps: [{ token: LOCALE_ID }, { token: i1.TranslateService }, { token: i1$1.Router }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1149
+ 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", 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: "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\">\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 *ngIf=\"viewTableRowObserved && (!viewActionVisibleField || fieldIsTruthy(rowObject, viewActionVisibleField))\">\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 *ngIf=\"editTableRowObserved && (!editActionVisibleField || fieldIsTruthy(rowObject, editActionVisibleField))\">\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 *ngIf=\"deleteTableRowObserved && (!deleteActionVisibleField || fieldIsTruthy(rowObject, deleteActionVisibleField))\">\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 <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\"\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\">\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 [value]=\"(displayedRows$ | async) || []\"\n responsiveLayout=\"scroll\"\n [paginator]=\"paginator\"\n [first]=\"page * pageSize\"\n (onPage)=\"onPageChange($event)\"\n [rows]=\"pageSize\"\n [showCurrentPageReport]=\"true\"\n currentPageReportTemplate=\"{{ (totalRecordsOnServer ? currentPageShowingWithTotalOnServerKey : currentPageShowingKey) | translate:params }}\"\n [rowsPerPageOptions]=\"[10, 25, 50, rows?.length]\"\n id=\"dataTable_{{name}}\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selection]=\"(selectedRows$ | async) || []\"\n [scrollable]=\"true\"\n>\n <ng-template let-item pTemplate=\"paginatordropdownitem\">\n {{ item.value === rows?.length ? (\"OCX_DATA_TABLE.ALL\" | translate) : item.value }}\n </ng-template>\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-slash]=\"(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 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) ? 1 : 0)\">{{ emptyResultsMessage || (\"OCX_DATA_TABLE.EMPTY_RESULT\" | translate) }}</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=\"'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 #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: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i2$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i5.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i6$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: i6$1.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "component", type: i6$1.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i6$1.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i7$1.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"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.DecimalPipe, name: "number" }, { kind: "pipe", type: i3.DatePipe, name: "date" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "pipe", type: OcxTimeAgoPipe, name: "timeago" }] });
1150
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataTableComponent, decorators: [{
1151
+ type: Component,
1152
+ args: [{ selector: 'ocx-data-table', template: "<ng-template #actionColumn let-rowObject=\"localRowObject\">\n <ng-container *ngIf=\"anyRowActionObserved\">\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 *ngIf=\"viewTableRowObserved && (!viewActionVisibleField || fieldIsTruthy(rowObject, viewActionVisibleField))\">\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 *ngIf=\"editTableRowObserved && (!editActionVisibleField || fieldIsTruthy(rowObject, editActionVisibleField))\">\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 *ngIf=\"deleteTableRowObserved && (!deleteActionVisibleField || fieldIsTruthy(rowObject, deleteActionVisibleField))\">\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 <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\"\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\">\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 [value]=\"(displayedRows$ | async) || []\"\n responsiveLayout=\"scroll\"\n [paginator]=\"paginator\"\n [first]=\"page * pageSize\"\n (onPage)=\"onPageChange($event)\"\n [rows]=\"pageSize\"\n [showCurrentPageReport]=\"true\"\n currentPageReportTemplate=\"{{ (totalRecordsOnServer ? currentPageShowingWithTotalOnServerKey : currentPageShowingKey) | translate:params }}\"\n [rowsPerPageOptions]=\"[10, 25, 50, rows?.length]\"\n id=\"dataTable_{{name}}\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selection]=\"(selectedRows$ | async) || []\"\n [scrollable]=\"true\"\n>\n <ng-template let-item pTemplate=\"paginatordropdownitem\">\n {{ item.value === rows?.length ? (\"OCX_DATA_TABLE.ALL\" | translate) : item.value }}\n </ng-template>\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-slash]=\"(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 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) ? 1 : 0)\">{{ emptyResultsMessage || (\"OCX_DATA_TABLE.EMPTY_RESULT\" | translate) }}</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=\"'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 #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"] }]
1153
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1154
+ type: Inject,
1155
+ args: [LOCALE_ID]
1156
+ }] }, { type: i1.TranslateService }, { type: i1$1.Router }, { type: i0.Injector }]; }, propDecorators: { rows: [{
1157
+ type: Input
1158
+ }], selectedRows: [{
1159
+ type: Input
1160
+ }], filters: [{
1161
+ type: Input
1162
+ }], sortDirection: [{
1163
+ type: Input
1164
+ }], sortColumn: [{
1165
+ type: Input
1166
+ }], columns: [{
1167
+ type: Input
1168
+ }], clientSideFiltering: [{
1169
+ type: Input
1170
+ }], clientSideSorting: [{
1171
+ type: Input
1172
+ }], sortStates: [{
1173
+ type: Input
1174
+ }], pageSizes: [{
1175
+ type: Input
1176
+ }], pageSize: [{
1177
+ type: Input
1178
+ }], emptyResultsMessage: [{
1179
+ type: Input
1180
+ }], name: [{
1181
+ type: Input
1182
+ }], deletePermission: [{
1183
+ type: Input
1184
+ }], viewPermission: [{
1185
+ type: Input
1186
+ }], editPermission: [{
1187
+ type: Input
1188
+ }], deleteActionVisibleField: [{
1189
+ type: Input
1190
+ }], deleteActionEnabledField: [{
1191
+ type: Input
1192
+ }], viewActionVisibleField: [{
1193
+ type: Input
1194
+ }], viewActionEnabledField: [{
1195
+ type: Input
1196
+ }], editActionVisibleField: [{
1197
+ type: Input
1198
+ }], editActionEnabledField: [{
1199
+ type: Input
1200
+ }], paginator: [{
1201
+ type: Input
1202
+ }], page: [{
1203
+ type: Input
1204
+ }], totalRecordsOnServer: [{
1205
+ type: Input
1206
+ }], currentPageShowingKey: [{
1207
+ type: Input
1208
+ }], currentPageShowingWithTotalOnServerKey: [{
1209
+ type: Input
1210
+ }], stringCellTemplate: [{
1211
+ type: Input
1212
+ }], stringCellChildTemplate: [{
1213
+ type: ContentChild,
1214
+ args: ['stringCell']
1215
+ }], numberCellTemplate: [{
1216
+ type: Input
1217
+ }], numberCellChildTemplate: [{
1218
+ type: ContentChild,
1219
+ args: ['numberCell']
1220
+ }], dateCellTemplate: [{
1221
+ type: Input
1222
+ }], dateCellChildTemplate: [{
1223
+ type: ContentChild,
1224
+ args: ['dateCell']
1225
+ }], relativeDateCellTemplate: [{
1226
+ type: Input
1227
+ }], relativeDateCellChildTemplate: [{
1228
+ type: ContentChild,
1229
+ args: ['relativeDateCell']
1230
+ }], cellTemplate: [{
1231
+ type: Input
1232
+ }], cellChildTemplate: [{
1233
+ type: ContentChild,
1234
+ args: ['cell']
1235
+ }], translationKeyCellTemplate: [{
1236
+ type: Input
1237
+ }], translationKeyCellChildTemplate: [{
1238
+ type: ContentChild,
1239
+ args: ['translationKeyCell']
1240
+ }], additionalActions: [{
1241
+ type: Input
1242
+ }], frozenActionColumn: [{
1243
+ type: Input
1244
+ }], actionColumnPosition: [{
1245
+ type: Input
1246
+ }], filtered: [{
1247
+ type: Output
1248
+ }], sorted: [{
1249
+ type: Output
1250
+ }], viewTableRow: [{
1251
+ type: Output
1252
+ }], editTableRow: [{
1253
+ type: Output
1254
+ }], deleteTableRow: [{
1255
+ type: Output
1256
+ }], selectionChanged: [{
1257
+ type: Output
1258
+ }], pageChanged: [{
1259
+ type: Output
1260
+ }] } });
1261
+
1262
+ class DataViewComponent {
1263
+ set listGrid(ref) {
1264
+ this._dataListGridComponent = ref;
1265
+ this.registerEventListenerForListGrid();
1266
+ }
1267
+ get listGrid() {
1268
+ return this._dataListGridComponent;
1269
+ }
1270
+ set dataTable(ref) {
1271
+ this._dataTableComponent = ref;
1272
+ this.registerEventListenerForDataTable();
1273
+ }
1274
+ get dataTable() {
1275
+ return this._dataTableComponent;
1276
+ }
1277
+ get paginator() {
1278
+ return this.listGridPaginator && this.tablePaginator;
1279
+ }
1280
+ set paginator(value) {
1281
+ this.listGridPaginator = value;
1282
+ this.tablePaginator = value;
1283
+ }
1284
+ get _stringTableCell() {
1285
+ return this.stringTableCellTemplate || this.stringTableCellChildTemplate;
1286
+ }
1287
+ get _numberTableCell() {
1288
+ return this.numberTableCellTemplate || this.numberTableCellChildTemplate;
1289
+ }
1290
+ get _tableDateCell() {
1291
+ return this.tableDateCellTemplate || this.tableDateCellChildTemplate;
1292
+ }
1293
+ get _tableCell() {
1294
+ return this.tableCellTemplate || this.tableCellChildTemplate;
1295
+ }
1296
+ get _tableTranslationKeyCell() {
1297
+ return this.tableTranslationKeyCellTemplate || this.tableTranslationKeyCellChildTemplate;
1298
+ }
1299
+ get _gridItemSubtitleLines() {
1300
+ return this.gridItemSubtitleLinesTemplate || this.gridItemSubtitleLinesChildTemplate;
1301
+ }
1302
+ get _listItemSubtitleLines() {
1303
+ return this.listItemSubtitleLinesTemplate || this.listItemSubtitleLinesChildTemplate;
1304
+ }
1305
+ get _gridItem() {
1306
+ return this.gridItemTemplate || this.gridItemChildTemplate;
1307
+ }
1308
+ get _listItem() {
1309
+ return this.listItemTemplate || this.listItemChildTemplate;
1310
+ }
1311
+ get _tableRelativeDateCell() {
1312
+ return this.tableRelativeDateCellTemplate || this.tableRelativeDateCellChildTemplate;
1313
+ }
1314
+ get viewItemObserved() {
1315
+ return this.injector.get('InteractiveDataViewComponent', null)?.viewItem.observed || this.viewItem.observed;
1316
+ }
1317
+ get editItemObserved() {
1318
+ return this.injector.get('InteractiveDataViewComponent', null)?.editItem.observed || this.editItem.observed;
1319
+ }
1320
+ get deleteItemObserved() {
1321
+ return this.injector.get('InteractiveDataViewComponent', null)?.deleteItem.observed || this.deleteItem.observed;
1322
+ }
1323
+ get selectionChangedObserved() {
1324
+ return (this.injector.get('InteractiveDataViewComponent', null)?.selectionChanged.observed ||
1325
+ this.selectionChanged.observed);
1326
+ }
1327
+ constructor(injector) {
1328
+ this.injector = injector;
1329
+ this.data = [];
1330
+ this.name = 'Data table';
1331
+ this.subtitleLineIds = [];
1332
+ this.layout = ['grid', 'list', 'table'];
1333
+ this.columns = [];
1334
+ this.clientSideFiltering = true;
1335
+ this.fallbackImage = 'placeholder.png';
1336
+ this.filters = [];
1337
+ this.sortField = '';
1338
+ this.sortDirection = "NONE" /* DataSortDirection.NONE */;
1339
+ this.listGridPaginator = true;
1340
+ this.tablePaginator = true;
1341
+ this.page = 0;
1342
+ this.currentPageShowingKey = 'OCX_DATA_TABLE.SHOWING';
1343
+ this.currentPageShowingWithTotalOnServerKey = 'OCX_DATA_TABLE.SHOWING_WITH_TOTAL_ON_SERVER';
1344
+ this.selectedRows = [];
1345
+ this.frozenActionColumn = false;
1346
+ this.actionColumnPosition = 'right';
1347
+ this.sortStates = ["ASCENDING" /* DataSortDirection.ASCENDING */, "DESCENDING" /* DataSortDirection.DESCENDING */];
1348
+ this.pageSizes = [10, 25, 50];
1349
+ this.pageSize = this.pageSizes?.[0] || 50;
1350
+ this.additionalActions = [];
1351
+ this.filtered = new EventEmitter();
1352
+ this.sorted = new EventEmitter();
1353
+ this.deleteItem = new EventEmitter();
1354
+ this.viewItem = new EventEmitter();
1355
+ this.editItem = new EventEmitter();
1356
+ this.selectionChanged = new EventEmitter();
1357
+ this.pageChanged = new EventEmitter();
1358
+ }
1359
+ ngOnInit() {
1360
+ this.firstColumnId = this.columns[0]?.id;
1361
+ }
1362
+ ngDoCheck() {
1363
+ this.registerEventListenerForDataTable();
1364
+ this.registerEventListenerForListGrid();
1365
+ }
1366
+ registerEventListenerForListGrid() {
1367
+ if (this.layout !== 'table') {
1368
+ if (this.deleteItem.observed) {
1369
+ this.isDeleteItemObserved = true;
1370
+ if (!this._dataListGridComponent?.deleteItem.observed) {
1371
+ this._dataListGridComponent?.deleteItem.subscribe((event) => {
1372
+ this.deletingElement(event);
1373
+ });
1374
+ }
1375
+ }
1376
+ if (this.viewItem.observed) {
1377
+ this.isViewItemObserved = true;
1378
+ if (!this._dataListGridComponent?.viewItem.observed) {
1379
+ this._dataListGridComponent?.viewItem.subscribe((event) => {
1380
+ this.viewingElement(event);
1381
+ });
1382
+ }
1383
+ }
1384
+ if (this.editItem.observed) {
1385
+ this.IsEditItemObserved = true;
1386
+ if (!this._dataListGridComponent?.editItem.observed) {
1387
+ this._dataListGridComponent?.editItem.subscribe((event) => {
1388
+ this.editingElement(event);
1389
+ });
1390
+ }
1391
+ }
1392
+ }
1393
+ }
1394
+ registerEventListenerForDataTable() {
1395
+ if (this.layout === 'table') {
1396
+ if (this.deleteItem.observed) {
1397
+ this.isDeleteItemObserved = true;
1398
+ if (!this._dataTableComponent?.deleteTableRow.observed) {
1399
+ this._dataTableComponent?.deleteTableRow.subscribe((event) => {
1400
+ this.deletingElement(event);
1401
+ });
1402
+ }
1403
+ }
1404
+ if (this.viewItem.observed) {
1405
+ this.isViewItemObserved = true;
1406
+ if (!this._dataTableComponent?.viewTableRow.observed) {
1407
+ this._dataTableComponent?.viewTableRow.subscribe((event) => {
1408
+ this.viewingElement(event);
1409
+ });
1410
+ }
1411
+ }
1412
+ if (this.editItem.observed) {
1413
+ this.IsEditItemObserved = true;
1414
+ if (!this._dataTableComponent?.editTableRow.observed) {
1415
+ this._dataTableComponent?.editTableRow.subscribe((event) => {
1416
+ this.editingElement(event);
1417
+ });
1418
+ }
1419
+ }
1420
+ if (this.selectionChangedObserved) {
1421
+ if (!this._dataTableComponent?.selectionChanged.observed) {
1422
+ this._dataTableComponent?.selectionChanged.subscribe((event) => {
1423
+ this.onRowSelectionChange(event);
1424
+ });
1425
+ }
1426
+ }
1427
+ }
1428
+ }
1429
+ filtering(event) {
1430
+ this.filters = event;
1431
+ this.filtered.emit(event);
1432
+ }
1433
+ sorting(event) {
1434
+ this.sortDirection = event.sortDirection;
1435
+ this.sortField = event.sortColumn;
1436
+ this.sorted.emit(event);
1437
+ }
1438
+ deletingElement(event) {
1439
+ if (this.isDeleteItemObserved) {
1440
+ this.deleteItem.emit(event);
1441
+ }
1442
+ }
1443
+ viewingElement(event) {
1444
+ if (this.isViewItemObserved) {
1445
+ this.viewItem.emit(event);
1446
+ }
1447
+ }
1448
+ editingElement(event) {
1449
+ if (this.IsEditItemObserved) {
1450
+ this.editItem.emit(event);
1451
+ }
1452
+ }
1453
+ onRowSelectionChange(event) {
1454
+ if (this.selectionChangedObserved) {
1455
+ this.selectionChanged.emit(event);
1456
+ }
1457
+ }
1458
+ onPageChange(event) {
1459
+ this.page = event;
1460
+ this.pageChanged.emit(event);
1461
+ }
1462
+ }
1463
+ DataViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataViewComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1464
+ 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", 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", tableDateCellTemplate: "tableDateCellTemplate", tableCellTemplate: "tableCellTemplate", tableTranslationKeyCellTemplate: "tableTranslationKeyCellTemplate", gridItemSubtitleLinesTemplate: "gridItemSubtitleLinesTemplate", listItemSubtitleLinesTemplate: "listItemSubtitleLinesTemplate", gridItemTemplate: "gridItemTemplate", listItemTemplate: "listItemTemplate", 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: "tableDateCellChildTemplate", first: true, predicate: ["tableDateCell"], descendants: true }, { propertyName: "tableCellChildTemplate", first: true, predicate: ["tableCell"], descendants: true }, { propertyName: "tableTranslationKeyCellChildTemplate", first: true, predicate: ["tableTranslationKeyCell"], 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 }], 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 [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]=\"true\"\n [clientSideSorting]=\"true\"\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 [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 #dateCell 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 #relativeDateCell 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 #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=\"_tableTranslationKeyCell\"\n [ngTemplateOutlet]=\"_tableTranslationKeyCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n ></ng-template>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.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", "dateCellTemplate", "relativeDateCellTemplate", "cellTemplate", "translationKeyCellTemplate", "additionalActions", "frozenActionColumn", "actionColumnPosition"], outputs: ["filtered", "sorted", "viewTableRow", "editTableRow", "deleteTableRow", "selectionChanged", "pageChanged"] }] });
1465
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DataViewComponent, decorators: [{
1466
+ type: Component,
1467
+ 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 [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]=\"true\"\n [clientSideSorting]=\"true\"\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 [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 #dateCell 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 #relativeDateCell 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 #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=\"_tableTranslationKeyCell\"\n [ngTemplateOutlet]=\"_tableTranslationKeyCell\"\n [ngTemplateOutletContext]=\"{rowObject:rowObject, column:column}\"\n >\n </ng-container\n ></ng-template>\n</div>\n" }]
1468
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { listGrid: [{
1469
+ type: ViewChild,
1470
+ args: [DataListGridComponent]
1471
+ }], dataTable: [{
1472
+ type: ViewChild,
1473
+ args: [DataTableComponent]
1474
+ }], deletePermission: [{
1475
+ type: Input
1476
+ }], editPermission: [{
1477
+ type: Input
1478
+ }], viewPermission: [{
1479
+ type: Input
1480
+ }], deleteActionVisibleField: [{
1481
+ type: Input
1482
+ }], deleteActionEnabledField: [{
1483
+ type: Input
1484
+ }], viewActionVisibleField: [{
1485
+ type: Input
1486
+ }], viewActionEnabledField: [{
1487
+ type: Input
1488
+ }], editActionVisibleField: [{
1489
+ type: Input
1490
+ }], editActionEnabledField: [{
1491
+ type: Input
1492
+ }], data: [{
1493
+ type: Input
1494
+ }], name: [{
1495
+ type: Input
1496
+ }], titleLineId: [{
1497
+ type: Input
1498
+ }], subtitleLineIds: [{
1499
+ type: Input
1500
+ }], layout: [{
1501
+ type: Input
1502
+ }], columns: [{
1503
+ type: Input
1504
+ }], emptyResultsMessage: [{
1505
+ type: Input
1506
+ }], clientSideFiltering: [{
1507
+ type: Input
1508
+ }], fallbackImage: [{
1509
+ type: Input
1510
+ }], filters: [{
1511
+ type: Input
1512
+ }], sortField: [{
1513
+ type: Input
1514
+ }], sortDirection: [{
1515
+ type: Input
1516
+ }], listGridPaginator: [{
1517
+ type: Input
1518
+ }], tablePaginator: [{
1519
+ type: Input
1520
+ }], page: [{
1521
+ type: Input
1522
+ }], totalRecordsOnServer: [{
1523
+ type: Input
1524
+ }], currentPageShowingKey: [{
1525
+ type: Input
1526
+ }], currentPageShowingWithTotalOnServerKey: [{
1527
+ type: Input
1528
+ }], selectedRows: [{
1529
+ type: Input
1530
+ }], frozenActionColumn: [{
1531
+ type: Input
1532
+ }], actionColumnPosition: [{
1533
+ type: Input
1534
+ }], paginator: [{
1535
+ type: Input
1536
+ }], sortStates: [{
1537
+ type: Input
1538
+ }], pageSizes: [{
1539
+ type: Input
1540
+ }], pageSize: [{
1541
+ type: Input
1542
+ }], stringTableCellTemplate: [{
1543
+ type: Input
1544
+ }], stringTableCellChildTemplate: [{
1545
+ type: ContentChild,
1546
+ args: ['stringTableCell']
1547
+ }], numberTableCellTemplate: [{
1548
+ type: Input
1549
+ }], numberTableCellChildTemplate: [{
1550
+ type: ContentChild,
1551
+ args: ['numberTableCell']
1552
+ }], tableDateCellTemplate: [{
1553
+ type: Input
1554
+ }], tableDateCellChildTemplate: [{
1555
+ type: ContentChild,
1556
+ args: ['tableDateCell']
1557
+ }], tableCellTemplate: [{
1558
+ type: Input
1559
+ }], tableCellChildTemplate: [{
1560
+ type: ContentChild,
1561
+ args: ['tableCell']
1562
+ }], tableTranslationKeyCellTemplate: [{
1563
+ type: Input
1564
+ }], tableTranslationKeyCellChildTemplate: [{
1565
+ type: ContentChild,
1566
+ args: ['tableTranslationKeyCell']
1567
+ }], gridItemSubtitleLinesTemplate: [{
1568
+ type: Input
1569
+ }], gridItemSubtitleLinesChildTemplate: [{
1570
+ type: ContentChild,
1571
+ args: ['gridItemSubtitleLines']
1572
+ }], listItemSubtitleLinesTemplate: [{
1573
+ type: Input
1574
+ }], listItemSubtitleLinesChildTemplate: [{
1575
+ type: ContentChild,
1576
+ args: ['listItemSubtitleLines']
1577
+ }], gridItemTemplate: [{
1578
+ type: Input
1579
+ }], gridItemChildTemplate: [{
1580
+ type: ContentChild,
1581
+ args: ['gridItem']
1582
+ }], listItemTemplate: [{
1583
+ type: Input
1584
+ }], listItemChildTemplate: [{
1585
+ type: ContentChild,
1586
+ args: ['listItem']
1587
+ }], tableRelativeDateCellTemplate: [{
1588
+ type: Input
1589
+ }], tableRelativeDateCellChildTemplate: [{
1590
+ type: ContentChild,
1591
+ args: ['tableRelativeDateCell']
1592
+ }], additionalActions: [{
1593
+ type: Input
1594
+ }], filtered: [{
1595
+ type: Output
1596
+ }], sorted: [{
1597
+ type: Output
1598
+ }], deleteItem: [{
1599
+ type: Output
1600
+ }], viewItem: [{
1601
+ type: Output
1602
+ }], editItem: [{
1603
+ type: Output
1604
+ }], selectionChanged: [{
1605
+ type: Output
1606
+ }], pageChanged: [{
1607
+ type: Output
1608
+ }] } });
1609
+
1610
+ class ColorUtils {
1611
+ static calculatePoint(i, intervalSize, colorRangeInfo) {
1612
+ const { colorStart, colorEnd, useEndAsStart } = colorRangeInfo;
1613
+ return useEndAsStart ? colorEnd - i * intervalSize : colorStart + i * intervalSize;
1614
+ }
1615
+ static interpolateColors(dataLength, colorScale, colorRangeInfo) {
1616
+ const { colorStart, colorEnd } = colorRangeInfo;
1617
+ const colorRange = colorEnd - colorStart;
1618
+ const intervalSize = colorRange / dataLength;
1619
+ let i, colorPoint;
1620
+ const colorArray = [];
1621
+ for (i = 0; i < dataLength; i++) {
1622
+ colorPoint = this.calculatePoint(i, intervalSize, colorRangeInfo);
1623
+ colorArray.push(colorScale(colorPoint));
1624
+ }
1625
+ return colorArray;
1626
+ }
1627
+ }
1628
+
1629
+ const allDiagramTypes = [
1630
+ { icon: PrimeIcons.CHART_PIE, layout: "PIE" /* DiagramType.PIE */, titleKey: 'OCX_DIAGRAM.SWITCH_DIAGRAM_TYPE.PIE' },
1631
+ {
1632
+ icon: PrimeIcons.BARS,
1633
+ layout: "HORIZONTAL_BAR" /* DiagramType.HORIZONTAL_BAR */,
1634
+ titleKey: 'OCX_DIAGRAM.SWITCH_DIAGRAM_TYPE.HORIZONTAL_BAR',
1635
+ },
1636
+ {
1637
+ icon: PrimeIcons.CHART_BAR,
1638
+ layout: "VERTICAL_BAR" /* DiagramType.VERTICAL_BAR */,
1639
+ titleKey: 'OCX_DIAGRAM.SWITCH_DIAGRAM_TYPE.VERTICAL_BAR',
1640
+ },
1641
+ ];
1642
+ class DiagramComponent {
1643
+ get diagramType() {
1644
+ return this._diagramType;
1645
+ }
1646
+ set diagramType(value) {
1647
+ this._diagramType = value;
1648
+ this.selectedDiagramType = allDiagramTypes.find((v) => v.layout === value);
1649
+ this.chartType = this.diagramTypeToChartType(value);
1650
+ }
1651
+ get supportedDiagramTypes() {
1652
+ return this._supportedDiagramTypes;
1653
+ }
1654
+ set supportedDiagramTypes(value) {
1655
+ this._supportedDiagramTypes = value;
1656
+ this.shownDiagramTypes = allDiagramTypes.filter((vl) => this.supportedDiagramTypes.includes(vl.layout));
1657
+ }
1658
+ constructor(translateService) {
1659
+ this.translateService = translateService;
1660
+ this.sumKey = 'OCX_DIAGRAM.SUM';
1661
+ this._diagramType = "PIE" /* DiagramType.PIE */;
1662
+ this.chartType = 'pie';
1663
+ this._supportedDiagramTypes = [];
1664
+ this.dataSelected = new EventEmitter();
1665
+ this.diagramTypeChanged = new EventEmitter();
1666
+ this.shownDiagramTypes = [];
1667
+ // Changing the colorRangeInfo, will change the range of the color palette of the diagram.
1668
+ this.colorRangeInfo = {
1669
+ colorStart: 0,
1670
+ colorEnd: 1,
1671
+ useEndAsStart: false,
1672
+ };
1673
+ // Changing the colorScale, will change the thematic color appearance of the diagram.
1674
+ this.colorScale = d3.interpolateCool;
1675
+ }
1676
+ ngOnChanges() {
1677
+ this.generateChart(this.colorScale, this.colorRangeInfo);
1678
+ }
1679
+ ngOnInit() {
1680
+ this.generateChart(this.colorScale, this.colorRangeInfo);
1681
+ }
1682
+ generateChart(colorScale, colorRangeInfo) {
1683
+ if (this.data) {
1684
+ const inputData = this.data.map((diagramData) => diagramData.value);
1685
+ this.amountOfData = this.data.reduce((acc, current) => acc + current.value, 0);
1686
+ const COLORS = interpolateColors(this.data.length, colorScale, colorRangeInfo);
1687
+ this.chartData = {
1688
+ labels: this.data.map((data) => data.label),
1689
+ datasets: [
1690
+ {
1691
+ data: inputData,
1692
+ backgroundColor: COLORS,
1693
+ },
1694
+ ],
1695
+ };
1696
+ }
1697
+ this.chartOptions = {
1698
+ plugins: {
1699
+ legend: {
1700
+ position: 'bottom',
1701
+ },
1702
+ },
1703
+ maintainAspectRatio: false,
1704
+ ...(this._diagramType === "VERTICAL_BAR" /* DiagramType.VERTICAL_BAR */ && {
1705
+ plugins: { legend: { display: false } },
1706
+ scales: { y: { ticks: { precision: 0 } } },
1707
+ }),
1708
+ ...(this._diagramType === "HORIZONTAL_BAR" /* DiagramType.HORIZONTAL_BAR */ && {
1709
+ indexAxis: 'y',
1710
+ plugins: { legend: { display: false } },
1711
+ scales: { x: { ticks: { precision: 0 } } },
1712
+ }),
1713
+ };
1714
+ }
1715
+ diagramTypeToChartType(value) {
1716
+ if (value === "PIE" /* DiagramType.PIE */)
1717
+ return 'pie';
1718
+ else if (value === "HORIZONTAL_BAR" /* DiagramType.HORIZONTAL_BAR */ || value === "VERTICAL_BAR" /* DiagramType.VERTICAL_BAR */)
1719
+ return 'bar';
1720
+ return 'pie';
1721
+ }
1722
+ dataClicked(event) {
1723
+ this.dataSelected.emit(event.length);
1724
+ }
1725
+ onDiagramTypeChanged(event) {
1726
+ this.diagramType = event.value.layout;
1727
+ this.generateChart(this.colorScale, this.colorRangeInfo);
1728
+ this.diagramTypeChanged.emit(event.value.layout);
1729
+ }
1730
+ }
1731
+ DiagramComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DiagramComponent, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
1732
+ 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: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6.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: "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.TranslatePipe, name: "translate" }] });
1733
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DiagramComponent, decorators: [{
1734
+ type: Component,
1735
+ 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"] }]
1736
+ }], ctorParameters: function () { return [{ type: i1.TranslateService }]; }, propDecorators: { data: [{
1737
+ type: Input
1738
+ }], sumKey: [{
1739
+ type: Input
1740
+ }], diagramType: [{
1741
+ type: Input
1742
+ }], supportedDiagramTypes: [{
1743
+ type: Input
1744
+ }], dataSelected: [{
1745
+ type: Output
1746
+ }], diagramTypeChanged: [{
1747
+ type: Output
1748
+ }] } });
1749
+ function interpolateColors(amountOfData, colorScale, colorRangeInfo) {
1750
+ return ColorUtils.interpolateColors(amountOfData, colorScale, colorRangeInfo);
1751
+ }
1752
+
1753
+ class GroupByCountDiagramComponent {
1754
+ /**
1755
+ * @deprecated Will be replaced by diagramType
1756
+ */
1757
+ get type() {
1758
+ return this.diagramType;
1759
+ }
1760
+ set type(value) {
1761
+ this.diagramType = value;
1762
+ }
1763
+ get data() {
1764
+ return this._data$.getValue();
1765
+ }
1766
+ set data(value) {
1767
+ this._data$.next(value);
1768
+ }
1769
+ get columnType() {
1770
+ return this._columnType$.getValue();
1771
+ }
1772
+ set columnType(value) {
1773
+ this._columnType$.next(value);
1774
+ }
1775
+ get columnField() {
1776
+ return this._columnField$.getValue();
1777
+ }
1778
+ set columnField(value) {
1779
+ this._columnField$.next(value);
1780
+ }
1781
+ get column() {
1782
+ return { columnType: this.columnType, id: this.columnField };
1783
+ }
1784
+ set column(value) {
1785
+ this.columnType = value.columnType;
1786
+ this.columnField = value.id;
1787
+ }
1788
+ constructor(translateService) {
1789
+ this.translateService = translateService;
1790
+ this.sumKey = 'SEARCH.SUMMARY_TITLE';
1791
+ this.diagramType = "PIE" /* DiagramType.PIE */;
1792
+ this.supportedDiagramTypes = [];
1793
+ this._data$ = new BehaviorSubject([]);
1794
+ this._columnType$ = new BehaviorSubject(ColumnType.STRING);
1795
+ this._columnField$ = new BehaviorSubject('');
1796
+ this.dataSelected = new EventEmitter();
1797
+ this.diagramTypeChanged = new EventEmitter();
1798
+ }
1799
+ ngOnInit() {
1800
+ this.diagramData$ = combineLatest([this._data$, this._columnField$, this._columnType$]).pipe(mergeMap(([data, columnField, columnType]) => {
1801
+ const columnData = data.map((d) => ObjectUtils.resolveFieldData(d, columnField));
1802
+ const occurrences = columnData.reduce((acc, current) => {
1803
+ return acc.some((e) => e.label === current)
1804
+ ? (acc.find((e) => e.label === current).value++, acc)
1805
+ : [...acc, { label: current, value: 1 }];
1806
+ }, []);
1807
+ if (columnType === ColumnType.TRANSLATION_KEY && occurrences.length > 0) {
1808
+ return this.translateService.get(occurrences.map((o) => o.label)).pipe(map((translations) => occurrences.map((o) => ({
1809
+ label: translations[o.label],
1810
+ value: o.value,
1811
+ }))));
1812
+ }
1813
+ else {
1814
+ return of(occurrences);
1815
+ }
1816
+ }));
1817
+ }
1818
+ dataClicked(event) {
1819
+ this.dataSelected.emit(event);
1820
+ }
1821
+ onDiagramTypeChanged(newDiagramType) {
1822
+ this.diagramType = newDiagramType;
1823
+ this.diagramTypeChanged.emit(newDiagramType);
1824
+ }
1825
+ }
1826
+ GroupByCountDiagramComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GroupByCountDiagramComponent, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
1827
+ 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: i3.AsyncPipe, name: "async" }] });
1828
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: GroupByCountDiagramComponent, decorators: [{
1829
+ type: Component,
1830
+ 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" }]
1831
+ }], ctorParameters: function () { return [{ type: i1.TranslateService }]; }, propDecorators: { sumKey: [{
1832
+ type: Input
1833
+ }], diagramType: [{
1834
+ type: Input
1835
+ }], type: [{
1836
+ type: Input
1837
+ }], supportedDiagramTypes: [{
1838
+ type: Input
1839
+ }], data: [{
1840
+ type: Input
1841
+ }], columnType: [{
1842
+ type: Input
1843
+ }], columnField: [{
1844
+ type: Input
1845
+ }], column: [{
1846
+ type: Input
1847
+ }], dataSelected: [{
1848
+ type: Output
1849
+ }], diagramTypeChanged: [{
1850
+ type: Output
1851
+ }] } });
1852
+
1853
+ class InteractiveDataViewComponent {
1854
+ constructor() {
1855
+ this.name = 'Data';
1856
+ this.subtitleLineIds = [];
1857
+ this.supportedViewLayouts = ['grid', 'list', 'table'];
1858
+ this.columns = [];
1859
+ this.clientSideFiltering = true;
1860
+ this.fallbackImage = 'placeholder.png';
1861
+ this.filters = [];
1862
+ this.sortDirection = "NONE" /* DataSortDirection.NONE */;
1863
+ this.sortField = '';
1864
+ this.sortStates = [
1865
+ "ASCENDING" /* DataSortDirection.ASCENDING */,
1866
+ "DESCENDING" /* DataSortDirection.DESCENDING */,
1867
+ "NONE" /* DataSortDirection.NONE */,
1868
+ ];
1869
+ this.pageSizes = [10, 25, 50];
1870
+ this.pageSize = this.pageSizes[0] || 50;
1871
+ this.layout = 'table';
1872
+ this.defaultGroupKey = '';
1873
+ this.customGroupKey = 'OCX_INTERACTIVE_DATA_VIEW.CUSTOM_GROUP';
1874
+ this.groupSelectionNoGroupSelectedKey = 'OCX_INTERACTIVE_DATA_VIEW.NO_GROUP_SELECTED';
1875
+ this.currentPageShowingKey = 'OCX_DATA_TABLE.SHOWING';
1876
+ this.currentPageShowingWithTotalOnServerKey = 'OCX_DATA_TABLE.SHOWING_WITH_TOTAL_ON_SERVER';
1877
+ this.additionalActions = [];
1878
+ this.listGridPaginator = true;
1879
+ this.tablePaginator = true;
1880
+ this.page = 0;
1881
+ this.selectedRows = [];
1882
+ this.displayedColumns = [];
1883
+ this.filtered = new EventEmitter();
1884
+ this.sorted = new EventEmitter();
1885
+ this.deleteItem = new EventEmitter();
1886
+ this.viewItem = new EventEmitter();
1887
+ this.editItem = new EventEmitter();
1888
+ this.dataViewLayoutChange = new EventEmitter();
1889
+ this.displayedColumnsChange = new EventEmitter();
1890
+ this.selectionChanged = new EventEmitter();
1891
+ this.pageChanged = new EventEmitter();
1892
+ this.selectedGroupKey = '';
1893
+ this.frozenActionColumn = false;
1894
+ this.actionColumnPosition = 'right';
1895
+ this._data = [];
1896
+ }
1897
+ set dataView(ref) {
1898
+ this._dataViewComponent = ref;
1899
+ this.registerEventListenerForDataView();
1900
+ }
1901
+ get dataView() {
1902
+ return this._dataViewComponent;
1903
+ }
1904
+ get paginator() {
1905
+ return this.listGridPaginator && this.tablePaginator;
1906
+ }
1907
+ set paginator(value) {
1908
+ this.listGridPaginator = value;
1909
+ this.tablePaginator = value;
1910
+ }
1911
+ get _gridItemSubtitleLines() {
1912
+ return this.gridItemSubtitleLines;
1913
+ }
1914
+ get _listItemSubtitleLines() {
1915
+ return this.listItemSubtitleLines;
1916
+ }
1917
+ get _tableCell() {
1918
+ return this.tableCell;
1919
+ }
1920
+ get _stringTableCell() {
1921
+ return this.stringTableCell;
1922
+ }
1923
+ get _numberTableCell() {
1924
+ return this.numberTableCell;
1925
+ }
1926
+ get _tableDateCell() {
1927
+ return this.tableDateCell;
1928
+ }
1929
+ get _tableRelativeDateCell() {
1930
+ return this.tableRelativeDateCell;
1931
+ }
1932
+ get _tableTranslationKeyCell() {
1933
+ return this.tableTranslationKeyCell;
1934
+ }
1935
+ get _gridItem() {
1936
+ return this.gridItem;
1937
+ }
1938
+ get _listItem() {
1939
+ return this.listItem;
1940
+ }
1941
+ get data() {
1942
+ return this._data;
1943
+ }
1944
+ set data(value) {
1945
+ this._data = value;
1946
+ }
1947
+ ngOnInit() {
1948
+ this.selectedGroupKey = this.defaultGroupKey;
1949
+ this.displayedColumns = this.columns;
1950
+ if (this.defaultGroupKey) {
1951
+ this.displayedColumns = this.columns.filter((column) => column.predefinedGroupKeys?.includes(this.defaultGroupKey));
1952
+ }
1953
+ this.displayedColumnsChange.emit(this.displayedColumns);
1954
+ if (!this.groupSelectionNoGroupSelectedKey) {
1955
+ this.groupSelectionNoGroupSelectedKey = 'OCX_INTERACTIVE_DATA_VIEW.NO_GROUP_SELECTED';
1956
+ }
1957
+ this.firstColumnId = this.columns[0]?.id;
1958
+ }
1959
+ filtering(event) {
1960
+ this.filters = event;
1961
+ this.filtered.emit(event);
1962
+ }
1963
+ sorting(event) {
1964
+ this.sortDirection = event.sortDirection;
1965
+ this.sortField = event.sortColumn;
1966
+ this.sorted.emit(event);
1967
+ }
1968
+ onDeleteElement(element) {
1969
+ if (this.isDeleteItemObserved) {
1970
+ this.deleteItem.emit(element);
1971
+ }
1972
+ }
1973
+ onViewElement(element) {
1974
+ if (this.isViewItemObserved) {
1975
+ this.viewItem.emit(element);
1976
+ }
1977
+ }
1978
+ onEditElement(element) {
1979
+ if (this.isEditItemObserved) {
1980
+ this.editItem.emit(element);
1981
+ }
1982
+ }
1983
+ onDataViewLayoutChange(layout) {
1984
+ this.layout = layout;
1985
+ this.dataViewLayoutChange.emit(layout);
1986
+ }
1987
+ onSortChange($event) {
1988
+ this.sortField = $event;
1989
+ this.sorted.emit({ sortColumn: this.sortField, sortDirection: this.sortDirection });
1990
+ }
1991
+ onSortDirectionChange($event) {
1992
+ this.sortDirection = $event;
1993
+ this.sorted.emit({ sortColumn: this.sortField, sortDirection: this.sortDirection });
1994
+ }
1995
+ onColumnGroupSelectionChange(event) {
1996
+ this.displayedColumns = event.activeColumns;
1997
+ this.selectedGroupKey = event.groupKey;
1998
+ this.displayedColumnsChange.emit(this.displayedColumns);
1999
+ }
2000
+ registerEventListenerForDataView() {
2001
+ if (this.deleteItem.observed) {
2002
+ this.isDeleteItemObserved = true;
2003
+ if (!this._dataViewComponent?.deleteItem.observed) {
2004
+ this._dataViewComponent?.deleteItem.subscribe((event) => {
2005
+ this.onDeleteElement(event);
2006
+ });
2007
+ }
2008
+ }
2009
+ if (this.viewItem.observed) {
2010
+ this.isViewItemObserved = true;
2011
+ if (!this._dataViewComponent?.viewItem.observed) {
2012
+ this._dataViewComponent?.viewItem.subscribe((event) => {
2013
+ this.onViewElement(event);
2014
+ });
2015
+ }
2016
+ }
2017
+ if (this.editItem.observed) {
2018
+ this.isEditItemObserved = true;
2019
+ if (!this._dataViewComponent?.editItem.observed) {
2020
+ this._dataViewComponent?.editItem.subscribe((event) => {
2021
+ this.onEditElement(event);
2022
+ });
2023
+ }
2024
+ }
2025
+ if (this.selectionChanged.observed) {
2026
+ if (!this._dataViewComponent?.selectionChanged.observed) {
2027
+ this._dataViewComponent?.selectionChanged.subscribe((event) => {
2028
+ this.onRowSelectionChange(event);
2029
+ });
2030
+ }
2031
+ }
2032
+ }
2033
+ onColumnSelectionChange(event) {
2034
+ this.displayedColumns = event.activeColumns;
2035
+ this.selectedGroupKey = this.customGroupKey;
2036
+ this.displayedColumnsChange.emit(this.displayedColumns);
2037
+ }
2038
+ onActionColumnConfigChange(event) {
2039
+ this.frozenActionColumn = event.frozenActionColumn;
2040
+ this.actionColumnPosition = event.actionColumnPosition;
2041
+ }
2042
+ onRowSelectionChange(event) {
2043
+ if (this.selectionChanged.observed) {
2044
+ this.selectionChanged.emit(event);
2045
+ }
2046
+ }
2047
+ onPageChange(event) {
2048
+ this.page = event;
2049
+ this.pageChanged.emit(event);
2050
+ }
2051
+ }
2052
+ InteractiveDataViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InteractiveDataViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2053
+ 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", 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", 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: "tableRelativeDateCell", first: true, predicate: ["tableRelativeDateCell"], descendants: true }, { propertyName: "tableTranslationKeyCell", first: true, predicate: ["tableTranslationKeyCell"], 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: "gridItem", first: true, predicate: ["gridItem"], descendants: true }, { propertyName: "listItem", first: true, predicate: ["listItem"], 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=\"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]=\"true\"\n [clientSideFiltering]=\"true\"\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 [tableDateCellTemplate]=\"_tableDateCell ? tableDateCell : undefined\"\n [tableRelativeDateTemplate]=\"_tableRelativeDateCell ? tableRelativeDateCell : undefined\"\n [tableCellTemplate]=\"_tableCell ? tableCell : undefined\"\n [tableTranslationKeyCellTemplate]=\"_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 #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 #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 #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: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.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", "clientSideFiltering", "fallbackImage", "filters", "sortField", "sortDirection", "listGridPaginator", "tablePaginator", "page", "totalRecordsOnServer", "currentPageShowingKey", "currentPageShowingWithTotalOnServerKey", "selectedRows", "frozenActionColumn", "actionColumnPosition", "paginator", "sortStates", "pageSizes", "pageSize", "stringTableCellTemplate", "numberTableCellTemplate", "tableDateCellTemplate", "tableCellTemplate", "tableTranslationKeyCellTemplate", "gridItemSubtitleLinesTemplate", "listItemSubtitleLinesTemplate", "gridItemTemplate", "listItemTemplate", "tableRelativeDateCellTemplate", "additionalActions"], outputs: ["filtered", "sorted", "deleteItem", "viewItem", "editItem", "selectionChanged", "pageChanged"] }] });
2054
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InteractiveDataViewComponent, decorators: [{
2055
+ type: Component,
2056
+ 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=\"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]=\"true\"\n [clientSideFiltering]=\"true\"\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 [tableDateCellTemplate]=\"_tableDateCell ? tableDateCell : undefined\"\n [tableRelativeDateTemplate]=\"_tableRelativeDateCell ? tableRelativeDateCell : undefined\"\n [tableCellTemplate]=\"_tableCell ? tableCell : undefined\"\n [tableTranslationKeyCellTemplate]=\"_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 #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 #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 #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" }]
2057
+ }], propDecorators: { dataView: [{
2058
+ type: ViewChild,
2059
+ args: [DataViewComponent]
2060
+ }], deletePermission: [{
2061
+ type: Input
2062
+ }], editPermission: [{
2063
+ type: Input
2064
+ }], viewPermission: [{
2065
+ type: Input
2066
+ }], deleteActionVisibleField: [{
2067
+ type: Input
2068
+ }], deleteActionEnabledField: [{
2069
+ type: Input
2070
+ }], viewActionVisibleField: [{
2071
+ type: Input
2072
+ }], viewActionEnabledField: [{
2073
+ type: Input
2074
+ }], editActionVisibleField: [{
2075
+ type: Input
2076
+ }], editActionEnabledField: [{
2077
+ type: Input
2078
+ }], name: [{
2079
+ type: Input
2080
+ }], titleLineId: [{
2081
+ type: Input
2082
+ }], subtitleLineIds: [{
2083
+ type: Input
2084
+ }], supportedViewLayouts: [{
2085
+ type: Input
2086
+ }], columns: [{
2087
+ type: Input
2088
+ }], emptyResultsMessage: [{
2089
+ type: Input
2090
+ }], clientSideFiltering: [{
2091
+ type: Input
2092
+ }], fallbackImage: [{
2093
+ type: Input
2094
+ }], filters: [{
2095
+ type: Input
2096
+ }], sortDirection: [{
2097
+ type: Input
2098
+ }], sortField: [{
2099
+ type: Input
2100
+ }], sortStates: [{
2101
+ type: Input
2102
+ }], pageSizes: [{
2103
+ type: Input
2104
+ }], pageSize: [{
2105
+ type: Input
2106
+ }], totalRecordsOnServer: [{
2107
+ type: Input
2108
+ }], layout: [{
2109
+ type: Input
2110
+ }], defaultGroupKey: [{
2111
+ type: Input
2112
+ }], customGroupKey: [{
2113
+ type: Input
2114
+ }], groupSelectionNoGroupSelectedKey: [{
2115
+ type: Input
2116
+ }], currentPageShowingKey: [{
2117
+ type: Input
2118
+ }], currentPageShowingWithTotalOnServerKey: [{
2119
+ type: Input
2120
+ }], additionalActions: [{
2121
+ type: Input
2122
+ }], listGridPaginator: [{
2123
+ type: Input
2124
+ }], tablePaginator: [{
2125
+ type: Input
2126
+ }], page: [{
2127
+ type: Input
2128
+ }], selectedRows: [{
2129
+ type: Input
2130
+ }], displayedColumns: [{
2131
+ type: Input
2132
+ }], tableCell: [{
2133
+ type: ContentChild,
2134
+ args: ['tableCell']
2135
+ }], tableDateCell: [{
2136
+ type: ContentChild,
2137
+ args: ['tableDateCell']
2138
+ }], tableRelativeDateCell: [{
2139
+ type: ContentChild,
2140
+ args: ['tableRelativeDateCell']
2141
+ }], tableTranslationKeyCell: [{
2142
+ type: ContentChild,
2143
+ args: ['tableTranslationKeyCell']
2144
+ }], gridItemSubtitleLines: [{
2145
+ type: ContentChild,
2146
+ args: ['gridItemSubtitleLines']
2147
+ }], listItemSubtitleLines: [{
2148
+ type: ContentChild,
2149
+ args: ['listItemSubtitleLines']
2150
+ }], stringTableCell: [{
2151
+ type: ContentChild,
2152
+ args: ['stringTableCell']
2153
+ }], numberTableCell: [{
2154
+ type: ContentChild,
2155
+ args: ['numberTableCell']
2156
+ }], gridItem: [{
2157
+ type: ContentChild,
2158
+ args: ['gridItem']
2159
+ }], listItem: [{
2160
+ type: ContentChild,
2161
+ args: ['listItem']
2162
+ }], filtered: [{
2163
+ type: Output
2164
+ }], sorted: [{
2165
+ type: Output
2166
+ }], deleteItem: [{
2167
+ type: Output
2168
+ }], viewItem: [{
2169
+ type: Output
2170
+ }], editItem: [{
2171
+ type: Output
2172
+ }], dataViewLayoutChange: [{
2173
+ type: Output
2174
+ }], displayedColumnsChange: [{
2175
+ type: Output
2176
+ }], selectionChanged: [{
2177
+ type: Output
2178
+ }], pageChanged: [{
2179
+ type: Output
2180
+ }], paginator: [{
2181
+ type: Input
2182
+ }], data: [{
2183
+ type: Input
2184
+ }] } });
2185
+
2186
+ class BreadcrumbService {
2187
+ constructor(router, activeRoute, translateService) {
2188
+ this.router = router;
2189
+ this.activeRoute = activeRoute;
2190
+ this.translateService = translateService;
2191
+ this.itemsSource = new BehaviorSubject([]);
2192
+ this.generatedItemsSource = new BehaviorSubject([]);
2193
+ this.itemsHandler = this.itemsSource.asObservable();
2194
+ const breadcrumbs = [];
2195
+ this.addBreadcrumb(this.activeRoute.snapshot, [], breadcrumbs);
2196
+ this.generatedItemsSource.next(breadcrumbs);
2197
+ this.router.events.pipe(filter((e) => e instanceof NavigationEnd)).subscribe(() => {
2198
+ const root = this.router.routerState.snapshot.root;
2199
+ const breadcrumbs = [];
2200
+ this.addBreadcrumb(root, [], breadcrumbs);
2201
+ this.generatedItemsSource.next(breadcrumbs);
2202
+ });
2203
+ }
2204
+ addBreadcrumb(route, parentUrl, breadcrumbs) {
2205
+ if (route && route.url) {
2206
+ const routeUrl = parentUrl.concat(route.url.map((url) => url.path));
2207
+ if (route.routeConfig?.path) {
2208
+ if (route.data['breadcrumb']) {
2209
+ const breadcrumb = {
2210
+ label: this.getLabel(route.data, route.paramMap),
2211
+ routerLink: '/' + routeUrl.join('/'),
2212
+ };
2213
+ breadcrumbs.push(breadcrumb);
2214
+ }
2215
+ else {
2216
+ const breadcrumb = {
2217
+ label: 'NA',
2218
+ routerLink: '/' + routeUrl.join('/'),
2219
+ };
2220
+ breadcrumbs.push(breadcrumb);
2221
+ }
2222
+ }
2223
+ this.addBreadcrumb(route.firstChild, routeUrl, breadcrumbs);
2224
+ }
2225
+ }
2226
+ getLabel(data, params) {
2227
+ if (typeof data['breadcrumbFn'] === 'function') {
2228
+ return data['breadcrumbFn'](data, params);
2229
+ }
2230
+ return data['breadcrumb'];
2231
+ }
2232
+ setItems(items) {
2233
+ const translationKeys = [
2234
+ ...items.map((i) => i.labelKey || '').filter((l) => !!l),
2235
+ ...items.map((i) => i.titleKey || '').filter((l) => !!l),
2236
+ ];
2237
+ if (translationKeys.length) {
2238
+ this.translateService.get(translationKeys).subscribe((translations) => {
2239
+ this.itemsSource.next(items.map((i) => ({
2240
+ ...i,
2241
+ label: translations[i.labelKey || ''] || i.label,
2242
+ title: translations[i.titleKey || ''] || i.title,
2243
+ })));
2244
+ });
2245
+ }
2246
+ else {
2247
+ this.itemsSource.next(items);
2248
+ }
2249
+ }
2250
+ }
2251
+ BreadcrumbService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BreadcrumbService, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
2252
+ BreadcrumbService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BreadcrumbService, providedIn: 'any' });
2253
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BreadcrumbService, decorators: [{
2254
+ type: Injectable,
2255
+ args: [{ providedIn: 'any' }]
2256
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i1.TranslateService }]; } });
2257
+
2258
+ class DynamicPipe {
2259
+ constructor(locale, injector) {
2260
+ this.injector = injector;
2261
+ this.knownPipes = {};
2262
+ this.knownPipes = {
2263
+ currency: new CurrencyPipe(locale),
2264
+ decimal: new DecimalPipe(locale),
2265
+ date: new DatePipe(locale),
2266
+ };
2267
+ }
2268
+ transform(value, requiredPipe, pipeArgs) {
2269
+ if (!requiredPipe) {
2270
+ return value;
2271
+ }
2272
+ const injector = Injector.create({
2273
+ name: 'DynamicPipe',
2274
+ parent: this.injector,
2275
+ providers: [{ provide: requiredPipe }],
2276
+ });
2277
+ const pipe = injector.get(requiredPipe);
2278
+ return pipe.transform(value, pipeArgs);
2279
+ }
2280
+ transform2(value, pipeToken, ...pipeArgs) {
2281
+ if (!pipeToken) {
2282
+ return value;
2283
+ }
2284
+ else {
2285
+ // eslint-disable-next-line no-prototype-builtins
2286
+ if (pipeToken && this.knownPipes.hasOwnProperty(pipeToken)) {
2287
+ const pipe = this.knownPipes[pipeToken];
2288
+ if (Array.isArray(pipeArgs)) {
2289
+ return pipe.transform(value, ...pipeArgs);
2290
+ }
2291
+ else {
2292
+ return pipe.transform(value, pipeArgs);
2293
+ }
2294
+ }
2295
+ else {
2296
+ return value;
2297
+ }
2298
+ }
2299
+ }
2300
+ }
2301
+ 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 });
2302
+ DynamicPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: DynamicPipe, name: "dynamicPipe" });
2303
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicPipe, decorators: [{
2304
+ type: Pipe,
2305
+ args: [{
2306
+ name: 'dynamicPipe',
2307
+ }]
2308
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2309
+ type: Inject,
2310
+ args: [LOCALE_ID]
2311
+ }] }, { type: i0.Injector }]; } });
2312
+
2313
+ class PageHeaderComponent {
2314
+ get actions() {
2315
+ return this._actions;
2316
+ }
2317
+ set actions(value) {
2318
+ this._actions = value;
2319
+ this.generateInlineActions();
2320
+ this.generateOverflowActions();
2321
+ }
2322
+ constructor(breadcrumbs, translateService, appStateService, userService) {
2323
+ this.translateService = translateService;
2324
+ this.appStateService = appStateService;
2325
+ this.userService = userService;
2326
+ this.loading = false;
2327
+ this.figureBackground = true;
2328
+ this.showFigure = true;
2329
+ this.disableDefaultActions = false;
2330
+ this.showBreadcrumbs = true;
2331
+ this.manualBreadcrumbs = false;
2332
+ this.save = new EventEmitter();
2333
+ this.overflowActions = [];
2334
+ this.dd = new Date();
2335
+ this.breadcrumbs = breadcrumbs;
2336
+ this.home$ = concat(of({ menuItem: { icon: PrimeIcons.HOME, routerLink: '/' } }), this.appStateService.currentPortal$.pipe(map((portal) => ({
2337
+ menuItem: {
2338
+ icon: PrimeIcons.HOME,
2339
+ routerLink: portal.baseUrl,
2340
+ },
2341
+ page: portal.portalName,
2342
+ }))));
2343
+ }
2344
+ ngOnChanges(changes) {
2345
+ if (changes['actions']) {
2346
+ this.generateInlineActions();
2347
+ this.generateOverflowActions();
2348
+ }
2349
+ }
2350
+ ngOnInit() {
2351
+ if (!this.manualBreadcrumbs) {
2352
+ this.breadcrumbs$ = this.breadcrumbs.generatedItemsSource;
2353
+ }
2354
+ else {
2355
+ this.breadcrumbs$ = this.breadcrumbs.itemsHandler;
2356
+ }
2357
+ this.generateInlineActions();
2358
+ this.generateOverflowActions();
2359
+ }
2360
+ onAction(action) {
2361
+ switch (action) {
2362
+ case 'save':
2363
+ this.save.emit();
2364
+ break;
2365
+ default:
2366
+ break;
2367
+ }
2368
+ }
2369
+ /**
2370
+ * Generates a list of actions that should be rendered in an overflow menu
2371
+ */
2372
+ generateOverflowActions() {
2373
+ if (this.actions) {
2374
+ const translationKeys = [
2375
+ ...this.actions.map((a) => a.labelKey || '').filter((a) => !!a),
2376
+ ...this.actions.map((a) => a.titleKey || '').filter((a) => !!a),
2377
+ ];
2378
+ const translations$ = translationKeys.length ? this.translateService.get(translationKeys) : of([]);
2379
+ translations$.subscribe((translations) => {
2380
+ const allowedActions = [];
2381
+ if (this.actions) {
2382
+ this.actions
2383
+ .filter((a) => a.show === 'asOverflow')
2384
+ .filter((a) => {
2385
+ if (a.conditional) {
2386
+ if (a.showCondition)
2387
+ return a;
2388
+ return null;
2389
+ }
2390
+ else
2391
+ return a;
2392
+ })
2393
+ .forEach((action) => {
2394
+ this.checkActionPermission(allowedActions, action);
2395
+ });
2396
+ this.overflowActions = [
2397
+ ...allowedActions.map((a) => ({
2398
+ label: a.labelKey ? translations[a.labelKey] : a.label,
2399
+ icon: a.icon,
2400
+ title: (a.titleKey ? translations[a.titleKey] : a.title) || (a.labelKey ? translations[a.labelKey] : a.label),
2401
+ command: a.actionCallback,
2402
+ disabled: a.disabled,
2403
+ })),
2404
+ ];
2405
+ }
2406
+ });
2407
+ }
2408
+ }
2409
+ /**
2410
+ * Generates a list of actions that should be rendered as inline buttons
2411
+ */
2412
+ generateInlineActions() {
2413
+ if (this.actions) {
2414
+ // Temp array to hold all inline actions that should be visible to the current user
2415
+ const allowedActions = [];
2416
+ // Check permissions for all actions that should be rendered 'always'
2417
+ this.actions
2418
+ .filter((a) => a.show === 'always')
2419
+ .filter((a) => {
2420
+ if (a.conditional) {
2421
+ return a.showCondition ? a : null;
2422
+ }
2423
+ else
2424
+ return a;
2425
+ })
2426
+ .forEach((action) => {
2427
+ this.checkActionPermission(allowedActions, action);
2428
+ });
2429
+ this.inlineActions = [...allowedActions];
2430
+ }
2431
+ }
2432
+ /**
2433
+ * Adds a given action to a given array if the current user is allowed to see it
2434
+ * @param allowedActions Array that the action should be added to if the current user is allowed to see it
2435
+ * @param action Action for which a permission check should be executed
2436
+ */
2437
+ checkActionPermission(allowedActions, action) {
2438
+ if (action.permission) {
2439
+ if (this.userService.hasPermission(action.permission)) {
2440
+ // Push action to allowed array if user has sufficient permissions
2441
+ allowedActions.push(action);
2442
+ }
2443
+ }
2444
+ else {
2445
+ // Push action to allowed array if no permission was specified
2446
+ allowedActions.push(action);
2447
+ }
2448
+ }
2449
+ }
2450
+ PageHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PageHeaderComponent, deps: [{ token: BreadcrumbService }, { token: i1.TranslateService }, { token: i2.AppStateService }, { token: i2.UserService }], target: i0.ɵɵFactoryTarget.Component });
2451
+ 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" }, 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\" 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 *ngIf=\"figureImage\" [src]=\"figureImage\" alt=\"Figure image\" class=\"w-full\" />\n </div>\n <div class=\"colorblob flex-1 border-round\" *ngIf=\"previewImage.children.length === 0\"></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 *ngIf=\"!!header\">{{ header }}</h1>\n <h2 *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\"> </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 flex-column md:flex-row\"\n [class.justify-content-evenly]=\"objectDetails\"\n [class.justify-content-start]=\"!objectDetails\"\n >\n <ng-container *ngIf=\"objectDetails\">\n <div\n class=\"object-info flex flex-row md:flex-column align-items-baseline md:align-items-center justify-content-between\"\n *ngFor=\"let item of objectDetails\"\n >\n <label class=\"flex font-medium text-600\" name=\"object-detail-label\">{{ item.label | dynamicPipe:item.labelPipe }}</label>\n <span\n *ngIf=\"item.icon || item.value\"\n class=\"flex text-900 mt-2\"\n [ngClass]=\"item.icon ? 'gap-1 align-items-center' : null\"\n [title]=\"item.tooltip || ''\"\n name=\"object-detail-value\"\n >\n <i *ngIf=\"item.icon\" class=\"{{item.icon}}\" name=\"object-detail-icon\"></i>\n {{ item.value | dynamicPipe:item.valuePipe:item.valuePipeArgs}}</span\n >\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;display:flex}.onecx-page-header .object-panel:empty{display:none}.badge-container{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.scale{transform:scale(2)}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i5.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i5.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: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "pipe", type: DynamicPipe, name: "dynamicPipe" }], encapsulation: i0.ViewEncapsulation.None });
2452
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PageHeaderComponent, decorators: [{
2453
+ type: Component,
2454
+ args: [{ selector: 'ocx-page-header', encapsulation: ViewEncapsulation.None, template: "<div class=\"onecx-page-header\" 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 *ngIf=\"figureImage\" [src]=\"figureImage\" alt=\"Figure image\" class=\"w-full\" />\n </div>\n <div class=\"colorblob flex-1 border-round\" *ngIf=\"previewImage.children.length === 0\"></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 *ngIf=\"!!header\">{{ header }}</h1>\n <h2 *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\"> </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 flex-column md:flex-row\"\n [class.justify-content-evenly]=\"objectDetails\"\n [class.justify-content-start]=\"!objectDetails\"\n >\n <ng-container *ngIf=\"objectDetails\">\n <div\n class=\"object-info flex flex-row md:flex-column align-items-baseline md:align-items-center justify-content-between\"\n *ngFor=\"let item of objectDetails\"\n >\n <label class=\"flex font-medium text-600\" name=\"object-detail-label\">{{ item.label | dynamicPipe:item.labelPipe }}</label>\n <span\n *ngIf=\"item.icon || item.value\"\n class=\"flex text-900 mt-2\"\n [ngClass]=\"item.icon ? 'gap-1 align-items-center' : null\"\n [title]=\"item.tooltip || ''\"\n name=\"object-detail-value\"\n >\n <i *ngIf=\"item.icon\" class=\"{{item.icon}}\" name=\"object-detail-icon\"></i>\n {{ item.value | dynamicPipe:item.valuePipe:item.valuePipeArgs}}</span\n >\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;display:flex}.onecx-page-header .object-panel:empty{display:none}.badge-container{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.scale{transform:scale(2)}\n"] }]
2455
+ }], ctorParameters: function () { return [{ type: BreadcrumbService }, { type: i1.TranslateService }, { type: i2.AppStateService }, { type: i2.UserService }]; }, propDecorators: { header: [{
2456
+ type: Input
2457
+ }], loading: [{
2458
+ type: Input
2459
+ }], figureBackground: [{
2460
+ type: Input
2461
+ }], showFigure: [{
2462
+ type: Input
2463
+ }], figureImage: [{
2464
+ type: Input
2465
+ }], disableDefaultActions: [{
2466
+ type: Input
2467
+ }], subheader: [{
2468
+ type: Input
2469
+ }], actions: [{
2470
+ type: Input
2471
+ }], objectDetails: [{
2472
+ type: Input
2473
+ }], showBreadcrumbs: [{
2474
+ type: Input
2475
+ }], manualBreadcrumbs: [{
2476
+ type: Input
2477
+ }], save: [{
2478
+ type: Output
2479
+ }], additionalToolbarContent: [{
2480
+ type: ContentChild,
2481
+ args: ['additionalToolbarContent']
2482
+ }], additionalToolbarContentLeft: [{
2483
+ type: ContentChild,
2484
+ args: ['additionalToolbarContentLeft']
2485
+ }] } });
2486
+
2487
+ class SearchConfigComponent {
2488
+ constructor() {
2489
+ this.placeholderKey = 'OCX_SEARCH_HEADER.OCX_SEARCH_CONFIG.DROPDOWN_DEFAULT';
2490
+ this.selectedSearchConfigChanged = new EventEmitter();
2491
+ }
2492
+ ngOnInit() {
2493
+ this.formGroup = new FormGroup({
2494
+ searchConfigForm: new FormControl(null),
2495
+ });
2496
+ }
2497
+ onSearchConfigChange(event) {
2498
+ this.selectedSearchConfigChanged?.emit(event.value);
2499
+ }
2500
+ }
2501
+ SearchConfigComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SearchConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2502
+ 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: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.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.TranslatePipe, name: "translate" }] });
2503
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SearchConfigComponent, decorators: [{
2504
+ type: Component,
2505
+ 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" }]
2506
+ }], propDecorators: { searchConfigs: [{
2507
+ type: Input
2508
+ }], placeholderKey: [{
2509
+ type: Input
2510
+ }], selectedSearchConfigChanged: [{
2511
+ type: Output
2512
+ }] } });
2513
+
2514
+ /**
2515
+ * To trigger the search when Enter key is pressed inside a search parameter field,
2516
+ * an EventListener for keyup enter event is added for HTML elements which have an input.
2517
+ * Please add the EventListener yourself manually, if you want to have that functionality for some other elements
2518
+ * which do not have an input element.
2519
+ */
2520
+ class SearchHeaderComponent {
2521
+ constructor() {
2522
+ this.header = '';
2523
+ this.viewMode = 'basic';
2524
+ this.manualBreadcrumbs = false;
2525
+ this._actions = [];
2526
+ this.searched = new EventEmitter();
2527
+ this.resetted = new EventEmitter();
2528
+ this.selectedSearchConfigChanged = new EventEmitter();
2529
+ this.viewModeChanged = new EventEmitter();
2530
+ this.hasAdvanced = false;
2531
+ this.headerActions = [];
2532
+ }
2533
+ /**
2534
+ * @deprecated Will be replaced by header
2535
+ */
2536
+ get headline() {
2537
+ return this.header;
2538
+ }
2539
+ set headline(value) {
2540
+ this.header = value;
2541
+ }
2542
+ get actions() {
2543
+ return this._actions;
2544
+ }
2545
+ set actions(value) {
2546
+ this._actions = value;
2547
+ this.updateHeaderActions();
2548
+ }
2549
+ get _additionalToolbarContent() {
2550
+ return this.additionalToolbarContent;
2551
+ }
2552
+ get _additionalToolbarContentLeft() {
2553
+ return this.additionalToolbarContentLeft;
2554
+ }
2555
+ ngAfterViewInit() {
2556
+ this.addKeyUpEventListener();
2557
+ }
2558
+ toggleViewMode() {
2559
+ this.viewMode = this.viewMode === 'basic' ? 'advanced' : 'basic';
2560
+ this.viewModeChanged?.emit(this.viewMode);
2561
+ this.updateHeaderActions();
2562
+ setTimeout(() => this.addKeyUpEventListener());
2563
+ }
2564
+ onResetClicked() {
2565
+ this.resetted.emit();
2566
+ }
2567
+ onSearchClicked() {
2568
+ this.searched.emit();
2569
+ }
2570
+ updateHeaderActions() {
2571
+ const headerActions = [];
2572
+ if (this.hasAdvanced) {
2573
+ headerActions.push({
2574
+ id: 'simpleAdvancedButton',
2575
+ labelKey: this.viewMode === 'basic'
2576
+ ? 'OCX_SEARCH_HEADER.TOGGLE_BUTTON.ADVANCED.TEXT'
2577
+ : 'OCX_SEARCH_HEADER.TOGGLE_BUTTON.SIMPLE.TEXT',
2578
+ actionCallback: () => this.toggleViewMode(),
2579
+ show: 'always',
2580
+ titleKey: this.viewMode === 'basic'
2581
+ ? 'OCX_SEARCH_HEADER.TOGGLE_BUTTON.ADVANCED.DETAIL'
2582
+ : 'OCX_SEARCH_HEADER.TOGGLE_BUTTON.SIMPLE.DETAIL',
2583
+ });
2584
+ }
2585
+ this.headerActions = headerActions.concat(this.actions);
2586
+ }
2587
+ addKeyUpEventListener() {
2588
+ const inputElements = this.searchParameterFields?.nativeElement.querySelectorAll('input');
2589
+ inputElements.forEach((inputElement) => {
2590
+ if (!inputElement.listenerAdded) {
2591
+ inputElement.addEventListener('keyup', (event) => this.onSearchKeyup(event));
2592
+ inputElement.listenerAdded = true;
2593
+ }
2594
+ });
2595
+ }
2596
+ onSearchKeyup(event) {
2597
+ if (event.code === 'Enter') {
2598
+ this.onSearchClicked();
2599
+ }
2600
+ }
2601
+ confirmSearchConfig(searchConfig) {
2602
+ this.selectedSearchConfigChanged?.emit(searchConfig);
2603
+ }
2604
+ }
2605
+ SearchHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SearchHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2606
+ 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: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.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"], outputs: ["save"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
2607
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SearchHeaderComponent, decorators: [{
2608
+ type: Component,
2609
+ 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"] }]
2610
+ }], propDecorators: { searchConfigs: [{
2611
+ type: Input
2612
+ }], header: [{
2613
+ type: Input
2614
+ }], headline: [{
2615
+ type: Input
2616
+ }], subheader: [{
2617
+ type: Input
2618
+ }], viewMode: [{
2619
+ type: Input
2620
+ }], manualBreadcrumbs: [{
2621
+ type: Input
2622
+ }], actions: [{
2623
+ type: Input
2624
+ }], searched: [{
2625
+ type: Output
2626
+ }], resetted: [{
2627
+ type: Output
2628
+ }], selectedSearchConfigChanged: [{
2629
+ type: Output
2630
+ }], viewModeChanged: [{
2631
+ type: Output
2632
+ }], additionalToolbarContent: [{
2633
+ type: ContentChild,
2634
+ args: ['additionalToolbarContent']
2635
+ }], additionalToolbarContentLeft: [{
2636
+ type: ContentChild,
2637
+ args: ['additionalToolbarContentLeft']
2638
+ }], searchParameterFields: [{
2639
+ type: ViewChild,
2640
+ args: ['searchParameterFields']
2641
+ }] } });
2642
+
2643
+ // This topic is defined here and not in integration-interface, because
2644
+ // it is not used as framework independent integration but for improving
2645
+ // angular specific things
2646
+ class TranslationCacheTopic extends SyncableTopic {
2647
+ constructor() {
2648
+ super('translationCache', 1);
2649
+ }
2650
+ }
2651
+ class TranslationCacheService {
2652
+ constructor() {
2653
+ this.translationTopic$ = new TranslationCacheTopic();
2654
+ this.translations$ = new BehaviorSubject({});
2655
+ this.translationTopic$
2656
+ .pipe(withLatestFrom(this.translations$), map(([topicTranslations, translations]) => {
2657
+ let foundValueOthersDoNotKnow = false;
2658
+ const newTranslations = { ...translations };
2659
+ Object.keys(topicTranslations).forEach((k) => {
2660
+ if (!topicTranslations[k] && translations[k]) {
2661
+ foundValueOthersDoNotKnow = true;
2662
+ }
2663
+ newTranslations[k] ?? (newTranslations[k] = topicTranslations[k]);
2664
+ });
2665
+ return [newTranslations, foundValueOthersDoNotKnow];
2666
+ }), tap(([newTranslations, foundValueOthersDoNotKnow]) => {
2667
+ if (foundValueOthersDoNotKnow) {
2668
+ this.translationTopic$.publish(newTranslations);
2669
+ }
2670
+ }), map(([newTranslations]) => newTranslations))
2671
+ .subscribe(this.translations$);
2672
+ }
2673
+ ngOnDestroy() {
2674
+ this.translationTopic$.destroy();
2675
+ }
2676
+ getTranslationFile(url, cacheMissFunction) {
2677
+ if (this.translations$.value[url]) {
2678
+ return of(this.translations$.value[url]);
2679
+ }
2680
+ this.translationTopic$.publish({ ...this.translations$.value, [url]: null });
2681
+ return race(this.translations$.pipe(filter((t) => t[url]), map((t) => t[url])), cacheMissFunction().pipe(tap((t) => {
2682
+ this.translationTopic$.publish({ ...this.translations$.value, [url]: t });
2683
+ }))).pipe(first());
2684
+ }
2685
+ }
2686
+ TranslationCacheService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TranslationCacheService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2687
+ TranslationCacheService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TranslationCacheService, providedIn: 'root' });
2688
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TranslationCacheService, decorators: [{
2689
+ type: Injectable,
2690
+ args: [{ providedIn: 'root' }]
2691
+ }], ctorParameters: function () { return []; } });
2692
+
2693
+ class AngularAcceleratorPrimeNgModule {
2694
+ }
2695
+ AngularAcceleratorPrimeNgModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AngularAcceleratorPrimeNgModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2696
+ AngularAcceleratorPrimeNgModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: AngularAcceleratorPrimeNgModule, imports: [DropdownModule,
2697
+ ButtonModule,
2698
+ DialogModule,
2699
+ PickListModule,
2700
+ SelectButtonModule,
2701
+ DataViewModule,
2702
+ TableModule,
2703
+ MenuModule,
2704
+ ChartModule,
2705
+ MultiSelectModule], exports: [DropdownModule,
2706
+ ButtonModule,
2707
+ DialogModule,
2708
+ PickListModule,
2709
+ SelectButtonModule,
2710
+ DataViewModule,
2711
+ TableModule,
2712
+ MenuModule,
2713
+ ChartModule,
2714
+ MultiSelectModule] });
2715
+ AngularAcceleratorPrimeNgModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AngularAcceleratorPrimeNgModule, imports: [DropdownModule,
2716
+ ButtonModule,
2717
+ DialogModule,
2718
+ PickListModule,
2719
+ SelectButtonModule,
2720
+ DataViewModule,
2721
+ TableModule,
2722
+ MenuModule,
2723
+ ChartModule,
2724
+ MultiSelectModule, DropdownModule,
2725
+ ButtonModule,
2726
+ DialogModule,
2727
+ PickListModule,
2728
+ SelectButtonModule,
2729
+ DataViewModule,
2730
+ TableModule,
2731
+ MenuModule,
2732
+ ChartModule,
2733
+ MultiSelectModule] });
2734
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AngularAcceleratorPrimeNgModule, decorators: [{
2735
+ type: NgModule,
2736
+ args: [{
2737
+ imports: [
2738
+ DropdownModule,
2739
+ ButtonModule,
2740
+ DialogModule,
2741
+ PickListModule,
2742
+ SelectButtonModule,
2743
+ DataViewModule,
2744
+ TableModule,
2745
+ MenuModule,
2746
+ ChartModule,
2747
+ MultiSelectModule,
2748
+ ],
2749
+ exports: [
2750
+ DropdownModule,
2751
+ ButtonModule,
2752
+ DialogModule,
2753
+ PickListModule,
2754
+ SelectButtonModule,
2755
+ DataViewModule,
2756
+ TableModule,
2757
+ MenuModule,
2758
+ ChartModule,
2759
+ MultiSelectModule,
2760
+ ],
2761
+ }]
2762
+ }] });
2763
+
2764
+ class OcxTimeagoIntl extends TimeagoIntl {
2765
+ constructor(userService) {
2766
+ super();
2767
+ this.userService = userService;
2768
+ this.LANG_TO_STRINGS = {
2769
+ en: strings,
2770
+ de: strings$1,
2771
+ };
2772
+ this.DEFAULT_LANG = 'en';
2773
+ this.strings = strings;
2774
+ userService.lang$
2775
+ .pipe(map((lang) => {
2776
+ return this.getBestMatchLanguage(lang);
2777
+ }))
2778
+ .subscribe((lang) => {
2779
+ this.strings = this.LANG_TO_STRINGS[lang];
2780
+ this.changes.next();
2781
+ });
2782
+ }
2783
+ getBestMatchLanguage(lang) {
2784
+ if (Object.keys(this.LANG_TO_STRINGS).includes(lang)) {
2785
+ return lang;
2786
+ }
2787
+ else {
2788
+ console.log(`${lang} is not supported. Using ${this.DEFAULT_LANG} as a fallback.`);
2789
+ }
2790
+ return this.DEFAULT_LANG;
2791
+ }
2792
+ }
2793
+
2794
+ class AsyncTranslateLoader {
2795
+ constructor(translateLoader$) {
2796
+ this.translateLoader$ = translateLoader$;
2797
+ this.timerId = AsyncTranslateLoader.lastTimerId++;
2798
+ }
2799
+ getTranslation(lang) {
2800
+ return this.translateLoader$.pipe(tap(() => console.time('AsyncTranslateLoader_' + this.timerId)), defaultIfEmpty(undefined), first(), mergeMap((translateLoader) => translateLoader?.getTranslation(lang) ?? of({})), tap(() => console.timeEnd('AsyncTranslateLoader_' + this.timerId)));
2801
+ }
2802
+ }
2803
+ AsyncTranslateLoader.lastTimerId = 0;
2804
+
2805
+ class CachingTranslateLoader {
2806
+ constructor(translationCache, http, prefix, suffix) {
2807
+ this.translationCache = translationCache;
2808
+ this.http = http;
2809
+ this.prefix = prefix;
2810
+ this.suffix = suffix;
2811
+ this.translateLoader = new TranslateHttpLoader(this.http, this.prefix, this.suffix);
2812
+ }
2813
+ getTranslation(lang) {
2814
+ const url = `${this.prefix}${lang}${this.suffix}`;
2815
+ return this.translationCache.getTranslationFile(url, () => this.translateLoader.getTranslation(lang));
2816
+ }
2817
+ }
2818
+
2819
+ class TranslateCombinedLoader {
2820
+ constructor(...loaders) {
2821
+ this._loaders = loaders;
2822
+ }
2823
+ getTranslation(lang) {
2824
+ return forkJoin(this._loaders.map((l) => l.getTranslation(lang))).pipe(map((allTranslations) => {
2825
+ let result = {};
2826
+ allTranslations.forEach((translations) => {
2827
+ result = this.mergeDeep(result, translations);
2828
+ });
2829
+ return result;
2830
+ }));
2831
+ }
2832
+ isObject(item) {
2833
+ return item && typeof item === 'object' && !Array.isArray(item);
2834
+ }
2835
+ mergeDeep(target, source) {
2836
+ const output = Object.assign({}, target);
2837
+ if (this.isObject(target) && this.isObject(source)) {
2838
+ Object.keys(source).forEach((key) => {
2839
+ if (this.isObject(source[key])) {
2840
+ if (!(key in target))
2841
+ Object.assign(output, { [key]: source[key] });
2842
+ else
2843
+ output[key] = this.mergeDeep(target[key], source[key]);
2844
+ }
2845
+ else {
2846
+ Object.assign(output, { [key]: source[key] });
2847
+ }
2848
+ });
2849
+ }
2850
+ return output;
2851
+ }
2852
+ }
2853
+
2854
+ let lastTranslateLoaderTimerId = 0;
2855
+ function createTranslateLoader(http, appStateService, translationCacheService) {
2856
+ const ts = translationCacheService ?? inject(TranslationCacheService);
2857
+ const timerId = lastTranslateLoaderTimerId++;
2858
+ console.time('createTranslateLoader_' + timerId);
2859
+ return new AsyncTranslateLoader(combineLatest([appStateService.currentMfe$.asObservable(), appStateService.globalLoading$.asObservable()]).pipe(filter(([, isLoading]) => !isLoading), map(([currentMfe]) => {
2860
+ return new TranslateCombinedLoader(
2861
+ // translations of shell or of app in standalone mode
2862
+ new CachingTranslateLoader(ts, http, `./assets/i18n/`, '.json'),
2863
+ // translations of portal-integration-angular of app
2864
+ new CachingTranslateLoader(ts, http, Location.joinWithSlash(currentMfe.remoteBaseUrl, `onecx-portal-lib/assets/i18n/`), '.json'),
2865
+ // translations of the app
2866
+ new CachingTranslateLoader(ts, http, Location.joinWithSlash(currentMfe.remoteBaseUrl, `assets/i18n/`), '.json'));
2867
+ }), tap(() => console.timeEnd('createTranslateLoader_' + timerId))));
2868
+ }
2869
+
2870
+ class AngularAcceleratorMissingTranslationHandler {
2871
+ handle(params) {
2872
+ console.log(`Missing translation for ${params.key}`, params);
2873
+ return params.key;
2874
+ }
2875
+ }
2876
+ class AngularAcceleratorModule {
2877
+ }
2878
+ AngularAcceleratorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AngularAcceleratorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2879
+ AngularAcceleratorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: AngularAcceleratorModule, declarations: [ColumnGroupSelectionComponent,
2880
+ CustomGroupColumnSelectorComponent,
2881
+ DataLayoutSelectionComponent,
2882
+ DataListGridSortingComponent,
2883
+ DataListGridComponent,
2884
+ DataTableComponent,
2885
+ DataViewComponent,
2886
+ InteractiveDataViewComponent,
2887
+ SearchConfigComponent,
2888
+ PageHeaderComponent,
2889
+ DynamicPipe,
2890
+ SearchHeaderComponent,
2891
+ DiagramComponent,
2892
+ GroupByCountDiagramComponent,
2893
+ IfPermissionDirective,
2894
+ IfBreakpointDirective,
2895
+ OcxTimeAgoPipe], imports: [CommonModule,
2896
+ AngularAcceleratorPrimeNgModule, i1.TranslateModule, FormsModule,
2897
+ RouterModule,
2898
+ ReactiveFormsModule], exports: [ColumnGroupSelectionComponent,
2899
+ CustomGroupColumnSelectorComponent,
2900
+ DataLayoutSelectionComponent,
2901
+ DataListGridComponent,
2902
+ DataTableComponent,
2903
+ DataViewComponent,
2904
+ InteractiveDataViewComponent,
2905
+ SearchConfigComponent,
2906
+ PageHeaderComponent,
2907
+ SearchHeaderComponent,
2908
+ DiagramComponent,
2909
+ GroupByCountDiagramComponent,
2910
+ IfPermissionDirective,
2911
+ IfBreakpointDirective,
2912
+ OcxTimeAgoPipe] });
2913
+ AngularAcceleratorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AngularAcceleratorModule, providers: [
2914
+ {
2915
+ provide: LOCALE_ID,
2916
+ useFactory: (UserService) => {
2917
+ return UserService.lang$.getValue();
2918
+ },
2919
+ deps: [UserService],
2920
+ },
2921
+ {
2922
+ provide: TimeagoIntl,
2923
+ useFactory: (userService) => {
2924
+ return new OcxTimeagoIntl(userService);
2925
+ },
2926
+ deps: [UserService],
2927
+ },
2928
+ importProvidersFrom(TimeagoModule),
2929
+ {
2930
+ provide: TimeagoFormatter,
2931
+ useFactory: (TimeagoIntl) => {
2932
+ return new TimeagoCustomFormatter(TimeagoIntl);
2933
+ },
2934
+ deps: [TimeagoIntl],
2935
+ },
2936
+ {
2937
+ provide: TimeagoClock,
2938
+ useClass: TimeagoDefaultClock,
2939
+ },
2940
+ ], imports: [CommonModule,
2941
+ AngularAcceleratorPrimeNgModule,
2942
+ TranslateModule.forRoot({
2943
+ isolate: true,
2944
+ loader: {
2945
+ provide: TranslateLoader,
2946
+ useFactory: createTranslateLoader,
2947
+ deps: [HttpClient, AppStateService, TranslationCacheService],
2948
+ },
2949
+ missingTranslationHandler: {
2950
+ provide: MissingTranslationHandler,
2951
+ useClass: AngularAcceleratorMissingTranslationHandler,
2952
+ },
2953
+ }),
2954
+ FormsModule,
2955
+ RouterModule,
2956
+ ReactiveFormsModule] });
2957
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AngularAcceleratorModule, decorators: [{
2958
+ type: NgModule,
2959
+ args: [{
2960
+ imports: [
2961
+ CommonModule,
2962
+ AngularAcceleratorPrimeNgModule,
2963
+ TranslateModule.forRoot({
2964
+ isolate: true,
2965
+ loader: {
2966
+ provide: TranslateLoader,
2967
+ useFactory: createTranslateLoader,
2968
+ deps: [HttpClient, AppStateService, TranslationCacheService],
2969
+ },
2970
+ missingTranslationHandler: {
2971
+ provide: MissingTranslationHandler,
2972
+ useClass: AngularAcceleratorMissingTranslationHandler,
2973
+ },
2974
+ }),
2975
+ FormsModule,
2976
+ RouterModule,
2977
+ ReactiveFormsModule,
2978
+ ],
2979
+ declarations: [
2980
+ ColumnGroupSelectionComponent,
2981
+ CustomGroupColumnSelectorComponent,
2982
+ DataLayoutSelectionComponent,
2983
+ DataListGridSortingComponent,
2984
+ DataListGridComponent,
2985
+ DataTableComponent,
2986
+ DataViewComponent,
2987
+ InteractiveDataViewComponent,
2988
+ SearchConfigComponent,
2989
+ PageHeaderComponent,
2990
+ DynamicPipe,
2991
+ SearchHeaderComponent,
2992
+ DiagramComponent,
2993
+ GroupByCountDiagramComponent,
2994
+ IfPermissionDirective,
2995
+ IfBreakpointDirective,
2996
+ OcxTimeAgoPipe,
2997
+ ],
2998
+ providers: [
2999
+ {
3000
+ provide: LOCALE_ID,
3001
+ useFactory: (UserService) => {
3002
+ return UserService.lang$.getValue();
3003
+ },
3004
+ deps: [UserService],
3005
+ },
3006
+ {
3007
+ provide: TimeagoIntl,
3008
+ useFactory: (userService) => {
3009
+ return new OcxTimeagoIntl(userService);
3010
+ },
3011
+ deps: [UserService],
3012
+ },
3013
+ importProvidersFrom(TimeagoModule),
3014
+ {
3015
+ provide: TimeagoFormatter,
3016
+ useFactory: (TimeagoIntl) => {
3017
+ return new TimeagoCustomFormatter(TimeagoIntl);
3018
+ },
3019
+ deps: [TimeagoIntl],
3020
+ },
3021
+ {
3022
+ provide: TimeagoClock,
3023
+ useClass: TimeagoDefaultClock,
3024
+ },
3025
+ ],
3026
+ exports: [
3027
+ ColumnGroupSelectionComponent,
3028
+ CustomGroupColumnSelectorComponent,
3029
+ DataLayoutSelectionComponent,
3030
+ DataListGridComponent,
3031
+ DataTableComponent,
3032
+ DataViewComponent,
3033
+ InteractiveDataViewComponent,
3034
+ SearchConfigComponent,
3035
+ PageHeaderComponent,
3036
+ SearchHeaderComponent,
3037
+ DiagramComponent,
3038
+ GroupByCountDiagramComponent,
3039
+ IfPermissionDirective,
3040
+ IfBreakpointDirective,
3041
+ OcxTimeAgoPipe,
3042
+ // DataListGridSortingComponent,
3043
+ ],
3044
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
3045
+ }]
3046
+ }] });
3047
+
3048
+ class DateUtils {
3049
+ constructor(locale) {
3050
+ this.locale = locale;
3051
+ this.options = {
3052
+ month: 'short',
3053
+ day: '2-digit',
3054
+ year: 'numeric',
3055
+ hour: 'numeric',
3056
+ minute: '2-digit',
3057
+ second: '2-digit',
3058
+ };
3059
+ }
3060
+ localizedDate(date) {
3061
+ return date
3062
+ ? new Intl.DateTimeFormat(this.locale, this.options).format(date instanceof Date ? date : new Date(date))
3063
+ : '';
3064
+ }
3065
+ }
3066
+ DateUtils.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DateUtils, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Injectable });
3067
+ DateUtils.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DateUtils, providedIn: 'root' });
3068
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DateUtils, decorators: [{
3069
+ type: Injectable,
3070
+ args: [{
3071
+ providedIn: 'root',
3072
+ }]
3073
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
3074
+ type: Inject,
3075
+ args: [LOCALE_ID]
3076
+ }] }]; } });
3077
+
3078
+ // directives
3079
+
3080
+ /**
3081
+ * Generated bundle index. Do not edit.
3082
+ */
3083
+
3084
+ export { AngularAcceleratorMissingTranslationHandler, AngularAcceleratorModule, AngularAcceleratorPrimeNgModule, AsyncTranslateLoader, BreadcrumbService, CachingTranslateLoader, ColorUtils, ColumnGroupSelectionComponent, ColumnType, CustomGroupColumnSelectorComponent, DataLayoutSelectionComponent, DataListGridComponent, DataListGridSortingComponent, DataTableComponent, DataViewComponent, DateUtils, DiagramComponent, DynamicPipe, GroupByCountDiagramComponent, IfBreakpointDirective, IfPermissionDirective, InteractiveDataViewComponent, ObjectUtils, OcxTimeAgoPipe, PageHeaderComponent, SearchConfigComponent, SearchHeaderComponent, TranslateCombinedLoader, TranslationCacheService, createTranslateLoader, flattenObject };
3085
+ //# sourceMappingURL=onecx-angular-accelerator.mjs.map