@pega/angular-sdk-overrides 0.242.2 → 0.242.3

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 (38) hide show
  1. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +1 -1
  2. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +4 -1
  3. package/lib/field/auto-complete/auto-complete.component.ts +14 -11
  4. package/lib/field/check-box/check-box.component.ts +8 -7
  5. package/lib/field/currency/currency.component.html +1 -1
  6. package/lib/field/currency/currency.component.ts +15 -1
  7. package/lib/field/date/date.component.html +1 -6
  8. package/lib/field/date/date.component.ts +19 -36
  9. package/lib/field/date-time/date-time.component.html +1 -2
  10. package/lib/field/date-time/date-time.component.ts +15 -10
  11. package/lib/field/decimal/decimal.component.ts +2 -2
  12. package/lib/field/dropdown/dropdown.component.ts +9 -10
  13. package/lib/field/email/email.component.ts +13 -3
  14. package/lib/field/integer/integer.component.html +1 -1
  15. package/lib/field/integer/integer.component.ts +12 -4
  16. package/lib/field/multiselect/multiselect.component.ts +11 -3
  17. package/lib/field/percentage/percentage.component.html +3 -2
  18. package/lib/field/percentage/percentage.component.ts +21 -12
  19. package/lib/field/phone/phone.component.html +1 -1
  20. package/lib/field/phone/phone.component.ts +11 -14
  21. package/lib/field/radio-buttons/radio-buttons.component.ts +8 -8
  22. package/lib/field/rich-text/rich-text.component.ts +7 -5
  23. package/lib/field/text/text.component.ts +2 -0
  24. package/lib/field/text-area/text-area.component.html +2 -1
  25. package/lib/field/text-area/text-area.component.ts +12 -5
  26. package/lib/field/text-input/text-input.component.html +1 -1
  27. package/lib/field/text-input/text-input.component.ts +12 -4
  28. package/lib/field/time/time.component.html +2 -2
  29. package/lib/field/time/time.component.ts +20 -6
  30. package/lib/field/url/url.component.html +1 -1
  31. package/lib/field/url/url.component.ts +12 -4
  32. package/lib/field/user-reference/user-reference.component.ts +10 -4
  33. package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
  34. package/lib/infra/Containers/flow-container/flow-container.component.ts +1 -0
  35. package/lib/infra/stages/stages.component.scss +2 -2
  36. package/lib/template/details-two-column/details-two-column.component.ts +1 -1
  37. package/lib/template/field-value-list/field-value-list.component.scss +1 -1
  38. package/package.json +1 -1
@@ -21,7 +21,7 @@
21
21
  <a *ngSwitchCase="'email'" href="mailto: {{ field.config.value }}">{{ _getValue(field.config.value) }}</a>
22
22
  <span *ngSwitchCase="'date'" class="psdk-details-text-style">{{ _formatDate(field.config.value, field.type) }}</span>
23
23
  <span *ngSwitchCase="'caseoperator'"></span>
24
- <span *ngSwitchDefault>{{ _getValue(field.config.value) }}</span>
24
+ <span *ngSwitchDefault>{{ _getValue(field.config.value, field) }}</span>
25
25
  </div>
26
26
  </div>
27
27
  </ng-template>
@@ -16,7 +16,10 @@ export class MaterialDetailsFieldsComponent {
16
16
  @Input() arFields$: any[];
17
17
  @Input() arHighlightedFields: any[];
18
18
 
19
- _getValue(configValue) {
19
+ _getValue(configValue, field: any = {}) {
20
+ if (field?.type === 'userreference') {
21
+ return configValue.userName;
22
+ }
20
23
  if (configValue && configValue != '') {
21
24
  return configValue;
22
25
  }
@@ -2,7 +2,7 @@ import { Component, OnInit, Input, ChangeDetectorRef, forwardRef, OnDestroy } fr
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
4
4
  import { MatOptionModule } from '@angular/material/core';
5
- import { MatAutocompleteModule, MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
5
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
6
6
  import { MatInputModule } from '@angular/material/input';
7
7
  import { MatFormFieldModule } from '@angular/material/form-field';
8
8
  import { interval, Observable } from 'rxjs';
@@ -71,6 +71,8 @@ export class AutoCompleteComponent implements OnInit, OnDestroy {
71
71
  hideLabel: boolean;
72
72
  filteredOptions: Observable<any[]>;
73
73
  filterValue = '';
74
+ actionsApi: Object;
75
+ propName: string;
74
76
 
75
77
  constructor(
76
78
  private angularPConnect: AngularPConnectService,
@@ -102,7 +104,7 @@ export class AutoCompleteComponent implements OnInit, OnDestroy {
102
104
 
103
105
  this.filteredOptions = this.fieldControl.valueChanges.pipe(
104
106
  startWith(''),
105
- map(value => this._filter(value || ''))
107
+ map(value => this._filter((value as string) || ''))
106
108
  );
107
109
  }
108
110
 
@@ -151,6 +153,9 @@ export class AutoCompleteComponent implements OnInit, OnDestroy {
151
153
 
152
154
  this.setPropertyValuesFromProps();
153
155
 
156
+ this.actionsApi = this.pConn$.getActionsApi();
157
+ this.propName = this.pConn$.getStateProps().value;
158
+
154
159
  const context = this.pConn$.getContextName();
155
160
  const { columns, datasource } = this.generateColumnsAndDataSource();
156
161
 
@@ -299,13 +304,14 @@ export class AutoCompleteComponent implements OnInit, OnDestroy {
299
304
  // this works - this.pConn$.setValue( this.componentReference, this.fieldControl.value);
300
305
  // PConnect wants to use changeHandler for onChange
301
306
  // this.angularPConnect.changeHandler( this, event);
302
- this.filterValue = (event.target as HTMLInputElement).value;
303
-
304
- this.angularPConnectData.actions?.onChange(this, event);
307
+ const value = (event.target as HTMLInputElement).value;
308
+ this.filterValue = value;
309
+ handleEvent(this.actionsApi, 'change', this.propName, value);
305
310
  }
306
311
 
307
- optionChanged(event: MatAutocompleteSelectedEvent) {
308
- this.angularPConnectData.actions?.onChange(this, event);
312
+ optionChanged(event: any) {
313
+ const value = event?.option?.value;
314
+ handleEvent(this.actionsApi, 'change', this.propName, value);
309
315
  }
310
316
 
311
317
  fieldOnBlur(event: Event) {
@@ -315,11 +321,8 @@ export class AutoCompleteComponent implements OnInit, OnDestroy {
315
321
  const index = this.options$?.findIndex(element => element.value === el.value);
316
322
  key = index > -1 ? (key = this.options$[index].key) : el.value;
317
323
  }
318
-
319
324
  const value = key;
320
- const actionsApi = this.pConn$?.getActionsApi();
321
- const propName = this.pConn$?.getStateProps().value;
322
- handleEvent(actionsApi, 'changeNblur', propName, value);
325
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
323
326
  if (this.configProps$?.onRecordChange) {
324
327
  el.value = value;
325
328
  this.configProps$.onRecordChange(event);
@@ -69,8 +69,8 @@ export class CheckBoxComponent implements OnInit, OnDestroy {
69
69
  selectedvalues: any;
70
70
  referenceList: string;
71
71
  listOfCheckboxes: any[] = [];
72
- actionsApi: any;
73
- propName: any;
72
+ actionsApi: Object;
73
+ propName: string;
74
74
 
75
75
  fieldControl = new FormControl('', null);
76
76
 
@@ -173,8 +173,8 @@ export class CheckBoxComponent implements OnInit, OnDestroy {
173
173
 
174
174
  this.caption$ = this.configProps$.caption;
175
175
  this.helperText = this.configProps$.helperText;
176
- this.trueLabel$ = this.configProps$.trueLabel;
177
- this.falseLabel$ = this.configProps$.falseLabel;
176
+ this.trueLabel$ = this.configProps$.trueLabel || 'Yes';
177
+ this.falseLabel$ = this.configProps$.falseLabel || 'No';
178
178
 
179
179
  // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
180
180
  setTimeout(() => {
@@ -225,16 +225,17 @@ export class CheckBoxComponent implements OnInit, OnDestroy {
225
225
 
226
226
  fieldOnChange(event: any) {
227
227
  event.value = event.checked;
228
-
229
228
  handleEvent(this.actionsApi, 'changeNblur', this.propName, event.checked);
229
+ this.pConn$.clearErrorMessages({
230
+ property: this.propName
231
+ });
230
232
  }
231
233
 
232
234
  fieldOnBlur(event: any) {
233
235
  if (this.selectionMode === 'multi') {
234
236
  this.pConn$.getValidationApi().validate(this.selectedvalues, this.selectionList);
235
237
  } else {
236
- event.value = event.checked;
237
- this.angularPConnectData.actions?.onBlur(this, event);
238
+ this.pConn$.getValidationApi().validate(event.target.checked);
238
239
  }
239
240
  }
240
241
 
@@ -1,5 +1,5 @@
1
1
  <div *ngIf="displayMode$; else noDisplayMode">
2
- <component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$, displayMode$ }"></component-mapper>
2
+ <component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$: formattedValue, displayMode$ }"></component-mapper>
3
3
  </div>
4
4
  <ng-template #noDisplayMode>
5
5
  <div *ngIf="bHasForm$; else noEdit">
@@ -9,13 +9,15 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
9
9
  import { Utils } from '@pega/angular-sdk-components';
10
10
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
11
11
  import { handleEvent } from '@pega/angular-sdk-components';
12
- import { getCurrencyCharacters } from '@pega/angular-sdk-components';
12
+ import { getCurrencyCharacters, getCurrencyOptions } from '@pega/angular-sdk-components';
13
13
  import { PConnFieldProps } from '@pega/angular-sdk-components';
14
+ import { format } from '@pega/angular-sdk-components';
14
15
 
15
16
  interface CurrrencyProps extends PConnFieldProps {
16
17
  // If any, enter additional props that only exist on Currency here
17
18
  currencyISOCode?: string;
18
19
  allowDecimals: boolean;
20
+ formatter?: string;
19
21
  }
20
22
 
21
23
  @Component({
@@ -55,6 +57,8 @@ export class CurrencyComponent implements OnInit, OnDestroy {
55
57
  currDec: string;
56
58
  inputMode: any;
57
59
  decimalPrecision: number | undefined;
60
+ formattedValue: string;
61
+ formatter;
58
62
 
59
63
  constructor(
60
64
  private angularPConnect: AngularPConnectService,
@@ -135,6 +139,16 @@ export class CurrencyComponent implements OnInit, OnDestroy {
135
139
  this.currSym = theSymbols.theCurrencySymbol;
136
140
  this.currSep = theSymbols.theDigitGroupSeparator;
137
141
  this.currDec = theSymbols.theDecimalIndicator;
142
+ this.formatter = this.configProps$.formatter;
143
+
144
+ if (this.displayMode$ === 'DISPLAY_ONLY' || this.displayMode$ === 'STACKED_LARGE_VAL') {
145
+ const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
146
+ if (this.formatter) {
147
+ this.formattedValue = format(this.value$, this.formatter.toLowerCase(), theCurrencyOptions);
148
+ } else {
149
+ this.formattedValue = format(this.value$, 'currency', theCurrencyOptions);
150
+ }
151
+ }
138
152
 
139
153
  // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
140
154
  setTimeout(() => {
@@ -1,9 +1,5 @@
1
1
  <div *ngIf="displayMode$; else noDisplayMode">
2
- <component-mapper
3
- *ngIf="bVisible$ !== false"
4
- name="FieldValueList"
5
- [props]="{ label$, value$: getFormattedValue(), displayMode$ }"
6
- ></component-mapper>
2
+ <component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$: formattedValue$, displayMode$ }"></component-mapper>
7
3
  </div>
8
4
  <ng-template #noDisplayMode>
9
5
  <div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
@@ -21,7 +17,6 @@
21
17
  [required]="bRequired$"
22
18
  [formControl]="fieldControl"
23
19
  (dateChange)="fieldOnDateChange($event)"
24
- (blur)="fieldOnBlur($event)"
25
20
  />
26
21
  <mat-datepicker-toggle matSuffix [for]="pegadate"></mat-datepicker-toggle>
27
22
  <mat-datepicker #pegadate [startAt]="value$"></mat-datepicker>
@@ -1,4 +1,3 @@
1
- /* eslint-disable max-classes-per-file */
2
1
  import { Component, OnInit, Input, ChangeDetectorRef, forwardRef, Inject, OnDestroy } from '@angular/core';
3
2
  import { CommonModule } from '@angular/common';
4
3
  import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
@@ -15,6 +14,7 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
15
14
  import { dateFormatInfoDefault, getDateFormatInfo } from '@pega/angular-sdk-components';
16
15
  import { PConnFieldProps } from '@pega/angular-sdk-components';
17
16
  import { format } from '@pega/angular-sdk-components';
17
+ import { handleEvent } from '@pega/angular-sdk-components';
18
18
 
19
19
  interface DateProps extends PConnFieldProps {
20
20
  // If any, enter additional props that only exist on Date here
@@ -84,6 +84,9 @@ export class DateComponent implements OnInit, OnDestroy {
84
84
  dateFormatInfo = dateFormatInfoDefault;
85
85
  // and then update, as needed, based on locale, etc.
86
86
  theDateFormat = getDateFormatInfo();
87
+ actionsApi: Object;
88
+ propName: string;
89
+ formattedValue$: any;
87
90
 
88
91
  constructor(
89
92
  private angularPConnect: AngularPConnectService,
@@ -146,27 +149,16 @@ export class DateComponent implements OnInit, OnDestroy {
146
149
  // moved this from ngOnInit() and call this from there instead...
147
150
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as DateProps;
148
151
 
149
- if (this.configProps$.value != undefined) {
150
- let sDateValue: any = '';
151
- sDateValue = this.configProps$.value;
152
-
153
- if (sDateValue != '') {
154
- if (typeof sDateValue === 'object') {
155
- sDateValue = sDateValue.toISOString();
156
- } else if (sDateValue.indexOf('/') < 0) {
157
- // if we have the "pega" format, then for display, convert to standard format (US)
158
- // sDateValue = this.formatDate(sDateValue);
159
- sDateValue = this.utils.generateDate(sDateValue, 'Date-Long-Custom-YYYY');
160
- }
161
- this.value$ = new Date(sDateValue);
162
- }
163
- }
152
+ this.value$ = this.configProps$.value;
164
153
  this.testId = this.configProps$.testId;
165
154
  this.label$ = this.configProps$.label;
166
155
  this.displayMode$ = this.configProps$.displayMode;
167
156
  this.helperText = this.configProps$.helperText;
168
157
  this.placeholder = this.configProps$.placeholder || '';
169
158
 
159
+ this.actionsApi = this.pConn$.getActionsApi();
160
+ this.propName = this.pConn$.getStateProps().value;
161
+
170
162
  // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
171
163
  setTimeout(() => {
172
164
  if (this.configProps$.required != null) {
@@ -175,6 +167,12 @@ export class DateComponent implements OnInit, OnDestroy {
175
167
  this.cdRef.detectChanges();
176
168
  });
177
169
 
170
+ if (this.displayMode$ === 'DISPLAY_ONLY' || this.displayMode$ === 'STACKED_LARGE_VAL') {
171
+ this.formattedValue$ = format(this.value$, 'date', {
172
+ format: this.theDateFormat.dateFormatString
173
+ });
174
+ }
175
+
178
176
  if (this.configProps$.visibility != null) {
179
177
  this.bVisible$ = this.utils.getBooleanValue(this.configProps$.visibility);
180
178
  }
@@ -209,20 +207,11 @@ export class DateComponent implements OnInit, OnDestroy {
209
207
 
210
208
  fieldOnDateChange(event: any) {
211
209
  // this comes from the date pop up
212
- if (typeof event.value === 'object') {
213
- // convert date to pega "date" format
214
- event.value = event.value?.toISOString();
215
- }
216
- this.angularPConnectData.actions?.onChange(this, { value: event.value });
217
- }
218
-
219
- fieldOnBlur(event: any) {
220
- // PConnect wants to use eventHandler for onBlur
221
- if (typeof event.value === 'object') {
222
- // convert date to pega "date" format
223
- event.value = event.value?.toISOString();
224
- }
225
- this.angularPConnectData.actions?.onBlur(this, { value: event.value });
210
+ const value = event?.target?.value.format('YYYY-MM-DD');
211
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
212
+ this.pConn$.clearErrorMessages({
213
+ property: this.propName
214
+ });
226
215
  }
227
216
 
228
217
  hasErrors() {
@@ -243,10 +232,4 @@ export class DateComponent implements OnInit, OnDestroy {
243
232
  }
244
233
  return errMessage;
245
234
  }
246
-
247
- getFormattedValue() {
248
- return format(this.value$, 'date', {
249
- format: this.theDateFormat.dateFormatString
250
- });
251
- }
252
235
  }
@@ -1,5 +1,5 @@
1
1
  <div *ngIf="displayMode$; else noDisplayMode">
2
- <component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$, displayMode$ }"></component-mapper>
2
+ <component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$: formattedValue$, displayMode$ }"></component-mapper>
3
3
  </div>
4
4
  <ng-template #noDisplayMode>
5
5
  <div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
@@ -12,7 +12,6 @@
12
12
  [attr.data-test-id]="testId"
13
13
  [placeholder]="placeholder"
14
14
  [formControl]="fieldControl"
15
- (blur)="fieldOnBlur($event)"
16
15
  (dateTimeChange)="fieldOnDateChange($event)"
17
16
  [value]="value$"
18
17
  [required]="bRequired$"
@@ -11,6 +11,8 @@ import { Utils } from '@pega/angular-sdk-components';
11
11
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
12
12
  import { dateFormatInfoDefault, getDateFormatInfo } from '@pega/angular-sdk-components';
13
13
  import { PConnFieldProps } from '@pega/angular-sdk-components';
14
+ import { handleEvent } from '@pega/angular-sdk-components';
15
+ import { format } from '@pega/angular-sdk-components';
14
16
 
15
17
  interface DateTimeProps extends PConnFieldProps {
16
18
  // If any, enter additional props that only exist on DateTime here
@@ -63,6 +65,9 @@ export class DateTimeComponent implements OnInit, OnDestroy {
63
65
  // and then update, as needed, based on locale, etc.
64
66
  theDateFormat = getDateFormatInfo();
65
67
  placeholder: string;
68
+ actionsApi: Object;
69
+ propName: string;
70
+ formattedValue$: any;
66
71
 
67
72
  constructor(
68
73
  private angularPConnect: AngularPConnectService,
@@ -136,6 +141,12 @@ export class DateTimeComponent implements OnInit, OnDestroy {
136
141
  this.cdRef.detectChanges();
137
142
  });
138
143
 
144
+ if (this.displayMode$ === 'DISPLAY_ONLY' || this.displayMode$ === 'STACKED_LARGE_VAL') {
145
+ this.formattedValue$ = format(this.value$, 'datetime', {
146
+ format: `${this.theDateFormat.dateFormatString} hh:mm a`
147
+ });
148
+ }
149
+
139
150
  if (this.configProps$.visibility != null) {
140
151
  this.bVisible$ = this.utils.getBooleanValue(this.configProps$.visibility);
141
152
  }
@@ -157,6 +168,9 @@ export class DateTimeComponent implements OnInit, OnDestroy {
157
168
 
158
169
  this.componentReference = this.pConn$.getStateProps().value;
159
170
 
171
+ this.actionsApi = this.pConn$.getActionsApi();
172
+ this.propName = this.pConn$.getStateProps().value;
173
+
160
174
  // trigger display of error message with field control
161
175
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
162
176
  const timer = interval(100).subscribe(() => {
@@ -174,16 +188,7 @@ export class DateTimeComponent implements OnInit, OnDestroy {
174
188
  // convert date to pega "date" format
175
189
  event.value = event.value?.toISOString();
176
190
  }
177
- this.angularPConnectData.actions?.onChange(this, { value: event.value });
178
- }
179
-
180
- fieldOnBlur(event: any) {
181
- if (typeof event.value === 'object') {
182
- // convert date to pega "date" format
183
- event.value = event.value?.toISOString();
184
- }
185
-
186
- this.angularPConnectData.actions?.onBlur(this, event);
191
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, event.value);
187
192
  }
188
193
 
189
194
  getErrorMessage() {
@@ -149,10 +149,10 @@ export class DecimalComponent implements OnInit, OnDestroy {
149
149
  const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
150
150
  this.formatter = this.configProps$.formatter;
151
151
 
152
- if (this.formatter === 'Currency') {
152
+ if (this.formatter) {
153
153
  this.formattedValue = format(this.value$, this.formatter.toLowerCase(), theCurrencyOptions);
154
154
  } else {
155
- this.formattedValue = format(this.value$, this.pConn$.getComponentName()?.toLowerCase(), theCurrencyOptions);
155
+ this.formattedValue = format(this.value$, 'decimal', theCurrencyOptions);
156
156
  }
157
157
 
158
158
  // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
@@ -61,6 +61,8 @@ export class DropdownComponent implements OnInit, OnDestroy {
61
61
  localeName = '';
62
62
  localePath = '';
63
63
  localizedValue = '';
64
+ actionsApi: Object;
65
+ propName: string;
64
66
 
65
67
  constructor(
66
68
  private angularPConnect: AngularPConnectService,
@@ -166,9 +168,10 @@ export class DropdownComponent implements OnInit, OnDestroy {
166
168
  this.value$ = 'Select';
167
169
  }
168
170
 
169
- const propName = this.pConn$.getStateProps().value;
171
+ this.actionsApi = this.pConn$.getActionsApi();
172
+ this.propName = this.pConn$.getStateProps().value;
170
173
  const className = this.pConn$.getCaseInfo().getClassName();
171
- const refName = propName?.slice(propName.lastIndexOf('.') + 1);
174
+ const refName = this.propName?.slice(this.propName.lastIndexOf('.') + 1);
172
175
 
173
176
  this.fieldMetadata = this.configProps$.fieldMetadata;
174
177
  const metaData = Array.isArray(this.fieldMetadata) ? this.fieldMetadata.filter(field => field?.classID === className)[0] : this.fieldMetadata;
@@ -204,17 +207,13 @@ export class DropdownComponent implements OnInit, OnDestroy {
204
207
  if (event?.value === 'Select') {
205
208
  event.value = '';
206
209
  }
207
- const actionsApi = this.pConn$?.getActionsApi();
208
- const propName = this.pConn$?.getStateProps().value;
209
- handleEvent(actionsApi, 'changeNblur', propName, event.value);
210
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, event.value);
210
211
  if (this.configProps$?.onRecordChange) {
211
212
  this.configProps$.onRecordChange(event);
212
213
  }
213
- }
214
-
215
- fieldOnBlur(event: any) {
216
- // PConnect wants to use eventHandler for onBlur
217
- this.angularPConnectData.actions?.onBlur(this, event);
214
+ this.pConn$.clearErrorMessages({
215
+ property: this.propName
216
+ });
218
217
  }
219
218
 
220
219
  getLocalizedOptionValue(opt: IOption) {
@@ -8,6 +8,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
10
  import { PConnFieldProps } from '@pega/angular-sdk-components';
11
+ import { handleEvent } from '@pega/angular-sdk-components';
11
12
 
12
13
  interface EmailProps extends PConnFieldProps {
13
14
  // If any, enter additional props that only exist on Email here
@@ -43,6 +44,8 @@ export class EmailComponent implements OnInit, OnDestroy {
43
44
  placeholder: string;
44
45
 
45
46
  fieldControl = new FormControl('', null);
47
+ actionsApi: Object;
48
+ propName: string;
46
49
 
47
50
  constructor(
48
51
  private angularPConnect: AngularPConnectService,
@@ -139,6 +142,9 @@ export class EmailComponent implements OnInit, OnDestroy {
139
142
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
140
143
  }
141
144
 
145
+ this.actionsApi = this.pConn$.getActionsApi();
146
+ this.propName = this.pConn$.getStateProps().value;
147
+
142
148
  this.componentReference = this.pConn$.getStateProps().value;
143
149
 
144
150
  // trigger display of error message with field control
@@ -153,12 +159,16 @@ export class EmailComponent implements OnInit, OnDestroy {
153
159
  }
154
160
 
155
161
  fieldOnChange(event: any) {
156
- this.angularPConnectData.actions?.onChange(this, event);
162
+ const value = event?.target?.value;
163
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
164
+ this.pConn$.clearErrorMessages({
165
+ property: this.propName
166
+ });
157
167
  }
158
168
 
159
169
  fieldOnBlur(event: any) {
160
- // PConnect wants to use eventHandler for onBlur
161
- this.angularPConnectData.actions?.onBlur(this, event);
170
+ const value = event?.target?.value;
171
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
162
172
  }
163
173
 
164
174
  getErrorMessage() {
@@ -15,7 +15,7 @@
15
15
  [required]="bRequired$"
16
16
  [formControl]="fieldControl"
17
17
  [attr.data-test-id]="testId"
18
- (change)="fieldOnChange($event)"
18
+ (change)="fieldOnChange()"
19
19
  (blur)="fieldOnBlur($event)"
20
20
  />
21
21
  <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
@@ -8,6 +8,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
10
  import { PConnFieldProps } from '@pega/angular-sdk-components';
11
+ import { handleEvent } from '@pega/angular-sdk-components';
11
12
 
12
13
  interface IntegerProps extends PConnFieldProps {
13
14
  // If any, enter additional props that only exist on Integer here
@@ -43,6 +44,8 @@ export class IntegerComponent implements OnInit, OnDestroy {
43
44
  placeholder: string;
44
45
 
45
46
  fieldControl = new FormControl<number | null>(null, null);
47
+ actionsApi: Object;
48
+ propName: string;
46
49
 
47
50
  constructor(
48
51
  private angularPConnect: AngularPConnectService,
@@ -115,6 +118,9 @@ export class IntegerComponent implements OnInit, OnDestroy {
115
118
  this.helperText = this.configProps$.helperText;
116
119
  this.placeholder = this.configProps$.placeholder || '';
117
120
 
121
+ this.actionsApi = this.pConn$.getActionsApi();
122
+ this.propName = this.pConn$.getStateProps().value;
123
+
118
124
  // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
119
125
  setTimeout(() => {
120
126
  if (this.configProps$.required != null) {
@@ -155,13 +161,15 @@ export class IntegerComponent implements OnInit, OnDestroy {
155
161
  }
156
162
  }
157
163
 
158
- fieldOnChange(event: any) {
159
- this.angularPConnectData.actions?.onChange(this, event);
164
+ fieldOnChange() {
165
+ this.pConn$.clearErrorMessages({
166
+ property: this.propName
167
+ });
160
168
  }
161
169
 
162
170
  fieldOnBlur(event: any) {
163
- // PConnect wants to use eventHandler for onBlur
164
- this.angularPConnectData.actions?.onBlur(this, event);
171
+ const value = event?.target?.value;
172
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
165
173
  }
166
174
 
167
175
  getErrorMessage() {
@@ -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 } from '@angular/material/autocomplete';
4
+ import { MatAutocompleteModule } 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';
@@ -13,6 +13,7 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
13
13
  import { Utils } from '@pega/angular-sdk-components';
14
14
  import { doSearch, getDisplayFieldsMetaData, getGroupDataForItemsTree, preProcessColumns } from './utils';
15
15
  import { deleteInstruction, insertInstruction } from '@pega/angular-sdk-components';
16
+ import { handleEvent } from '@pega/angular-sdk-components';
16
17
 
17
18
  @Component({
18
19
  selector: 'app-multiselect',
@@ -73,6 +74,8 @@ export class MultiselectComponent implements OnInit, OnDestroy {
73
74
  dataApiObj: any;
74
75
  itemsTree: any[] = [];
75
76
  trigger: any;
77
+ actionsApi: Object;
78
+ propName: string;
76
79
 
77
80
  constructor(
78
81
  private angularPConnect: AngularPConnectService,
@@ -212,6 +215,9 @@ export class MultiselectComponent implements OnInit, OnDestroy {
212
215
  this.fieldControl.enable();
213
216
  }
214
217
 
218
+ this.actionsApi = this.pConn$.getActionsApi();
219
+ this.propName = this.pConn$.getStateProps().value;
220
+
215
221
  if (this.listType !== 'associated') {
216
222
  PCore.getDataApi()
217
223
  ?.init(dataConfig, contextName)
@@ -285,8 +291,10 @@ export class MultiselectComponent implements OnInit, OnDestroy {
285
291
  this.getCaseListBasedOnParams(this.value$, '', [...this.selectedItems], [...this.itemsTree], true);
286
292
  }
287
293
 
288
- optionChanged(event: MatAutocompleteSelectedEvent) {
289
- this.angularPConnectData.actions?.onChange(this, event);
294
+ optionChanged(event: any) {
295
+ let value = event?.target?.value;
296
+ value = value?.substring(1);
297
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
290
298
  }
291
299
 
292
300
  optionClicked = (event: Event, data: any): void => {
@@ -1,5 +1,5 @@
1
1
  <div *ngIf="displayMode$; else noDisplayMode">
2
- <component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$, displayMode$ }"></component-mapper>
2
+ <component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$: formattedValue, displayMode$ }"></component-mapper>
3
3
  </div>
4
4
  <ng-template #noDisplayMode>
5
5
  <div *ngIf="bHasForm$; else noEdit">
@@ -26,9 +26,10 @@
26
26
  [required]="bRequired$"
27
27
  [formControl]="fieldControl"
28
28
  [attr.data-test-id]="testId"
29
- (change)="fieldOnChange($event)"
29
+ (change)="fieldOnChange()"
30
30
  (blur)="fieldOnBlur($event)"
31
31
  [readonly]="bReadonly$"
32
+ [value]="value$"
32
33
  />
33
34
  <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
34
35
  </mat-form-field>
@@ -11,10 +11,12 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
11
11
  import { handleEvent } from '@pega/angular-sdk-components';
12
12
  import { getCurrencyCharacters } from '@pega/angular-sdk-components';
13
13
  import { PConnFieldProps } from '@pega/angular-sdk-components';
14
+ import { format } from '@pega/angular-sdk-components';
14
15
 
15
16
  interface PercentageProps extends PConnFieldProps {
16
17
  showGroupSeparators?: string;
17
18
  decimalPrecision?: number;
19
+ currencyISOCode?: string;
18
20
  // If any, enter additional props that only exist on Percentage here
19
21
  }
20
22
 
@@ -51,6 +53,9 @@ export class PercentageComponent implements OnInit, OnDestroy {
51
53
  inputMode: any;
52
54
  decimalPrecision: number | undefined;
53
55
  fieldControl = new FormControl<number | null>(null, null);
56
+ actionsApi: Object;
57
+ propName: string;
58
+ formattedValue: string;
54
59
 
55
60
  constructor(
56
61
  private angularPConnect: AngularPConnectService,
@@ -113,11 +118,8 @@ export class PercentageComponent implements OnInit, OnDestroy {
113
118
  this.label$ = this.configProps$.label;
114
119
  this.displayMode$ = this.configProps$.displayMode;
115
120
  this.inputMode = NgxCurrencyInputMode.Natural;
116
- let nValue: any = this.configProps$.value;
121
+ const nValue: any = this.configProps$.value;
117
122
  if (nValue) {
118
- if (typeof nValue === 'string') {
119
- nValue = parseInt(nValue, 10);
120
- }
121
123
  this.value$ = nValue;
122
124
  }
123
125
  this.helperText = this.configProps$.helperText;
@@ -128,6 +130,13 @@ export class PercentageComponent implements OnInit, OnDestroy {
128
130
  this.currDec = theSymbols.theDecimalIndicator || '2';
129
131
  this.currSep = showGroupSeparators ? theSymbols.theDigitGroupSeparator : '';
130
132
 
133
+ this.actionsApi = this.pConn$.getActionsApi();
134
+ this.propName = this.pConn$.getStateProps().value;
135
+
136
+ if (this.displayMode$ === 'DISPLAY_ONLY' || this.displayMode$ === 'STACKED_LARGE_VAL') {
137
+ this.formattedValue = format(nValue, 'percentage');
138
+ }
139
+
131
140
  // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
132
141
  setTimeout(() => {
133
142
  if (this.configProps$.required != null) {
@@ -169,22 +178,22 @@ export class PercentageComponent implements OnInit, OnDestroy {
169
178
  }
170
179
  }
171
180
 
172
- fieldOnChange(event: any) {
173
- this.angularPConnectData.actions?.onChange(this, event);
181
+ fieldOnChange() {
182
+ this.pConn$.clearErrorMessages({
183
+ property: this.propName
184
+ });
174
185
  }
175
186
 
176
187
  fieldOnBlur(event: any) {
177
- const actionsApi = this.pConn$?.getActionsApi();
178
- const propName = this.pConn$?.getStateProps()?.value;
179
188
  let value = event?.target?.value;
180
189
  value = value ? value.replace(/%/g, '') : '';
181
- if (this.currSep === ',') {
182
- value = value.replace(/,/g, '');
183
- } else {
190
+ if (this.currSep === '.') {
184
191
  value = value?.replace(/\./g, '');
185
192
  value = value?.replace(/,/g, '.');
193
+ } else {
194
+ value = value.replace(/,/g, '');
186
195
  }
187
- handleEvent(actionsApi, 'changeNblur', propName, value);
196
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
188
197
  }
189
198
 
190
199
  getErrorMessage() {
@@ -12,7 +12,7 @@
12
12
  [enablePlaceholder]="true"
13
13
  [enableSearch]="true"
14
14
  (change)="fieldOnChange()"
15
- (blur)="fieldOnBlur($event)"
15
+ (blur)="fieldOnBlur()"
16
16
  >
17
17
  </ngx-mat-intl-tel-input>
18
18
  <mat-label>{{ label$ }}</mat-label>
@@ -50,6 +50,9 @@ export class PhoneComponent implements OnInit, OnDestroy {
50
50
  phone: new FormControl<string | null>(null)
51
51
  });
52
52
 
53
+ actionsApi: Object;
54
+ propName: string;
55
+
53
56
  constructor(
54
57
  private angularPConnect: AngularPConnectService,
55
58
  private cdRef: ChangeDetectorRef,
@@ -117,6 +120,9 @@ export class PhoneComponent implements OnInit, OnDestroy {
117
120
  }
118
121
  this.helperText = this.configProps$.helperText;
119
122
 
123
+ this.actionsApi = this.pConn$.getActionsApi();
124
+ this.propName = this.pConn$.getStateProps().value;
125
+
120
126
  // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
121
127
  setTimeout(() => {
122
128
  if (this.configProps$.required != null) {
@@ -159,27 +165,18 @@ export class PhoneComponent implements OnInit, OnDestroy {
159
165
  }
160
166
  }
161
167
 
168
+ fieldOnBlur() {
169
+ // 'blur' isn't getting fired
170
+ }
171
+
162
172
  fieldOnChange() {
163
173
  if (this.formGroup$.controls[this.controlName$].value) {
164
- const actionsApi = this.pConn$?.getActionsApi();
165
- const propName = this.pConn$?.getStateProps().value;
166
174
  const value = this.formGroup$.controls[this.controlName$].value;
167
- const eventObj = {
168
- target: {
169
- value
170
- }
171
- };
172
175
  this.afterBlur = true;
173
- this.angularPConnectData.actions?.onChange(this, eventObj);
174
- handleEvent(actionsApi, 'blur', propName, value);
176
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
175
177
  }
176
178
  }
177
179
 
178
- fieldOnBlur(event: any) {
179
- // PConnect wants to use eventHandler for onBlur
180
- this.angularPConnectData.actions?.onBlur(this, event);
181
- }
182
-
183
180
  getErrorMessage() {
184
181
  let errMessage = '';
185
182
 
@@ -9,6 +9,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
9
9
  import { Utils } from '@pega/angular-sdk-components';
10
10
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
11
11
  import { PConnFieldProps } from '@pega/angular-sdk-components';
12
+ import { handleEvent } from '@pega/angular-sdk-components';
12
13
 
13
14
  interface IOption {
14
15
  key: string;
@@ -60,6 +61,8 @@ export class RadioButtonsComponent implements OnInit, OnDestroy {
60
61
  localeName = '';
61
62
  localePath = '';
62
63
  localizedValue = '';
64
+ actionsApi: Object;
65
+ propName: string;
63
66
 
64
67
  constructor(
65
68
  private angularPConnect: AngularPConnectService,
@@ -168,9 +171,11 @@ export class RadioButtonsComponent implements OnInit, OnDestroy {
168
171
 
169
172
  this.options$ = this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject());
170
173
 
171
- const propName = this.pConn$.getStateProps().value;
174
+ this.actionsApi = this.pConn$.getActionsApi();
175
+ this.propName = this.pConn$.getStateProps().value;
176
+
172
177
  const className = this.pConn$.getCaseInfo().getClassName();
173
- const refName = propName?.slice(propName.lastIndexOf('.') + 1);
178
+ const refName = this.propName?.slice(this.propName.lastIndexOf('.') + 1);
174
179
 
175
180
  this.fieldMetadata = this.configProps$.fieldMetadata;
176
181
  const metaData = Array.isArray(this.fieldMetadata) ? this.fieldMetadata.filter(field => field?.classID === className)[0] : this.fieldMetadata;
@@ -203,12 +208,7 @@ export class RadioButtonsComponent implements OnInit, OnDestroy {
203
208
  }
204
209
 
205
210
  fieldOnChange(event: any) {
206
- this.angularPConnectData.actions?.onChange(this, event);
207
- }
208
-
209
- fieldOnBlur(event: any) {
210
- // PConnect wants to use eventHandler for onBlur
211
- this.angularPConnectData.actions?.onBlur(this, event);
211
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, event.value);
212
212
  }
213
213
 
214
214
  getLocalizedOptionValue(opt: IOption) {
@@ -40,6 +40,8 @@ export class RichTextComponent implements OnInit, OnDestroy {
40
40
  info: any;
41
41
  error: boolean;
42
42
  status: any;
43
+ actionsApi: Object;
44
+ propName: string;
43
45
 
44
46
  constructor(
45
47
  private angularPConnect: AngularPConnectService,
@@ -94,6 +96,9 @@ export class RichTextComponent implements OnInit, OnDestroy {
94
96
  this.info = stateProps?.validatemessage || this.configProps$.helperText;
95
97
  this.error = stateProps?.status === 'error';
96
98
 
99
+ this.actionsApi = this.pConn$.getActionsApi();
100
+ this.propName = this.pConn$.getStateProps().value;
101
+
97
102
  if (this.configProps$.required != null) {
98
103
  this.bRequired$ = this.utils.getBooleanValue(this.configProps$.required);
99
104
  }
@@ -113,7 +118,7 @@ export class RichTextComponent implements OnInit, OnDestroy {
113
118
 
114
119
  fieldOnChange() {
115
120
  if (this.status === 'error') {
116
- const property = this.pConn$.getStateProps().value;
121
+ const property = this.propName;
117
122
  this.pConn$.clearErrorMessages({
118
123
  property,
119
124
  category: '',
@@ -123,9 +128,6 @@ export class RichTextComponent implements OnInit, OnDestroy {
123
128
  }
124
129
 
125
130
  fieldOnBlur(editorValue: any) {
126
- // PConnect wants to use eventHandler for onBlur
127
- const actionsApi = this.pConn$?.getActionsApi();
128
- const propName = this.pConn$?.getStateProps()?.value;
129
- handleEvent(actionsApi, 'changeNblur', propName, editorValue);
131
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, editorValue);
130
132
  }
131
133
  }
@@ -1,5 +1,6 @@
1
1
  import { Component, OnInit, Input, forwardRef, OnDestroy } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
+ import { FormGroup } from '@angular/forms';
3
4
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
4
5
  import { Utils } from '@pega/angular-sdk-components';
5
6
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
@@ -18,6 +19,7 @@ interface TextProps extends PConnFieldProps {
18
19
  })
19
20
  export class TextComponent implements OnInit, OnDestroy {
20
21
  @Input() pConn$: typeof PConnect;
22
+ @Input() formGroup$: FormGroup;
21
23
  @Input() formatAs$: string;
22
24
 
23
25
  // Used with AngularPConnect
@@ -16,7 +16,8 @@
16
16
  [required]="bRequired$"
17
17
  [disabled]="bDisabled$"
18
18
  [formControl]="fieldControl"
19
- (change)="fieldOnChange($event)"
19
+ (change)="fieldOnChange()"
20
+ (blur)="fieldOnBlur($event)"
20
21
  ></textarea>
21
22
  <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
22
23
  </mat-form-field>
@@ -8,6 +8,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
10
  import { PConnFieldProps } from '@pega/angular-sdk-components';
11
+ import { handleEvent } from '@pega/angular-sdk-components';
11
12
 
12
13
  interface TextAreaProps extends PConnFieldProps {
13
14
  // If any, enter additional props that only exist on TextArea here
@@ -44,6 +45,8 @@ export class TextAreaComponent implements OnInit, OnDestroy {
44
45
  helperText: string;
45
46
 
46
47
  fieldControl = new FormControl('', null);
48
+ actionsApi: Object;
49
+ propName: string;
47
50
 
48
51
  constructor(
49
52
  private angularPConnect: AngularPConnectService,
@@ -113,6 +116,9 @@ export class TextAreaComponent implements OnInit, OnDestroy {
113
116
  this.label$ = this.configProps$.label;
114
117
  this.helperText = this.configProps$.helperText;
115
118
 
119
+ this.actionsApi = this.pConn$.getActionsApi();
120
+ this.propName = this.pConn$.getStateProps().value;
121
+
116
122
  // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
117
123
  setTimeout(() => {
118
124
  if (this.configProps$.required != null) {
@@ -153,14 +159,15 @@ export class TextAreaComponent implements OnInit, OnDestroy {
153
159
  }
154
160
  }
155
161
 
156
- fieldOnChange(event: any) {
157
- // PConnect wants to use changeHandler for onChange
158
- this.angularPConnectData.actions?.onChange(this, event);
162
+ fieldOnChange() {
163
+ this.pConn$.clearErrorMessages({
164
+ property: this.propName
165
+ });
159
166
  }
160
167
 
161
168
  fieldOnBlur(event: any) {
162
- // PConnect wants to use eventHandler for onBlur
163
- this.angularPConnectData.actions?.onBlur(this, event);
169
+ const value = event?.target?.value;
170
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
164
171
  }
165
172
 
166
173
  getErrorMessage() {
@@ -14,7 +14,7 @@
14
14
  [required]="bRequired$"
15
15
  [attr.data-test-id]="testId"
16
16
  [formControl]="fieldControl"
17
- (change)="fieldOnChange($event)"
17
+ (change)="fieldOnChange()"
18
18
  (blur)="fieldOnBlur($event)"
19
19
  />
20
20
  <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
@@ -8,6 +8,7 @@ import { AngularPConnectService, AngularPConnectData } from '@pega/angular-sdk-c
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
10
  import { PConnFieldProps } from '@pega/angular-sdk-components';
11
+ import { handleEvent } from '@pega/angular-sdk-components';
11
12
 
12
13
  interface TextInputProps extends PConnFieldProps {
13
14
  // If any, enter additional props that only exist on TextInput here
@@ -44,6 +45,8 @@ export class TextInputComponent implements OnInit, OnDestroy {
44
45
  placeholder: string;
45
46
 
46
47
  fieldControl = new FormControl('', null);
48
+ actionsApi: Object;
49
+ propName: string;
47
50
 
48
51
  constructor(
49
52
  private angularPConnect: AngularPConnectService,
@@ -115,6 +118,9 @@ export class TextInputComponent implements OnInit, OnDestroy {
115
118
 
116
119
  this.componentReference = this.pConn$.getStateProps().value;
117
120
 
121
+ this.actionsApi = this.pConn$.getActionsApi();
122
+ this.propName = this.pConn$.getStateProps().value;
123
+
118
124
  if (this.configProps$.visibility != null) {
119
125
  this.bVisible$ = this.utils.getBooleanValue(this.configProps$.visibility);
120
126
  }
@@ -155,13 +161,15 @@ export class TextInputComponent implements OnInit, OnDestroy {
155
161
  }
156
162
  }
157
163
 
158
- fieldOnChange(event: any) {
159
- this.angularPConnectData.actions?.onChange(this, event);
164
+ fieldOnChange() {
165
+ this.pConn$.clearErrorMessages({
166
+ property: this.propName
167
+ });
160
168
  }
161
169
 
162
170
  fieldOnBlur(event: any) {
163
- // PConnect wants to use eventHandler for onBlur
164
- this.angularPConnectData.actions?.onBlur(this, event);
171
+ const value = event?.target?.value;
172
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
165
173
  }
166
174
 
167
175
  getErrorMessage() {
@@ -1,5 +1,5 @@
1
1
  <div *ngIf="displayMode$; else noDisplayMode">
2
- <component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$, displayMode$ }"></component-mapper>
2
+ <component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$: formattedValue$, displayMode$ }"></component-mapper>
3
3
  </div>
4
4
  <ng-template #noDisplayMode>
5
5
  <div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
@@ -14,7 +14,7 @@
14
14
  [required]="bRequired$"
15
15
  [attr.data-test-id]="testId"
16
16
  [formControl]="fieldControl"
17
- (change)="fieldOnChange($event)"
17
+ (change)="fieldOnChange()"
18
18
  (blur)="fieldOnBlur($event)"
19
19
  />
20
20
  <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
@@ -8,6 +8,8 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
10
  import { PConnFieldProps } from '@pega/angular-sdk-components';
11
+ import { handleEvent } from '@pega/angular-sdk-components';
12
+ import { format } from '@pega/angular-sdk-components';
11
13
 
12
14
  interface TimeProps extends PConnFieldProps {
13
15
  // If any, enter additional props that only exist on Time here
@@ -43,6 +45,9 @@ export class TimeComponent implements OnInit, OnDestroy {
43
45
  placeholder: string;
44
46
 
45
47
  fieldControl = new FormControl('', null);
48
+ actionsApi: Object;
49
+ propName: string;
50
+ formattedValue$: any;
46
51
 
47
52
  constructor(
48
53
  private angularPConnect: AngularPConnectService,
@@ -111,6 +116,9 @@ export class TimeComponent implements OnInit, OnDestroy {
111
116
  this.helperText = this.configProps$.helperText;
112
117
  this.placeholder = this.configProps$.placeholder || '';
113
118
 
119
+ this.actionsApi = this.pConn$.getActionsApi();
120
+ this.propName = this.pConn$.getStateProps().value;
121
+
114
122
  // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
115
123
  setTimeout(() => {
116
124
  if (this.configProps$.required != null) {
@@ -119,6 +127,12 @@ export class TimeComponent implements OnInit, OnDestroy {
119
127
  this.cdRef.detectChanges();
120
128
  });
121
129
 
130
+ if (this.displayMode$ === 'DISPLAY_ONLY' || this.displayMode$ === 'STACKED_LARGE_VAL') {
131
+ this.formattedValue$ = format(this.value$, 'timeonly', {
132
+ format: 'hh:mm a'
133
+ });
134
+ }
135
+
122
136
  if (this.configProps$.visibility != null) {
123
137
  this.bVisible$ = this.utils.getBooleanValue(this.configProps$.visibility);
124
138
  }
@@ -151,15 +165,15 @@ export class TimeComponent implements OnInit, OnDestroy {
151
165
  }
152
166
  }
153
167
 
154
- fieldOnChange(event: any) {
155
- event.value = event.target.value;
156
- this.angularPConnectData.actions?.onChange(this, event);
168
+ fieldOnChange() {
169
+ this.pConn$.clearErrorMessages({
170
+ property: this.propName
171
+ });
157
172
  }
158
173
 
159
174
  fieldOnBlur(event: any) {
160
- // PConnect wants to use eventHandler for onBlur
161
- event.value = event.target.value;
162
- this.angularPConnectData.actions?.onBlur(this, event);
175
+ const value = event?.target?.value;
176
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
163
177
  }
164
178
 
165
179
  getErrorMessage() {
@@ -14,7 +14,7 @@
14
14
  [required]="bRequired$"
15
15
  [attr.data-test-id]="testId"
16
16
  [formControl]="fieldControl"
17
- (change)="fieldOnChange($event)"
17
+ (change)="fieldOnChange()"
18
18
  (blur)="fieldOnBlur($event)"
19
19
  />
20
20
  <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
@@ -8,6 +8,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
8
8
  import { Utils } from '@pega/angular-sdk-components';
9
9
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
10
  import { PConnFieldProps } from '@pega/angular-sdk-components';
11
+ import { handleEvent } from '@pega/angular-sdk-components';
11
12
 
12
13
  interface URLProps extends PConnFieldProps {
13
14
  // If any, enter additional props that only exist on URL here
@@ -43,6 +44,8 @@ export class UrlComponent implements OnInit, OnDestroy {
43
44
  placeholder: string;
44
45
 
45
46
  fieldControl = new FormControl('', null);
47
+ actionsApi: Object;
48
+ propName: string;
46
49
 
47
50
  constructor(
48
51
  private angularPConnect: AngularPConnectService,
@@ -113,6 +116,9 @@ export class UrlComponent implements OnInit, OnDestroy {
113
116
  this.helperText = this.configProps$.helperText;
114
117
  this.placeholder = this.configProps$.placeholder || '';
115
118
 
119
+ this.actionsApi = this.pConn$.getActionsApi();
120
+ this.propName = this.pConn$.getStateProps().value;
121
+
116
122
  // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
117
123
  setTimeout(() => {
118
124
  if (this.configProps$.required != null) {
@@ -153,13 +159,15 @@ export class UrlComponent implements OnInit, OnDestroy {
153
159
  }
154
160
  }
155
161
 
156
- fieldOnChange(event: any) {
157
- this.angularPConnectData.actions?.onChange(this, event);
162
+ fieldOnChange() {
163
+ this.pConn$.clearErrorMessages({
164
+ property: this.propName
165
+ });
158
166
  }
159
167
 
160
168
  fieldOnBlur(event: any) {
161
- // PConnect wants to use eventHandler for onBlur
162
- this.angularPConnectData.actions?.onBlur(this, event);
169
+ const value = event?.target?.value;
170
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
163
171
  }
164
172
 
165
173
  getErrorMessage() {
@@ -11,6 +11,7 @@ import { Utils } from '@pega/angular-sdk-components';
11
11
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
12
12
  import { PConnFieldProps } from '@pega/angular-sdk-components';
13
13
  import { map, Observable, startWith } from 'rxjs';
14
+ import { handleEvent } from '@pega/angular-sdk-components';
14
15
 
15
16
  const OPERATORS_DP = 'D_pyGetOperatorsForCurrentApplication';
16
17
  const DROPDOWN_LIST = 'Drop-down list';
@@ -63,6 +64,8 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
63
64
  filterValue = '';
64
65
 
65
66
  fieldControl = new FormControl('', null);
67
+ actionsApi: Object;
68
+ propName: string;
66
69
 
67
70
  constructor(
68
71
  private angularPConnect: AngularPConnectService,
@@ -150,6 +153,9 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
150
153
  const { readOnly, required } = props;
151
154
  [this.bReadonly$, this.bRequired$] = [readOnly, required].map(prop => prop === true || (typeof prop === 'string' && prop === 'true'));
152
155
 
156
+ this.actionsApi = this.pConn$.getActionsApi();
157
+ this.propName = this.pConn$.getStateProps().value;
158
+
153
159
  const isUserNameAvailable = user => {
154
160
  return typeof user === 'object' && user !== null && user.userName;
155
161
  };
@@ -195,7 +201,8 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
195
201
  if (event?.target) {
196
202
  this.filterValue = (event.target as HTMLInputElement).value;
197
203
  }
198
- this.angularPConnectData.actions?.onChange(this, event);
204
+ const value = event?.target?.value;
205
+ handleEvent(this.actionsApi, 'change', this.propName, value);
199
206
  }
200
207
 
201
208
  fieldOnBlur(event: any) {
@@ -205,11 +212,10 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
205
212
  key = index > -1 ? (key = this.options$[index].key) : event.target.value;
206
213
  }
207
214
 
208
- const eve = {
215
+ const value = {
209
216
  value: key
210
217
  };
211
- // PConnect wants to use eventHandler for onBlur
212
- this.angularPConnectData.actions?.onChange(this, eve);
218
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
213
219
  }
214
220
 
215
221
  getErrorMessage() {
@@ -38,7 +38,7 @@
38
38
  </div>
39
39
  </mat-card>
40
40
  </div>
41
- <div *ngIf="bShowBanner && bShowConfirm">
41
+ <div *ngIf="bShowBanner && bShowConfirm && confirm_pconn">
42
42
  <component-mapper name="View" [props]="{ formGroup$, pConn$: confirm_pconn }"></component-mapper>
43
43
  </div>
44
44
  </div>
@@ -484,6 +484,7 @@ export class FlowContainerComponent extends FlowContainerBaseComponent implement
484
484
  updateFlowContainerChildren() {
485
485
  // routingInfo was added as component prop in populateAdditionalProps
486
486
  const routingInfo = this.angularPConnect.getComponentProp(this, 'routingInfo');
487
+ this.confirm_pconn = null;
487
488
 
488
489
  let loadingInfo: any;
489
490
  try {
@@ -59,13 +59,13 @@
59
59
  border-radius: 0.5rem;
60
60
  border: 0.0625rem solid var(--app-neutral-light-color);
61
61
  overflow: hidden;
62
- height: 2rem;
63
62
  display: flex;
63
+ flex-wrap: wrap;
64
64
  }
65
65
 
66
66
  .psdk-stages-chevron {
67
67
  position: relative;
68
- padding: calc(1rem);
68
+ padding: calc(0.5rem);
69
69
  display: flex;
70
70
  justify-content: center;
71
71
  align-items: center;
@@ -63,7 +63,7 @@ export class DetailsTwoColumnComponent implements OnInit, OnDestroy {
63
63
 
64
64
  if (this.showHighlightedData) {
65
65
  const highlightedData = rawMetaData?.highlightedData;
66
- this.highlightedDataArr = highlightedData.map(field => {
66
+ this.highlightedDataArr = highlightedData?.map(field => {
67
67
  field.config.displayMode = 'STACKED_LARGE_VAL';
68
68
 
69
69
  if (field.config.value === '@P .pyStatusWork') {
@@ -4,6 +4,7 @@
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;
7
8
  }
8
9
  .psdk-value {
9
10
  margin: 8px 0px;
@@ -14,5 +15,4 @@
14
15
  font-size: 1.25rem;
15
16
  }
16
17
  .psdk-val-labels-left {
17
- margin: 8px 0px;
18
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/angular-sdk-overrides",
3
- "version": "0.242.2",
3
+ "version": "0.242.3",
4
4
  "description": "Angular SDK - Code for overriding components",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"