@pega/angular-sdk-overrides 0.242.4 → 0.242.6
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/lib/field/dropdown/dropdown.component.ts +29 -15
- package/lib/field/user-reference/user-reference.component.html +2 -10
- package/lib/field/user-reference/user-reference.component.ts +34 -12
- package/lib/infra/Containers/flow-container/flow-container.component.ts +17 -40
- package/lib/infra/Containers/flow-container/helpers.ts +1 -1
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +0 -6
- package/lib/infra/assignment/assignment.component.html +1 -1
- package/lib/infra/assignment/assignment.component.ts +84 -39
- package/lib/infra/assignment-card/assignment-card.component.html +1 -0
- package/lib/infra/assignment-card/assignment-card.component.ts +32 -4
- package/lib/infra/root-container/root-container.component.html +2 -15
- package/lib/infra/root-container/root-container.component.ts +0 -10
- package/lib/infra/view/view.component.ts +15 -1
- package/lib/template/base/details-template-base.ts +67 -0
- package/lib/template/base/form-template-base.ts +16 -0
- package/lib/template/case-view/case-view.component.html +4 -4
- package/lib/template/case-view/case-view.component.ts +7 -12
- package/lib/template/default-form/default-form.component.ts +40 -5
- package/lib/template/details/details.component.ts +5 -39
- package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +5 -38
- package/lib/template/details-one-column/details-one-column.component.ts +5 -40
- package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
- package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -37
- package/lib/template/details-three-column/details-three-column.component.ts +5 -41
- package/lib/template/details-two-column/details-two-column.component.ts +5 -41
- package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +5 -40
- package/lib/template/one-column/one-column.component.ts +2 -2
- package/lib/template/simple-table-manual/helpers.ts +7 -5
- package/lib/template/three-column/three-column.component.ts +2 -2
- package/lib/template/two-column/two-column.component.ts +2 -2
- package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +2 -2
- package/lib/widget/todo/todo.component.html +3 -3
- package/lib/widget/todo/todo.component.scss +7 -0
- package/package.json +1 -1
- package/lib/template/form-template-base/form-template-base.component.ts +0 -10
|
@@ -5,20 +5,11 @@
|
|
|
5
5
|
<div *ngIf="bShowRoot$">
|
|
6
6
|
<div [ngSwitch]="componentName$">
|
|
7
7
|
<component-mapper *ngSwitchCase="'View'" name="View" [props]="{ pConn$, displayOnlyFA$ }"></component-mapper>
|
|
8
|
-
<!-- <app-reference *ngSwitchCase="'reference'" [pConn$]="pConn$" [displayOnlyFA$]="displayOnlyFA$"></app-reference> -->
|
|
9
8
|
<component-mapper
|
|
10
9
|
*ngSwitchCase="'ViewContainer'"
|
|
11
10
|
name="ViewContainer"
|
|
12
|
-
[props]="{ pConn$:
|
|
11
|
+
[props]="{ pConn$: viewContainerPConn$, displayOnlyFA$ }"
|
|
13
12
|
></component-mapper>
|
|
14
|
-
<app-hybrid-view-container *ngSwitchCase="'HybridViewContainer'" [pConn$]="pConn$" [displayOnlyFA$]="displayOnlyFA$"></app-hybrid-view-container>
|
|
15
|
-
<app-modal-view-container
|
|
16
|
-
*ngSwitchCase="'ModalViewContainer'"
|
|
17
|
-
[pConn$]="pConn$"
|
|
18
|
-
[displayOnlyFA$]="displayOnlyFA$"
|
|
19
|
-
(modalVisibleChange)="modalVisibleChanged($event)"
|
|
20
|
-
></app-modal-view-container>
|
|
21
|
-
<div *ngSwitchCase="''"></div>
|
|
22
13
|
<div *ngSwitchDefault>{{ localizedVal('RootContainer Missing: ' + componentName$, localeCategory) }}.</div>
|
|
23
14
|
</div>
|
|
24
15
|
</div>
|
|
@@ -28,9 +19,5 @@
|
|
|
28
19
|
</div>
|
|
29
20
|
|
|
30
21
|
<div *ngIf="mConn$ != null">
|
|
31
|
-
<app-modal-view-container
|
|
32
|
-
[pConn$]="mConn$"
|
|
33
|
-
[displayOnlyFA$]="displayOnlyFA$"
|
|
34
|
-
(modalVisibleChange)="modalVisibleChanged($event)"
|
|
35
|
-
></app-modal-view-container>
|
|
22
|
+
<app-modal-view-container [pConn$]="mConn$"></app-modal-view-container>
|
|
36
23
|
</div>
|
|
@@ -128,16 +128,6 @@ export class RootContainerComponent implements OnInit, OnDestroy {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
modalVisibleChanged(isVisible) {
|
|
132
|
-
if (this.displayOnlyFA$) {
|
|
133
|
-
if (isVisible) {
|
|
134
|
-
this.bShowRoot$ = false;
|
|
135
|
-
} else {
|
|
136
|
-
this.bShowRoot$ = true;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
131
|
updateSelf() {
|
|
142
132
|
// need to call this.getCurrentCompleteProps (not this.thePConn.getConfigProps)
|
|
143
133
|
// to get full set of props that affect this component in Redux
|
|
@@ -8,6 +8,20 @@ import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
|
8
8
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
9
9
|
|
|
10
10
|
const NO_HEADER_TEMPLATES = ['SubTabs', 'SimpleTable', 'Confirmation', 'DynamicTabs', 'DetailsSubTabs'];
|
|
11
|
+
const DETAILS_TEMPLATES = [
|
|
12
|
+
'Details',
|
|
13
|
+
'DetailsFields',
|
|
14
|
+
'DetailsOneColumn',
|
|
15
|
+
'DetailsSubTabs',
|
|
16
|
+
'DetailsThreeColumn',
|
|
17
|
+
'DetailsTwoColumn',
|
|
18
|
+
'NarrowWideDetails',
|
|
19
|
+
'WideNarrowDetails'
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
function isDetailsTemplate(template) {
|
|
23
|
+
return DETAILS_TEMPLATES.includes(template);
|
|
24
|
+
}
|
|
11
25
|
|
|
12
26
|
/**
|
|
13
27
|
* WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
|
|
@@ -146,7 +160,7 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
146
160
|
this.templateName$ = this.configProps$.template || '';
|
|
147
161
|
this.title$ = this.configProps$.title || '';
|
|
148
162
|
this.label$ = this.configProps$.label || '';
|
|
149
|
-
this.showLabel$ = this.configProps$.showLabel || this.showLabel$;
|
|
163
|
+
this.showLabel$ = this.configProps$.showLabel || isDetailsTemplate(this.templateName$) || this.showLabel$;
|
|
150
164
|
// label & showLabel within inheritedProps takes precedence over configProps
|
|
151
165
|
this.label$ = this.inheritedProps$.label || this.label$;
|
|
152
166
|
this.showLabel$ = this.inheritedProps$.showLabel || this.showLabel$;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Directive, OnInit, OnDestroy, Injector, Input } from '@angular/core';
|
|
2
|
+
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
3
|
+
|
|
4
|
+
@Directive()
|
|
5
|
+
export class DetailsTemplateBase implements OnInit, OnDestroy {
|
|
6
|
+
@Input() pConn$: typeof PConnect;
|
|
7
|
+
|
|
8
|
+
// For interaction with AngularPConnect
|
|
9
|
+
protected angularPConnectData: AngularPConnectData = {};
|
|
10
|
+
protected angularPConnect;
|
|
11
|
+
|
|
12
|
+
childrenMetadataOld;
|
|
13
|
+
|
|
14
|
+
constructor(injector: Injector) {
|
|
15
|
+
this.angularPConnect = injector.get(AngularPConnectService);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
ngOnInit(): void {
|
|
19
|
+
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
20
|
+
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
21
|
+
|
|
22
|
+
this.checkAndUpdate();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
ngOnDestroy() {
|
|
26
|
+
if (this.angularPConnectData.unsubscribeFn) {
|
|
27
|
+
this.angularPConnectData.unsubscribeFn();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
onStateChange() {
|
|
32
|
+
this.checkAndUpdate();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
checkAndUpdate() {
|
|
36
|
+
// Should always check the bridge to see if the component should update itself (re-render)
|
|
37
|
+
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
38
|
+
|
|
39
|
+
// Only call updateSelf when the component should update
|
|
40
|
+
if (bUpdateSelf || this.hasRawMetadataChanged()) {
|
|
41
|
+
this.updateSelf();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// this method will get overriden by the child component
|
|
46
|
+
updateSelf() {}
|
|
47
|
+
|
|
48
|
+
hasRawMetadataChanged(): boolean {
|
|
49
|
+
const newChildrenMetadata = this.fetchChildrenMetadata();
|
|
50
|
+
|
|
51
|
+
if (!PCore.isDeepEqual(newChildrenMetadata, this.childrenMetadataOld)) {
|
|
52
|
+
this.childrenMetadataOld = newChildrenMetadata;
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
fetchChildrenMetadata() {
|
|
60
|
+
const children = this.pConn$.getChildren() || [];
|
|
61
|
+
|
|
62
|
+
return children.map(child => {
|
|
63
|
+
const pConnect = child.getPConnect();
|
|
64
|
+
return pConnect.resolveConfigProps(pConnect.getRawMetadata());
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Directive, OnDestroy } from '@angular/core';
|
|
2
|
+
import { AngularPConnectData } from 'packages/angular-sdk-components/src/public-api';
|
|
3
|
+
|
|
4
|
+
@Directive()
|
|
5
|
+
export class FormTemplateBase implements OnDestroy {
|
|
6
|
+
pConn$: any;
|
|
7
|
+
angularPConnectData: AngularPConnectData;
|
|
8
|
+
|
|
9
|
+
ngOnDestroy(): void {
|
|
10
|
+
PCore.getContextTreeManager().removeContextTreeNode(this.pConn$.getContextName());
|
|
11
|
+
|
|
12
|
+
if (this.angularPConnectData.unsubscribeFn) {
|
|
13
|
+
this.angularPConnectData.unsubscribeFn();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div class="psdk-case-view" id="case-view">
|
|
2
|
-
<div
|
|
2
|
+
<div class="psdk-case-view-info">
|
|
3
3
|
<mat-toolbar color="primary" class="psdk-case-view-toolbar">
|
|
4
4
|
<mat-toolbar-row style="padding-left: 1rem">
|
|
5
5
|
<div class="psdk-case-icon-div">
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
></component-mapper>
|
|
48
48
|
</div>
|
|
49
49
|
<div class="psdk-case-view-main">
|
|
50
|
-
<div
|
|
50
|
+
<div>
|
|
51
51
|
<div *ngFor="let kid of arChildren$">
|
|
52
52
|
<div
|
|
53
53
|
*ngIf="
|
|
@@ -73,11 +73,11 @@
|
|
|
73
73
|
</div>
|
|
74
74
|
</div>
|
|
75
75
|
|
|
76
|
-
<div
|
|
76
|
+
<div>
|
|
77
77
|
<component-mapper name="DeferLoad" [props]="{ pConn$, loadData$: tabData$, name: tabData$?.config?.name }"></component-mapper>
|
|
78
78
|
</div>
|
|
79
79
|
</div>
|
|
80
|
-
<div
|
|
80
|
+
<div>
|
|
81
81
|
<div *ngIf="arChildren$" class="psdk-case-view-utilities">
|
|
82
82
|
<div *ngFor="let kid of arChildren$">
|
|
83
83
|
<div *ngIf="kid.getPConnect().getRawMetadata()?.type.toLowerCase() == 'region' && kid.getPConnect().getRawMetadata()?.name == 'Utilities'">
|
|
@@ -27,7 +27,6 @@ interface CaseViewProps {
|
|
|
27
27
|
export class CaseViewComponent implements OnInit, OnDestroy {
|
|
28
28
|
@Input() pConn$: typeof PConnect;
|
|
29
29
|
@Input() formGroup$: FormGroup;
|
|
30
|
-
@Input() displayOnlyFA$: boolean;
|
|
31
30
|
|
|
32
31
|
// Used with AngularPConnect
|
|
33
32
|
angularPConnectData: AngularPConnectData = {};
|
|
@@ -161,19 +160,15 @@ export class CaseViewComponent implements OnInit, OnDestroy {
|
|
|
161
160
|
|
|
162
161
|
this.svgCase$ = this.utils.getImageSrc(this.configProps$.icon, this.utils.getSDKStaticContentUrl());
|
|
163
162
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
if (kidPConn.getRawMetadata().name == 'Tabs') {
|
|
170
|
-
this.mainTabs = kid;
|
|
171
|
-
this.mainTabData = this.mainTabs.getPConnect().getChildren();
|
|
172
|
-
}
|
|
163
|
+
for (const kid of this.arChildren$) {
|
|
164
|
+
const kidPConn = kid.getPConnect();
|
|
165
|
+
if (kidPConn.getRawMetadata().name == 'Tabs') {
|
|
166
|
+
this.mainTabs = kid;
|
|
167
|
+
this.mainTabData = this.mainTabs.getPConnect().getChildren();
|
|
173
168
|
}
|
|
174
|
-
|
|
175
|
-
this.generateTabsData();
|
|
176
169
|
}
|
|
170
|
+
|
|
171
|
+
this.generateTabsData();
|
|
177
172
|
}
|
|
178
173
|
|
|
179
174
|
generateTabsData() {
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
import { Component, OnInit, Input, forwardRef } from '@angular/core';
|
|
1
|
+
import { Component, OnInit, Input, forwardRef, OnDestroy } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
4
|
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
5
|
+
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
5
6
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
6
7
|
import { TemplateUtils } from '@pega/angular-sdk-components';
|
|
7
|
-
import {
|
|
8
|
+
import { FormTemplateBase } from '@pega/angular-sdk-components';
|
|
9
|
+
|
|
10
|
+
function areViewsChanged(oldViews: any[], newViews: any[]): boolean {
|
|
11
|
+
if (oldViews?.length !== newViews?.length) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return !oldViews?.every((oldView, index) => {
|
|
16
|
+
const newView = newViews[index];
|
|
17
|
+
return oldView.getPConnect().viewName === newView.getPConnect().viewName;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
8
20
|
|
|
9
21
|
interface DefaultFormProps {
|
|
10
22
|
// If any, enter additional props that only exist on this component
|
|
@@ -19,19 +31,36 @@ interface DefaultFormProps {
|
|
|
19
31
|
standalone: true,
|
|
20
32
|
imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
|
|
21
33
|
})
|
|
22
|
-
export class DefaultFormComponent extends
|
|
34
|
+
export class DefaultFormComponent extends FormTemplateBase implements OnInit, OnDestroy {
|
|
23
35
|
@Input() override pConn$: typeof PConnect;
|
|
24
36
|
@Input() formGroup$: FormGroup;
|
|
25
37
|
|
|
38
|
+
// Used with AngularPConnect
|
|
39
|
+
override angularPConnectData: AngularPConnectData = {};
|
|
40
|
+
|
|
26
41
|
arChildren$: any[];
|
|
27
42
|
divClass$: string;
|
|
28
43
|
instructions: string;
|
|
29
44
|
|
|
30
|
-
constructor(
|
|
45
|
+
constructor(
|
|
46
|
+
private angularPConnect: AngularPConnectService,
|
|
47
|
+
private templateUtils: TemplateUtils
|
|
48
|
+
) {
|
|
31
49
|
super();
|
|
32
50
|
}
|
|
33
51
|
|
|
34
52
|
ngOnInit(): void {
|
|
53
|
+
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
54
|
+
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
55
|
+
|
|
56
|
+
this.updateSelf();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
onStateChange() {
|
|
60
|
+
this.updateSelf();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
updateSelf() {
|
|
35
64
|
const configProps = this.pConn$.getConfigProps() as DefaultFormProps;
|
|
36
65
|
const kids = this.pConn$.getChildren();
|
|
37
66
|
this.instructions = this.templateUtils.getInstructions(this.pConn$, configProps?.instructions);
|
|
@@ -55,6 +84,12 @@ export class DefaultFormComponent extends FormTemplateBaseComponent implements O
|
|
|
55
84
|
// repoint children before getting templateArray
|
|
56
85
|
// Children may contain 'reference' component, so we need to
|
|
57
86
|
// normalize them
|
|
58
|
-
|
|
87
|
+
const children = ReferenceComponent.normalizePConnArray(kids[0].getPConnect().getChildren());
|
|
88
|
+
|
|
89
|
+
const visibleChildren = children?.filter(child => child !== undefined) || [];
|
|
90
|
+
|
|
91
|
+
if (areViewsChanged(this.arChildren$, visibleChildren)) {
|
|
92
|
+
this.arChildren$ = visibleChildren;
|
|
93
|
+
}
|
|
59
94
|
}
|
|
60
95
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Component,
|
|
2
|
-
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
1
|
+
import { Component, forwardRef } from '@angular/core';
|
|
3
2
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
3
|
+
import { DetailsTemplateBase } from '@pega/angular-sdk-components';
|
|
4
4
|
|
|
5
5
|
@Component({
|
|
6
6
|
selector: 'app-details',
|
|
@@ -9,48 +9,14 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
|
9
9
|
standalone: true,
|
|
10
10
|
imports: [forwardRef(() => ComponentMapperComponent)]
|
|
11
11
|
})
|
|
12
|
-
export class DetailsComponent
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@Input() pConn$: typeof PConnect;
|
|
12
|
+
export class DetailsComponent extends DetailsTemplateBase {
|
|
13
|
+
override pConn$: typeof PConnect;
|
|
16
14
|
|
|
17
15
|
highlightedDataArr: any[] = [];
|
|
18
16
|
showHighlightedData: boolean;
|
|
19
17
|
arFields$: any[] = [];
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
angularPConnectData: AngularPConnectData = {};
|
|
23
|
-
|
|
24
|
-
ngOnInit(): void {
|
|
25
|
-
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
26
|
-
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
27
|
-
|
|
28
|
-
// this.updateSelf();
|
|
29
|
-
this.checkAndUpdate();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
ngOnDestroy() {
|
|
33
|
-
if (this.angularPConnectData.unsubscribeFn) {
|
|
34
|
-
this.angularPConnectData.unsubscribeFn();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
onStateChange() {
|
|
39
|
-
this.checkAndUpdate();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
checkAndUpdate() {
|
|
43
|
-
// Should always check the bridge to see if the component should
|
|
44
|
-
// update itself (re-render)
|
|
45
|
-
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
46
|
-
|
|
47
|
-
// ONLY call updateSelf when the component should update
|
|
48
|
-
if (bUpdateSelf) {
|
|
49
|
-
this.updateSelf();
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
updateSelf() {
|
|
19
|
+
override updateSelf() {
|
|
54
20
|
const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
|
|
55
21
|
this.showHighlightedData = rawMetaData?.showHighlightedData;
|
|
56
22
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Component,
|
|
2
|
-
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
1
|
+
import { Component, forwardRef } from '@angular/core';
|
|
3
2
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
3
|
+
import { DetailsTemplateBase } from '@pega/angular-sdk-components';
|
|
4
4
|
|
|
5
5
|
@Component({
|
|
6
6
|
selector: 'app-details-narrow-wide',
|
|
@@ -9,48 +9,15 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
|
9
9
|
standalone: true,
|
|
10
10
|
imports: [forwardRef(() => ComponentMapperComponent)]
|
|
11
11
|
})
|
|
12
|
-
export class DetailsNarrowWideComponent
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@Input() pConn$: typeof PConnect;
|
|
12
|
+
export class DetailsNarrowWideComponent extends DetailsTemplateBase {
|
|
13
|
+
override pConn$: typeof PConnect;
|
|
16
14
|
|
|
17
15
|
arFields$: any[] = [];
|
|
18
16
|
arFields2$: any[] = [];
|
|
19
17
|
highlightedDataArr: any[] = [];
|
|
20
18
|
showHighlightedData: boolean;
|
|
21
|
-
// Used with AngularPConnect
|
|
22
|
-
angularPConnectData: AngularPConnectData = {};
|
|
23
|
-
|
|
24
|
-
ngOnInit(): void {
|
|
25
|
-
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
26
|
-
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
27
|
-
|
|
28
|
-
// this.updateSelf();
|
|
29
|
-
this.checkAndUpdate();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
ngOnDestroy() {
|
|
33
|
-
if (this.angularPConnectData.unsubscribeFn) {
|
|
34
|
-
this.angularPConnectData.unsubscribeFn();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
onStateChange() {
|
|
39
|
-
this.checkAndUpdate();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
checkAndUpdate() {
|
|
43
|
-
// Should always check the bridge to see if the component should
|
|
44
|
-
// update itself (re-render)
|
|
45
|
-
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
46
|
-
|
|
47
|
-
// ONLY call updateSelf when the component should update
|
|
48
|
-
if (bUpdateSelf) {
|
|
49
|
-
this.updateSelf();
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
19
|
|
|
53
|
-
updateSelf() {
|
|
20
|
+
override updateSelf() {
|
|
54
21
|
const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
|
|
55
22
|
this.showHighlightedData = rawMetaData?.showHighlightedData;
|
|
56
23
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Component,
|
|
2
|
-
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
3
|
-
import { FormGroup } from '@angular/forms';
|
|
1
|
+
import { Component, forwardRef } from '@angular/core';
|
|
4
2
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
3
|
+
import { DetailsTemplateBase } from '@pega/angular-sdk-components';
|
|
5
4
|
|
|
6
5
|
@Component({
|
|
7
6
|
selector: 'app-details-one-column',
|
|
@@ -10,49 +9,15 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
|
10
9
|
standalone: true,
|
|
11
10
|
imports: [forwardRef(() => ComponentMapperComponent)]
|
|
12
11
|
})
|
|
13
|
-
export class DetailsOneColumnComponent
|
|
14
|
-
|
|
12
|
+
export class DetailsOneColumnComponent extends DetailsTemplateBase {
|
|
13
|
+
override pConn$: typeof PConnect;
|
|
15
14
|
|
|
16
|
-
@Input() pConn$: typeof PConnect;
|
|
17
|
-
@Input() formGroup$: FormGroup;
|
|
18
15
|
showHighlightedData: boolean;
|
|
19
16
|
highlightedDataArr: any;
|
|
20
17
|
|
|
21
18
|
arFields$: any[] = [];
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
angularPConnectData: AngularPConnectData = {};
|
|
25
|
-
|
|
26
|
-
ngOnInit(): void {
|
|
27
|
-
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
28
|
-
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
29
|
-
|
|
30
|
-
// this.updateSelf();
|
|
31
|
-
this.checkAndUpdate();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
ngOnDestroy() {
|
|
35
|
-
if (this.angularPConnectData.unsubscribeFn) {
|
|
36
|
-
this.angularPConnectData.unsubscribeFn();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
onStateChange() {
|
|
41
|
-
this.checkAndUpdate();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
checkAndUpdate() {
|
|
45
|
-
// Should always check the bridge to see if the component should
|
|
46
|
-
// update itself (re-render)
|
|
47
|
-
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
48
|
-
|
|
49
|
-
// ONLY call updateSelf when the component should update
|
|
50
|
-
if (bUpdateSelf) {
|
|
51
|
-
this.updateSelf();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
updateSelf() {
|
|
20
|
+
override updateSelf() {
|
|
56
21
|
const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
|
|
57
22
|
this.showHighlightedData = rawMetaData?.showHighlightedData;
|
|
58
23
|
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
*ngIf="tab.content?.getPConnect()"
|
|
6
6
|
[name]="tab.content?.getPConnect().getComponentName()"
|
|
7
7
|
[props]="{
|
|
8
|
-
pConn$: tab.content?.getPConnect()
|
|
9
|
-
formGroup$: formGroup$
|
|
8
|
+
pConn$: tab.content?.getPConnect()
|
|
10
9
|
}"
|
|
11
10
|
errorMsg="Details Sub tabs wants component not yet available: {{ tab.content?.getPConnect().getComponentName() }}"
|
|
12
11
|
></component-mapper>
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, forwardRef } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { FormGroup } from '@angular/forms';
|
|
4
3
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
5
|
-
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
6
4
|
import { getTransientTabs, getVisibleTabs, tabClick } from '@pega/angular-sdk-components';
|
|
7
5
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
6
|
+
import { DetailsTemplateBase } from '@pega/angular-sdk-components';
|
|
8
7
|
|
|
9
8
|
@Component({
|
|
10
9
|
selector: 'app-details-sub-tabs',
|
|
@@ -13,45 +12,14 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
|
13
12
|
standalone: true,
|
|
14
13
|
imports: [MatTabsModule, CommonModule, forwardRef(() => ComponentMapperComponent)]
|
|
15
14
|
})
|
|
16
|
-
export class DetailsSubTabsComponent
|
|
17
|
-
|
|
18
|
-
@Input() formGroup$: FormGroup;
|
|
15
|
+
export class DetailsSubTabsComponent extends DetailsTemplateBase {
|
|
16
|
+
override pConn$: typeof PConnect;
|
|
19
17
|
|
|
20
|
-
angularPConnectData: AngularPConnectData = {};
|
|
21
18
|
currentTabId = '0';
|
|
22
19
|
tabItems: any[];
|
|
23
20
|
availableTabs: any[];
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
ngOnInit(): void {
|
|
28
|
-
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
29
|
-
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
30
|
-
this.checkAndUpdate();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
ngOnDestroy() {
|
|
34
|
-
if (this.angularPConnectData.unsubscribeFn) {
|
|
35
|
-
this.angularPConnectData.unsubscribeFn();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
onStateChange() {
|
|
40
|
-
this.checkAndUpdate();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
checkAndUpdate() {
|
|
44
|
-
// Should always check the bridge to see if the component should
|
|
45
|
-
// update itself (re-render)
|
|
46
|
-
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
47
|
-
|
|
48
|
-
// ONLY call updateSelf when the component should update
|
|
49
|
-
if (bUpdateSelf) {
|
|
50
|
-
this.updateSelf();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
updateSelf() {
|
|
22
|
+
override updateSelf() {
|
|
55
23
|
const children = this.pConn$?.getChildren();
|
|
56
24
|
const deferLoadedTabs = children[0];
|
|
57
25
|
this.availableTabs = getVisibleTabs(deferLoadedTabs, 'tabsSubs');
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Component,
|
|
2
|
-
import { FormGroup } from '@angular/forms';
|
|
3
|
-
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
1
|
+
import { Component, forwardRef } from '@angular/core';
|
|
4
2
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
3
|
+
import { DetailsTemplateBase } from '@pega/angular-sdk-components';
|
|
5
4
|
|
|
6
5
|
@Component({
|
|
7
6
|
selector: 'app-details-three-column',
|
|
@@ -10,11 +9,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
|
10
9
|
standalone: true,
|
|
11
10
|
imports: [forwardRef(() => ComponentMapperComponent)]
|
|
12
11
|
})
|
|
13
|
-
export class DetailsThreeColumnComponent
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@Input() pConn$: typeof PConnect;
|
|
17
|
-
@Input() formGroup$: FormGroup;
|
|
12
|
+
export class DetailsThreeColumnComponent extends DetailsTemplateBase {
|
|
13
|
+
override pConn$: typeof PConnect;
|
|
18
14
|
|
|
19
15
|
showHighlightedData: boolean;
|
|
20
16
|
highlightedDataArr: any;
|
|
@@ -25,39 +21,7 @@ export class DetailsThreeColumnComponent implements OnInit, OnDestroy {
|
|
|
25
21
|
|
|
26
22
|
propsToUse: any = {};
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
angularPConnectData: AngularPConnectData = {};
|
|
30
|
-
|
|
31
|
-
ngOnInit(): void {
|
|
32
|
-
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
33
|
-
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
34
|
-
|
|
35
|
-
// this.updateSelf();
|
|
36
|
-
this.checkAndUpdate();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
ngOnDestroy() {
|
|
40
|
-
if (this.angularPConnectData.unsubscribeFn) {
|
|
41
|
-
this.angularPConnectData.unsubscribeFn();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
onStateChange() {
|
|
46
|
-
this.checkAndUpdate();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
checkAndUpdate() {
|
|
50
|
-
// Should always check the bridge to see if the component should
|
|
51
|
-
// update itself (re-render)
|
|
52
|
-
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
53
|
-
|
|
54
|
-
// ONLY call updateSelf when the component should update
|
|
55
|
-
if (bUpdateSelf) {
|
|
56
|
-
this.updateSelf();
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
updateSelf() {
|
|
24
|
+
override updateSelf() {
|
|
61
25
|
const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
|
|
62
26
|
this.showHighlightedData = rawMetaData?.showHighlightedData;
|
|
63
27
|
|