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