@pega/angular-sdk-overrides 23.1.10 → 24.2.10
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/designSystemExtension/alert-banner/alert-banner.component.ts +1 -1
- package/lib/designSystemExtension/case-create-stage/case-create-stage.component.ts +1 -1
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.html +7 -4
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +2 -1
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +3 -1
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +1 -1
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +4 -1
- package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.html +1 -1
- package/lib/designSystemExtension/operator/operator.component.ts +11 -6
- package/lib/designSystemExtension/pulse/pulse.component.ts +7 -7
- package/lib/field/auto-complete/auto-complete.component.ts +17 -14
- package/lib/field/cancel-alert/cancel-alert.component.ts +0 -2
- package/lib/field/check-box/check-box.component.html +16 -15
- package/lib/field/check-box/check-box.component.scss +14 -1
- package/lib/field/check-box/check-box.component.ts +128 -45
- package/lib/field/currency/currency.component.html +16 -7
- package/lib/field/currency/currency.component.ts +55 -20
- package/lib/field/date/date.component.html +1 -6
- package/lib/field/date/date.component.ts +22 -39
- package/lib/field/date-time/date-time.component.html +6 -7
- package/lib/field/date-time/date-time.component.ts +28 -45
- package/lib/field/decimal/decimal.component.html +14 -4
- package/lib/field/decimal/decimal.component.ts +47 -7
- package/lib/field/dropdown/dropdown.component.ts +132 -21
- package/lib/field/email/email.component.ts +14 -4
- package/lib/field/group/group.component.html +1 -1
- package/lib/field/group/group.component.ts +6 -2
- package/lib/field/integer/integer.component.html +1 -1
- package/lib/field/integer/integer.component.ts +13 -5
- package/lib/field/multiselect/multiselect.component.html +33 -0
- package/lib/field/multiselect/multiselect.component.scss +7 -0
- package/lib/field/multiselect/multiselect.component.spec.ts +21 -0
- package/lib/field/multiselect/multiselect.component.ts +369 -0
- package/lib/field/multiselect/utils.ts +209 -0
- package/lib/field/percentage/percentage.component.html +17 -6
- package/lib/field/percentage/percentage.component.ts +51 -12
- package/lib/field/phone/phone.component.html +1 -1
- package/lib/field/phone/phone.component.ts +11 -14
- package/lib/field/radio-buttons/radio-buttons.component.ts +9 -12
- package/lib/field/rich-text/config-ext.json +10 -0
- package/lib/field/rich-text/rich-text.component.html +1 -1
- package/lib/field/rich-text/rich-text.component.ts +8 -6
- package/lib/field/scalar-list/scalar-list.component.ts +4 -4
- package/lib/field/text/text.component.ts +2 -0
- package/lib/field/text-area/text-area.component.html +2 -1
- package/lib/field/text-area/text-area.component.ts +13 -8
- package/lib/field/text-input/text-input.component.html +1 -1
- package/lib/field/text-input/text-input.component.ts +13 -5
- package/lib/field/time/time.component.html +3 -2
- package/lib/field/time/time.component.ts +23 -7
- package/lib/field/url/url.component.html +2 -1
- package/lib/field/url/url.component.ts +15 -5
- package/lib/field/user-reference/user-reference.component.html +42 -45
- package/lib/field/user-reference/user-reference.component.ts +73 -27
- package/lib/infra/Containers/base-components/flow-container-base.component.ts +22 -0
- package/lib/infra/Containers/base-components/helper.ts +89 -0
- package/lib/infra/Containers/flow-container/flow-container.component.html +9 -4
- package/lib/infra/Containers/flow-container/flow-container.component.ts +38 -33
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +41 -9
- package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +1 -1
- package/lib/infra/Containers/view-container/helper.ts +22 -0
- package/lib/infra/Containers/view-container/view-container.component.ts +5 -18
- package/lib/infra/assignment/assignment.component.ts +37 -39
- package/lib/infra/dashboard-filter/dashboard-filter.component.ts +0 -1
- package/lib/infra/defer-load/defer-load.component.ts +9 -12
- package/lib/infra/multi-step/multi-step.component.html +1 -1
- package/lib/infra/multi-step/multi-step.component.scss +1 -0
- package/lib/infra/navbar/navbar.component.html +4 -4
- package/lib/infra/navbar/navbar.component.ts +9 -6
- package/lib/infra/root-container/root-container.component.ts +3 -3
- package/lib/infra/stages/stages.component.scss +2 -2
- package/lib/infra/view/view.component.html +7 -20
- package/lib/infra/view/view.component.ts +21 -3
- package/lib/template/app-shell/app-shell.component.ts +20 -2
- package/lib/template/banner-page/config-ext.json +9 -0
- package/lib/template/base/details-template-base.ts +67 -0
- package/lib/template/base/form-template-base.ts +10 -0
- package/lib/template/case-summary/case-summary.component.ts +38 -4
- package/lib/template/case-view/case-view.component.html +7 -7
- package/lib/template/case-view/case-view.component.scss +2 -0
- package/lib/template/case-view/case-view.component.ts +8 -19
- package/lib/template/confirmation/confirmation.component.ts +1 -1
- package/lib/template/data-reference/data-reference.component.ts +37 -43
- package/lib/template/default-form/default-form.component.html +0 -4
- package/lib/template/default-form/default-form.component.ts +7 -23
- package/lib/template/details/details.component.ts +7 -41
- package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +6 -39
- package/lib/template/details-one-column/details-one-column.component.ts +7 -42
- 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 +7 -43
- package/lib/template/details-two-column/details-two-column.component.ts +8 -44
- package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +7 -42
- package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
- package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +8 -4
- package/lib/template/field-group-template/field-group-template.component.ts +4 -14
- package/lib/template/field-value-list/field-value-list.component.html +8 -3
- package/lib/template/field-value-list/field-value-list.component.scss +2 -1
- package/lib/template/field-value-list/field-value-list.component.ts +1 -0
- package/lib/template/inline-dashboard-page/config-ext.json +9 -0
- package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -2
- package/lib/template/list-view/list-view.component.html +9 -6
- package/lib/template/list-view/list-view.component.scss +11 -0
- package/lib/template/list-view/list-view.component.ts +60 -32
- package/lib/template/list-view/listViewHelpers.ts +1 -2
- package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +1 -1
- package/lib/template/one-column/one-column.component.ts +4 -3
- package/lib/template/one-column-tab/one-column-tab.component.ts +1 -1
- package/lib/template/page/page.component.ts +1 -1
- package/lib/template/promoted-filters/promoted-filters.component.ts +1 -1
- package/lib/template/repeating-structures/repeating-structures.component.ts +2 -3
- package/lib/template/simple-table/simple-table.component.ts +0 -2
- package/lib/template/simple-table-manual/helpers.ts +2 -2
- package/lib/template/simple-table-manual/simple-table-manual.component.html +1 -1
- package/lib/template/simple-table-manual/simple-table-manual.component.scss +1 -0
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +60 -28
- package/lib/template/simple-table-select/simple-table-select.component.ts +5 -7
- package/lib/template/three-column/three-column.component.ts +4 -3
- package/lib/template/two-column/two-column.component.ts +4 -3
- package/lib/template/two-column-tab/two-column-tab.component.ts +1 -1
- package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +4 -3
- package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +1 -1
- package/lib/template/wss-nav-bar/wss-nav-bar.component.html +1 -1
- package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +5 -4
- package/lib/widget/attachment/attachment.component.html +50 -26
- package/lib/widget/attachment/attachment.component.scss +118 -0
- package/lib/widget/attachment/attachment.component.ts +256 -503
- package/lib/widget/case-history/case-history.component.ts +1 -2
- package/lib/widget/feed-container/feed-container.component.ts +7 -11
- package/lib/widget/file-utility/file-utility.component.html +2 -2
- package/lib/widget/file-utility/file-utility.component.ts +15 -22
- package/lib/widget/list-utility/list-utility.component.html +1 -1
- package/lib/widget/quick-create/config-ext.json +9 -0
- package/lib/widget/quick-create/quick-create.component.ts +1 -1
- package/lib/widget/todo/todo.component.html +8 -7
- package/lib/widget/todo/todo.component.ts +97 -86
- package/package.json +1 -1
|
@@ -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-wide-narrow',
|
|
@@ -10,51 +9,17 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
|
10
9
|
standalone: true,
|
|
11
10
|
imports: [forwardRef(() => ComponentMapperComponent)]
|
|
12
11
|
})
|
|
13
|
-
export class DetailsWideNarrowComponent
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@Input() pConn$: typeof PConnect;
|
|
17
|
-
@Input() formGroup$: FormGroup;
|
|
12
|
+
export class DetailsWideNarrowComponent extends DetailsTemplateBase {
|
|
13
|
+
override pConn$: typeof PConnect;
|
|
18
14
|
|
|
19
15
|
highlightedDataArr: any[] = [];
|
|
20
16
|
showHighlightedData: boolean;
|
|
21
17
|
arFields$: any[] = [];
|
|
22
18
|
arFields2$: any[] = [];
|
|
23
19
|
propsToUse: any = {};
|
|
24
|
-
// Used with AngularPConnect
|
|
25
|
-
angularPConnectData: AngularPConnectData = {};
|
|
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
|
-
|
|
31
|
-
// this.updateSelf();
|
|
32
|
-
this.checkAndUpdate();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
ngOnDestroy() {
|
|
36
|
-
if (this.angularPConnectData.unsubscribeFn) {
|
|
37
|
-
this.angularPConnectData.unsubscribeFn();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
onStateChange() {
|
|
42
|
-
this.checkAndUpdate();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
checkAndUpdate() {
|
|
46
|
-
// Should always check the bridge to see if the component should
|
|
47
|
-
// update itself (re-render)
|
|
48
|
-
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
49
|
-
|
|
50
|
-
// ONLY call updateSelf when the component should update
|
|
51
|
-
if (bUpdateSelf) {
|
|
52
|
-
this.updateSelf();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
20
|
|
|
56
|
-
updateSelf() {
|
|
57
|
-
const rawMetaData: any = this.pConn$.resolveConfigProps(
|
|
21
|
+
override updateSelf() {
|
|
22
|
+
const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
|
|
58
23
|
this.showHighlightedData = rawMetaData?.showHighlightedData;
|
|
59
24
|
|
|
60
25
|
if (this.showHighlightedData) {
|
|
@@ -71,7 +36,7 @@ export class DetailsWideNarrowComponent implements OnInit, OnDestroy {
|
|
|
71
36
|
});
|
|
72
37
|
}
|
|
73
38
|
|
|
74
|
-
this.pConn$.setInheritedProp('displayMode', '
|
|
39
|
+
this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
75
40
|
this.pConn$.setInheritedProp('readOnly', true);
|
|
76
41
|
|
|
77
42
|
const kids = this.pConn$.getChildren() as any[];
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
<div *ngIf="propsToUse.showLabel && propsToUse.label" class="template-title-container">
|
|
2
|
+
<span>{{ propsToUse.label }}</span>
|
|
3
|
+
</div>
|
|
1
4
|
<mat-tab-group id="dynamic-tabs" mat-stretch-tabs="false" animationDuration="0">
|
|
2
5
|
<mat-tab *ngFor="let tab of tabsItems" [label]="tab.name">
|
|
3
6
|
<component-mapper name="View" [props]="{ pConn$: tab.content.getPConnect() }"></component-mapper>
|
|
@@ -9,6 +9,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
|
9
9
|
interface DynamicTabsProps {
|
|
10
10
|
referenceList: string;
|
|
11
11
|
template: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
showLabel?: boolean;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
@Component({
|
|
@@ -24,6 +26,7 @@ export class DynamicTabsComponent implements OnInit, OnDestroy {
|
|
|
24
26
|
|
|
25
27
|
angularPConnectData: AngularPConnectData = {};
|
|
26
28
|
tabsItems: any[];
|
|
29
|
+
propsToUse: any;
|
|
27
30
|
|
|
28
31
|
constructor(private angularPConnect: AngularPConnectService) {}
|
|
29
32
|
|
|
@@ -54,16 +57,17 @@ export class DynamicTabsComponent implements OnInit, OnDestroy {
|
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
updateSelf() {
|
|
57
|
-
const { referenceList } = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as DynamicTabsProps;
|
|
60
|
+
const { referenceList, label, showLabel } = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as DynamicTabsProps;
|
|
61
|
+
|
|
62
|
+
this.propsToUse = { label, showLabel, ...this.pConn$.getInheritedProps() };
|
|
58
63
|
|
|
59
|
-
// @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'
|
|
60
64
|
const { tablabel } = this.pConn$.getComponentConfig();
|
|
61
65
|
const tablabelProp = PCore.getAnnotationUtils().getPropertyName(tablabel);
|
|
62
66
|
|
|
63
|
-
this.pConn$.setInheritedProp('displayMode', '
|
|
67
|
+
this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
64
68
|
this.pConn$.setInheritedProp('readOnly', true);
|
|
65
69
|
|
|
66
|
-
const referenceListData
|
|
70
|
+
const referenceListData = this.pConn$.getValue(`${referenceList}.pxResults`, ''); // 2nd arg empty string until typedefs properly allow optional
|
|
67
71
|
|
|
68
72
|
this.tabsItems =
|
|
69
73
|
referenceListData?.map((item, i) => {
|
|
@@ -105,7 +105,7 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
|
|
|
105
105
|
|
|
106
106
|
const renderMode = this.configProps$.renderMode;
|
|
107
107
|
const displayMode = this.configProps$.displayMode;
|
|
108
|
-
this.readonlyMode = renderMode === 'ReadOnly' || displayMode === '
|
|
108
|
+
this.readonlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY';
|
|
109
109
|
this.contextClass = this.configProps$.contextClass;
|
|
110
110
|
const lookForChildInConfig = this.configProps$.lookForChildInConfig;
|
|
111
111
|
this.heading = this.configProps$.heading ?? 'Row';
|
|
@@ -114,7 +114,7 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
|
|
|
114
114
|
this.pageReference = `${this.pConn$.getPageReference()}${resolvedList}`;
|
|
115
115
|
this.pConn$.setReferenceList(resolvedList);
|
|
116
116
|
if (this.readonlyMode) {
|
|
117
|
-
this.pConn$.setInheritedProp('displayMode', '
|
|
117
|
+
this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
118
118
|
}
|
|
119
119
|
this.referenceList = this.configProps$.referenceList;
|
|
120
120
|
if (this.prevRefLength != this.referenceList.length) {
|
|
@@ -149,20 +149,10 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
|
|
|
149
149
|
};
|
|
150
150
|
|
|
151
151
|
addFieldGroupItem() {
|
|
152
|
-
|
|
153
|
-
this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceList.length, this.pageReference);
|
|
154
|
-
} else {
|
|
155
|
-
// @ts-ignore - second parameter "pageRef" is optional for insert method
|
|
156
|
-
this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceList.length);
|
|
157
|
-
}
|
|
152
|
+
this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceList.length);
|
|
158
153
|
}
|
|
159
154
|
|
|
160
155
|
deleteFieldGroupItem(index) {
|
|
161
|
-
|
|
162
|
-
this.pConn$.getListActions().deleteEntry(index, this.pageReference);
|
|
163
|
-
} else {
|
|
164
|
-
// @ts-ignore - second parameter "pageRef" is optional for deleteEntry method
|
|
165
|
-
this.pConn$.getListActions().deleteEntry(index);
|
|
166
|
-
}
|
|
156
|
+
this.pConn$.getListActions().deleteEntry(index);
|
|
167
157
|
}
|
|
168
158
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<div *ngIf="displayMode$ === '
|
|
1
|
+
<div *ngIf="displayMode$ === 'DISPLAY_ONLY'; else STACKED_LARGE_VAL" class="psdk-container-labels-left">
|
|
2
2
|
<div class="psdk-grid-label">{{ label$ }}</div>
|
|
3
3
|
<div class="psdk-val-labels-left">
|
|
4
|
-
|
|
4
|
+
<ng-container *ngTemplateOutlet="valueTemplate"></ng-container>
|
|
5
5
|
</div>
|
|
6
6
|
</div>
|
|
7
7
|
|
|
@@ -9,7 +9,12 @@
|
|
|
9
9
|
<div *ngIf="displayMode$ === 'STACKED_LARGE_VAL'" class="psdk-container-stacked-large-val">
|
|
10
10
|
<div class="psdk-grid-label">{{ label$ }}</div>
|
|
11
11
|
<div class="psdk-val-stacked">
|
|
12
|
-
|
|
12
|
+
<ng-container *ngTemplateOutlet="valueTemplate"></ng-container>
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
15
|
</ng-template>
|
|
16
|
+
|
|
17
|
+
<ng-template #valueTemplate>
|
|
18
|
+
<div *ngIf="isHtml$; else valueOnly" id="instruction-text" [innerHTML]="value$ || '---'"></div>
|
|
19
|
+
<ng-template #valueOnly>{{ value$ || '---' }}</ng-template>
|
|
20
|
+
</ng-template>
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
column-gap: calc(2 * 0.5rem);
|
|
5
5
|
row-gap: calc(2 * 0.5rem);
|
|
6
6
|
align-items: start;
|
|
7
|
+
padding-block: 8px;
|
|
7
8
|
}
|
|
8
9
|
.psdk-value {
|
|
9
10
|
margin: 8px 0px;
|
|
@@ -14,5 +15,5 @@
|
|
|
14
15
|
font-size: 1.25rem;
|
|
15
16
|
}
|
|
16
17
|
.psdk-val-labels-left {
|
|
17
|
-
|
|
18
|
+
white-space: break-spaces;
|
|
18
19
|
}
|
|
@@ -45,8 +45,8 @@ export class InlineDashboardPageComponent implements OnInit, OnChanges {
|
|
|
45
45
|
|
|
46
46
|
updateSelf() {
|
|
47
47
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as InlineDashboardPageProps;
|
|
48
|
-
const arChildren$ = this.pConn$.getChildren()
|
|
49
|
-
const allFilters =
|
|
48
|
+
const arChildren$ = this.pConn$.getChildren();
|
|
49
|
+
const allFilters = this.pConn$.getRawMetadata()?.children[1];
|
|
50
50
|
const filterComponents = buildFilterComponents(this.pConn$, allFilters);
|
|
51
51
|
this.inlineProps = this.configProps$;
|
|
52
52
|
this.children[0] = arChildren$[0];
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<div class="psdk-list-header">
|
|
2
2
|
<div>
|
|
3
|
+
<h3 *ngIf="label" class="label" style="font-weight: bold">
|
|
4
|
+
{{ label }} <span class="results-count">{{ getResultsText() }}</span>
|
|
5
|
+
</h3>
|
|
3
6
|
<mat-form-field class="psdk-search" *ngIf="bShowSearch$">
|
|
4
7
|
<mat-label><img class="psdk-icon-search" src="{{ searchIcon$ }}" /> <span class="psdk-search-label">Search</span> </mat-label>
|
|
5
8
|
<input matInput id="search" (keyup)="applySearch($event)" placeholder="" />
|
|
@@ -50,7 +53,7 @@
|
|
|
50
53
|
color="primary"
|
|
51
54
|
(click)="_listViewClick(dCol.config, element)"
|
|
52
55
|
>
|
|
53
|
-
{{ element[dCol.config.name] }}
|
|
56
|
+
{{ element[dCol.config.name] || '---' }}
|
|
54
57
|
</button>
|
|
55
58
|
<ng-template #regular>
|
|
56
59
|
{{ element[dCol.config.name] || '---' }}
|
|
@@ -114,10 +117,10 @@
|
|
|
114
117
|
color="primary"
|
|
115
118
|
(click)="_listViewClick(dCol.config, element)"
|
|
116
119
|
>
|
|
117
|
-
{{ element[dCol.config.name] }}
|
|
120
|
+
{{ element[dCol.config.name] || '---' }}
|
|
118
121
|
</button>
|
|
119
122
|
<ng-template #regular>
|
|
120
|
-
{{ element[dCol.config.name] }}
|
|
123
|
+
{{ element[dCol.config.name] || '---' }}
|
|
121
124
|
</ng-template>
|
|
122
125
|
</td>
|
|
123
126
|
</ng-container>
|
|
@@ -150,20 +153,20 @@
|
|
|
150
153
|
<ng-container *ngIf="singleSelectionMode" matColumnDef="select">
|
|
151
154
|
<th mat-header-cell *matHeaderCellDef></th>
|
|
152
155
|
<td mat-cell *matCellDef="let row">
|
|
153
|
-
<mat-radio-button [value]="row[rowID]" (change)="fieldOnChange(row)"></mat-radio-button>
|
|
156
|
+
<mat-radio-button [value]="row[rowID]" [checked]="row[rowID] === checkBoxValue" (change)="fieldOnChange(row)"></mat-radio-button>
|
|
154
157
|
</td>
|
|
155
158
|
</ng-container>
|
|
156
159
|
<ng-container *ngIf="multiSelectionMode" matColumnDef="select">
|
|
157
160
|
<th mat-header-cell *matHeaderCellDef></th>
|
|
158
161
|
<td mat-cell *matCellDef="let row">
|
|
159
|
-
<mat-checkbox [value]="row[rowID]" (change)="onCheckboxClick(row, $event)"></mat-checkbox>
|
|
162
|
+
<mat-checkbox [value]="row[rowID]" [checked]="isChecked(row)" (change)="onCheckboxClick(row, $event)"></mat-checkbox>
|
|
160
163
|
</td>
|
|
161
164
|
</ng-container>
|
|
162
165
|
<ng-container *ngFor="let dCol of fields$" [matColumnDef]="dCol.config.name">
|
|
163
166
|
<th mat-header-cell *matHeaderCellDef mat-sort-header (click)="_headerSortClick($event, dCol)" arrowPosition="before">
|
|
164
167
|
{{ dCol.config.label }}
|
|
165
168
|
</th>
|
|
166
|
-
<td mat-cell *matCellDef="let element">{{ element[dCol.config.name] }}</td>
|
|
169
|
+
<td mat-cell *matCellDef="let element">{{ element[dCol.config.name] || '---' }}</td>
|
|
167
170
|
</ng-container>
|
|
168
171
|
|
|
169
172
|
<tr mat-header-row *matHeaderRowDef="displayedColumns$"></tr>
|
|
@@ -165,3 +165,14 @@ tr.mat-mdc-row {
|
|
|
165
165
|
background-color: transparent;
|
|
166
166
|
align-items: center;
|
|
167
167
|
}
|
|
168
|
+
|
|
169
|
+
.results-count {
|
|
170
|
+
opacity: 0.7;
|
|
171
|
+
font-size: 0.8rem;
|
|
172
|
+
font-weight: bold;
|
|
173
|
+
margin-inline-start: 0.625rem;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.label {
|
|
177
|
+
margin: 8px;
|
|
178
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-classes-per-file */
|
|
2
1
|
import { Component, OnInit, Input, ViewChild, forwardRef, OnDestroy } from '@angular/core';
|
|
3
2
|
import { CommonModule } from '@angular/common';
|
|
4
3
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
@@ -22,13 +21,15 @@ import { getCurrencyOptions } from '@pega/angular-sdk-components';
|
|
|
22
21
|
import { getLocale, getSeconds } from '@pega/angular-sdk-components';
|
|
23
22
|
import { formatters } from '@pega/angular-sdk-components';
|
|
24
23
|
|
|
25
|
-
import {
|
|
24
|
+
import { init } from './listViewHelpers';
|
|
26
25
|
|
|
27
26
|
declare const window: any;
|
|
28
27
|
|
|
29
28
|
const SELECTION_MODE = { SINGLE: 'single', MULTI: 'multi' };
|
|
30
29
|
|
|
31
30
|
interface ListViewProps {
|
|
31
|
+
inheritedProps: any;
|
|
32
|
+
title: string | undefined;
|
|
32
33
|
// If any, enter additional props that only exist on this component
|
|
33
34
|
globalSearch?: boolean;
|
|
34
35
|
referenceList?: any;
|
|
@@ -40,6 +41,9 @@ interface ListViewProps {
|
|
|
40
41
|
presets?: any;
|
|
41
42
|
reorderFields: string | boolean;
|
|
42
43
|
grouping: string | boolean;
|
|
44
|
+
value: any;
|
|
45
|
+
readonlyContextList: any;
|
|
46
|
+
label?: string;
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
export class Group {
|
|
@@ -156,6 +160,8 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
156
160
|
fieldDefs: any;
|
|
157
161
|
xRayApis = PCore.getDebugger().getXRayRuntime();
|
|
158
162
|
xRayUid = this.xRayApis.startXRay();
|
|
163
|
+
checkBoxValue: string;
|
|
164
|
+
label?: string = '';
|
|
159
165
|
|
|
160
166
|
constructor(
|
|
161
167
|
private psService: ProgressSpinnerService,
|
|
@@ -169,7 +175,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
169
175
|
/** If compositeKeys is defined, use dynamic value, else fallback to pyID or pyGUID. */
|
|
170
176
|
this.compositeKeys = this.configProps$?.compositeKeys;
|
|
171
177
|
this.rowID = this.compositeKeys && this.compositeKeys?.length === 1 ? this.compositeKeys[0] : defRowID;
|
|
172
|
-
this.bShowSearch$ = this.utils.getBooleanValue(this.configProps
|
|
178
|
+
this.bShowSearch$ = this.utils.getBooleanValue(this.configProps$?.globalSearch ? this.configProps$.globalSearch : this.payload?.globalSearch);
|
|
173
179
|
this.bColumnReorder$ = this.utils.getBooleanValue(this.configProps$.reorderFields);
|
|
174
180
|
this.bGrouping$ = this.utils.getBooleanValue(this.configProps$.grouping);
|
|
175
181
|
this.showDynamicFields = this.configProps$?.showDynamicFields;
|
|
@@ -184,9 +190,23 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
184
190
|
|
|
185
191
|
this.selectionMode = this.configProps$.selectionMode;
|
|
186
192
|
|
|
193
|
+
this.checkBoxValue = this.configProps$.value;
|
|
194
|
+
|
|
187
195
|
this.arFilterMainButtons$.push({ actionID: 'submit', jsAction: 'submit', name: 'Submit' });
|
|
188
196
|
this.arFilterSecondaryButtons$.push({ actionID: 'cancel', jsAction: 'cancel', name: 'Cancel' });
|
|
189
197
|
|
|
198
|
+
let title = this.configProps$?.title || this.configProps$?.label || 'List';
|
|
199
|
+
const inheritedProps = this.configProps$?.inheritedProps;
|
|
200
|
+
if (title === 'List' && inheritedProps) {
|
|
201
|
+
for (const inheritedProp of inheritedProps) {
|
|
202
|
+
if (inheritedProp?.prop === 'label') {
|
|
203
|
+
title = inheritedProp?.value;
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
this.label = title;
|
|
209
|
+
|
|
190
210
|
this.searchIcon$ = this.utils.getImageSrc('search', this.utils.getSDKStaticContentUrl());
|
|
191
211
|
setTimeout(() => {
|
|
192
212
|
PCore.getPubSubUtils().subscribe(
|
|
@@ -213,7 +233,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
213
233
|
if (!this.payload) {
|
|
214
234
|
this.payload = { referenceList: this.configProps$.referenceList };
|
|
215
235
|
}
|
|
216
|
-
|
|
236
|
+
init({
|
|
217
237
|
pConn$: this.pConn$,
|
|
218
238
|
bInForm$: this.bInForm$,
|
|
219
239
|
...this.payload,
|
|
@@ -353,7 +373,6 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
353
373
|
}
|
|
354
374
|
|
|
355
375
|
getListData() {
|
|
356
|
-
// @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'
|
|
357
376
|
const componentConfig = this.pConn$.getComponentConfig();
|
|
358
377
|
if (this.configProps$) {
|
|
359
378
|
this.preparePayload();
|
|
@@ -364,8 +383,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
364
383
|
const dataViewParameters = this.payload.parameters;
|
|
365
384
|
|
|
366
385
|
const workListDataPromise = !this.bInForm$
|
|
367
|
-
?
|
|
368
|
-
PCore.getDataApiUtils().getData(refList, payload)
|
|
386
|
+
? PCore.getDataApiUtils().getData(refList, payload)
|
|
369
387
|
: PCore.getDataPageUtils().getDataAsync(
|
|
370
388
|
refList,
|
|
371
389
|
this.pConn$.getContextName(),
|
|
@@ -505,6 +523,13 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
505
523
|
}
|
|
506
524
|
}
|
|
507
525
|
|
|
526
|
+
isChecked(rowIn): any {
|
|
527
|
+
const initialVal = false;
|
|
528
|
+
return this.configProps$?.readonlyContextList?.reduce((acc, currRow) => {
|
|
529
|
+
return acc || rowIn[this.rowID] === currRow[this.rowID];
|
|
530
|
+
}, initialVal);
|
|
531
|
+
}
|
|
532
|
+
|
|
508
533
|
fieldOnChange(row) {
|
|
509
534
|
const value = row[this.rowID];
|
|
510
535
|
const reqObj = {};
|
|
@@ -517,6 +542,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
517
542
|
} else {
|
|
518
543
|
reqObj[this.rowID] = value;
|
|
519
544
|
}
|
|
545
|
+
this.checkBoxValue = value;
|
|
520
546
|
this.pConn$?.getListActions?.()?.setSelectedRows([reqObj]);
|
|
521
547
|
}
|
|
522
548
|
|
|
@@ -601,7 +627,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
601
627
|
this.pConn$.getActionsApi().openAssignment(pzInsKey, pxObjClass, {
|
|
602
628
|
containerName: 'primary',
|
|
603
629
|
channelName: ''
|
|
604
|
-
});
|
|
630
|
+
} as any);
|
|
605
631
|
} else {
|
|
606
632
|
this.pConn$.getActionsApi().openWorkByHandle(pzInsKey, pxObjClass);
|
|
607
633
|
}
|
|
@@ -619,10 +645,6 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
619
645
|
}
|
|
620
646
|
}
|
|
621
647
|
|
|
622
|
-
compare(a: number | string, b: number | string, isAsc: boolean) {
|
|
623
|
-
return (a < b ? -1 : 1) * (isAsc ? 1 : -1);
|
|
624
|
-
}
|
|
625
|
-
|
|
626
648
|
_headerSortClick(event, columnData) {
|
|
627
649
|
// images 0 - filter, 1 - arrow, 2 - more
|
|
628
650
|
|
|
@@ -655,21 +677,22 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
655
677
|
this.filterSortGroupBy();
|
|
656
678
|
}
|
|
657
679
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
}
|
|
680
|
+
// Commenting below method, since the code which is using it, is already commented
|
|
681
|
+
// clearOutArrows(event, columnData) {
|
|
682
|
+
// const arImages = event.srcElement.parentElement.getElementsByTagName('img');
|
|
683
|
+
|
|
684
|
+
// for (const theImage of arImages) {
|
|
685
|
+
// // let theImage = arImages[i]
|
|
686
|
+
// const arrow = theImage.getAttribute('arrow');
|
|
687
|
+
// if (arrow) {
|
|
688
|
+
// const arrowId = theImage.getAttribute('arrowid');
|
|
689
|
+
// if (arrow != 'none' && arrowId != columnData.config.name) {
|
|
690
|
+
// theImage.setAttribute('arrow', 'none');
|
|
691
|
+
// theImage.src = '';
|
|
692
|
+
// }
|
|
693
|
+
// }
|
|
694
|
+
// }
|
|
695
|
+
// }
|
|
673
696
|
|
|
674
697
|
sortCompare(a, b): number {
|
|
675
698
|
let aValue = a[this.compareRef];
|
|
@@ -689,18 +712,18 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
689
712
|
|
|
690
713
|
switch (this.arrowDirection) {
|
|
691
714
|
case 'up':
|
|
692
|
-
if (aValue < bValue) {
|
|
715
|
+
if (!aValue || aValue < bValue) {
|
|
693
716
|
return -1;
|
|
694
717
|
}
|
|
695
|
-
if (aValue > bValue) {
|
|
718
|
+
if (!bValue || aValue > bValue) {
|
|
696
719
|
return 1;
|
|
697
720
|
}
|
|
698
721
|
break;
|
|
699
722
|
case 'down':
|
|
700
|
-
if (aValue > bValue) {
|
|
723
|
+
if (!bValue || aValue > bValue) {
|
|
701
724
|
return -1;
|
|
702
725
|
}
|
|
703
|
-
if (aValue < bValue) {
|
|
726
|
+
if (!aValue || aValue < bValue) {
|
|
704
727
|
return 1;
|
|
705
728
|
}
|
|
706
729
|
break;
|
|
@@ -953,7 +976,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
953
976
|
|
|
954
977
|
filterDataWithDate(item, filterObj, filterValue) {
|
|
955
978
|
let bKeep;
|
|
956
|
-
let value = item[filterObj.ref] != null
|
|
979
|
+
let value = item[filterObj.ref] != null || item[filterObj.ref] != '' ? getSeconds(item[filterObj.ref]) : null;
|
|
957
980
|
filterValue = filterObj.containsFilterValue != null && filterObj.containsFilterValue != '' ? getSeconds(filterObj.containsFilterValue) : null;
|
|
958
981
|
|
|
959
982
|
switch (filterObj.containsFilter) {
|
|
@@ -1372,6 +1395,11 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
1372
1395
|
return listFields;
|
|
1373
1396
|
}
|
|
1374
1397
|
|
|
1398
|
+
getResultsText() {
|
|
1399
|
+
const recordsCount = this.repeatList$?.paginator?.length || 0;
|
|
1400
|
+
return `${recordsCount || 0} result${recordsCount > 1 ? 's' : ''}`;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1375
1403
|
getField(fieldDefs, columnId) {
|
|
1376
1404
|
const fieldsMap = this.getFieldsMap(fieldDefs);
|
|
1377
1405
|
return fieldsMap.get(columnId);
|
|
@@ -3,7 +3,7 @@ import { getContext, readContextResponse } from './utils';
|
|
|
3
3
|
// Remove this and use "real" PCore type once .d.ts is fixed (currently shows 1 error)
|
|
4
4
|
declare const PCore: any;
|
|
5
5
|
|
|
6
|
-
export function
|
|
6
|
+
export function init(props) {
|
|
7
7
|
const {
|
|
8
8
|
referenceList,
|
|
9
9
|
pConn$,
|
|
@@ -25,7 +25,6 @@ export function useInit(props) {
|
|
|
25
25
|
let selectionCountThreshold;
|
|
26
26
|
|
|
27
27
|
// promise to fetch metadata
|
|
28
|
-
// @ts-ignore - 3rd parameter "associationFilter" should be optional for getDataViewMetadata method
|
|
29
28
|
const metaDataPromise = PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, showDynamicFields);
|
|
30
29
|
|
|
31
30
|
const promisesArray = [metaDataPromise];
|
|
@@ -2,6 +2,7 @@ import { Component, OnInit, Input, forwardRef, OnChanges, SimpleChanges } from '
|
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
4
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
5
|
+
import { FormTemplateBase } from '@pega/angular-sdk-components';
|
|
5
6
|
|
|
6
7
|
@Component({
|
|
7
8
|
selector: 'app-one-column',
|
|
@@ -10,8 +11,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
|
10
11
|
standalone: true,
|
|
11
12
|
imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
|
|
12
13
|
})
|
|
13
|
-
export class OneColumnComponent implements OnInit, OnChanges {
|
|
14
|
-
@Input() pConn$: typeof PConnect;
|
|
14
|
+
export class OneColumnComponent extends FormTemplateBase implements OnInit, OnChanges {
|
|
15
|
+
@Input() override pConn$: typeof PConnect;
|
|
15
16
|
@Input() formGroup$: FormGroup;
|
|
16
17
|
|
|
17
18
|
arChildren$: any[];
|
|
@@ -29,6 +30,6 @@ export class OneColumnComponent implements OnInit, OnChanges {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
updateSelf() {
|
|
32
|
-
this.arChildren$ = this.pConn$.getChildren()
|
|
33
|
+
this.arChildren$ = this.pConn$.getChildren();
|
|
33
34
|
}
|
|
34
35
|
}
|
|
@@ -34,7 +34,7 @@ export class PageComponent implements OnInit, OnDestroy {
|
|
|
34
34
|
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
35
35
|
|
|
36
36
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as PageProps;
|
|
37
|
-
this.arChildren$ = this.pConn$.getChildren()
|
|
37
|
+
this.arChildren$ = this.pConn$.getChildren();
|
|
38
38
|
|
|
39
39
|
this.title$ = this.configProps$.title;
|
|
40
40
|
const operator = this.configProps$.operator;
|
|
@@ -81,7 +81,7 @@ export class PromotedFiltersComponent implements OnInit, OnDestroy {
|
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
const filtersWithClassID = { ...this.filtersProperties, classID: this.pageClass };
|
|
84
|
-
this.transientItemID =
|
|
84
|
+
this.transientItemID = this.pConn$.getContainerManager().addTransientItem({ id: this.viewName, data: filtersWithClassID });
|
|
85
85
|
this.processedFilters = [];
|
|
86
86
|
this.filters.forEach(filter => {
|
|
87
87
|
const filterClone = { ...filter };
|
|
@@ -41,8 +41,7 @@ export class RepeatingStructuresComponent implements OnInit, AfterViewInit {
|
|
|
41
41
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());
|
|
42
42
|
this.fields$ = this.initializeColumns(componentConfig.fields);
|
|
43
43
|
|
|
44
|
-
const refList = this.configProps$.referenceList;
|
|
45
|
-
// @ts-ignore - second parameter pageReference for getValue method should be optional
|
|
44
|
+
const refList: any = this.configProps$.referenceList;
|
|
46
45
|
const tableDataResults = JSON.parse(JSON.stringify(this.pConn$.getValue(refList)));
|
|
47
46
|
|
|
48
47
|
// update elements like date format
|
|
@@ -108,7 +107,7 @@ export class RepeatingStructuresComponent implements OnInit, AfterViewInit {
|
|
|
108
107
|
openAssignment(row) {
|
|
109
108
|
const { pxRefObjectClass, pzInsKey } = row;
|
|
110
109
|
const sTarget = this.pConn$.getContainerName();
|
|
111
|
-
const options
|
|
110
|
+
const options = { containerName: sTarget };
|
|
112
111
|
this.pConn$
|
|
113
112
|
.getActionsApi()
|
|
114
113
|
.openAssignment(pzInsKey, pxRefObjectClass, options)
|
|
@@ -87,10 +87,8 @@ export class SimpleTableComponent implements OnInit, OnDestroy {
|
|
|
87
87
|
const { multiRecordDisplayAs } = this.configProps$;
|
|
88
88
|
let { contextClass } = this.configProps$;
|
|
89
89
|
if (!contextClass) {
|
|
90
|
-
// @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'
|
|
91
90
|
let listName = this.pConn$.getComponentConfig().referenceList;
|
|
92
91
|
listName = PCore.getAnnotationUtils().getPropertyName(listName);
|
|
93
|
-
// @ts-ignore - Property 'getFieldMetadata' is private and only accessible within class 'C11nEnv'
|
|
94
92
|
contextClass = this.pConn$.getFieldMetadata(listName)?.pageClass;
|
|
95
93
|
}
|
|
96
94
|
if (multiRecordDisplayAs === 'fieldGroup') {
|
|
@@ -130,7 +130,7 @@ export const buildFieldsForTable = (configFields, fields, showDeleteButton) => {
|
|
|
130
130
|
type: 'text',
|
|
131
131
|
label: fields[index].config.label || fields[index].config.caption,
|
|
132
132
|
fillAvailableSpace: !!field.config.fillAvailableSpace,
|
|
133
|
-
id: index
|
|
133
|
+
id: `${index}`,
|
|
134
134
|
name: field.config.value.substr(4),
|
|
135
135
|
cellRenderer: TABLE_CELL,
|
|
136
136
|
sort: false,
|
|
@@ -190,7 +190,7 @@ export const createMetaForTable = (fields, renderMode) => {
|
|
|
190
190
|
|
|
191
191
|
export const filterDataByDate = (item, filterObj) => {
|
|
192
192
|
let bKeep;
|
|
193
|
-
let value = item[filterObj.ref] != null
|
|
193
|
+
let value = item[filterObj.ref] != null || item[filterObj.ref] != '' ? getSeconds(item[filterObj.ref]) : null;
|
|
194
194
|
let filterValue = filterObj.containsFilterValue != null && filterObj.containsFilterValue != '' ? getSeconds(filterObj.containsFilterValue) : null;
|
|
195
195
|
|
|
196
196
|
switch (filterObj.containsFilter) {
|