@pega/angular-sdk-overrides 0.25.9 → 0.25.11

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.
@@ -12,7 +12,9 @@
12
12
  <div [formGroup]="formGroup$" *ngIf="bVisible$">
13
13
  <div class="mat-form-field-infix" *ngIf="showLabel$">
14
14
  <span>
15
- <label class="mat-form-field-label psdk-label-readonly">{{ label$ }}</label>
15
+ <label class="mat-form-field-label psdk-label-readonly" [ngClass]="{ 'label-required': bRequired$ && selectionMode === 'multi' }">{{
16
+ label$
17
+ }}</label>
16
18
  </span>
17
19
  </div>
18
20
  <div *ngIf="selectionMode === 'multi'; else single">
@@ -38,11 +40,11 @@
38
40
  [formControl]="fieldControl"
39
41
  (change)="fieldOnChange($event)"
40
42
  (blur)="fieldOnBlur($event)"
41
- >{{ caption$ }}</mat-checkbox
43
+ ><span [ngClass]="{ 'label-required': bRequired$ }">{{ caption$ }}</span></mat-checkbox
42
44
  >
43
45
  <p *ngIf="helperText">{{ helperText }}</p>
44
46
  </ng-template>
45
- <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
47
+ <mat-error *ngIf="fieldControl.invalid && (fieldControl.touched || fieldControl.dirty)">{{ getErrorMessage() }}</mat-error>
46
48
  </div>
47
49
  </div>
48
50
  </ng-template>
@@ -34,3 +34,9 @@ mat-checkbox {
34
34
  .mat-mdc-option {
35
35
  margin-left: -16px;
36
36
  }
37
+
38
+ .label-required::after {
39
+ display: inline;
40
+ content: ' *';
41
+ vertical-align: top;
42
+ }
@@ -18,7 +18,7 @@
18
18
  />
19
19
  <mat-datepicker-toggle matSuffix [owlDateTimeTrigger]="dtPicker"></mat-datepicker-toggle>
20
20
  <owl-date-time #dtPicker [disabled]="bDisabled$" [scrollStrategy]="scrollStrategy"></owl-date-time>
21
- <mat-error *ngIf="fieldControl?.invalid">{{ getErrorMessage() }}</mat-error>
21
+ <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
22
22
  </mat-form-field>
23
23
  </div>
24
24
  </div>
@@ -9,6 +9,7 @@
9
9
  [formControl]="fieldControl"
10
10
  [required]="bRequired$"
11
11
  [matAutocomplete]="auto"
12
+ [readonly]="bReadonly$"
12
13
  [attr.data-test-id]="testId"
13
14
  (blur)="fieldOnBlur()"
14
15
  />
@@ -4,7 +4,7 @@
4
4
  <ng-template #noDisplayMode>
5
5
  <div *ngIf="bHasForm$ && bVisible$; else noEdit">
6
6
  <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText" floatLabel="always">
7
- <mat-tel-input
7
+ <ngx-mat-input-tel
8
8
  [attr.data-test-id]="testId"
9
9
  [formControl]="fieldControl"
10
10
  [preferredCountries]="preferredCountries"
@@ -16,7 +16,7 @@
16
16
  (change)="fieldOnChange()"
17
17
  (blur)="fieldOnBlur()"
18
18
  >
19
- </mat-tel-input>
19
+ </ngx-mat-input-tel>
20
20
  <mat-label>{{ label$ }}</mat-label>
21
21
  <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
22
22
  </mat-form-field>
@@ -2,7 +2,7 @@ import { Component, forwardRef } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { ReactiveFormsModule } from '@angular/forms';
4
4
  import { MatFormFieldModule } from '@angular/material/form-field';
5
- import { MatTelInput } from 'mat-tel-input';
5
+ import { NgxMatInputTelComponent } from 'ngx-mat-input-tel';
6
6
  import { parsePhoneNumberFromString } from 'libphonenumber-js';
7
7
 
8
8
  import { FieldBase } from '@pega/angular-sdk-components';
@@ -18,7 +18,7 @@ interface PhoneProps extends PConnFieldProps {
18
18
  selector: 'app-phone',
19
19
  templateUrl: './phone.component.html',
20
20
  styleUrls: ['./phone.component.scss'],
21
- imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatTelInput, forwardRef(() => ComponentMapperComponent)]
21
+ imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, NgxMatInputTelComponent, forwardRef(() => ComponentMapperComponent)]
22
22
  })
23
23
  export class PhoneComponent extends FieldBase {
24
24
  configProps$: PhoneProps;
@@ -2,7 +2,7 @@
2
2
  <div *ngIf="!bShowConfirm">
3
3
  <div *ngIf="!todo_showTodo$">
4
4
  <h2 *ngIf="!isMultiStep">{{ containerName$ }}</h2>
5
- <div *ngIf="banners?.length">
5
+ <div *ngIf="banners.length">
6
6
  <component-mapper name="AlertBanner" [props]="{ banners }"></component-mapper>
7
7
  </div>
8
8
  </div>
@@ -11,9 +11,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
11
11
  import { FlowContainerBaseComponent } from '@pega/angular-sdk-components';
12
12
 
13
13
  /**
14
- * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
15
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
16
- * is totally at your own risk.
14
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
15
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
17
16
  */
18
17
 
19
18
  interface FlowContainerProps {
@@ -66,7 +65,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
66
65
  localizedVal: any;
67
66
  localeCategory = 'Messages';
68
67
  localeReference: any;
69
- banners: any[];
68
+ banners: any[] = [];
70
69
  // itemKey: string = ""; // JA - this is what Nebula/Constellation uses to pass to finishAssignment, navigateToStep
71
70
 
72
71
  pConnectOfActiveContainerItem;
@@ -3,9 +3,8 @@ import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
 
5
5
  /**
6
- * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
7
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
8
- * is totally at your own risk.
6
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
7
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
9
8
  */
10
9
 
11
10
  // Right this is a skeleton, as Hybrid ViewContainer hasn't been implemented
@@ -9,9 +9,8 @@ import { getBanners } from '@pega/angular-sdk-components';
9
9
  import { ReferenceComponent } from '@pega/angular-sdk-components';
10
10
 
11
11
  /**
12
- * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
13
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
14
- * is totally at your own risk.
12
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
13
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
15
14
  */
16
15
 
17
16
  @Component({
@@ -1,9 +1,8 @@
1
1
  import { Component, OnInit, Input } from '@angular/core';
2
2
 
3
3
  /**
4
- * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
5
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
6
- * is totally at your own risk.
4
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
5
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
7
6
  */
8
7
 
9
8
  // Right this is a skeleton, as Preview hasn't been implemented
@@ -8,9 +8,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
8
8
  import { configureBrowserBookmark } from './helper';
9
9
 
10
10
  /**
11
- * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
12
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
13
- * is totally at your own risk.
11
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
12
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
14
13
  */
15
14
 
16
15
  interface ViewContainerProps {
@@ -6,9 +6,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
6
6
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
7
7
 
8
8
  /**
9
- * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
10
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
11
- * is totally at your own risk.
9
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
10
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
12
11
  */
13
12
 
14
13
  @Component({
@@ -1,9 +1,8 @@
1
1
  import { Component } from '@angular/core';
2
2
 
3
3
  /**
4
- * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
5
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
6
- * is totally at your own risk.
4
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
5
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
7
6
  */
8
7
 
9
8
  @Component({
@@ -11,9 +11,8 @@ import { ModalViewContainerComponent } from '@pega/angular-sdk-components';
11
11
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
12
12
 
13
13
  /**
14
- * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
15
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
16
- * is totally at your own risk.
14
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
15
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
17
16
  */
18
17
 
19
18
  const options = { context: 'app' };
@@ -24,9 +24,8 @@ function isDetailsTemplate(template) {
24
24
  }
25
25
 
26
26
  /**
27
- * WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
28
- * Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
29
- * is totally at your own risk.
27
+ * WARNING: This file is part of the infrastructure component responsible for working with Redux and managing the creation and update of Redux containers and PConnect.
28
+ * You may override Material components within this component if needed, but do not modify any container-related logic. Changing this logic can lead to unexpected behavior.
30
29
  */
31
30
 
32
31
  /**
@@ -176,7 +176,7 @@
176
176
  <tr mat-header-row *matHeaderRowDef="displayedColumns$"></tr>
177
177
  <tr mat-row *matRowDef="let row; columns: displayedColumns$"></tr>
178
178
  </table>
179
- <div *ngIf="repeatListData?.length === 0">
179
+ <div *ngIf="repeatListData.length === 0">
180
180
  <table id="list-view" mat-table [dataSource]="[]">
181
181
  <!-- Define columns for headers -->
182
182
  <ng-container *ngFor="let col of displayedColumns$" [matColumnDef]="col">
@@ -189,7 +189,7 @@
189
189
  <tr mat-header-row *matHeaderRowDef="displayedColumns$"></tr>
190
190
  </table>
191
191
  </div>
192
- <div class="psdk-no-records" *ngIf="repeatListData?.length === 0">
192
+ <div class="psdk-no-records" *ngIf="repeatListData.length === 0">
193
193
  {{ utils.getGenericFieldsLocalizedValue('COSMOSFIELDS.lists', 'No records found.') }}
194
194
  </div>
195
195
  </div>
@@ -1,4 +1,4 @@
1
1
  <div>
2
2
  <h3 style="font-weight: bold; margin: 0">{{ label }}</h3>
3
- <component-mapper name="SimpleTable" [props]="{ pConn$ }"></component-mapper>
3
+ <component-mapper name="SimpleTable" [props]="{ pConn$: newPConn.getPConnect() }"></component-mapper>
4
4
  </div>
@@ -4,6 +4,8 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
4
4
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
5
5
 
6
6
  interface MultiReferenceReadOnlyProps {
7
+ readonlyContextList: string;
8
+ referenceList: string;
7
9
  label: string;
8
10
  hideLabel: boolean;
9
11
  }
@@ -21,6 +23,7 @@ export class MultiReferenceReadonlyComponent implements OnInit, OnDestroy {
21
23
  angularPConnectData: AngularPConnectData = {};
22
24
  configProps$: MultiReferenceReadOnlyProps;
23
25
  label: string;
26
+ newPConn: any;
24
27
 
25
28
  constructor(private angularPConnect: AngularPConnectService) {}
26
29
 
@@ -49,5 +52,29 @@ export class MultiReferenceReadonlyComponent implements OnInit, OnDestroy {
49
52
  updateSelf() {
50
53
  this.configProps$ = this.pConn$.getConfigProps() as MultiReferenceReadOnlyProps;
51
54
  this.label = this.configProps$.label;
55
+
56
+ const config = (this.pConn$.getMetadata() as any)?.config;
57
+ const { referenceList, readonlyContextList } = config;
58
+ let readonlyContextObject;
59
+ if (!PCore.getAnnotationUtils().isProperty(referenceList)) {
60
+ readonlyContextObject = {
61
+ referenceList: readonlyContextList
62
+ };
63
+ }
64
+ const hideLabel = this.configProps$.hideLabel ?? false;
65
+ this.newPConn = this.pConn$.createComponent(
66
+ {
67
+ type: 'SimpleTable',
68
+ config: {
69
+ ...config,
70
+ ...readonlyContextObject,
71
+ label: this.label,
72
+ hideLabel
73
+ }
74
+ },
75
+ '',
76
+ 0,
77
+ {}
78
+ );
52
79
  }
53
80
  }
@@ -46,7 +46,7 @@ export const getContext = thePConn => {
46
46
  const pageReference = thePConn.getPageReference();
47
47
  const { readonlyContextList, referenceList = readonlyContextList } = thePConn.getStateProps()?.config || thePConn.getStateProps();
48
48
 
49
- const pageReferenceForRows = referenceList.startsWith('.') ? `${pageReference}.${referenceList.substring(1)}` : referenceList;
49
+ const pageReferenceForRows = referenceList?.startsWith('.') ? `${pageReference}.${referenceList?.substring(1)}` : referenceList;
50
50
  const viewName = thePConn.viewName;
51
51
 
52
52
  // removing "caseInfo.content" prefix to avoid setting it as a target while preparing pageInstructions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/angular-sdk-overrides",
3
- "version": "0.25.9",
3
+ "version": "0.25.11",
4
4
  "description": "Angular SDK - Code for overriding components",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"