@pega/angular-sdk-overrides 0.24.9 → 0.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/lib/designSystemExtension/alert/alert.component.ts +0 -1
  2. package/lib/designSystemExtension/alert-banner/alert-banner.component.ts +1 -2
  3. package/lib/designSystemExtension/banner/banner.component.ts +0 -1
  4. package/lib/designSystemExtension/case-create-stage/case-create-stage.component.ts +1 -2
  5. package/lib/designSystemExtension/field-group/field-group.component.ts +0 -1
  6. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +2 -1
  7. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +0 -2
  8. package/lib/designSystemExtension/material-details/material-details.component.ts +0 -1
  9. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +2 -2
  10. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +10 -2
  11. package/lib/designSystemExtension/material-summary-item/material-summary-item.component.ts +0 -1
  12. package/lib/designSystemExtension/material-summary-list/material-summary-list.component.ts +0 -1
  13. package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.ts +0 -1
  14. package/lib/designSystemExtension/operator/operator.component.html +1 -1
  15. package/lib/designSystemExtension/operator/operator.component.scss +10 -2
  16. package/lib/designSystemExtension/operator/operator.component.ts +5 -5
  17. package/lib/designSystemExtension/pulse/pulse.component.ts +7 -8
  18. package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.ts +0 -1
  19. package/lib/designSystemExtension/wss-quick-create/wss-quick-create.component.ts +0 -1
  20. package/lib/field/auto-complete/auto-complete.component.html +0 -1
  21. package/lib/field/auto-complete/auto-complete.component.ts +31 -16
  22. package/lib/field/cancel-alert/cancel-alert.component.ts +0 -1
  23. package/lib/field/check-box/check-box.component.html +18 -6
  24. package/lib/field/check-box/check-box.component.ts +17 -12
  25. package/lib/field/currency/currency.component.html +4 -4
  26. package/lib/field/currency/currency.component.ts +42 -20
  27. package/lib/field/date/date.component.html +3 -7
  28. package/lib/field/date/date.component.ts +22 -40
  29. package/lib/field/date-time/date-time.component.html +3 -4
  30. package/lib/field/date-time/date-time.component.ts +35 -17
  31. package/lib/field/decimal/decimal.component.html +4 -3
  32. package/lib/field/decimal/decimal.component.ts +47 -22
  33. package/lib/field/dropdown/dropdown.component.html +1 -0
  34. package/lib/field/dropdown/dropdown.component.ts +146 -19
  35. package/lib/field/email/email.component.ts +24 -5
  36. package/lib/field/group/group.component.ts +2 -3
  37. package/lib/field/integer/integer.component.ts +22 -5
  38. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.html +1 -1
  39. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.ts +3 -3
  40. package/lib/field/location/config-ext.json +8 -0
  41. package/lib/field/location/location.component.html +45 -0
  42. package/lib/field/location/location.component.scss +18 -0
  43. package/lib/field/location/location.component.spec.ts +22 -0
  44. package/lib/field/location/location.component.ts +385 -0
  45. package/lib/field/multiselect/multiselect.component.ts +17 -10
  46. package/lib/field/percentage/percentage.component.html +3 -3
  47. package/lib/field/percentage/percentage.component.ts +45 -21
  48. package/lib/field/phone/config-ext.json +1 -1
  49. package/lib/field/phone/phone.component.html +9 -6
  50. package/lib/field/phone/phone.component.scss +9 -0
  51. package/lib/field/phone/phone.component.ts +30 -27
  52. package/lib/field/radio-buttons/radio-buttons.component.html +17 -12
  53. package/lib/field/radio-buttons/radio-buttons.component.ts +13 -10
  54. package/lib/field/rich-text/rich-text.component.ts +19 -9
  55. package/lib/field/scalar-list/scalar-list.component.ts +3 -5
  56. package/lib/field/selectable-card/selectable-card.component.html +40 -0
  57. package/lib/field/selectable-card/selectable-card.component.scss +0 -0
  58. package/lib/field/selectable-card/selectable-card.component.spec.ts +22 -0
  59. package/lib/field/selectable-card/selectable-card.component.ts +255 -0
  60. package/lib/field/semantic-link/semantic-link.component.ts +0 -1
  61. package/lib/field/text/text.component.ts +8 -5
  62. package/lib/field/text-area/text-area.component.html +4 -1
  63. package/lib/field/text-area/text-area.component.ts +22 -6
  64. package/lib/field/text-content/text-content.component.ts +0 -1
  65. package/lib/field/text-input/text-input.component.ts +22 -5
  66. package/lib/field/time/time.component.html +2 -2
  67. package/lib/field/time/time.component.ts +35 -7
  68. package/lib/field/url/url.component.ts +22 -5
  69. package/lib/field/user-reference/user-reference.component.html +40 -46
  70. package/lib/field/user-reference/user-reference.component.ts +111 -21
  71. package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
  72. package/lib/infra/Containers/flow-container/flow-container.component.ts +25 -48
  73. package/lib/infra/Containers/flow-container/helpers.ts +2 -2
  74. package/lib/infra/Containers/hybrid-view-container/hybrid-view-container.component.ts +0 -1
  75. package/lib/infra/Containers/modal-view-container/modal-view-container.component.html +1 -11
  76. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +1 -9
  77. package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +1 -1
  78. package/lib/infra/Containers/view-container/helper.ts +22 -0
  79. package/lib/infra/Containers/view-container/view-container.component.ts +5 -18
  80. package/lib/infra/action-buttons/action-buttons.component.html +1 -1
  81. package/lib/infra/action-buttons/action-buttons.component.ts +0 -1
  82. package/lib/infra/assignment/assignment.component.html +1 -1
  83. package/lib/infra/assignment/assignment.component.ts +82 -41
  84. package/lib/infra/assignment-card/assignment-card.component.html +1 -0
  85. package/lib/infra/assignment-card/assignment-card.component.ts +0 -1
  86. package/lib/infra/dashboard-filter/dashboard-filter.component.ts +0 -1
  87. package/lib/infra/defer-load/defer-load.component.ts +8 -6
  88. package/lib/infra/error-boundary/error-boundary.component.ts +0 -1
  89. package/lib/infra/multi-step/multi-step.component.ts +0 -1
  90. package/lib/infra/navbar/navbar.component.ts +3 -6
  91. package/lib/infra/reference/reference.component.ts +77 -90
  92. package/lib/infra/region/region.component.ts +0 -1
  93. package/lib/infra/root-container/root-container.component.html +2 -15
  94. package/lib/infra/root-container/root-container.component.ts +27 -33
  95. package/lib/infra/stages/stages.component.scss +2 -2
  96. package/lib/infra/stages/stages.component.ts +0 -1
  97. package/lib/infra/view/view.component.html +7 -20
  98. package/lib/infra/view/view.component.ts +20 -3
  99. package/lib/template/app-shell/app-shell.component.ts +20 -3
  100. package/lib/template/banner-page/banner-page.component.ts +0 -1
  101. package/lib/template/base/details-template-base.ts +67 -0
  102. package/lib/template/base/form-template-base.ts +16 -0
  103. package/lib/template/case-summary/case-summary.component.ts +7 -23
  104. package/lib/template/case-view/case-view.component.html +4 -4
  105. package/lib/template/case-view/case-view.component.ts +8 -14
  106. package/lib/template/confirmation/confirmation.component.html +1 -1
  107. package/lib/template/confirmation/confirmation.component.ts +1 -2
  108. package/lib/template/data-reference/data-reference.component.ts +36 -41
  109. package/lib/template/default-form/default-form.component.html +0 -4
  110. package/lib/template/default-form/default-form.component.ts +41 -25
  111. package/lib/template/details/details.component.ts +7 -42
  112. package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +6 -40
  113. package/lib/template/details-one-column/details-one-column.component.ts +7 -43
  114. package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
  115. package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -38
  116. package/lib/template/details-three-column/details-three-column.component.ts +7 -44
  117. package/lib/template/details-two-column/details-two-column.component.ts +8 -45
  118. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +7 -43
  119. package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
  120. package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +8 -4
  121. package/lib/template/field-group-list/field-group-list.component.ts +0 -1
  122. package/lib/template/field-group-template/field-group-template.component.html +7 -7
  123. package/lib/template/field-group-template/field-group-template.component.scss +8 -0
  124. package/lib/template/field-group-template/field-group-template.component.ts +68 -48
  125. package/lib/template/field-value-list/field-value-list.component.html +2 -2
  126. package/lib/template/field-value-list/field-value-list.component.scss +6 -1
  127. package/lib/template/field-value-list/field-value-list.component.ts +0 -1
  128. package/lib/template/inline-dashboard/inline-dashboard.component.ts +0 -1
  129. package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -3
  130. package/lib/template/list-page/list-page.component.ts +0 -1
  131. package/lib/template/list-view/list-view.component.html +6 -1
  132. package/lib/template/list-view/list-view.component.scss +11 -0
  133. package/lib/template/list-view/list-view.component.ts +25 -11
  134. package/lib/template/list-view/listViewHelpers.ts +4 -10
  135. package/lib/template/list-view/utils.ts +2 -5
  136. package/lib/template/multi-reference-readonly/multi-reference-readonly.component.ts +0 -1
  137. package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +1 -2
  138. package/lib/template/one-column/one-column.component.ts +4 -4
  139. package/lib/template/one-column-page/one-column-page.component.ts +0 -1
  140. package/lib/template/one-column-tab/one-column-tab.component.ts +1 -2
  141. package/lib/template/page/page.component.ts +1 -2
  142. package/lib/template/promoted-filters/promoted-filters.component.ts +1 -2
  143. package/lib/template/repeating-structures/repeating-structures.component.ts +1 -2
  144. package/lib/template/simple-table/simple-table.component.ts +0 -1
  145. package/lib/template/simple-table-manual/helpers.ts +126 -10
  146. package/lib/template/simple-table-manual/simple-table-manual.component.html +25 -6
  147. package/lib/template/simple-table-manual/simple-table-manual.component.scss +12 -3
  148. package/lib/template/simple-table-manual/simple-table-manual.component.ts +110 -54
  149. package/lib/template/simple-table-select/simple-table-select.component.ts +3 -4
  150. package/lib/template/single-reference-readonly/single-reference-readonly.component.ts +0 -1
  151. package/lib/template/sub-tabs/sub-tabs.component.ts +0 -1
  152. package/lib/template/three-column/three-column.component.ts +4 -4
  153. package/lib/template/three-column-page/three-column-page.component.ts +0 -1
  154. package/lib/template/two-column/two-column.component.ts +4 -4
  155. package/lib/template/two-column-page/two-column-page.component.ts +0 -1
  156. package/lib/template/two-column-tab/two-column-tab.component.ts +1 -2
  157. package/lib/template/utils.ts +16 -0
  158. package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +4 -4
  159. package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +1 -2
  160. package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +3 -4
  161. package/lib/widget/app-announcement/app-announcement.component.ts +0 -1
  162. package/lib/widget/attachment/attachment.component.ts +9 -13
  163. package/lib/widget/case-history/case-history.component.ts +0 -1
  164. package/lib/widget/feed-container/feed-container.component.ts +7 -10
  165. package/lib/widget/file-utility/file-utility.component.ts +2 -6
  166. package/lib/widget/list-utility/list-utility.component.ts +0 -1
  167. package/lib/widget/quick-create/quick-create.component.ts +0 -1
  168. package/lib/widget/todo/todo.component.html +5 -6
  169. package/lib/widget/todo/todo.component.scss +9 -0
  170. package/lib/widget/todo/todo.component.ts +95 -85
  171. package/lib/widget/utility/utility.component.ts +0 -1
  172. package/package.json +1 -1
@@ -1,20 +1,15 @@
1
- import { Component, OnInit, Input, forwardRef, OnDestroy } from '@angular/core';
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-two-column',
8
7
  templateUrl: './details-two-column.component.html',
9
8
  styleUrls: ['./details-two-column.component.scss'],
10
- standalone: true,
11
9
  imports: [forwardRef(() => ComponentMapperComponent)]
12
10
  })
13
- export class DetailsTwoColumnComponent implements OnInit, OnDestroy {
14
- constructor(private angularPConnect: AngularPConnectService) {}
15
-
16
- @Input() pConn$: typeof PConnect;
17
- @Input() formGroup$: FormGroup;
11
+ export class DetailsTwoColumnComponent extends DetailsTemplateBase {
12
+ override pConn$: typeof PConnect;
18
13
 
19
14
  showHighlightedData: boolean;
20
15
  highlightedDataArr: any;
@@ -25,45 +20,13 @@ export class DetailsTwoColumnComponent implements OnInit, OnDestroy {
25
20
 
26
21
  propsToUse: any = {};
27
22
 
28
- // Used with AngularPConnect
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() {
61
- const rawMetaData: any = this.pConn$.resolveConfigProps((this.pConn$.getRawMetadata() as any).config);
23
+ override updateSelf() {
24
+ const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
62
25
  this.showHighlightedData = rawMetaData?.showHighlightedData;
63
26
 
64
27
  if (this.showHighlightedData) {
65
28
  const highlightedData = rawMetaData?.highlightedData;
66
- this.highlightedDataArr = highlightedData.map(field => {
29
+ this.highlightedDataArr = highlightedData?.map(field => {
67
30
  field.config.displayMode = 'STACKED_LARGE_VAL';
68
31
 
69
32
  if (field.config.value === '@P .pyStatusWork') {
@@ -75,7 +38,7 @@ export class DetailsTwoColumnComponent implements OnInit, OnDestroy {
75
38
  });
76
39
  }
77
40
 
78
- this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
41
+ this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
79
42
  this.pConn$.setInheritedProp('readOnly', true);
80
43
 
81
44
  const kids = this.pConn$.getChildren() as any[];
@@ -1,60 +1,24 @@
1
- import { Component, OnInit, Input, forwardRef, OnDestroy } from '@angular/core';
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',
8
7
  templateUrl: './details-wide-narrow.component.html',
9
8
  styleUrls: ['./details-wide-narrow.component.scss'],
10
- standalone: true,
11
9
  imports: [forwardRef(() => ComponentMapperComponent)]
12
10
  })
13
- export class DetailsWideNarrowComponent implements OnInit, OnDestroy {
14
- constructor(private angularPConnect: AngularPConnectService) {}
15
-
16
- @Input() pConn$: typeof PConnect;
17
- @Input() formGroup$: FormGroup;
11
+ export class DetailsWideNarrowComponent extends DetailsTemplateBase {
12
+ override pConn$: typeof PConnect;
18
13
 
19
14
  highlightedDataArr: any[] = [];
20
15
  showHighlightedData: boolean;
21
16
  arFields$: any[] = [];
22
17
  arFields2$: any[] = [];
23
18
  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
19
 
56
- updateSelf() {
57
- const rawMetaData: any = this.pConn$.resolveConfigProps((this.pConn$.getRawMetadata() as any).config);
20
+ override updateSelf() {
21
+ const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
58
22
  this.showHighlightedData = rawMetaData?.showHighlightedData;
59
23
 
60
24
  if (this.showHighlightedData) {
@@ -71,7 +35,7 @@ export class DetailsWideNarrowComponent implements OnInit, OnDestroy {
71
35
  });
72
36
  }
73
37
 
74
- this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
38
+ this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
75
39
  this.pConn$.setInheritedProp('readOnly', true);
76
40
 
77
41
  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,13 +9,14 @@ 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({
15
17
  selector: 'app-dynamic-tabs',
16
18
  templateUrl: './dynamic-tabs.component.html',
17
19
  styleUrls: ['./dynamic-tabs.component.scss'],
18
- standalone: true,
19
20
  imports: [CommonModule, MatTabsModule, forwardRef(() => ComponentMapperComponent)]
20
21
  })
21
22
  export class DynamicTabsComponent implements OnInit, OnDestroy {
@@ -24,6 +25,7 @@ export class DynamicTabsComponent implements OnInit, OnDestroy {
24
25
 
25
26
  angularPConnectData: AngularPConnectData = {};
26
27
  tabsItems: any[];
28
+ propsToUse: any;
27
29
 
28
30
  constructor(private angularPConnect: AngularPConnectService) {}
29
31
 
@@ -54,15 +56,17 @@ export class DynamicTabsComponent implements OnInit, OnDestroy {
54
56
  }
55
57
 
56
58
  updateSelf() {
57
- const { referenceList } = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as DynamicTabsProps;
59
+ const { referenceList, label, showLabel } = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as DynamicTabsProps;
60
+
61
+ this.propsToUse = { label, showLabel, ...this.pConn$.getInheritedProps() };
58
62
 
59
63
  const { tablabel } = this.pConn$.getComponentConfig();
60
64
  const tablabelProp = PCore.getAnnotationUtils().getPropertyName(tablabel);
61
65
 
62
- this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
66
+ this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
63
67
  this.pConn$.setInheritedProp('readOnly', true);
64
68
 
65
- const referenceListData: any = this.pConn$.getValue(`${referenceList}.pxResults`, ''); // 2nd arg empty string until typedefs properly allow optional
69
+ const referenceListData = this.pConn$.getValue(`${referenceList}.pxResults`, ''); // 2nd arg empty string until typedefs properly allow optional
66
70
 
67
71
  this.tabsItems =
68
72
  referenceListData?.map((item, i) => {
@@ -6,7 +6,6 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
6
6
  selector: 'app-field-group-list',
7
7
  templateUrl: './field-group-list.component.html',
8
8
  styleUrls: ['./field-group-list.component.scss'],
9
- standalone: true,
10
9
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
11
10
  })
12
11
  export class FieldGroupListComponent {
@@ -1,5 +1,5 @@
1
1
  <div id="field-group">
2
- <h3 *ngIf="showLabel$" className="label" style="font-weight: bold">
2
+ <h3 *ngIf="showLabel$" class="field-group-template-header" style="font-weight: bold">
3
3
  {{ label$ }}
4
4
  </h3>
5
5
  <div *ngIf="readonlyMode; else editable">
@@ -11,23 +11,23 @@
11
11
  </div>
12
12
  <ng-template #editable>
13
13
  <div *ngIf="children && children.length > 0">
14
- <div *ngFor="let kid of children; let i = index">
14
+ <div class="field-group-template-item" *ngFor="let child of children; let i = index">
15
15
  <div class="header-div">
16
16
  <div style="width: 80%">
17
- <b>{{ kid.name }}</b>
17
+ <b>{{ child.name }}</b>
18
18
  </div>
19
- <div *ngIf="allowAddEdit !== false" style="width: 20%; text-align: right">
19
+ <div *ngIf="allowDelete && child.allowRowDelete" style="width: 20%; text-align: right">
20
20
  <button id="delete-button" mat-icon-button (click)="deleteFieldGroupItem(i)">
21
21
  <img class="psdk-utility-card-action-svg-icon" src="{{ menuIconOverride$ }}" />
22
22
  </button>
23
23
  </div>
24
24
  </div>
25
25
 
26
- <div *ngIf="kid.children.getPConnect().getRawMetadata().type.toLowerCase() == 'region'">
27
- <component-mapper name="Region" [props]="{ pConn$: kid.children.getPConnect(), formGroup$ }"></component-mapper>
26
+ <div *ngIf="child.children.getPConnect().getRawMetadata().type.toLowerCase() == 'region'">
27
+ <component-mapper name="Region" [props]="{ pConn$: child.children.getPConnect(), formGroup$ }"></component-mapper>
28
28
  </div>
29
29
  </div>
30
- <button *ngIf="allowAddEdit !== false" mat-button color="primary" style="font-size: 16px" (click)="addFieldGroupItem()">+ Add</button>
31
30
  </div>
31
+ <button *ngIf="allowAdd" mat-button color="primary" style="font-size: 16px" (click)="addFieldGroupItem()">{{ getAddBtnLabel() }}</button>
32
32
  </ng-template>
33
33
  </div>
@@ -6,3 +6,11 @@
6
6
  display: flex;
7
7
  align-items: center;
8
8
  }
9
+
10
+ .field-group-template-header {
11
+ margin-left: 0;
12
+ }
13
+
14
+ .field-group-template-item {
15
+ padding-block: 1rem;
16
+ }
@@ -1,4 +1,4 @@
1
- import { Component, OnInit, Input, forwardRef, OnDestroy, OnChanges } from '@angular/core';
1
+ import { Component, OnInit, Input, forwardRef, OnDestroy, OnChanges, AfterViewInit } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
  import { MatButtonModule } from '@angular/material/button';
@@ -6,11 +6,14 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
6
6
  import { buildView, getReferenceList } from '@pega/angular-sdk-components';
7
7
  import { Utils } from '@pega/angular-sdk-components';
8
8
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
9
+ import { evaluateAllowRowAction } from '@pega/angular-sdk-components';
9
10
 
10
11
  interface FieldGroupTemplateProps {
11
12
  // If any, enter additional props that only exist on this component
12
13
  label?: string;
13
- showLabel?: boolean;
14
+ hideLabel?: boolean;
15
+ allowActions?: any;
16
+ allowRowDelete?: any;
14
17
  referenceList?: any[];
15
18
  contextClass: string;
16
19
  renderMode?: string;
@@ -19,35 +22,36 @@ interface FieldGroupTemplateProps {
19
22
  displayMode?: string;
20
23
  fieldHeader?: string;
21
24
  allowTableEdit: boolean;
25
+ targetClassLabel?: string;
22
26
  }
23
27
 
24
28
  @Component({
25
29
  selector: 'app-field-group-template',
26
30
  templateUrl: './field-group-template.component.html',
27
31
  styleUrls: ['./field-group-template.component.scss'],
28
- standalone: true,
29
32
  imports: [CommonModule, MatButtonModule, forwardRef(() => ComponentMapperComponent)]
30
33
  })
31
- export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges {
34
+ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges, AfterViewInit {
32
35
  @Input() configProps$: FieldGroupTemplateProps;
33
36
  @Input() pConn$: typeof PConnect;
34
37
  @Input() formGroup$: FormGroup;
35
38
 
36
39
  angularPConnectData: AngularPConnectData = {};
37
- inheritedProps$: object;
40
+
38
41
  showLabel$?: boolean = true;
39
42
  label$?: string;
40
43
  readonlyMode: boolean;
41
44
  contextClass: any;
42
- referenceList: any;
43
- pageReference: any;
44
45
  heading: any;
45
46
  children: any;
46
47
  menuIconOverride$: any;
47
- prevRefLength: number;
48
- allowAddEdit: boolean;
48
+ referenceListLength: number;
49
49
  fieldHeader: any;
50
50
 
51
+ allowAdd = true;
52
+ allowEdit = true;
53
+ allowDelete = true;
54
+
51
55
  constructor(
52
56
  private angularPConnect: AngularPConnectService,
53
57
  private utils: Utils
@@ -58,9 +62,21 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
58
62
  this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
59
63
  this.updateSelf();
60
64
 
61
- const menuIconOverride$ = 'trash';
62
- if (menuIconOverride$) {
63
- this.menuIconOverride$ = this.utils.getImageSrc(menuIconOverride$, this.utils.getSDKStaticContentUrl());
65
+ this.menuIconOverride$ = this.utils.getImageSrc('trash', this.utils.getSDKStaticContentUrl());
66
+
67
+ const { allowActions, allowTableEdit, referenceList } = this.configProps$;
68
+
69
+ if (allowActions && Object.keys(allowActions).length > 0) {
70
+ this.allowAdd = allowActions.allowAdd ?? allowTableEdit ?? true;
71
+ this.allowEdit = allowActions.allowEdit ?? true;
72
+ this.allowDelete = allowActions.allowDelete ?? allowTableEdit ?? true;
73
+ } else {
74
+ this.allowAdd = allowTableEdit ?? true;
75
+ this.allowDelete = allowTableEdit ?? true;
76
+ }
77
+
78
+ if (referenceList?.length === 0 && (this.allowAdd || this.allowEdit)) {
79
+ this.pConn$.getListActions().insert({ classID: this.contextClass }, referenceList.length);
64
80
  }
65
81
  }
66
82
 
@@ -85,56 +101,57 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
85
101
  const props = changes.configProps$;
86
102
  if (props.currentValue !== props.previousValue) {
87
103
  this.configProps$ = props.currentValue;
104
+
88
105
  if (changes?.pConn$?.currentValue) {
89
106
  this.pConn$ = changes?.pConn$?.currentValue;
90
107
  }
108
+
91
109
  this.updateSelf();
92
110
  }
93
111
  }
94
112
  }
95
113
 
114
+ ngAfterViewInit() {
115
+ const resolvedList = getReferenceList(this.pConn$);
116
+ // @ts-ignore - Expected 3 arguments, but got 1
117
+ this.pConn$.getListActions().initDefaultPageInstructions(resolvedList);
118
+ }
119
+
96
120
  updateSelf() {
97
- this.inheritedProps$ = this.pConn$.getInheritedProps();
98
- this.label$ = this.configProps$.label;
99
- this.showLabel$ = this.configProps$.showLabel;
100
- // label & showLabel within inheritedProps takes precedence over configProps
101
- this.label$ = (this.inheritedProps$ as any).label || this.label$;
102
- this.showLabel$ = (this.inheritedProps$ as any).showLabel || this.showLabel$;
103
-
104
- this.allowAddEdit = this.configProps$.allowTableEdit;
105
-
106
- const renderMode = this.configProps$.renderMode;
107
- const displayMode = this.configProps$.displayMode;
108
- this.readonlyMode = renderMode === 'ReadOnly' || displayMode === 'LABELS_LEFT';
109
- this.contextClass = this.configProps$.contextClass;
110
- const lookForChildInConfig = this.configProps$.lookForChildInConfig;
111
- this.heading = this.configProps$.heading ?? 'Row';
112
- this.fieldHeader = this.configProps$.fieldHeader;
121
+ const inheritedProps: any = this.pConn$.getInheritedProps();
122
+
123
+ const { label, hideLabel, allowRowDelete, referenceList, fieldHeader, renderMode, displayMode, heading, contextClass, lookForChildInConfig } =
124
+ this.configProps$;
125
+
126
+ // label within inheritedProps takes precedence over configProps
127
+ this.label$ = inheritedProps.label || label;
128
+
129
+ this.showLabel$ = referenceList?.length === 0 || !hideLabel;
130
+
131
+ this.readonlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY';
132
+
133
+ this.contextClass = contextClass;
134
+ this.heading = heading ?? 'Row';
135
+ this.fieldHeader = fieldHeader;
136
+
113
137
  const resolvedList = getReferenceList(this.pConn$);
114
- this.pageReference = `${this.pConn$.getPageReference()}${resolvedList}`;
115
138
  this.pConn$.setReferenceList(resolvedList);
139
+
116
140
  if (this.readonlyMode) {
117
- this.pConn$.setInheritedProp('displayMode', 'LABELS_LEFT');
141
+ this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
118
142
  }
119
- this.referenceList = this.configProps$.referenceList;
120
- if (this.prevRefLength != this.referenceList.length) {
121
- // eslint-disable-next-line sonarjs/no-collapsible-if
122
- if (!this.readonlyMode) {
123
- if (this.referenceList?.length === 0 && this.allowAddEdit !== false) {
124
- this.addFieldGroupItem();
125
- }
126
- }
127
- const children: any = [];
128
- this.referenceList?.forEach((item, index) => {
129
- children.push({
143
+
144
+ if (this.referenceListLength != referenceList?.length) {
145
+ this.children = referenceList?.map((item, index) => {
146
+ return {
130
147
  id: index,
131
148
  name: this.fieldHeader === 'propertyRef' ? this.getDynamicHeader(item, index) : this.getStaticHeader(this.heading, index),
132
- children: buildView(this.pConn$, index, lookForChildInConfig)
133
- });
149
+ children: buildView(this.pConn$, index, lookForChildInConfig),
150
+ allowRowDelete: evaluateAllowRowAction(allowRowDelete, item)
151
+ };
134
152
  });
135
- this.children = children;
136
153
  }
137
- this.prevRefLength = this.referenceList.length;
154
+ this.referenceListLength = referenceList?.length || 0;
138
155
  }
139
156
 
140
157
  getStaticHeader = (heading, index) => {
@@ -149,12 +166,15 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
149
166
  };
150
167
 
151
168
  addFieldGroupItem() {
152
- // @ts-ignore - second parameter "pageRef" is optional for insert method
153
- this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceList.length);
169
+ this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceListLength);
154
170
  }
155
171
 
156
172
  deleteFieldGroupItem(index) {
157
- // @ts-ignore - second parameter "pageRef" is optional for deleteEntry method
158
173
  this.pConn$.getListActions().deleteEntry(index);
159
174
  }
175
+
176
+ getAddBtnLabel() {
177
+ const { targetClassLabel } = this.configProps$;
178
+ return targetClassLabel ? `+ Add ${targetClassLabel}` : '+ Add';
179
+ }
160
180
  }
@@ -1,5 +1,5 @@
1
- <div *ngIf="displayMode$ === 'LABELS_LEFT'; else STACKED_LARGE_VAL" class="psdk-container-labels-left">
2
- <div class="psdk-grid-label">{{ label$ }}</div>
1
+ <div *ngIf="displayMode$ === 'DISPLAY_ONLY'; else STACKED_LARGE_VAL" [ngClass]="label$ ? 'psdk-container-labels-left' : 'psdk-container-nolabels'">
2
+ <div *ngIf="label$" 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>
@@ -4,6 +4,11 @@
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;
8
+ }
9
+ .psdk-container-nolabels {
10
+ align-items: start;
11
+ padding-block: 8px;
7
12
  }
8
13
  .psdk-value {
9
14
  margin: 8px 0px;
@@ -14,5 +19,5 @@
14
19
  font-size: 1.25rem;
15
20
  }
16
21
  .psdk-val-labels-left {
17
- margin: 8px 0px;
22
+ white-space: break-spaces;
18
23
  }
@@ -5,7 +5,6 @@ import { Component, Input } from '@angular/core';
5
5
  selector: 'app-field-value-list',
6
6
  templateUrl: './field-value-list.component.html',
7
7
  styleUrls: ['./field-value-list.component.scss'],
8
- standalone: true,
9
8
  imports: [CommonModule]
10
9
  })
11
10
  export class FieldValueListComponent {
@@ -13,7 +13,6 @@ interface InlineDashboardProps {
13
13
  selector: 'app-inline-dashboard',
14
14
  templateUrl: './inline-dashboard.component.html',
15
15
  styleUrls: ['./inline-dashboard.component.scss'],
16
- standalone: true,
17
16
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
18
17
  })
19
18
  export class InlineDashboardComponent {
@@ -15,7 +15,6 @@ interface InlineDashboardPageProps {
15
15
  selector: 'app-inline-dashboard-page',
16
16
  templateUrl: './inline-dashboard-page.component.html',
17
17
  styleUrls: ['./inline-dashboard-page.component.scss'],
18
- standalone: true,
19
18
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
20
19
  })
21
20
  export class InlineDashboardPageComponent implements OnInit, OnChanges {
@@ -45,8 +44,8 @@ export class InlineDashboardPageComponent implements OnInit, OnChanges {
45
44
 
46
45
  updateSelf() {
47
46
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as InlineDashboardPageProps;
48
- const arChildren$ = this.pConn$.getChildren() as any[];
49
- const allFilters = (this.pConn$.getRawMetadata() as any).children[1];
47
+ const arChildren$ = this.pConn$.getChildren();
48
+ const allFilters = this.pConn$.getRawMetadata()?.children[1];
50
49
  const filterComponents = buildFilterComponents(this.pConn$, allFilters);
51
50
  this.inlineProps = this.configProps$;
52
51
  this.children[0] = arChildren$[0];
@@ -5,7 +5,6 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
5
5
  selector: 'app-list-page',
6
6
  templateUrl: './list-page.component.html',
7
7
  styleUrls: ['./list-page.component.scss'],
8
- standalone: true,
9
8
  imports: [forwardRef(() => ComponentMapperComponent)]
10
9
  })
11
10
  export class ListPageComponent {
@@ -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="" />
@@ -177,7 +180,9 @@
177
180
  <tr mat-header-row *matHeaderRowDef="displayedColumns$"></tr>
178
181
  </table>
179
182
  </div>
180
- <div class="psdk-no-records" *ngIf="repeatListData?.length === 0">No Records Found.</div>
183
+ <div class="psdk-no-records" *ngIf="repeatListData?.length === 0">
184
+ {{ utils.getGenericFieldsLocalizedValue('CosmosFields.fields.lists', 'No records found.') }}
185
+ </div>
181
186
  </div>
182
187
  </div>
183
188
  </div>
@@ -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
+ }