@pega/angular-sdk-overrides 0.242.6 → 0.242.8
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.
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +0 -1
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +1 -1
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +6 -0
- package/lib/designSystemExtension/operator/operator.component.html +1 -1
- package/lib/designSystemExtension/operator/operator.component.scss +10 -2
- package/lib/designSystemExtension/operator/operator.component.ts +4 -3
- package/lib/field/currency/currency.component.ts +19 -13
- package/lib/field/date-time/date-time.component.html +0 -1
- package/lib/field/date-time/date-time.component.ts +17 -3
- package/lib/field/decimal/decimal.component.html +1 -0
- package/lib/field/decimal/decimal.component.ts +38 -15
- package/lib/field/dropdown/dropdown.component.ts +18 -3
- package/lib/field/email/email.component.ts +17 -7
- package/lib/field/integer/integer.component.html +1 -1
- package/lib/field/integer/integer.component.ts +16 -6
- package/lib/field/list-view-action-buttons/list-view-action-buttons.component.html +1 -1
- package/lib/field/percentage/percentage.component.html +1 -1
- package/lib/field/percentage/percentage.component.ts +27 -17
- package/lib/field/phone/phone.component.ts +6 -13
- package/lib/field/rich-text/rich-text.component.ts +12 -3
- package/lib/field/text/text.component.ts +2 -2
- package/lib/field/text-area/text-area.component.html +1 -1
- package/lib/field/text-area/text-area.component.ts +16 -6
- package/lib/field/text-input/text-input.component.html +1 -1
- package/lib/field/text-input/text-input.component.ts +16 -6
- package/lib/field/time/time.component.html +1 -1
- package/lib/field/time/time.component.ts +21 -6
- package/lib/field/url/url.component.html +1 -1
- package/lib/field/url/url.component.ts +16 -6
- package/lib/field/user-reference/user-reference.component.html +40 -38
- package/lib/field/user-reference/user-reference.component.ts +66 -7
- package/lib/infra/Containers/flow-container/flow-container.component.ts +2 -5
- package/lib/infra/Containers/flow-container/helpers.ts +1 -1
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.html +1 -11
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +0 -1
- package/lib/infra/action-buttons/action-buttons.component.html +1 -1
- package/lib/infra/assignment/assignment.component.ts +3 -5
- package/lib/infra/assignment-card/assignment-card.component.ts +4 -32
- package/lib/infra/defer-load/defer-load.component.ts +4 -1
- package/lib/infra/reference/reference.component.ts +77 -90
- package/lib/infra/root-container/root-container.component.ts +24 -17
- package/lib/template/base/form-template-base.ts +2 -2
- package/lib/template/default-form/default-form.component.ts +5 -7
- package/lib/template/field-group-template/field-group-template.component.html +7 -7
- package/lib/template/field-group-template/field-group-template.component.scss +8 -0
- package/lib/template/field-group-template/field-group-template.component.ts +64 -41
- package/lib/template/field-group-template/utils.ts +9 -0
- package/lib/template/field-value-list/field-value-list.component.html +2 -2
- package/lib/template/field-value-list/field-value-list.component.scss +4 -0
- package/lib/template/list-view/list-view.component.html +3 -1
- package/lib/template/list-view/list-view.component.ts +1 -1
- package/lib/template/simple-table-manual/helpers.ts +18 -2
- package/lib/template/simple-table-manual/simple-table-manual.component.html +25 -6
- package/lib/template/simple-table-manual/simple-table-manual.component.scss +7 -3
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +62 -23
- package/lib/widget/todo/todo.component.html +1 -2
- package/lib/widget/todo/todo.component.scss +2 -0
- package/lib/widget/todo/todo.component.ts +4 -3
- package/package.json +1 -1
|
@@ -27,7 +27,6 @@ export class MaterialCaseSummaryComponent implements OnInit, OnChanges {
|
|
|
27
27
|
this.updateLabelAndDate(this.secondaryFields$);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
// eslint-disable-next-line sonarjs/no-identical-functions
|
|
31
30
|
ngOnChanges() {
|
|
32
31
|
this.updatePrimaryWithStatus();
|
|
33
32
|
this.updateLabelAndDate(this.primaryFieldsWithStatus$);
|
package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
</ng-template>
|
|
11
11
|
|
|
12
12
|
<ng-template #showDetails>
|
|
13
|
-
<div class="psdk-grid-filter" *ngIf="field.config.label">
|
|
13
|
+
<div class="psdk-grid-filter" *ngIf="field.config.label && getVisibility(field.config)">
|
|
14
14
|
<div class="psdk-details-fields-label">
|
|
15
15
|
{{ field.config.label }}
|
|
16
16
|
</div>
|
package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts
CHANGED
|
@@ -29,4 +29,10 @@ export class MaterialDetailsFieldsComponent {
|
|
|
29
29
|
_formatDate(dateValue: string, dateFormat: string): string {
|
|
30
30
|
return this.utils.generateDate(dateValue, dateFormat);
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
getVisibility(config): boolean {
|
|
34
|
+
const { visibility = true } = config;
|
|
35
|
+
|
|
36
|
+
return this.utils.getBooleanValue(visibility);
|
|
37
|
+
}
|
|
32
38
|
}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
.psdk-operator {
|
|
2
2
|
display: flex;
|
|
3
|
-
flex-direction:
|
|
3
|
+
flex-direction: column;
|
|
4
4
|
font-size: 0.8rem;
|
|
5
5
|
color: var(--app-neutral-color);
|
|
6
|
+
padding-left: 0.625rem;
|
|
7
|
+
margin: 16px 0 8px 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.psdk-operator.flex-row {
|
|
11
|
+
flex-direction: row;
|
|
6
12
|
align-items: center;
|
|
13
|
+
text-align: center;
|
|
14
|
+
padding-left: 0;
|
|
15
|
+
margin: 0;
|
|
7
16
|
}
|
|
8
17
|
|
|
9
18
|
.psdk-operator-popover {
|
|
@@ -35,7 +44,6 @@
|
|
|
35
44
|
|
|
36
45
|
.psdk-double {
|
|
37
46
|
column-gap: 1rem;
|
|
38
|
-
text-align: center;
|
|
39
47
|
}
|
|
40
48
|
|
|
41
49
|
.psdk-top-pad {
|
|
@@ -13,10 +13,11 @@ import { Utils } from '@pega/angular-sdk-components';
|
|
|
13
13
|
export class OperatorComponent implements OnInit, OnChanges, OnDestroy {
|
|
14
14
|
@Input() pConn$: typeof PConnect;
|
|
15
15
|
@Input() displayLabel;
|
|
16
|
+
@Input() name$?: string;
|
|
17
|
+
|
|
16
18
|
fields$: any[] = [];
|
|
17
19
|
bShowPopover$: boolean;
|
|
18
20
|
date$: string;
|
|
19
|
-
name$: string;
|
|
20
21
|
label$: string;
|
|
21
22
|
id$: string;
|
|
22
23
|
constructor(
|
|
@@ -40,7 +41,7 @@ export class OperatorComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
40
41
|
|
|
41
42
|
ngOnChanges(changes: SimpleChanges): void {
|
|
42
43
|
const { pConn$ } = changes;
|
|
43
|
-
if (pConn$.previousValue !== pConn$.currentValue) {
|
|
44
|
+
if (pConn$ && pConn$.previousValue !== pConn$.currentValue) {
|
|
44
45
|
this.updateSelf();
|
|
45
46
|
}
|
|
46
47
|
}
|
|
@@ -69,7 +70,7 @@ export class OperatorComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
69
70
|
this.id$ = configProps$.resolveOperator.userId;
|
|
70
71
|
this.label$ = configProps$.resolveLabel;
|
|
71
72
|
} else {
|
|
72
|
-
this.name$ = configProps$?.value.userName;
|
|
73
|
+
this.name$ = this.name$ || configProps$?.value.userName;
|
|
73
74
|
this.id$ = configProps$?.value.userId;
|
|
74
75
|
this.label$ = configProps$.label;
|
|
75
76
|
}
|
|
@@ -130,6 +130,7 @@ export class CurrencyComponent implements OnInit, OnDestroy {
|
|
|
130
130
|
nValue = parseFloat(nValue);
|
|
131
131
|
}
|
|
132
132
|
this.value$ = nValue;
|
|
133
|
+
this.fieldControl.setValue(this.value$);
|
|
133
134
|
}
|
|
134
135
|
this.helperText = this.configProps$.helperText;
|
|
135
136
|
this.placeholder = this.configProps$.placeholder || '';
|
|
@@ -197,20 +198,25 @@ export class CurrencyComponent implements OnInit, OnDestroy {
|
|
|
197
198
|
}
|
|
198
199
|
|
|
199
200
|
fieldOnBlur(event: any) {
|
|
200
|
-
const
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
regExp = new RegExp(String.raw`${
|
|
211
|
-
value = value
|
|
201
|
+
const oldVal = this.value$ ?? '';
|
|
202
|
+
const isValueChanged = event.target.value.toString() !== oldVal.toString();
|
|
203
|
+
|
|
204
|
+
if (isValueChanged) {
|
|
205
|
+
const actionsApi = this.pConn$?.getActionsApi();
|
|
206
|
+
const propName = this.pConn$?.getStateProps().value;
|
|
207
|
+
let value = event?.target?.value;
|
|
208
|
+
value = value?.substring(1);
|
|
209
|
+
// replacing thousand separator with empty string as not required in api call
|
|
210
|
+
const thousandSep = this.thousandSeparator === '.' ? '\\.' : this.thousandSeparator;
|
|
211
|
+
let regExp = new RegExp(String.raw`${thousandSep}`, 'g');
|
|
212
|
+
value = value?.replace(regExp, '');
|
|
213
|
+
// replacing decimal separator with '.'
|
|
214
|
+
if (this.decimalSeparator !== '.') {
|
|
215
|
+
regExp = new RegExp(String.raw`${this.decimalSeparator}`, 'g');
|
|
216
|
+
value = value.replace(regExp, '.');
|
|
217
|
+
}
|
|
218
|
+
handleEvent(actionsApi, 'changeNblur', propName, value);
|
|
212
219
|
}
|
|
213
|
-
handleEvent(actionsApi, 'changeNblur', propName, value);
|
|
214
220
|
}
|
|
215
221
|
|
|
216
222
|
getErrorMessage() {
|
|
@@ -6,6 +6,7 @@ import { MatInputModule } from '@angular/material/input';
|
|
|
6
6
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
7
7
|
import { OwlDateTimeModule, OwlNativeDateTimeModule } from '@danielmoncada/angular-datetime-picker';
|
|
8
8
|
import { interval } from 'rxjs';
|
|
9
|
+
import dayjs from 'dayjs';
|
|
9
10
|
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
10
11
|
import { Utils } from '@pega/angular-sdk-components';
|
|
11
12
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
@@ -13,6 +14,7 @@ import { dateFormatInfoDefault, getDateFormatInfo } from '@pega/angular-sdk-comp
|
|
|
13
14
|
import { PConnFieldProps } from '@pega/angular-sdk-components';
|
|
14
15
|
import { handleEvent } from '@pega/angular-sdk-components';
|
|
15
16
|
import { format } from '@pega/angular-sdk-components';
|
|
17
|
+
import { DateFormatters } from '@pega/angular-sdk-components';
|
|
16
18
|
|
|
17
19
|
interface DateTimeProps extends PConnFieldProps {
|
|
18
20
|
// If any, enter additional props that only exist on DateTime here
|
|
@@ -68,6 +70,7 @@ export class DateTimeComponent implements OnInit, OnDestroy {
|
|
|
68
70
|
actionsApi: Object;
|
|
69
71
|
propName: string;
|
|
70
72
|
formattedValue$: any;
|
|
73
|
+
timezone = PCore.getEnvironmentInfo()?.getTimeZone();
|
|
71
74
|
|
|
72
75
|
constructor(
|
|
73
76
|
private angularPConnect: AngularPConnectService,
|
|
@@ -88,7 +91,12 @@ export class DateTimeComponent implements OnInit, OnDestroy {
|
|
|
88
91
|
if (this.formGroup$) {
|
|
89
92
|
// add control to formGroup
|
|
90
93
|
this.formGroup$.addControl(this.controlName$, this.fieldControl);
|
|
91
|
-
this.
|
|
94
|
+
let dateTimeValue = this.value$ ?? '';
|
|
95
|
+
|
|
96
|
+
if (this.value$) {
|
|
97
|
+
dateTimeValue = dayjs(DateFormatters?.convertToTimezone(this.value$, { timezone: this.timezone }))?.toISOString();
|
|
98
|
+
}
|
|
99
|
+
this.fieldControl.setValue(dateTimeValue);
|
|
92
100
|
this.bHasForm$ = true;
|
|
93
101
|
} else {
|
|
94
102
|
this.bReadonly$ = true;
|
|
@@ -132,7 +140,11 @@ export class DateTimeComponent implements OnInit, OnDestroy {
|
|
|
132
140
|
this.testId = this.configProps$.testId;
|
|
133
141
|
this.helperText = this.configProps$.helperText;
|
|
134
142
|
this.value$ = this.configProps$?.value;
|
|
135
|
-
this.
|
|
143
|
+
let dateTimeValue = this.configProps$?.value ?? '';
|
|
144
|
+
if (this.value$) {
|
|
145
|
+
dateTimeValue = dayjs(DateFormatters?.convertToTimezone(this.value$, { timezone: this.timezone }))?.toISOString();
|
|
146
|
+
}
|
|
147
|
+
this.fieldControl.setValue(dateTimeValue);
|
|
136
148
|
// timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
137
149
|
setTimeout(() => {
|
|
138
150
|
if (this.configProps$.required != null) {
|
|
@@ -186,7 +198,9 @@ export class DateTimeComponent implements OnInit, OnDestroy {
|
|
|
186
198
|
// this comes from the date pop up
|
|
187
199
|
if (typeof event.value === 'object') {
|
|
188
200
|
// convert date to pega "date" format
|
|
189
|
-
|
|
201
|
+
const dateTime = dayjs(event.value?.toISOString());
|
|
202
|
+
const timeZoneDateTime = (dayjs as any).tz(dateTime.format('YYYY-MM-DDTHH:mm:ss'), this.timezone);
|
|
203
|
+
event.value = timeZoneDateTime && timeZoneDateTime.isValid() ? timeZoneDateTime.toISOString() : '';
|
|
190
204
|
}
|
|
191
205
|
handleEvent(this.actionsApi, 'changeNblur', this.propName, event.value);
|
|
192
206
|
}
|
|
@@ -4,6 +4,7 @@ import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angul
|
|
|
4
4
|
import { MatInputModule } from '@angular/material/input';
|
|
5
5
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
6
6
|
import { NgxCurrencyDirective, NgxCurrencyInputMode } from 'ngx-currency';
|
|
7
|
+
import { interval } from 'rxjs';
|
|
7
8
|
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
8
9
|
import { Utils } from '@pega/angular-sdk-components';
|
|
9
10
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
@@ -65,6 +66,7 @@ export class DecimalComponent implements OnInit, OnDestroy {
|
|
|
65
66
|
formatter;
|
|
66
67
|
formattedValue: any;
|
|
67
68
|
inputMode: any;
|
|
69
|
+
suffix = '';
|
|
68
70
|
|
|
69
71
|
constructor(
|
|
70
72
|
private angularPConnect: AngularPConnectService,
|
|
@@ -136,6 +138,7 @@ export class DecimalComponent implements OnInit, OnDestroy {
|
|
|
136
138
|
nValue = parseFloat(nValue);
|
|
137
139
|
}
|
|
138
140
|
this.value$ = nValue;
|
|
141
|
+
this.fieldControl.setValue(this.value$);
|
|
139
142
|
}
|
|
140
143
|
this.helperText = this.configProps$.helperText;
|
|
141
144
|
this.placeholder = this.configProps$.placeholder || '';
|
|
@@ -185,27 +188,47 @@ export class DecimalComponent implements OnInit, OnDestroy {
|
|
|
185
188
|
if (this.bReadonly$ && this.formatter === 'Currency') {
|
|
186
189
|
this.currencySymbol = theSymbols.theCurrencySymbol;
|
|
187
190
|
}
|
|
191
|
+
|
|
192
|
+
if (this.bReadonly$ && this.formatter === 'Percentage') {
|
|
193
|
+
this.suffix = '%';
|
|
194
|
+
}
|
|
195
|
+
|
|
188
196
|
this.decimalPrecision = this.configProps$?.decimalPrecision ?? 2;
|
|
189
197
|
|
|
190
198
|
this.componentReference = this.pConn$.getStateProps().value;
|
|
199
|
+
|
|
200
|
+
// trigger display of error message with field control
|
|
201
|
+
if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
|
|
202
|
+
const timer = interval(100).subscribe(() => {
|
|
203
|
+
this.fieldControl.setErrors({ message: true });
|
|
204
|
+
this.fieldControl.markAsTouched();
|
|
205
|
+
|
|
206
|
+
timer.unsubscribe();
|
|
207
|
+
});
|
|
208
|
+
}
|
|
191
209
|
}
|
|
192
210
|
|
|
193
211
|
fieldOnBlur(event: any) {
|
|
194
|
-
const
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
212
|
+
const oldVal = this.value$ ?? '';
|
|
213
|
+
const isValueChanged = event.target.value.toString() !== oldVal.toString();
|
|
214
|
+
|
|
215
|
+
if (isValueChanged) {
|
|
216
|
+
const actionsApi = this.pConn$?.getActionsApi();
|
|
217
|
+
const propName = this.pConn$?.getStateProps().value;
|
|
218
|
+
let value = event?.target?.value;
|
|
219
|
+
// replacing thousand separator with empty string as not required in api call
|
|
220
|
+
if (this.configProps$.showGroupSeparators) {
|
|
221
|
+
const thousandSep = this.thousandSeparator === '.' ? '\\.' : this.thousandSeparator;
|
|
222
|
+
const regExp = new RegExp(String.raw`${thousandSep}`, 'g');
|
|
223
|
+
value = value?.replace(regExp, '');
|
|
224
|
+
}
|
|
225
|
+
// replacing decimal separator with '.'
|
|
226
|
+
if (this.decimalSeparator !== '.') {
|
|
227
|
+
const regExp = new RegExp(String.raw`${this.decimalSeparator}`, 'g');
|
|
228
|
+
value = value.replace(regExp, '.');
|
|
229
|
+
}
|
|
230
|
+
handleEvent(actionsApi, 'changeNblur', propName, value);
|
|
231
|
+
}
|
|
209
232
|
}
|
|
210
233
|
|
|
211
234
|
getErrorMessage() {
|
|
@@ -134,6 +134,18 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
set options(options: IOption[]) {
|
|
138
|
+
this.options$ = options;
|
|
139
|
+
if (this.displayMode$) {
|
|
140
|
+
this.value$ = this.options$?.find(option => option.key === this.value$)?.value || this.value$;
|
|
141
|
+
this.localizedValue = this.pConn$.getLocalizedValue(
|
|
142
|
+
this.value$ === 'Select...' ? '' : this.value$,
|
|
143
|
+
this.localePath,
|
|
144
|
+
this.pConn$.getLocaleRuleNameFromKeys(this.localeClass, this.localeContext, this.localeName)
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
137
149
|
ngOnDestroy(): void {
|
|
138
150
|
if (this.formGroup$) {
|
|
139
151
|
this.formGroup$.removeControl(this.controlName$);
|
|
@@ -215,7 +227,7 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
215
227
|
if (this.theDatasource) {
|
|
216
228
|
const optionsList = [...this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject())];
|
|
217
229
|
optionsList?.unshift({ key: 'Select', value: this.pConn$.getLocalizedValue('Select...', '', '') });
|
|
218
|
-
this.options
|
|
230
|
+
this.options = optionsList;
|
|
219
231
|
}
|
|
220
232
|
|
|
221
233
|
this.actionsApi = this.pConn$.getActionsApi();
|
|
@@ -239,6 +251,9 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
239
251
|
this.localePath,
|
|
240
252
|
this.pConn$.getLocaleRuleNameFromKeys(this.localeClass, this.localeContext, this.localeName)
|
|
241
253
|
);
|
|
254
|
+
|
|
255
|
+
this.localizedValue = this.options$?.find(opt => opt.key === this.value$)?.value || this.localizedValue;
|
|
256
|
+
|
|
242
257
|
// trigger display of error message with field control
|
|
243
258
|
if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
|
|
244
259
|
const timer = interval(100).subscribe(() => {
|
|
@@ -278,7 +293,7 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
278
293
|
}
|
|
279
294
|
|
|
280
295
|
columns = preProcessColumns(columns) || [];
|
|
281
|
-
if (
|
|
296
|
+
if (listType !== 'associated' && typeof datasource === 'string') {
|
|
282
297
|
this.getData(datasource, parameters, columns, context, listType);
|
|
283
298
|
}
|
|
284
299
|
}
|
|
@@ -309,7 +324,7 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
309
324
|
optionsData.push(obj);
|
|
310
325
|
});
|
|
311
326
|
optionsData?.unshift({ key: 'Select', value: this.pConn$.getLocalizedValue('Select...', '', '') });
|
|
312
|
-
this.options
|
|
327
|
+
this.options = optionsData;
|
|
313
328
|
});
|
|
314
329
|
});
|
|
315
330
|
}
|
|
@@ -159,16 +159,26 @@ export class EmailComponent implements OnInit, OnDestroy {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
fieldOnChange(event: any) {
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
162
|
+
const oldVal = this.value$ ?? '';
|
|
163
|
+
const isValueChanged = event.target.value.toString() !== oldVal.toString();
|
|
164
|
+
|
|
165
|
+
if (isValueChanged) {
|
|
166
|
+
const value = event?.target?.value;
|
|
167
|
+
handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
|
|
168
|
+
this.pConn$.clearErrorMessages({
|
|
169
|
+
property: this.propName
|
|
170
|
+
});
|
|
171
|
+
}
|
|
167
172
|
}
|
|
168
173
|
|
|
169
174
|
fieldOnBlur(event: any) {
|
|
170
|
-
const
|
|
171
|
-
|
|
175
|
+
const oldVal = this.value$ ?? '';
|
|
176
|
+
const isValueChanged = event.target.value.toString() !== oldVal.toString();
|
|
177
|
+
|
|
178
|
+
if (isValueChanged) {
|
|
179
|
+
const value = event?.target?.value;
|
|
180
|
+
handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
|
|
181
|
+
}
|
|
172
182
|
}
|
|
173
183
|
|
|
174
184
|
getErrorMessage() {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
[required]="bRequired$"
|
|
16
16
|
[formControl]="fieldControl"
|
|
17
17
|
[attr.data-test-id]="testId"
|
|
18
|
-
(change)="fieldOnChange()"
|
|
18
|
+
(change)="fieldOnChange($event)"
|
|
19
19
|
(blur)="fieldOnBlur($event)"
|
|
20
20
|
/>
|
|
21
21
|
<mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
|
|
@@ -161,15 +161,25 @@ export class IntegerComponent implements OnInit, OnDestroy {
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
fieldOnChange() {
|
|
165
|
-
this.
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
fieldOnChange(event: any) {
|
|
165
|
+
const oldVal = this.value$ ?? '';
|
|
166
|
+
const isValueChanged = event.target.value.toString() !== oldVal.toString();
|
|
167
|
+
|
|
168
|
+
if (isValueChanged) {
|
|
169
|
+
this.pConn$.clearErrorMessages({
|
|
170
|
+
property: this.propName
|
|
171
|
+
});
|
|
172
|
+
}
|
|
168
173
|
}
|
|
169
174
|
|
|
170
175
|
fieldOnBlur(event: any) {
|
|
171
|
-
const
|
|
172
|
-
|
|
176
|
+
const oldVal = this.value$ ?? '';
|
|
177
|
+
const isValueChanged = event.target.value.toString() !== oldVal.toString();
|
|
178
|
+
|
|
179
|
+
if (isValueChanged) {
|
|
180
|
+
const value = event?.target?.value;
|
|
181
|
+
handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
|
|
182
|
+
}
|
|
173
183
|
}
|
|
174
184
|
|
|
175
185
|
getErrorMessage() {
|
|
@@ -179,27 +179,37 @@ export class PercentageComponent implements OnInit, OnDestroy {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
fieldOnChange() {
|
|
183
|
-
this.
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
fieldOnChange(event: any) {
|
|
183
|
+
const oldVal = this.value$ ?? '';
|
|
184
|
+
const isValueChanged = event.target.value.toString() !== oldVal.toString();
|
|
185
|
+
|
|
186
|
+
if (isValueChanged) {
|
|
187
|
+
this.pConn$.clearErrorMessages({
|
|
188
|
+
property: this.propName
|
|
189
|
+
});
|
|
190
|
+
}
|
|
186
191
|
}
|
|
187
192
|
|
|
188
193
|
fieldOnBlur(event: any) {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
if (
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
194
|
+
const oldVal = this.value$ ?? '';
|
|
195
|
+
const isValueChanged = event.target.value.toString() !== oldVal.toString();
|
|
196
|
+
|
|
197
|
+
if (isValueChanged) {
|
|
198
|
+
let value = event?.target?.value;
|
|
199
|
+
value = value ? value.replace(/%/g, '') : '';
|
|
200
|
+
// replacing thousand separator with empty string as not required in api call
|
|
201
|
+
if (this.configProps$.showGroupSeparators) {
|
|
202
|
+
const thousandSep = this.thousandSeparator === '.' ? '\\.' : this.thousandSeparator;
|
|
203
|
+
const regExp = new RegExp(String.raw`${thousandSep}`, 'g');
|
|
204
|
+
value = value?.replace(regExp, '');
|
|
205
|
+
}
|
|
206
|
+
// replacing decimal separator with '.'
|
|
207
|
+
if (this.decimalSeparator !== '.') {
|
|
208
|
+
const regExp = new RegExp(String.raw`${this.decimalSeparator}`, 'g');
|
|
209
|
+
value = value.replace(regExp, '.');
|
|
210
|
+
}
|
|
211
|
+
handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
|
|
201
212
|
}
|
|
202
|
-
handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
|
|
203
213
|
}
|
|
204
214
|
|
|
205
215
|
getErrorMessage() {
|
|
@@ -38,18 +38,11 @@ export class PhoneComponent implements OnInit, OnDestroy {
|
|
|
38
38
|
displayMode$?: string = '';
|
|
39
39
|
controlName$: string;
|
|
40
40
|
bHasForm$ = true;
|
|
41
|
-
componentReference = '';
|
|
42
41
|
testId: string;
|
|
43
|
-
separateDialCode = false;
|
|
44
|
-
afterBlur: boolean;
|
|
45
42
|
helperText: string;
|
|
46
43
|
|
|
47
44
|
fieldControl = new FormControl('', null);
|
|
48
45
|
|
|
49
|
-
phoneForm = new FormGroup({
|
|
50
|
-
phone: new FormControl<string | null>(null)
|
|
51
|
-
});
|
|
52
|
-
|
|
53
46
|
actionsApi: Object;
|
|
54
47
|
propName: string;
|
|
55
48
|
|
|
@@ -117,6 +110,7 @@ export class PhoneComponent implements OnInit, OnDestroy {
|
|
|
117
110
|
this.testId = this.configProps$.testId;
|
|
118
111
|
if (this.configProps$.value != undefined) {
|
|
119
112
|
this.value$ = this.configProps$.value;
|
|
113
|
+
this.fieldControl.setValue(this.value$);
|
|
120
114
|
}
|
|
121
115
|
this.helperText = this.configProps$.helperText;
|
|
122
116
|
|
|
@@ -150,10 +144,6 @@ export class PhoneComponent implements OnInit, OnDestroy {
|
|
|
150
144
|
this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
|
|
151
145
|
}
|
|
152
146
|
|
|
153
|
-
if (this.bReadonly$) {
|
|
154
|
-
this.phoneForm.setValue({ phone: this.value$ });
|
|
155
|
-
}
|
|
156
|
-
|
|
157
147
|
// trigger display of error message with field control
|
|
158
148
|
if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
|
|
159
149
|
const timer = interval(100).subscribe(() => {
|
|
@@ -170,9 +160,12 @@ export class PhoneComponent implements OnInit, OnDestroy {
|
|
|
170
160
|
}
|
|
171
161
|
|
|
172
162
|
fieldOnChange() {
|
|
173
|
-
|
|
163
|
+
const oldVal = this.value$ ?? '';
|
|
164
|
+
const newVal = this.formGroup$.controls[this.controlName$].value;
|
|
165
|
+
const isValueChanged = newVal?.toString() !== oldVal.toString();
|
|
166
|
+
|
|
167
|
+
if (isValueChanged && newVal) {
|
|
174
168
|
const value = this.formGroup$.controls[this.controlName$].value;
|
|
175
|
-
this.afterBlur = true;
|
|
176
169
|
handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
|
|
177
170
|
}
|
|
178
171
|
}
|
|
@@ -116,8 +116,12 @@ export class RichTextComponent implements OnInit, OnDestroy {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
fieldOnChange() {
|
|
120
|
-
|
|
119
|
+
fieldOnChange(editorValue: any) {
|
|
120
|
+
const oldVal = this.value$ ?? '';
|
|
121
|
+
const newVal = editorValue?.editor?.getBody()?.innerHTML ?? '';
|
|
122
|
+
const isValueChanged = newVal.toString() !== oldVal.toString();
|
|
123
|
+
|
|
124
|
+
if (isValueChanged || this.status === 'error') {
|
|
121
125
|
const property = this.propName;
|
|
122
126
|
this.pConn$.clearErrorMessages({
|
|
123
127
|
property,
|
|
@@ -128,6 +132,11 @@ export class RichTextComponent implements OnInit, OnDestroy {
|
|
|
128
132
|
}
|
|
129
133
|
|
|
130
134
|
fieldOnBlur(editorValue: any) {
|
|
131
|
-
|
|
135
|
+
const oldVal = this.value$ ?? '';
|
|
136
|
+
const isValueChanged = editorValue.toString() !== oldVal.toString();
|
|
137
|
+
|
|
138
|
+
if (isValueChanged) {
|
|
139
|
+
handleEvent(this.actionsApi, 'changeNblur', this.propName, editorValue);
|
|
140
|
+
}
|
|
132
141
|
}
|
|
133
142
|
}
|
|
@@ -144,7 +144,7 @@ export class TextComponent implements OnInit, OnDestroy {
|
|
|
144
144
|
generateDateTime(sVal): string {
|
|
145
145
|
if (!sVal) return '';
|
|
146
146
|
if (sVal.length === 10) return this.generateDate(sVal);
|
|
147
|
-
const value = sVal.substring(0, sVal.length - 1);
|
|
147
|
+
// const value = sVal.substring(0, sVal.length - 1);
|
|
148
148
|
// value = new Intl.DateTimeFormat('default', {
|
|
149
149
|
// year: 'numeric',
|
|
150
150
|
// month: 'numeric',
|
|
@@ -155,6 +155,6 @@ export class TextComponent implements OnInit, OnDestroy {
|
|
|
155
155
|
// hour12: true,
|
|
156
156
|
// }).format(new Date(value))
|
|
157
157
|
|
|
158
|
-
return this.utils.generateDateTime(
|
|
158
|
+
return this.utils.generateDateTime(sVal, 'DateTime-Long-YYYY-Custom');
|
|
159
159
|
}
|
|
160
160
|
}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
[required]="bRequired$"
|
|
17
17
|
[disabled]="bDisabled$"
|
|
18
18
|
[formControl]="fieldControl"
|
|
19
|
-
(change)="fieldOnChange()"
|
|
19
|
+
(change)="fieldOnChange($event)"
|
|
20
20
|
(blur)="fieldOnBlur($event)"
|
|
21
21
|
></textarea>
|
|
22
22
|
<mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
|