@pega/angular-sdk-overrides 0.24.3 → 0.24.4

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,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
  }
@@ -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,8 @@
17
17
  headerText$: todo_headerText$,
18
18
  type$: 'TODO',
19
19
  context$: todo_context$,
20
- itemKey$: itemKey$
20
+ itemKey$: itemKey$,
21
+ isConfirm: true
21
22
  }"
22
23
  ></component-mapper>
23
24
  </div>
@@ -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.4",
4
4
  "description": "Angular SDK - Code for overriding components",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"