@pega/angular-sdk-overrides 0.24.3 → 0.24.5

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.
@@ -2,7 +2,7 @@
2
2
  <dl class="psdk-case-summary-fields-primary">
3
3
  <div *ngFor="let field of primaryFieldsWithStatus$" class="psdk-csf-primary-field">
4
4
  <dt class="psdk-csf-primary-field-header">
5
- {{ field.config.label }}
5
+ {{ field.config?.label }}
6
6
  </dt>
7
7
  <dd *ngIf="field.config.value === ''; else hasValue" class="psdk-csf-primary-field-data">
8
8
  <ng-container [ngSwitch]="field.type.toLowerCase()">
@@ -28,10 +28,10 @@
28
28
  <dl *ngFor="let field of secondaryFields$" class="psdk-case-summary-fields-secondary">
29
29
  <div
30
30
  *ngIf="
31
- field.config?.label?.toLowerCase() == 'create operator' ||
32
- field.displayLabel.toLowerCase() == 'create operator' ||
33
- field.config?.label?.toLowerCase() == 'update operator' ||
34
- field.displayLabel.toLowerCase() == 'update operator';
31
+ field?.config?.label?.toLowerCase() == 'create operator' ||
32
+ field?.displayLabel?.toLowerCase() == 'create operator' ||
33
+ field?.config?.label?.toLowerCase() == 'update operator' ||
34
+ field?.displayLabel?.toLowerCase() == 'update operator';
35
35
  else hasSecondaryValue
36
36
  "
37
37
  >
@@ -40,7 +40,7 @@
40
40
  <ng-template #hasSecondaryValue>
41
41
  <div class="psdk-csf-secondary-field">
42
42
  <dt class="psdk-csf-secondary-field-header">
43
- {{ field.config.displayLabel || field.config.label }}
43
+ {{ field.config?.displayLabel || field.config?.label }}
44
44
  </dt>
45
45
  <dd class="psdk-csf-secondary-field-data">
46
46
  <div [ngSwitch]="field.type">
@@ -193,15 +193,14 @@ export class CheckBoxComponent implements OnInit, OnDestroy {
193
193
  this.bDisabled$ = this.utils.getBooleanValue(this.configProps$.disabled);
194
194
  }
195
195
 
196
- if (this.bDisabled$) {
197
- this.fieldControl.disable();
198
- } else {
199
- this.fieldControl.enable();
200
- }
201
-
202
196
  if (this.configProps$.readOnly != null) {
203
197
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
198
+ }
199
+
200
+ if (this.bDisabled$ || this.bReadonly$) {
204
201
  this.fieldControl.disable();
202
+ } else {
203
+ this.fieldControl.enable();
205
204
  }
206
205
 
207
206
  this.componentReference = (this.pConn$.getStateProps() as any).value;
@@ -2,23 +2,32 @@
2
2
  <component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$, displayMode$ }"></component-mapper>
3
3
  </div>
4
4
  <ng-template #noDisplayMode>
5
- <div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
5
+ <div *ngIf="bHasForm$; else noEdit">
6
6
  <div [formGroup]="formGroup$" *ngIf="bVisible$" class="psdk-currency-field">
7
7
  <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
8
8
  <mat-label>{{ label$ }}</mat-label>
9
9
  <div class="psdk-currency-input">
10
10
  <input
11
- style="margin-left: 5px"
11
+ style="margin-left: 5px; margin-top: -1rem"
12
12
  type="text"
13
13
  matInput
14
14
  currencyMask
15
- [options]="{ prefix: currSym, thousands: currSep, decimal: currDec, align: 'left', nullable: true }"
15
+ [options]="{
16
+ prefix: currSym,
17
+ thousands: currSep,
18
+ decimal: currDec,
19
+ align: 'left',
20
+ nullable: true,
21
+ precision: decimalPrecision,
22
+ inputMode: inputMode
23
+ }"
16
24
  [placeholder]="placeholder"
17
25
  [formControlName]="controlName$"
18
26
  [required]="bRequired$"
19
27
  [formControl]="fieldControl"
20
28
  [attr.data-test-id]="testId"
21
29
  (blur)="fieldOnBlur($event)"
30
+ [readonly]="bReadonly$"
22
31
  />
23
32
  </div>
24
33
  <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
@@ -4,7 +4,7 @@ import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
4
4
  import { MatInputModule } from '@angular/material/input';
5
5
  import { MatFormFieldModule } from '@angular/material/form-field';
6
6
  import { interval } from 'rxjs';
7
- import { NgxCurrencyDirective } from 'ngx-currency';
7
+ import { NgxCurrencyDirective, NgxCurrencyInputMode } from 'ngx-currency';
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';
@@ -15,6 +15,7 @@ import { PConnFieldProps } from '@pega/angular-sdk-components';
15
15
  interface CurrrencyProps extends PConnFieldProps {
16
16
  // If any, enter additional props that only exist on Currency here
17
17
  currencyISOCode?: string;
18
+ allowDecimals: boolean;
18
19
  }
19
20
 
20
21
  @Component({
@@ -52,6 +53,8 @@ export class CurrencyComponent implements OnInit, OnDestroy {
52
53
  currSym: string;
53
54
  currSep: string;
54
55
  currDec: string;
56
+ inputMode: any;
57
+ decimalPrecision: number | undefined;
55
58
 
56
59
  constructor(
57
60
  private angularPConnect: AngularPConnectService,
@@ -116,6 +119,7 @@ export class CurrencyComponent implements OnInit, OnDestroy {
116
119
  this.testId = this.configProps$.testId;
117
120
  this.label$ = this.configProps$.label;
118
121
  this.displayMode$ = this.configProps$.displayMode;
122
+ this.inputMode = NgxCurrencyInputMode.Natural;
119
123
  let nValue: any = this.configProps$.value;
120
124
  if (nValue) {
121
125
  if (typeof nValue === 'string') {
@@ -163,6 +167,8 @@ export class CurrencyComponent implements OnInit, OnDestroy {
163
167
  this.currencyISOCode = this.configProps$.currencyISOCode;
164
168
  }
165
169
 
170
+ this.decimalPrecision = this.configProps$?.allowDecimals ? 2 : 0;
171
+
166
172
  this.componentReference = (this.pConn$.getStateProps() as any).value;
167
173
 
168
174
  // trigger display of error message with field control
@@ -16,6 +16,7 @@
16
16
  decimal: currDec,
17
17
  align: 'left',
18
18
  nullable: true,
19
+ precision: decimalPrecision,
19
20
  inputMode: inputMode
20
21
  }"
21
22
  [placeholder]="placeholder"
@@ -187,6 +187,7 @@ export class DecimalComponent implements OnInit, OnDestroy {
187
187
  } else {
188
188
  this.currSym = '';
189
189
  }
190
+ this.decimalPrecision = this.configProps$?.decimalPrecision ?? 2;
190
191
 
191
192
  this.componentReference = (this.pConn$.getStateProps() as any).value;
192
193
  }
@@ -20,11 +20,10 @@
20
20
  [matAutocomplete]="auto"
21
21
  (input)="fieldOnChange($event)"
22
22
  [matChipInputFor]="chipGrid"
23
- #trigger="matAutocompleteTrigger"
24
23
  />
25
24
  <mat-autocomplete #auto="matAutocomplete">
26
- <mat-option *ngFor="let item of itemsTree" [value]="item.primary" (click)="optionClicked($event, item, trigger)">
27
- <mat-checkbox [checked]="item.selected" (click)="optionClicked($event, item, trigger)">
25
+ <mat-option *ngFor="let item of itemsTree" [value]="item.primary" (click)="optionClicked($event, item)">
26
+ <mat-checkbox [checked]="item.selected" (click)="optionClicked($event, item)">
28
27
  <span>{{ item.primary }}</span>
29
28
  </mat-checkbox>
30
29
  </mat-option>
@@ -1,7 +1,7 @@
1
1
  import { CommonModule } from '@angular/common';
2
2
  import { Component, forwardRef, Input, OnDestroy, OnInit } from '@angular/core';
3
3
  import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
4
- import { MatAutocompleteModule, MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';
4
+ import { MatAutocompleteModule, MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
5
5
  import { MatChipsModule } from '@angular/material/chips';
6
6
  import { MatCheckboxModule } from '@angular/material/checkbox';
7
7
  import { MatOptionModule } from '@angular/material/core';
@@ -273,9 +273,6 @@ export class MultiselectComponent implements OnInit, OnDestroy {
273
273
  selectedRows || []
274
274
  ).then(res => {
275
275
  this.itemsTree = res || [];
276
- if (this.trigger) {
277
- this.trigger.openPanel();
278
- }
279
276
  });
280
277
  });
281
278
  }
@@ -290,14 +287,13 @@ export class MultiselectComponent implements OnInit, OnDestroy {
290
287
  this.angularPConnectData.actions?.onChange(this, event);
291
288
  }
292
289
 
293
- optionClicked = (event: Event, data: any, trigger?: MatAutocompleteTrigger): void => {
290
+ optionClicked = (event: Event, data: any): void => {
294
291
  event.stopPropagation();
295
- this.toggleSelection(data, trigger);
292
+ this.toggleSelection(data);
296
293
  };
297
294
 
298
- toggleSelection = (data: any, trigger?: MatAutocompleteTrigger): void => {
295
+ toggleSelection = (data: any): void => {
299
296
  data.selected = !data.selected;
300
- this.trigger = trigger;
301
297
  this.itemsTree.map((ele: any) => {
302
298
  if (ele.id === data.id) {
303
299
  ele.selected = data.selected;
@@ -2,7 +2,7 @@
2
2
  <component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$, displayMode$ }"></component-mapper>
3
3
  </div>
4
4
  <ng-template #noDisplayMode>
5
- <div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
5
+ <div *ngIf="bHasForm$; else noEdit">
6
6
  <div [formGroup]="formGroup$" *ngIf="bVisible$">
7
7
  <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
8
8
  <mat-label>{{ label$ }}</mat-label>
@@ -10,7 +10,16 @@
10
10
  type="text"
11
11
  matInput
12
12
  currencyMask
13
- [options]="{ prefix: '', suffix: '%', thousands: currSep, decimal: currDec, align: 'left', nullable: true }"
13
+ [options]="{
14
+ prefix: '',
15
+ suffix: '%',
16
+ thousands: currSep,
17
+ decimal: currDec,
18
+ align: 'left',
19
+ nullable: true,
20
+ precision: decimalPrecision,
21
+ inputMode: inputMode
22
+ }"
14
23
  [placeholder]="placeholder"
15
24
  step=".01"
16
25
  [formControlName]="controlName$"
@@ -19,6 +28,7 @@
19
28
  [attr.data-test-id]="testId"
20
29
  (change)="fieldOnChange($event)"
21
30
  (blur)="fieldOnBlur($event)"
31
+ [readonly]="bReadonly$"
22
32
  />
23
33
  <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
24
34
  </mat-form-field>
@@ -4,7 +4,7 @@ import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
4
4
  import { MatInputModule } from '@angular/material/input';
5
5
  import { MatFormFieldModule } from '@angular/material/form-field';
6
6
  import { interval } from 'rxjs';
7
- import { NgxCurrencyDirective } from 'ngx-currency';
7
+ import { NgxCurrencyDirective, NgxCurrencyInputMode } from 'ngx-currency';
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';
@@ -48,6 +48,8 @@ export class PercentageComponent implements OnInit, OnDestroy {
48
48
  placeholder: string;
49
49
  currDec: string;
50
50
  currSep: string;
51
+ inputMode: any;
52
+ decimalPrecision: number | undefined;
51
53
  fieldControl = new FormControl<number | null>(null, null);
52
54
 
53
55
  constructor(
@@ -110,6 +112,7 @@ export class PercentageComponent implements OnInit, OnDestroy {
110
112
  this.testId = this.configProps$.testId;
111
113
  this.label$ = this.configProps$.label;
112
114
  this.displayMode$ = this.configProps$.displayMode;
115
+ this.inputMode = NgxCurrencyInputMode.Natural;
113
116
  let nValue: any = this.configProps$.value;
114
117
  if (nValue) {
115
118
  if (typeof nValue === 'string') {
@@ -152,6 +155,8 @@ export class PercentageComponent implements OnInit, OnDestroy {
152
155
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
153
156
  }
154
157
 
158
+ this.decimalPrecision = this.configProps$?.decimalPrecision ?? 2;
159
+
155
160
  this.componentReference = (this.pConn$.getStateProps() as any).value;
156
161
 
157
162
  // trigger display of error message with field control
@@ -17,7 +17,7 @@
17
17
  headerText$: todo_headerText$,
18
18
  type$: 'TODO',
19
19
  context$: todo_context$,
20
- itemKey$: itemKey$
20
+ isConfirm: true
21
21
  }"
22
22
  ></component-mapper>
23
23
  </div>
@@ -159,7 +159,7 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
159
159
  * The resolution lies in transferring this responsibility to the Reference component, eliminating the need for this code when Reference
160
160
  * component is able to handle it.
161
161
  */
162
- if (this.pConn$.getPageReference().length > 'caseInfo.content'.length) {
162
+ if (!this.configProps$.visibility && this.pConn$.getPageReference().length > 'caseInfo.content'.length) {
163
163
  this.visibility$ = evaluateVisibility(this.pConn$);
164
164
  }
165
165
 
@@ -172,7 +172,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
172
172
  /** If compositeKeys is defined, use dynamic value, else fallback to pyID or pyGUID. */
173
173
  this.compositeKeys = this.configProps$?.compositeKeys;
174
174
  this.rowID = this.compositeKeys && this.compositeKeys?.length === 1 ? this.compositeKeys[0] : defRowID;
175
- this.bShowSearch$ = this.utils.getBooleanValue(this.configProps$.globalSearch ? this.configProps$.globalSearch : this.payload.globalSearch);
175
+ this.bShowSearch$ = this.utils.getBooleanValue(this.configProps$?.globalSearch ? this.configProps$.globalSearch : this.payload?.globalSearch);
176
176
  this.bColumnReorder$ = this.utils.getBooleanValue(this.configProps$.reorderFields);
177
177
  this.bGrouping$ = this.utils.getBooleanValue(this.configProps$.grouping);
178
178
  this.showDynamicFields = this.configProps$?.showDynamicFields;
@@ -960,9 +960,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
960
960
  this.rawFields?.forEach(item => {
961
961
  const referenceListData = getReferenceList(this.pConn$);
962
962
  const isDatapage = referenceListData.startsWith('D_');
963
- const pageReferenceValue = isDatapage
964
- ? `${referenceListData}[${index}]`
965
- : `${this.pConn$.getPageReference()}${referenceListData.substring(referenceListData.lastIndexOf('.'))}[${index}]`;
963
+ const pageReferenceValue = isDatapage ? `${referenceListData}[${index}]` : `${this.pConn$.getPageReference()}${referenceListData}[${index}]`;
966
964
  const config = {
967
965
  meta: item,
968
966
  options: {
@@ -26,7 +26,7 @@
26
26
  </div>
27
27
  </div>
28
28
  </div>
29
- <div class="psdk-todo-assignment-action">
29
+ <div class="psdk-todo-assignment-action" *ngIf="!isConfirm || canPerform">
30
30
  <button mat-flat-button color="primary" (click)="clickGo(assignment)">{{ localizedVal('Go', localeCategory) }}</button>
31
31
  </div>
32
32
  </div>
@@ -48,6 +48,7 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
48
48
  localeCategory = 'Todo';
49
49
  showlessLocalizedValue = this.localizedVal('show_less', 'CosmosFields');
50
50
  showMoreLocalizedValue = this.localizedVal('show_more', 'CosmosFields');
51
+ canPerform: boolean;
51
52
 
52
53
  constructor(
53
54
  private psService: ProgressSpinnerService,
@@ -149,6 +150,8 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
149
150
  }
150
151
  }
151
152
 
153
+ this.canPerform = this.arAssignments$?.[0]?.canPerform === 'true' || this.arAssignments$?.[0]?.canPerform === true;
154
+
152
155
  this.currentUser$ = PCore.getEnvironmentInfo().getOperatorName();
153
156
  this.currentUserInitials$ = this.utils.getInitials(this.currentUser$);
154
157
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/angular-sdk-overrides",
3
- "version": "0.24.3",
3
+ "version": "0.24.5",
4
4
  "description": "Angular SDK - Code for overriding components",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"