@pega/angular-sdk-overrides 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.
@@ -170,15 +170,25 @@ export class CurrencyComponent implements OnInit, OnDestroy {
170
170
  }
171
171
 
172
172
  fieldOnChange(event: any) {
173
- this.angularPConnectData.actions?.onChange(this, event);
173
+ const oldVal = this.value$ ?? '';
174
+ const isValueChanged = Number(event.target.value).toString() !== oldVal.toString();
175
+
176
+ if (isValueChanged) {
177
+ this.angularPConnectData.actions?.onChange(this, event);
178
+ }
174
179
  }
175
180
 
176
181
  fieldOnBlur(event: any) {
177
182
  // PConnect wants to use eventHandler for onBlur
178
183
 
179
- const actionsApi = this.pConn$?.getActionsApi();
180
- const propName = (this.pConn$?.getStateProps() as any).value;
181
- handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
184
+ const oldVal = this.value$ ?? '';
185
+ const isValueChanged = Number(event.target.value).toString() !== oldVal.toString();
186
+
187
+ if (isValueChanged) {
188
+ const actionsApi = this.pConn$?.getActionsApi();
189
+ const propName = (this.pConn$?.getStateProps() as any).value;
190
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
191
+ }
182
192
  }
183
193
 
184
194
  getErrorMessage() {
@@ -160,12 +160,18 @@ export class DecimalComponent implements OnInit, OnDestroy {
160
160
  }
161
161
 
162
162
  fieldOnBlur(event: any) {
163
- const actionsApi = this.pConn$?.getActionsApi();
164
- const propName = (this.pConn$?.getStateProps() as any).value;
165
163
  let value = event?.target?.value;
166
164
  value = value.replace(/,/g, '');
167
165
  value = value !== '' ? Number(value) : value;
168
- handleEvent(actionsApi, 'changeNblur', propName, value);
166
+
167
+ const oldVal = this.value$ ?? '';
168
+ const isValueChanged = value.toString() !== oldVal.toString();
169
+
170
+ if (isValueChanged) {
171
+ const actionsApi = this.pConn$?.getActionsApi();
172
+ const propName = (this.pConn$?.getStateProps() as any).value;
173
+ handleEvent(actionsApi, 'changeNblur', propName, value);
174
+ }
169
175
  }
170
176
 
171
177
  getErrorMessage() {
@@ -154,13 +154,23 @@ export class EmailComponent implements OnInit, OnDestroy {
154
154
  }
155
155
 
156
156
  fieldOnChange(event: any) {
157
- this.angularPConnectData.actions?.onChange(this, event);
157
+ const oldVal = this.value$ ?? '';
158
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
159
+
160
+ if (isValueChanged) {
161
+ this.angularPConnectData.actions?.onChange(this, event);
162
+ }
158
163
  }
159
164
 
160
165
  fieldOnBlur(event: any) {
161
- const actionsApi = this.pConn$?.getActionsApi();
162
- const propName = (this.pConn$?.getStateProps() as any).value;
163
- handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
166
+ const oldVal = this.value$ ?? '';
167
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
168
+
169
+ if (isValueChanged) {
170
+ const actionsApi = this.pConn$?.getActionsApi();
171
+ const propName = (this.pConn$?.getStateProps() as any).value;
172
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
173
+ }
164
174
  }
165
175
 
166
176
  getErrorMessage() {
@@ -157,13 +157,23 @@ export class IntegerComponent implements OnInit, OnDestroy {
157
157
  }
158
158
 
159
159
  fieldOnChange(event: any) {
160
- this.angularPConnectData.actions?.onChange(this, event);
160
+ const oldVal = this.value$ ?? '';
161
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
162
+
163
+ if (isValueChanged) {
164
+ this.angularPConnectData.actions?.onChange(this, event);
165
+ }
161
166
  }
162
167
 
163
168
  fieldOnBlur(event: any) {
164
- const actionsApi = this.pConn$?.getActionsApi();
165
- const propName = (this.pConn$?.getStateProps() as any).value;
166
- handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
169
+ const oldVal = this.value$ ?? '';
170
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
171
+
172
+ if (isValueChanged) {
173
+ const actionsApi = this.pConn$?.getActionsApi();
174
+ const propName = (this.pConn$?.getStateProps() as any).value;
175
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
176
+ }
167
177
  }
168
178
 
169
179
  getErrorMessage() {
@@ -155,13 +155,23 @@ export class PercentageComponent implements OnInit, OnDestroy {
155
155
  }
156
156
 
157
157
  fieldOnChange(event: any) {
158
- this.angularPConnectData.actions?.onChange(this, event);
158
+ const oldVal = this.value$ ?? '';
159
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
160
+
161
+ if (isValueChanged) {
162
+ this.angularPConnectData.actions?.onChange(this, event);
163
+ }
159
164
  }
160
165
 
161
166
  fieldOnBlur(event: any) {
162
- const actionsApi = this.pConn$?.getActionsApi();
163
- const propName = (this.pConn$?.getStateProps() as any).value;
164
- handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
167
+ const oldVal = this.value$ ?? '';
168
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
169
+
170
+ if (isValueChanged) {
171
+ const actionsApi = this.pConn$?.getActionsApi();
172
+ const propName = (this.pConn$?.getStateProps() as any).value;
173
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
174
+ }
165
175
  }
166
176
 
167
177
  getErrorMessage() {
@@ -159,26 +159,18 @@ export class PhoneComponent implements OnInit, OnDestroy {
159
159
  }
160
160
  }
161
161
 
162
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
163
+ fieldOnBlur(event: Event) {}
164
+
162
165
  fieldOnChange() {
163
166
  if (this.formGroup$.controls[this.controlName$].value) {
164
- const actionsApi = this.pConn$?.getActionsApi();
165
- const propName = (this.pConn$?.getStateProps() as any).value;
166
167
  const value = this.formGroup$.controls[this.controlName$].value;
167
- const eventObj = {
168
- target: {
169
- value
170
- }
171
- };
172
168
  this.afterBlur = true;
173
- this.angularPConnectData.actions?.onChange(this, eventObj);
174
- handleEvent(actionsApi, 'blur', propName, value);
175
- }
176
- }
177
169
 
178
- fieldOnBlur(event: any) {
179
- const actionsApi = this.pConn$?.getActionsApi();
180
- const propName = (this.pConn$?.getStateProps() as any).value;
181
- handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
170
+ const actionsApi = this.pConn$.getActionsApi();
171
+ const propName = (this.pConn$.getStateProps() as any).value;
172
+ handleEvent(actionsApi, 'changeNblur', propName, value);
173
+ }
182
174
  }
183
175
 
184
176
  getErrorMessage() {
@@ -157,9 +157,14 @@ export class TextAreaComponent implements OnInit, OnDestroy {
157
157
  }
158
158
 
159
159
  fieldOnChange(event: any) {
160
- const actionsApi = this.pConn$?.getActionsApi();
161
- const propName = (this.pConn$?.getStateProps() as any).value;
162
- handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
160
+ const oldVal = this.value$ ?? '';
161
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
162
+
163
+ if (isValueChanged) {
164
+ const actionsApi = this.pConn$?.getActionsApi();
165
+ const propName = (this.pConn$?.getStateProps() as any).value;
166
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
167
+ }
163
168
  }
164
169
 
165
170
  getErrorMessage() {
@@ -157,13 +157,23 @@ export class TextInputComponent implements OnInit, OnDestroy {
157
157
  }
158
158
 
159
159
  fieldOnChange(event: any) {
160
- this.angularPConnectData.actions?.onChange(this, event);
160
+ const oldVal = this.value$ ?? '';
161
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
162
+
163
+ if (isValueChanged) {
164
+ this.angularPConnectData.actions?.onChange(this, event);
165
+ }
161
166
  }
162
167
 
163
168
  fieldOnBlur(event: any) {
164
- const actionsApi = this.pConn$?.getActionsApi();
165
- const propName = (this.pConn$?.getStateProps() as any).value;
166
- handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
169
+ const oldVal = this.value$ ?? '';
170
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
171
+
172
+ if (isValueChanged) {
173
+ const actionsApi = this.pConn$?.getActionsApi();
174
+ const propName = (this.pConn$?.getStateProps() as any).value;
175
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
176
+ }
167
177
  }
168
178
 
169
179
  getErrorMessage() {
@@ -155,13 +155,23 @@ export class UrlComponent implements OnInit, OnDestroy {
155
155
  }
156
156
 
157
157
  fieldOnChange(event: any) {
158
- this.angularPConnectData.actions?.onChange(this, event);
158
+ const oldVal = this.value$ ?? '';
159
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
160
+
161
+ if (isValueChanged) {
162
+ this.angularPConnectData.actions?.onChange(this, event);
163
+ }
159
164
  }
160
165
 
161
166
  fieldOnBlur(event: any) {
162
- const actionsApi = this.pConn$?.getActionsApi();
163
- const propName = (this.pConn$?.getStateProps() as any).value;
164
- handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
167
+ const oldVal = this.value$ ?? '';
168
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
169
+
170
+ if (isValueChanged) {
171
+ const actionsApi = this.pConn$?.getActionsApi();
172
+ const propName = (this.pConn$?.getStateProps() as any).value;
173
+ handleEvent(actionsApi, 'changeNblur', propName, event?.target?.value);
174
+ }
165
175
  }
166
176
 
167
177
  getErrorMessage() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/angular-sdk-overrides",
3
- "version": "0.23.15",
3
+ "version": "0.23.16",
4
4
  "description": "Angular SDK - Code for overriding components",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"