@pega/angular-sdk-overrides 25.1.13 → 26.1.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.
Files changed (153) hide show
  1. package/lib/designSystemExtension/alert/alert.component.html +4 -1
  2. package/lib/designSystemExtension/alert/alert.component.scss +9 -10
  3. package/lib/designSystemExtension/alert/alert.component.ts +6 -2
  4. package/lib/designSystemExtension/field-group/field-group.component.ts +11 -3
  5. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.html +51 -36
  6. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +12 -0
  7. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +11 -0
  8. package/lib/designSystemExtension/operator/operator.component.html +5 -3
  9. package/lib/designSystemExtension/operator/operator.component.scss +7 -0
  10. package/lib/designSystemExtension/operator/operator.component.ts +2 -1
  11. package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.html +100 -10
  12. package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.scss +141 -1
  13. package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.spec.ts +1 -1
  14. package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.ts +240 -72
  15. package/lib/field/auto-complete/auto-complete.component.html +46 -5
  16. package/lib/field/auto-complete/auto-complete.component.scss +92 -0
  17. package/lib/field/auto-complete/auto-complete.component.ts +350 -23
  18. package/lib/field/cancel-alert/cancel-alert.component.ts +38 -15
  19. package/lib/field/check-box/check-box.component.html +8 -6
  20. package/lib/field/check-box/check-box.component.ts +9 -2
  21. package/lib/field/currency/currency.component.html +2 -1
  22. package/lib/field/currency/currency.component.ts +10 -1
  23. package/lib/field/date/date.component.html +2 -1
  24. package/lib/field/date/date.component.ts +2 -0
  25. package/lib/field/date-time/date-time.component.html +2 -1
  26. package/lib/field/date-time/date-time.component.scss +46 -40
  27. package/lib/field/date-time/date-time.component.ts +29 -0
  28. package/lib/field/decimal/decimal.component.html +2 -1
  29. package/lib/field/decimal/decimal.component.ts +2 -0
  30. package/lib/field/dropdown/dropdown.component.html +4 -1
  31. package/lib/field/dropdown/dropdown.component.ts +18 -19
  32. package/lib/field/email/email.component.html +2 -1
  33. package/lib/field/email/email.component.ts +2 -2
  34. package/lib/field/embedded-data-multi/embedded-data-multi.component.html +3 -0
  35. package/lib/field/embedded-data-multi/embedded-data-multi.component.scss +0 -0
  36. package/lib/field/embedded-data-multi/embedded-data-multi.component.ts +173 -0
  37. package/lib/field/field.base.ts +27 -1
  38. package/lib/field/group/group.component.html +1 -1
  39. package/lib/field/group/group.component.ts +15 -5
  40. package/lib/field/integer/integer.component.html +2 -1
  41. package/lib/field/integer/integer.component.ts +4 -2
  42. package/lib/field/location/location.component.html +2 -1
  43. package/lib/field/location/location.component.ts +3 -1
  44. package/lib/field/multiselect/multiselect.component.html +1 -1
  45. package/lib/field/multiselect/multiselect.component.ts +23 -4
  46. package/lib/field/multiselect/utils.ts +5 -3
  47. package/lib/field/object-reference/object-reference.component.html +30 -15
  48. package/lib/field/object-reference/object-reference.component.ts +818 -94
  49. package/lib/field/percentage/percentage.component.html +2 -1
  50. package/lib/field/percentage/percentage.component.ts +10 -1
  51. package/lib/field/phone/phone.component.html +2 -1
  52. package/lib/field/phone/phone.component.ts +2 -1
  53. package/lib/field/radio-buttons/radio-buttons.component.html +2 -1
  54. package/lib/field/radio-buttons/radio-buttons.component.ts +10 -1
  55. package/lib/field/rich-text/rich-text.component.scss +1 -166
  56. package/lib/field/rich-text/rich-text.component.spec.ts +1 -1
  57. package/lib/field/rich-text/rich-text.component.ts +1 -1
  58. package/lib/field/selectable-card/selectable-card.component.html +1 -0
  59. package/lib/field/selectable-card/selectable-card.component.ts +31 -16
  60. package/lib/field/semantic-link/semantic-link.component.html +1 -1
  61. package/lib/field/semantic-link/semantic-link.component.scss +4 -0
  62. package/lib/field/semantic-link/semantic-link.component.ts +13 -7
  63. package/lib/field/text-area/text-area.component.html +2 -1
  64. package/lib/field/text-area/text-area.component.ts +2 -1
  65. package/lib/field/text-input/text-input.component.html +2 -1
  66. package/lib/field/text-input/text-input.component.ts +2 -1
  67. package/lib/field/time/time.component.html +2 -1
  68. package/lib/field/time/time.component.ts +2 -1
  69. package/lib/field/url/url.component.html +2 -1
  70. package/lib/field/url/url.component.ts +2 -1
  71. package/lib/field/user-reference/user-reference.component.html +4 -2
  72. package/lib/field/user-reference/user-reference.component.ts +11 -6
  73. package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
  74. package/lib/infra/Containers/flow-container/flow-container.component.ts +35 -46
  75. package/lib/infra/Containers/modal-view-container/data-view-action-buttons/data-view-action-buttons.component.html +12 -0
  76. package/lib/infra/Containers/modal-view-container/data-view-action-buttons/data-view-action-buttons.component.spec.ts +130 -0
  77. package/lib/infra/Containers/modal-view-container/data-view-action-buttons/data-view-action-buttons.component.ts +77 -0
  78. package/lib/infra/Containers/modal-view-container/modal-view-container.component.html +35 -8
  79. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +185 -194
  80. package/lib/infra/Containers/view-container/view-container.component.ts +32 -35
  81. package/lib/infra/assignment/assignment.component.html +2 -1
  82. package/lib/infra/assignment/assignment.component.ts +42 -15
  83. package/lib/infra/defer-load/defer-load.component.ts +6 -3
  84. package/lib/infra/multi-step/multi-step.component.html +25 -33
  85. package/lib/infra/multi-step/multi-step.component.scss +67 -125
  86. package/lib/infra/multi-step/multi-step.component.ts +11 -0
  87. package/lib/infra/navbar/navbar.component.ts +33 -36
  88. package/lib/infra/reference/reference.component.ts +1 -2
  89. package/lib/infra/root-container/root-container.component.ts +33 -38
  90. package/lib/infra/view/view.component.ts +21 -40
  91. package/lib/template/advanced-search/advanced-search.component.ts +0 -1
  92. package/lib/template/advanced-search/search-groups/search-groups.component.ts +2 -3
  93. package/lib/template/app-shell/app-shell.component.ts +13 -13
  94. package/lib/template/base/details-template-base.ts +41 -14
  95. package/lib/template/case-summary/case-summary.component.ts +15 -1
  96. package/lib/template/case-view/case-view.component.html +13 -1
  97. package/lib/template/case-view/case-view.component.spec.ts +119 -10
  98. package/lib/template/case-view/case-view.component.ts +52 -3
  99. package/lib/template/data-reference/data-reference.component.ts +2 -4
  100. package/lib/template/data-reference/search-form/search-form.component.html +1 -1
  101. package/lib/template/data-reference/search-form/search-form.component.ts +9 -1
  102. package/lib/template/data-reference/search-form/tabsData.ts +0 -1
  103. package/lib/template/default-form/default-form.component.html +19 -3
  104. package/lib/template/default-form/default-form.component.ts +13 -3
  105. package/lib/template/details/details.component.html +23 -3
  106. package/lib/template/details/details.component.scss +9 -2
  107. package/lib/template/details/details.component.ts +3 -70
  108. package/lib/template/details-narrow-wide/details-narrow-wide.component.html +21 -2
  109. package/lib/template/details-narrow-wide/details-narrow-wide.component.scss +8 -1
  110. package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +3 -39
  111. package/lib/template/details-one-column/details-one-column.component.html +23 -1
  112. package/lib/template/details-one-column/details-one-column.component.scss +14 -0
  113. package/lib/template/details-one-column/details-one-column.component.ts +3 -40
  114. package/lib/template/details-three-column/details-three-column.component.html +21 -2
  115. package/lib/template/details-three-column/details-three-column.component.scss +8 -1
  116. package/lib/template/details-three-column/details-three-column.component.ts +3 -48
  117. package/lib/template/details-two-column/details-two-column.component.html +21 -2
  118. package/lib/template/details-two-column/details-two-column.component.scss +8 -1
  119. package/lib/template/details-two-column/details-two-column.component.ts +3 -46
  120. package/lib/template/details-wide-narrow/details-wide-narrow.component.html +21 -2
  121. package/lib/template/details-wide-narrow/details-wide-narrow.component.scss +8 -1
  122. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +3 -43
  123. package/lib/template/field-group-template/field-group-template.component.ts +19 -6
  124. package/lib/template/field-value-list/field-value-list.component.scss +17 -0
  125. package/lib/template/list-view/list-view.component.ts +47 -11
  126. package/lib/template/self-service-case-view/self-service-case-view.component.html +13 -1
  127. package/lib/template/self-service-case-view/self-service-case-view.component.spec.ts +96 -11
  128. package/lib/template/self-service-case-view/self-service-case-view.component.ts +52 -3
  129. package/lib/template/simple-table/simple-table.component.ts +6 -0
  130. package/lib/template/simple-table-manual/helpers.ts +84 -16
  131. package/lib/template/simple-table-manual/simple-table-manual.component.html +30 -14
  132. package/lib/template/simple-table-manual/simple-table-manual.component.scss +8 -2
  133. package/lib/template/simple-table-manual/simple-table-manual.component.ts +131 -43
  134. package/lib/template/single-reference-readonly/single-reference-readonly.component.html +0 -0
  135. package/lib/template/single-reference-readonly/single-reference-readonly.component.scss +2 -3
  136. package/lib/template/single-reference-readonly/single-reference-readonly.component.ts +7 -8
  137. package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +19 -21
  138. package/lib/widget/attachment/AttachmentUtils.ts +19 -11
  139. package/lib/widget/attachment/attachment.component.html +16 -6
  140. package/lib/widget/attachment/attachment.component.ts +14 -4
  141. package/lib/widget/case-history/case-history.component.ts +6 -2
  142. package/lib/widget/feed-container/feed-container.component.ts +1 -199
  143. package/lib/widget/file-utility/file-utility.component.ts +26 -30
  144. package/lib/widget/todo/todo.component.ts +7 -2
  145. package/package.json +2 -2
  146. package/lib/designSystemExtension/material-details/material-details.component.html +0 -40
  147. package/lib/designSystemExtension/material-details/material-details.component.scss +0 -116
  148. package/lib/designSystemExtension/material-details/material-details.component.spec.ts +0 -24
  149. package/lib/designSystemExtension/material-details/material-details.component.ts +0 -31
  150. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +0 -29
  151. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.scss +0 -34
  152. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.spec.ts +0 -22
  153. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +0 -37
@@ -8,6 +8,7 @@ import { interval } from 'rxjs';
8
8
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
9
9
  import { Utils } from '@pega/angular-sdk-components';
10
10
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
11
+ import { CreateCaseAction, DataObjectAction, DataObjectActions } from '@pega/angular-sdk-components';
11
12
 
12
13
  interface CaseViewProps {
13
14
  // If any, enter additional props that only exist on this component
@@ -45,6 +46,9 @@ export class CaseViewComponent implements OnInit, OnDestroy {
45
46
 
46
47
  arAvailableActions$: any[] = [];
47
48
  arAvailabeProcesses$: any[] = [];
49
+ arDataObjectActions$: DataObjectAction[] = [];
50
+ arCreateCaseActions$: CreateCaseAction[] = [];
51
+ bActionsMenuDisabled$ = true;
48
52
 
49
53
  caseSummaryPConn$: any;
50
54
  currentCaseID = '';
@@ -98,10 +102,31 @@ export class CaseViewComponent implements OnInit, OnDestroy {
98
102
  sessionStorage.setItem('okToInitFlowContainer', 'true');
99
103
  } else {
100
104
  this.updateHeaderAndSummary();
105
+ this.updateCaseActions();
101
106
  }
102
107
  }
103
108
  }
104
109
 
110
+ // React re-reads every action source on each render. Here fullUpdate is gated on a case ID
111
+ // change and so runs once, while actions (and a data object's `dataInfo.actions`) arrive
112
+ // later, so they are all refreshed on every store update instead.
113
+ updateCaseActions() {
114
+ const caseInfo = this.pConn$.getDataObject()?.caseInfo ?? {};
115
+ this.arAvailableActions$ = caseInfo.availableActions ?? [];
116
+ this.arAvailabeProcesses$ = caseInfo.availableProcesses ?? [];
117
+ this.editAction = this.arAvailableActions$.find(action => action.ID === 'pyUpdateCaseDetails');
118
+
119
+ const dataInfoActions: DataObjectActions = this.pConn$.getValue('.actions', 'dataInfo') ?? {};
120
+ this.arDataObjectActions$ = dataInfoActions.availableActions ?? [];
121
+ this.arCreateCaseActions$ = dataInfoActions.availableCreateCaseActions ?? [];
122
+
123
+ this.bActionsMenuDisabled$ =
124
+ this.arAvailableActions$.length === 0 &&
125
+ this.arAvailabeProcesses$.length === 0 &&
126
+ this.arDataObjectActions$.length === 0 &&
127
+ this.arCreateCaseActions$.length === 0;
128
+ }
129
+
105
130
  hasCaseIDChanged(): boolean {
106
131
  if (this.currentCaseID !== this.pConn$.getDataObject().caseInfo.ID) {
107
132
  this.currentCaseID = this.pConn$.getDataObject().caseInfo.ID;
@@ -144,9 +169,8 @@ export class CaseViewComponent implements OnInit, OnDestroy {
144
169
 
145
170
  const caseInfo = this.pConn$.getDataObject().caseInfo;
146
171
  this.currentCaseID = caseInfo.ID;
147
- this.arAvailableActions$ = caseInfo?.availableActions ? caseInfo.availableActions : [];
148
- this.editAction = this.arAvailableActions$.find(action => action.ID === 'pyUpdateCaseDetails');
149
- this.arAvailabeProcesses$ = caseInfo?.availableProcesses ? caseInfo.availableProcesses : [];
172
+
173
+ this.updateCaseActions();
150
174
 
151
175
  this.svgCase$ = this.utils.getImageSrc(this.configProps$.icon, this.utils.getSDKStaticContentUrl());
152
176
 
@@ -218,4 +242,29 @@ export class CaseViewComponent implements OnInit, OnDestroy {
218
242
 
219
243
  openProcessAction(data.ID, { ...data });
220
244
  }
245
+
246
+ _menuDataObjectActionClick(action: DataObjectAction) {
247
+ const actionsAPI = this.pConn$.getActionsApi();
248
+ const openDataObjectAction = actionsAPI.openDataObjectAction.bind(actionsAPI);
249
+ const classID = this.pConn$.getValue('.classID', 'dataInfo.content');
250
+ const dataRecord = this.pConn$.getValue('.content', 'dataInfo');
251
+
252
+ openDataObjectAction(classID, dataRecord, action.ID, this.localizedVal(action.name, '', this.localeKey));
253
+ }
254
+
255
+ _menuCreateCaseActionClick(action: CreateCaseAction) {
256
+ const actionsAPI = this.pConn$.getActionsApi();
257
+ const createWork = actionsAPI.createWork.bind(actionsAPI);
258
+ const { field, inputs } = action.targetDataReferenceField ?? {};
259
+ const startingFields: Record<string, any> = {};
260
+
261
+ // The engine expects the linked values nested under the target reference field.
262
+ if (field) {
263
+ inputs?.forEach(input => {
264
+ startingFields[field] = { ...startingFields[field], [input.linkedField]: this.pConn$.getValue(`.${input.linkedField}`, '') };
265
+ });
266
+ }
267
+
268
+ createWork(action.ID, { startingFields });
269
+ }
221
270
  }
@@ -152,8 +152,7 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
152
152
  this.isDisplayModeEnabled = ['DISPLAY_ONLY', 'STACKED_LARGE_VAL'].includes(displayMode);
153
153
  this.refFieldMetadata = this.pConn$.getFieldMetadata(this.rawViewMetadata?.config?.authorContext);
154
154
  this.pyID = getMappedKey('pyID');
155
- // @ts-ignore
156
- const { allowImplicitRefresh } = PCore.getFieldDefaultUtils().fieldDefaults?.DataReference || {};
155
+ const { allowImplicitRefresh } = PCore.getFieldDefaultUtils().fieldDefaults?.['DataReference'] || {};
157
156
 
158
157
  this.allowImplicitRefresh = allowImplicitRefresh;
159
158
  this.isDDSourceDeferred =
@@ -265,7 +264,7 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
265
264
  if (this.pConn$.getContextName().includes('modal') || this.pConn$.getContextName().includes('workarea')) {
266
265
  if (hasAssociatedViewConfigured || this.allowImplicitRefresh) {
267
266
  const pageReference = this.pConn$.getPageReference();
268
- let pgRef: any = null;
267
+ let pgRef: string;
269
268
  if (pageReference.startsWith('objectInfo')) {
270
269
  pgRef = pageReference.replace('objectInfo.content', '');
271
270
  } else {
@@ -398,7 +397,6 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
398
397
  if (['Dropdown', 'Checkbox', 'RadioButtons'].includes(type) && !config.deferDatasource && config.datasource) {
399
398
  const isCardVariant = config.variant === 'card';
400
399
  const hasParameters = this.rawViewMetadata.config?.parameters;
401
- // @ts-ignore
402
400
  const isDeferDataPageCallEnabled = isCardVariant && hasParameters && !this.firstChildPConnect()?.getSharedDataPageForReferenceList();
403
401
 
404
402
  const useDropDownDataSource = (isCardVariant && (this.dropDownDataSource || isDeferDataPageCallEnabled)) || (!isCardVariant && hasParameters);
@@ -1,5 +1,5 @@
1
1
  <div class="search-form" style="display: flex; flex-direction: column">
2
- <h5>{{ propsToUse.label }}</h5>
2
+ <h3>{{ label$ }}</h3>
3
3
  <div *ngIf="searchCategoriesComp === 'dropdown'">
4
4
  <mat-form-field class="psdk-full-width">
5
5
  <mat-select [value]="currentTabId" (selectionChange)="handleTabClick($event.value)">
@@ -37,6 +37,7 @@ export class SearchFormComponent implements OnInit, OnChanges {
37
37
  @Input() pConn$: typeof PConnect;
38
38
  @Input() formGroup$: FormGroup;
39
39
  @Input() searchSelectCacheKey;
40
+ @Input() type: string;
40
41
 
41
42
  configProps$: any;
42
43
  isInitialized = false;
@@ -47,6 +48,7 @@ export class SearchFormComponent implements OnInit, OnChanges {
47
48
  tabItems: any[] = [];
48
49
  searchCategoriesComp: any;
49
50
  propsToUse: any;
51
+ label$: string;
50
52
  tabData: any = [];
51
53
  tabCountSources: any;
52
54
  deferLoadedTabs: any;
@@ -58,7 +60,13 @@ export class SearchFormComponent implements OnInit, OnChanges {
58
60
  this.isInitialized = true;
59
61
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());
60
62
  this.propsToUse = { ...this.pConn$.getInheritedProps() };
61
- this.deferLoadedTabs = this.pConn$.getChildren()[2];
63
+ this.label$ = this.configProps$?.label || this.propsToUse.label;
64
+ // When called from ObjectReference, pConn$ itself acts as deferLoadedTabs (no children[2])
65
+ if (this.type === 'ObjectReference') {
66
+ this.deferLoadedTabs = { getPConnect: () => this.pConn$ };
67
+ } else {
68
+ this.deferLoadedTabs = this.pConn$.getChildren()[2];
69
+ }
62
70
  const cache: any = PCore.getNavigationUtils().getComponentCache(this.searchSelectCacheKey) ?? {};
63
71
  const { selectedCategory } = cache;
64
72
  const firstTabId = getFirstVisibleTabId(this.deferLoadedTabs, selectedCategory);
@@ -127,7 +127,6 @@ export function getData(deferLoadedTabs, tabCountSources, currentTabId, data) {
127
127
  });
128
128
  } else if (calculatedFieldsWithoutValue.length) {
129
129
  PCore.getViewRuleApi()
130
- // @ts-ignore
131
130
  .getCalculatedFields(
132
131
  pConn.getCaseInfo().getKey(),
133
132
  pConn.getCurrentView(),
@@ -1,6 +1,22 @@
1
- <div *ngIf="instructions" class="psdk-default-form-instruction-text">
2
- <div key="instructions" id="instruction-text" [innerHTML]="instructions"></div>
3
- </div>
1
+ <ng-container *ngIf="instructions && bShowInstructions$">
2
+ <component-mapper
3
+ *ngIf="instructionBannerVariant$; else instructionText"
4
+ name="Alert"
5
+ [props]="{
6
+ message: instructions,
7
+ messageIsHtml: true,
8
+ severity: instructionBannerVariant$,
9
+ hideClose: !bDismissInstructions$
10
+ }"
11
+ [parent]="this"
12
+ [outputEvents]="{ onClose: dismissInstructions }"
13
+ ></component-mapper>
14
+ <ng-template #instructionText>
15
+ <div class="psdk-default-form-instruction-text">
16
+ <div key="instructions" id="instruction-text" [innerHTML]="instructions"></div>
17
+ </div>
18
+ </ng-template>
19
+ </ng-container>
4
20
  <div [className]="divClass$">
5
21
  <div *ngFor="let kid of arChildren$" [ngClass]="{ 'grid-column': kid.getPConnect().getComponentName() === 'reference' }">
6
22
  <component-mapper
@@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
5
5
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
6
- import { TemplateUtils } from '@pega/angular-sdk-components';
6
+ import { InstructionObject, TemplateUtils } from '@pega/angular-sdk-components';
7
7
  import { FormTemplateBase } from '@pega/angular-sdk-components';
8
8
 
9
9
  function areViewsChanged(oldViews: any[], newViews: any[]): boolean {
@@ -20,7 +20,7 @@ function areViewsChanged(oldViews: any[], newViews: any[]): boolean {
20
20
  interface DefaultFormProps {
21
21
  // If any, enter additional props that only exist on this component
22
22
  NumCols: string;
23
- instructions: string;
23
+ instructions?: string | InstructionObject;
24
24
  }
25
25
 
26
26
  @Component({
@@ -38,7 +38,10 @@ export class DefaultFormComponent extends FormTemplateBase implements OnInit, On
38
38
 
39
39
  arChildren$: any[];
40
40
  divClass$: string;
41
- instructions: string;
41
+ instructions: string | undefined;
42
+ instructionBannerVariant$: 'warning' | 'info' | 'success' | undefined;
43
+ bDismissInstructions$ = false;
44
+ bShowInstructions$ = true;
42
45
 
43
46
  constructor(
44
47
  private angularPConnect: AngularPConnectService,
@@ -70,6 +73,9 @@ export class DefaultFormComponent extends FormTemplateBase implements OnInit, On
70
73
  const configProps = this.pConn$.getConfigProps() as DefaultFormProps;
71
74
  const kids = this.pConn$.getChildren();
72
75
  this.instructions = this.templateUtils.getInstructions(this.pConn$, configProps?.instructions);
76
+ const instructionsType = this.templateUtils.getInstructionsType(configProps?.instructions);
77
+ this.instructionBannerVariant$ = instructionsType ? this.templateUtils.mapInstructionsTypeToBannerVariant(instructionsType) : undefined;
78
+ this.bDismissInstructions$ = this.templateUtils.getDismissBanner(configProps?.instructions);
73
79
 
74
80
  const numCols = configProps.NumCols ? configProps.NumCols : '1';
75
81
  switch (numCols) {
@@ -96,4 +102,8 @@ export class DefaultFormComponent extends FormTemplateBase implements OnInit, On
96
102
  this.arChildren$ = children;
97
103
  }
98
104
  }
105
+
106
+ dismissInstructions() {
107
+ this.bShowInstructions$ = false;
108
+ }
99
109
  }
@@ -1,3 +1,23 @@
1
- <div>
2
- <component-mapper name="MaterialDetails" [props]="{ arFields$, arHighlightedFields: highlightedDataArr, layout: 'one-column' }"></component-mapper>
3
- </div>
1
+ <component-mapper
2
+ name="FieldGroup"
3
+ [props]="{ name: propsToUse.showLabel ? propsToUse.label : '', childrenTemplate: detailsContent }"
4
+ ></component-mapper>
5
+
6
+ <ng-template #detailsContent>
7
+ <ng-container *ngIf="showHighlightedData && highlightedDataArr.length > 0">
8
+ <div class="psdk-grid-highlighted">
9
+ <component-mapper
10
+ *ngFor="let field of highlightedDataArr"
11
+ [name]="field.getComponentName()"
12
+ [props]="{ pConn$: field, formGroup$ }"
13
+ ></component-mapper>
14
+ </div>
15
+ </ng-container>
16
+ <div class="psdk-grid-filter-1">
17
+ <component-mapper
18
+ *ngFor="let child of children"
19
+ [name]="child.getPConnect().getComponentName()"
20
+ [props]="{ pConn$: child.getPConnect(), formGroup$ }"
21
+ ></component-mapper>
22
+ </div>
23
+ </ng-template>
@@ -1,7 +1,14 @@
1
- .psdk-grid-filter {
1
+ .psdk-grid-filter-1 {
2
2
  display: grid;
3
- grid-template-columns: repeat(2, minmax(0, 1fr));
3
+ grid-template-columns: repeat(1, minmax(0, 1fr));
4
4
  column-gap: calc(2 * 0.5rem);
5
5
  row-gap: calc(2 * 0.5rem);
6
6
  align-items: start;
7
7
  }
8
+
9
+ .psdk-grid-highlighted {
10
+ display: flex;
11
+ flex-wrap: wrap;
12
+ align-items: flex-start;
13
+ gap: calc(0.5rem) calc(5rem);
14
+ }
@@ -1,4 +1,5 @@
1
1
  import { Component, forwardRef } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
2
3
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
3
4
  import { DetailsTemplateBase } from '@pega/angular-sdk-components';
4
5
 
@@ -6,74 +7,6 @@ import { DetailsTemplateBase } from '@pega/angular-sdk-components';
6
7
  selector: 'app-details',
7
8
  templateUrl: './details.component.html',
8
9
  styleUrls: ['./details.component.scss'],
9
- imports: [forwardRef(() => ComponentMapperComponent)]
10
+ imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
10
11
  })
11
- export class DetailsComponent extends DetailsTemplateBase {
12
- override pConn$: typeof PConnect;
13
-
14
- highlightedDataArr: any[] = [];
15
- showHighlightedData: boolean;
16
- arFields$: any[] = [];
17
-
18
- override updateSelf() {
19
- const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
20
- this.showHighlightedData = rawMetaData?.showHighlightedData;
21
-
22
- if (this.showHighlightedData) {
23
- const highlightedData = rawMetaData?.highlightedData;
24
- this.highlightedDataArr = highlightedData.map(field => {
25
- field.config.displayMode = 'STACKED_LARGE_VAL';
26
-
27
- if (field.config.value === '@P .pyStatusWork') {
28
- field.type = 'TextInput';
29
- field.config.displayAsStatus = true;
30
- }
31
-
32
- return field;
33
- });
34
- }
35
-
36
- const kids = this.pConn$.getChildren() as any[];
37
- for (const kid of kids) {
38
- this.arFields$ = [];
39
- const pKid = kid.getPConnect();
40
- const fields = pKid.getChildren();
41
- fields?.forEach(field => {
42
- const thePConn = field.getPConnect();
43
- const theCompType = thePConn.getComponentName().toLowerCase();
44
- if (theCompType === 'reference' || theCompType === 'group') {
45
- const configProps = thePConn.getConfigProps();
46
- configProps.readOnly = true;
47
- configProps.displayMode = 'DISPLAY_ONLY';
48
- const propToUse = { ...thePConn.getInheritedProps() };
49
- configProps.label = propToUse?.label;
50
- const options = {
51
- context: thePConn.getContextName(),
52
- pageReference: thePConn.getPageReference(),
53
- referenceList: thePConn.getReferenceList()
54
- };
55
- const viewContConfig = {
56
- meta: {
57
- ...thePConn.getMetadata(),
58
- type: theCompType,
59
- config: configProps
60
- },
61
- options
62
- };
63
- const theViewCont = PCore.createPConnect(viewContConfig);
64
- const data = {
65
- type: theCompType,
66
- pConn: theViewCont?.getPConnect()
67
- };
68
- this.arFields$.push(data);
69
- } else {
70
- const data = {
71
- type: theCompType,
72
- config: thePConn.getConfigProps()
73
- };
74
- this.arFields$.push(data);
75
- }
76
- });
77
- }
78
- }
79
- }
12
+ export class DetailsComponent extends DetailsTemplateBase {}
@@ -1,4 +1,23 @@
1
1
  <component-mapper
2
- name="MaterialDetails"
3
- [props]="{ arFields$, arFields2$, arHighlightedFields: highlightedDataArr, layout: 'narrow-wide' }"
2
+ name="FieldGroup"
3
+ [props]="{ name: propsToUse.showLabel ? propsToUse.label : '', childrenTemplate: detailsContent }"
4
4
  ></component-mapper>
5
+
6
+ <ng-template #detailsContent>
7
+ <ng-container *ngIf="showHighlightedData && highlightedDataArr.length > 0">
8
+ <div class="psdk-grid-highlighted">
9
+ <component-mapper
10
+ *ngFor="let field of highlightedDataArr"
11
+ [name]="field.getComponentName()"
12
+ [props]="{ pConn$: field, formGroup$ }"
13
+ ></component-mapper>
14
+ </div>
15
+ </ng-container>
16
+ <div class="psdk-grid-filter-narrow-wide">
17
+ <component-mapper
18
+ *ngFor="let child of children"
19
+ [name]="child.getPConnect().getComponentName()"
20
+ [props]="{ pConn$: child.getPConnect(), formGroup$ }"
21
+ ></component-mapper>
22
+ </div>
23
+ </ng-template>
@@ -1,7 +1,14 @@
1
- .psdk-grid-filter {
1
+ .psdk-grid-filter-narrow-wide {
2
2
  display: grid;
3
3
  grid-template-columns: 3fr 7fr;
4
4
  column-gap: calc(2 * 0.5rem);
5
5
  row-gap: calc(2 * 0.5rem);
6
6
  align-items: start;
7
7
  }
8
+
9
+ .psdk-grid-highlighted {
10
+ display: flex;
11
+ flex-wrap: wrap;
12
+ align-items: flex-start;
13
+ gap: calc(0.5rem) calc(5rem);
14
+ }
@@ -1,4 +1,5 @@
1
1
  import { Component, forwardRef } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
2
3
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
3
4
  import { DetailsTemplateBase } from '@pega/angular-sdk-components';
4
5
 
@@ -6,43 +7,6 @@ import { DetailsTemplateBase } from '@pega/angular-sdk-components';
6
7
  selector: 'app-details-narrow-wide',
7
8
  templateUrl: './details-narrow-wide.component.html',
8
9
  styleUrls: ['./details-narrow-wide.component.scss'],
9
- imports: [forwardRef(() => ComponentMapperComponent)]
10
+ imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
10
11
  })
11
- export class DetailsNarrowWideComponent extends DetailsTemplateBase {
12
- override pConn$: typeof PConnect;
13
-
14
- arFields$: any[] = [];
15
- arFields2$: any[] = [];
16
- highlightedDataArr: any[] = [];
17
- showHighlightedData: boolean;
18
-
19
- override updateSelf() {
20
- const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
21
- this.showHighlightedData = rawMetaData?.showHighlightedData;
22
-
23
- if (this.showHighlightedData) {
24
- const highlightedData = rawMetaData?.highlightedData;
25
- this.highlightedDataArr = highlightedData.map(field => {
26
- field.config.displayMode = 'STACKED_LARGE_VAL';
27
-
28
- if (field.config.value === '@P .pyStatusWork') {
29
- field.type = 'TextInput';
30
- field.config.displayAsStatus = true;
31
- }
32
-
33
- return field;
34
- });
35
- }
36
-
37
- const kids = this.pConn$.getChildren() as any[];
38
- for (const kid of kids) {
39
- const pKid = kid.getPConnect();
40
- const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
41
- if (kids.indexOf(kid) == 0) {
42
- this.arFields$ = pKidData.children;
43
- } else {
44
- this.arFields2$ = pKidData.children;
45
- }
46
- }
47
- }
48
- }
12
+ export class DetailsNarrowWideComponent extends DetailsTemplateBase {}
@@ -1 +1,23 @@
1
- <component-mapper name="MaterialDetails" [props]="{ arFields$, arHighlightedFields: highlightedDataArr, layout: 'one-column' }"></component-mapper>
1
+ <component-mapper
2
+ name="FieldGroup"
3
+ [props]="{ name: propsToUse.showLabel ? propsToUse.label : '', childrenTemplate: detailsContent }"
4
+ ></component-mapper>
5
+
6
+ <ng-template #detailsContent>
7
+ <ng-container *ngIf="showHighlightedData && highlightedDataArr.length > 0">
8
+ <div class="psdk-grid-highlighted">
9
+ <component-mapper
10
+ *ngFor="let field of highlightedDataArr"
11
+ [name]="field.getComponentName()"
12
+ [props]="{ pConn$: field, formGroup$ }"
13
+ ></component-mapper>
14
+ </div>
15
+ </ng-container>
16
+ <div class="psdk-grid-filter-1">
17
+ <component-mapper
18
+ *ngFor="let child of children"
19
+ [name]="child.getPConnect().getComponentName()"
20
+ [props]="{ pConn$: child.getPConnect(), formGroup$ }"
21
+ ></component-mapper>
22
+ </div>
23
+ </ng-template>
@@ -0,0 +1,14 @@
1
+ .psdk-grid-filter-1 {
2
+ display: grid;
3
+ grid-template-columns: repeat(1, minmax(0, 1fr));
4
+ column-gap: calc(2 * 0.5rem);
5
+ row-gap: calc(2 * 0.5rem);
6
+ align-items: start;
7
+ }
8
+
9
+ .psdk-grid-highlighted {
10
+ display: flex;
11
+ flex-wrap: wrap;
12
+ align-items: flex-start;
13
+ gap: calc(0.5rem) calc(5rem);
14
+ }
@@ -1,4 +1,5 @@
1
1
  import { Component, forwardRef } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
2
3
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
3
4
  import { DetailsTemplateBase } from '@pega/angular-sdk-components';
4
5
 
@@ -6,44 +7,6 @@ import { DetailsTemplateBase } from '@pega/angular-sdk-components';
6
7
  selector: 'app-details-one-column',
7
8
  templateUrl: './details-one-column.component.html',
8
9
  styleUrls: ['./details-one-column.component.scss'],
9
- imports: [forwardRef(() => ComponentMapperComponent)]
10
+ imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
10
11
  })
11
- export class DetailsOneColumnComponent extends DetailsTemplateBase {
12
- override pConn$: typeof PConnect;
13
-
14
- showHighlightedData: boolean;
15
- highlightedDataArr: any;
16
-
17
- arFields$: any[] = [];
18
-
19
- override updateSelf() {
20
- const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
21
- this.showHighlightedData = rawMetaData?.showHighlightedData;
22
-
23
- if (this.showHighlightedData) {
24
- const highlightedData = rawMetaData?.highlightedData;
25
- this.highlightedDataArr = highlightedData.map(field => {
26
- field.config.displayMode = 'STACKED_LARGE_VAL';
27
-
28
- if (field.config.value === '@P .pyStatusWork') {
29
- field.type = 'TextInput';
30
- field.config.displayAsStatus = true;
31
- }
32
-
33
- return field;
34
- });
35
- }
36
-
37
- this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
38
- this.pConn$.setInheritedProp('readOnly', true);
39
-
40
- const kids = this.pConn$.getChildren() as any[];
41
- for (const kid of kids) {
42
- const pKid = kid.getPConnect();
43
- const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
44
- if (kids.indexOf(kid) == 0) {
45
- this.arFields$ = pKidData.children;
46
- }
47
- }
48
- }
49
- }
12
+ export class DetailsOneColumnComponent extends DetailsTemplateBase {}
@@ -1,4 +1,23 @@
1
1
  <component-mapper
2
- name="MaterialDetails"
3
- [props]="{ arFields$, arFields2$, arFields3$, arHighlightedFields: highlightedDataArr, layout: 'three-column' }"
2
+ name="FieldGroup"
3
+ [props]="{ name: propsToUse.showLabel ? propsToUse.label : '', childrenTemplate: detailsContent }"
4
4
  ></component-mapper>
5
+
6
+ <ng-template #detailsContent>
7
+ <ng-container *ngIf="showHighlightedData && highlightedDataArr.length > 0">
8
+ <div class="psdk-grid-highlighted">
9
+ <component-mapper
10
+ *ngFor="let field of highlightedDataArr"
11
+ [name]="field.getComponentName()"
12
+ [props]="{ pConn$: field, formGroup$ }"
13
+ ></component-mapper>
14
+ </div>
15
+ </ng-container>
16
+ <div class="psdk-grid-filter-3">
17
+ <component-mapper
18
+ *ngFor="let child of children"
19
+ [name]="child.getPConnect().getComponentName()"
20
+ [props]="{ pConn$: child.getPConnect(), formGroup$ }"
21
+ ></component-mapper>
22
+ </div>
23
+ </ng-template>
@@ -1,7 +1,14 @@
1
- .psdk-grid-filter {
1
+ .psdk-grid-filter-3 {
2
2
  display: grid;
3
3
  grid-template-columns: repeat(3, minmax(0, 1fr));
4
4
  column-gap: calc(2 * 0.5rem);
5
5
  row-gap: calc(2 * 0.5rem);
6
6
  align-items: start;
7
7
  }
8
+
9
+ .psdk-grid-highlighted {
10
+ display: flex;
11
+ flex-wrap: wrap;
12
+ align-items: flex-start;
13
+ gap: calc(0.5rem) calc(5rem);
14
+ }
@@ -1,4 +1,5 @@
1
1
  import { Component, forwardRef } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
2
3
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
3
4
  import { DetailsTemplateBase } from '@pega/angular-sdk-components';
4
5
 
@@ -6,52 +7,6 @@ import { DetailsTemplateBase } from '@pega/angular-sdk-components';
6
7
  selector: 'app-details-three-column',
7
8
  templateUrl: './details-three-column.component.html',
8
9
  styleUrls: ['./details-three-column.component.scss'],
9
- imports: [forwardRef(() => ComponentMapperComponent)]
10
+ imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
10
11
  })
11
- export class DetailsThreeColumnComponent extends DetailsTemplateBase {
12
- override pConn$: typeof PConnect;
13
-
14
- showHighlightedData: boolean;
15
- highlightedDataArr: any;
16
-
17
- arFields$: any[] = [];
18
- arFields2$: any[] = [];
19
- arFields3$: any[] = [];
20
-
21
- propsToUse: any = {};
22
-
23
- override updateSelf() {
24
- const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
25
- this.showHighlightedData = rawMetaData?.showHighlightedData;
26
-
27
- if (this.showHighlightedData) {
28
- const highlightedData = rawMetaData?.highlightedData;
29
- this.highlightedDataArr = highlightedData.map(field => {
30
- field.config.displayMode = 'STACKED_LARGE_VAL';
31
-
32
- if (field.config.value === '@P .pyStatusWork') {
33
- field.type = 'TextInput';
34
- field.config.displayAsStatus = true;
35
- }
36
-
37
- return field;
38
- });
39
- }
40
-
41
- this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
42
- this.pConn$.setInheritedProp('readOnly', true);
43
-
44
- const kids = this.pConn$.getChildren() as any[];
45
- for (const kid of kids) {
46
- const pKid = kid.getPConnect();
47
- const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
48
- if (kids.indexOf(kid) == 0) {
49
- this.arFields$ = pKidData.children;
50
- } else if (kids.indexOf(kid) == 1) {
51
- this.arFields2$ = pKidData.children;
52
- } else {
53
- this.arFields3$ = pKidData.children;
54
- }
55
- }
56
- }
57
- }
12
+ export class DetailsThreeColumnComponent extends DetailsTemplateBase {}