@pega/angular-sdk-components 0.23.15 → 0.23.16

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.
@@ -1218,18 +1218,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1218
1218
  class BannerService {
1219
1219
  constructor() {
1220
1220
  this.banners = [];
1221
- this.localizedVal = PCore.getLocaleUtils().getLocaleValue;
1222
1221
  }
1223
1222
  clearBanners() {
1224
1223
  this.banners = [];
1225
1224
  }
1226
1225
  updateBanners(itemKey) {
1226
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
1227
1227
  let validationErrors = PCore.getMessageManager().getValidationErrorMessages(itemKey) || [];
1228
1228
  // const completeProps = this.angularPConnect.getCurrentCompleteProps(this) as FlowContainerProps;
1229
1229
  validationErrors = validationErrors.map(item => ({ message: typeof item === 'string' ? item : `${item.label}: ${item.description}` }));
1230
1230
  // this.showPageMessages(completeProps);
1231
1231
  if (validationErrors.length) {
1232
- this.banners = [{ messages: validationErrors?.map(msg => this.localizedVal(msg.message, 'Messages')), variant: 'urgent' }];
1232
+ this.banners = [{ messages: validationErrors?.map(msg => localizedVal(msg.message, 'Messages')), variant: 'urgent' }];
1233
+ }
1234
+ else {
1235
+ this.banners = [];
1233
1236
  }
1234
1237
  }
1235
1238
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BannerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
@@ -5882,13 +5885,21 @@ class CurrencyComponent {
5882
5885
  }
5883
5886
  }
5884
5887
  fieldOnChange(event) {
5885
- this.angularPConnectData.actions?.onChange(this, event);
5888
+ const oldVal = this.value$ ?? '';
5889
+ const isValueChanged = Number(event.target.value).toString() !== oldVal.toString();
5890
+ if (isValueChanged) {
5891
+ this.angularPConnectData.actions?.onChange(this, event);
5892
+ }
5886
5893
  }
5887
5894
  fieldOnBlur(event) {
5888
5895
  // PConnect wants to use eventHandler for onBlur
5889
- const actionsApi = this.pConn$?.getActionsApi();
5890
- const propName = (this.pConn$?.getStateProps()).value;
5891
- handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
5896
+ const oldVal = this.value$ ?? '';
5897
+ const isValueChanged = Number(event.target.value).toString() !== oldVal.toString();
5898
+ if (isValueChanged) {
5899
+ const actionsApi = this.pConn$?.getActionsApi();
5900
+ const propName = (this.pConn$?.getStateProps()).value;
5901
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
5902
+ }
5892
5903
  }
5893
5904
  getErrorMessage() {
5894
5905
  let errMessage = '';
@@ -6767,12 +6778,16 @@ class DecimalComponent {
6767
6778
  this.componentReference = this.pConn$.getStateProps().value;
6768
6779
  }
6769
6780
  fieldOnBlur(event) {
6770
- const actionsApi = this.pConn$?.getActionsApi();
6771
- const propName = (this.pConn$?.getStateProps()).value;
6772
6781
  let value = event?.target?.value;
6773
6782
  value = value.replace(/,/g, '');
6774
6783
  value = value !== '' ? Number(value) : value;
6775
- handleEvent(actionsApi, 'changeNblur', propName, value);
6784
+ const oldVal = this.value$ ?? '';
6785
+ const isValueChanged = value.toString() !== oldVal.toString();
6786
+ if (isValueChanged) {
6787
+ const actionsApi = this.pConn$?.getActionsApi();
6788
+ const propName = (this.pConn$?.getStateProps()).value;
6789
+ handleEvent(actionsApi, 'changeNblur', propName, value);
6790
+ }
6776
6791
  }
6777
6792
  getErrorMessage() {
6778
6793
  let errMessage = '';
@@ -7187,12 +7202,20 @@ class EmailComponent {
7187
7202
  }
7188
7203
  }
7189
7204
  fieldOnChange(event) {
7190
- this.angularPConnectData.actions?.onChange(this, event);
7205
+ const oldVal = this.value$ ?? '';
7206
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
7207
+ if (isValueChanged) {
7208
+ this.angularPConnectData.actions?.onChange(this, event);
7209
+ }
7191
7210
  }
7192
7211
  fieldOnBlur(event) {
7193
- const actionsApi = this.pConn$?.getActionsApi();
7194
- const propName = (this.pConn$?.getStateProps()).value;
7195
- handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
7212
+ const oldVal = this.value$ ?? '';
7213
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
7214
+ if (isValueChanged) {
7215
+ const actionsApi = this.pConn$?.getActionsApi();
7216
+ const propName = (this.pConn$?.getStateProps()).value;
7217
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
7218
+ }
7196
7219
  }
7197
7220
  getErrorMessage() {
7198
7221
  let errMessage = '';
@@ -7385,12 +7408,20 @@ class IntegerComponent {
7385
7408
  }
7386
7409
  }
7387
7410
  fieldOnChange(event) {
7388
- this.angularPConnectData.actions?.onChange(this, event);
7411
+ const oldVal = this.value$ ?? '';
7412
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
7413
+ if (isValueChanged) {
7414
+ this.angularPConnectData.actions?.onChange(this, event);
7415
+ }
7389
7416
  }
7390
7417
  fieldOnBlur(event) {
7391
- const actionsApi = this.pConn$?.getActionsApi();
7392
- const propName = (this.pConn$?.getStateProps()).value;
7393
- handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
7418
+ const oldVal = this.value$ ?? '';
7419
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
7420
+ if (isValueChanged) {
7421
+ const actionsApi = this.pConn$?.getActionsApi();
7422
+ const propName = (this.pConn$?.getStateProps()).value;
7423
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
7424
+ }
7394
7425
  }
7395
7426
  getErrorMessage() {
7396
7427
  // field control gets error message from here
@@ -7564,12 +7595,20 @@ class PercentageComponent {
7564
7595
  }
7565
7596
  }
7566
7597
  fieldOnChange(event) {
7567
- this.angularPConnectData.actions?.onChange(this, event);
7598
+ const oldVal = this.value$ ?? '';
7599
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
7600
+ if (isValueChanged) {
7601
+ this.angularPConnectData.actions?.onChange(this, event);
7602
+ }
7568
7603
  }
7569
7604
  fieldOnBlur(event) {
7570
- const actionsApi = this.pConn$?.getActionsApi();
7571
- const propName = (this.pConn$?.getStateProps()).value;
7572
- handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
7605
+ const oldVal = this.value$ ?? '';
7606
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
7607
+ if (isValueChanged) {
7608
+ const actionsApi = this.pConn$?.getActionsApi();
7609
+ const propName = (this.pConn$?.getStateProps()).value;
7610
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
7611
+ }
7573
7612
  }
7574
7613
  getErrorMessage() {
7575
7614
  // field control gets error message from here
@@ -7706,26 +7745,17 @@ class PhoneComponent {
7706
7745
  });
7707
7746
  }
7708
7747
  }
7748
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
7749
+ fieldOnBlur(event) { }
7709
7750
  fieldOnChange() {
7710
7751
  if (this.formGroup$.controls[this.controlName$].value) {
7711
- const actionsApi = this.pConn$?.getActionsApi();
7712
- const propName = (this.pConn$?.getStateProps()).value;
7713
7752
  const value = this.formGroup$.controls[this.controlName$].value;
7714
- const eventObj = {
7715
- target: {
7716
- value
7717
- }
7718
- };
7719
7753
  this.afterBlur = true;
7720
- this.angularPConnectData.actions?.onChange(this, eventObj);
7721
- handleEvent(actionsApi, 'blur', propName, value);
7754
+ const actionsApi = this.pConn$.getActionsApi();
7755
+ const propName = this.pConn$.getStateProps().value;
7756
+ handleEvent(actionsApi, 'changeNblur', propName, value);
7722
7757
  }
7723
7758
  }
7724
- fieldOnBlur(event) {
7725
- const actionsApi = this.pConn$?.getActionsApi();
7726
- const propName = (this.pConn$?.getStateProps()).value;
7727
- handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
7728
- }
7729
7759
  getErrorMessage() {
7730
7760
  let errMessage = '';
7731
7761
  // look for validation messages for json, pre-defined or just an error pushed from workitem (400)
@@ -8079,9 +8109,13 @@ class TextAreaComponent {
8079
8109
  }
8080
8110
  }
8081
8111
  fieldOnChange(event) {
8082
- const actionsApi = this.pConn$?.getActionsApi();
8083
- const propName = (this.pConn$?.getStateProps()).value;
8084
- handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
8112
+ const oldVal = this.value$ ?? '';
8113
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
8114
+ if (isValueChanged) {
8115
+ const actionsApi = this.pConn$?.getActionsApi();
8116
+ const propName = (this.pConn$?.getStateProps()).value;
8117
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
8118
+ }
8085
8119
  }
8086
8120
  getErrorMessage() {
8087
8121
  // field control gets error message from here
@@ -8410,12 +8444,20 @@ class TextInputComponent {
8410
8444
  }
8411
8445
  }
8412
8446
  fieldOnChange(event) {
8413
- this.angularPConnectData.actions?.onChange(this, event);
8447
+ const oldVal = this.value$ ?? '';
8448
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
8449
+ if (isValueChanged) {
8450
+ this.angularPConnectData.actions?.onChange(this, event);
8451
+ }
8414
8452
  }
8415
8453
  fieldOnBlur(event) {
8416
- const actionsApi = this.pConn$?.getActionsApi();
8417
- const propName = (this.pConn$?.getStateProps()).value;
8418
- handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
8454
+ const oldVal = this.value$ ?? '';
8455
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
8456
+ if (isValueChanged) {
8457
+ const actionsApi = this.pConn$?.getActionsApi();
8458
+ const propName = (this.pConn$?.getStateProps()).value;
8459
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
8460
+ }
8419
8461
  }
8420
8462
  getErrorMessage() {
8421
8463
  let errMessage = '';
@@ -8688,12 +8730,20 @@ class UrlComponent {
8688
8730
  }
8689
8731
  }
8690
8732
  fieldOnChange(event) {
8691
- this.angularPConnectData.actions?.onChange(this, event);
8733
+ const oldVal = this.value$ ?? '';
8734
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
8735
+ if (isValueChanged) {
8736
+ this.angularPConnectData.actions?.onChange(this, event);
8737
+ }
8692
8738
  }
8693
8739
  fieldOnBlur(event) {
8694
- const actionsApi = this.pConn$?.getActionsApi();
8695
- const propName = (this.pConn$?.getStateProps()).value;
8696
- handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
8740
+ const oldVal = this.value$ ?? '';
8741
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
8742
+ if (isValueChanged) {
8743
+ const actionsApi = this.pConn$?.getActionsApi();
8744
+ const propName = (this.pConn$?.getStateProps()).value;
8745
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
8746
+ }
8697
8747
  }
8698
8748
  getErrorMessage() {
8699
8749
  let errMessage = '';