@pega/angular-sdk-overrides 24.2.10 → 24.2.12
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/auto-complete/auto-complete.component.html +0 -1
- package/lib/field/auto-complete/auto-complete.component.ts +15 -2
- package/lib/field/check-box/check-box.component.html +4 -0
- package/lib/field/currency/currency.component.ts +19 -13
- package/lib/field/date/date.component.html +2 -1
- package/lib/field/date-time/date-time.component.html +2 -2
- 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.html +1 -0
- package/lib/field/dropdown/dropdown.component.ts +18 -4
- 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/list-view-action-buttons/list-view-action-buttons.component.ts +3 -2
- package/lib/field/percentage/percentage.component.html +1 -1
- package/lib/field/percentage/percentage.component.ts +27 -17
- package/lib/field/phone/config-ext.json +1 -1
- package/lib/field/phone/phone.component.html +3 -1
- package/lib/field/phone/phone.component.ts +6 -13
- package/lib/field/radio-buttons/radio-buttons.component.html +3 -6
- package/lib/field/rich-text/rich-text.component.ts +12 -3
- package/lib/field/text/text.component.ts +6 -4
- package/lib/field/text-area/text-area.component.html +4 -2
- 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 +2 -2
- 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 +70 -7
- package/lib/infra/Containers/flow-container/flow-container.component.ts +17 -43
- package/lib/infra/Containers/flow-container/helpers.ts +2 -2
- 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 -7
- package/lib/infra/action-buttons/action-buttons.component.html +1 -1
- package/lib/infra/assignment/assignment.component.html +1 -1
- package/lib/infra/assignment/assignment.component.ts +82 -39
- package/lib/infra/assignment-card/assignment-card.component.html +1 -0
- package/lib/infra/defer-load/defer-load.component.ts +4 -1
- package/lib/infra/navbar/navbar.component.ts +0 -2
- package/lib/infra/reference/reference.component.ts +77 -90
- package/lib/infra/root-container/root-container.component.html +2 -15
- package/lib/infra/root-container/root-container.component.ts +24 -27
- package/lib/template/base/form-template-base.ts +6 -0
- package/lib/template/confirmation/confirmation.component.html +1 -1
- package/lib/template/default-form/default-form.component.ts +35 -2
- 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-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 -3
- package/lib/template/list-view/listViewHelpers.ts +2 -5
- package/lib/template/list-view/utils.ts +2 -5
- package/lib/template/simple-table-manual/helpers.ts +9 -7
- package/lib/template/simple-table-manual/simple-table-manual.component.html +25 -6
- package/lib/template/simple-table-manual/simple-table-manual.component.scss +11 -3
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +62 -24
- package/lib/template/utils.ts +16 -0
- package/lib/widget/feed-container/feed-container.component.ts +0 -2
- package/lib/widget/todo/todo.component.html +4 -5
- package/lib/widget/todo/todo.component.scss +9 -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
|
}
|
|
@@ -14,6 +14,10 @@ import { DatapageService } from '@pega/angular-sdk-components';
|
|
|
14
14
|
import { handleEvent } from '@pega/angular-sdk-components';
|
|
15
15
|
import { PConnFieldProps } from '@pega/angular-sdk-components';
|
|
16
16
|
|
|
17
|
+
interface IOption {
|
|
18
|
+
key: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}
|
|
17
21
|
interface AutoCompleteProps extends PConnFieldProps {
|
|
18
22
|
// If any, enter additional props that only exist on AutoComplete here
|
|
19
23
|
deferDatasource?: boolean;
|
|
@@ -108,6 +112,13 @@ export class AutoCompleteComponent implements OnInit, OnDestroy {
|
|
|
108
112
|
);
|
|
109
113
|
}
|
|
110
114
|
|
|
115
|
+
setOptions(options: IOption[]) {
|
|
116
|
+
this.options$ = options;
|
|
117
|
+
const index = this.options$?.findIndex(element => element.key === this.configProps$.value);
|
|
118
|
+
this.value$ = index > -1 ? this.options$[index].value : this.configProps$.value;
|
|
119
|
+
this.fieldControl.setValue(this.value$);
|
|
120
|
+
}
|
|
121
|
+
|
|
111
122
|
ngOnDestroy(): void {
|
|
112
123
|
if (this.formGroup$) {
|
|
113
124
|
this.formGroup$.removeControl(this.controlName$);
|
|
@@ -149,6 +160,7 @@ export class AutoCompleteComponent implements OnInit, OnDestroy {
|
|
|
149
160
|
if (this.configProps$.value != undefined) {
|
|
150
161
|
const index = this.options$?.findIndex(element => element.key === this.configProps$.value);
|
|
151
162
|
this.value$ = index > -1 ? this.options$[index].value : this.configProps$.value;
|
|
163
|
+
this.fieldControl.setValue(this.value$);
|
|
152
164
|
}
|
|
153
165
|
|
|
154
166
|
this.setPropertyValuesFromProps();
|
|
@@ -191,7 +203,8 @@ export class AutoCompleteComponent implements OnInit, OnDestroy {
|
|
|
191
203
|
|
|
192
204
|
this.componentReference = this.pConn$.getStateProps().value;
|
|
193
205
|
if (this.listType === 'associated') {
|
|
194
|
-
|
|
206
|
+
const optionsList = this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject('')); // 1st arg empty string until typedef marked correctly
|
|
207
|
+
this.setOptions(optionsList);
|
|
195
208
|
}
|
|
196
209
|
|
|
197
210
|
if (!this.displayMode$ && this.listType !== 'associated') {
|
|
@@ -263,7 +276,7 @@ export class AutoCompleteComponent implements OnInit, OnDestroy {
|
|
|
263
276
|
};
|
|
264
277
|
optionsData.push(obj);
|
|
265
278
|
});
|
|
266
|
-
this.
|
|
279
|
+
this.setOptions(optionsData);
|
|
267
280
|
}
|
|
268
281
|
|
|
269
282
|
flattenParameters(params = {}) {
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
<mat-checkbox
|
|
19
19
|
[labelPosition]="'after'"
|
|
20
20
|
[checked]="item.selected"
|
|
21
|
+
[disabled]="bDisabled$ || bReadonly$"
|
|
22
|
+
[required]="bRequired$"
|
|
21
23
|
[attr.data-test-id]="testId + ':' + item.value"
|
|
22
24
|
(change)="handleChangeMultiMode($event, item)"
|
|
23
25
|
(blur)="fieldOnBlur($event)"
|
|
@@ -29,6 +31,8 @@
|
|
|
29
31
|
<mat-checkbox
|
|
30
32
|
[labelPosition]="'after'"
|
|
31
33
|
[checked]="isChecked$"
|
|
34
|
+
[disabled]="bDisabled$ || bReadonly$"
|
|
35
|
+
[required]="bRequired$"
|
|
32
36
|
[attr.data-test-id]="testId"
|
|
33
37
|
[formControl]="fieldControl"
|
|
34
38
|
(change)="fieldOnChange($event)"
|
|
@@ -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() {
|
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
type="text"
|
|
16
16
|
[value]="value$"
|
|
17
17
|
[required]="bRequired$"
|
|
18
|
+
[disabled]="bDisabled$"
|
|
18
19
|
[formControl]="fieldControl"
|
|
19
20
|
(dateChange)="fieldOnDateChange($event)"
|
|
20
21
|
/>
|
|
21
|
-
<mat-datepicker-toggle matSuffix [for]="pegadate"></mat-datepicker-toggle>
|
|
22
|
+
<mat-datepicker-toggle matSuffix [for]="pegadate" [disabled]="bDisabled$"></mat-datepicker-toggle>
|
|
22
23
|
<mat-datepicker #pegadate [startAt]="value$"></mat-datepicker>
|
|
23
24
|
<mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
|
|
24
25
|
</mat-form-field>
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
[placeholder]="placeholder"
|
|
14
14
|
[formControl]="fieldControl"
|
|
15
15
|
(dateTimeChange)="fieldOnDateChange($event)"
|
|
16
|
-
[value]="value$"
|
|
17
16
|
[required]="bRequired$"
|
|
17
|
+
[readonly]="bDisabled$"
|
|
18
18
|
/>
|
|
19
19
|
<mat-datepicker-toggle matSuffix [owlDateTimeTrigger]="dtPicker"></mat-datepicker-toggle>
|
|
20
|
-
<owl-date-time #dtPicker></owl-date-time>
|
|
20
|
+
<owl-date-time #dtPicker [disabled]="bDisabled$"></owl-date-time>
|
|
21
21
|
<mat-error *ngIf="fieldControl?.invalid">{{ getErrorMessage() }}</mat-error>
|
|
22
22
|
</mat-form-field>
|
|
23
23
|
</div>
|
|
@@ -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() {
|
|
@@ -121,7 +121,6 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
121
121
|
// call updateSelf when initializing
|
|
122
122
|
this.checkAndUpdate();
|
|
123
123
|
// this should get called afer checkAndUpdate
|
|
124
|
-
this.getDatapageData();
|
|
125
124
|
|
|
126
125
|
if (this.formGroup$) {
|
|
127
126
|
// add control to formGroup
|
|
@@ -134,6 +133,18 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
134
133
|
}
|
|
135
134
|
}
|
|
136
135
|
|
|
136
|
+
set options(options: IOption[]) {
|
|
137
|
+
this.options$ = options;
|
|
138
|
+
if (this.displayMode$) {
|
|
139
|
+
this.value$ = this.options$?.find(option => option.key === this.value$)?.value || this.value$;
|
|
140
|
+
this.localizedValue = this.pConn$.getLocalizedValue(
|
|
141
|
+
this.value$ === 'Select...' ? '' : this.value$,
|
|
142
|
+
this.localePath,
|
|
143
|
+
this.pConn$.getLocaleRuleNameFromKeys(this.localeClass, this.localeContext, this.localeName)
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
137
148
|
ngOnDestroy(): void {
|
|
138
149
|
if (this.formGroup$) {
|
|
139
150
|
this.formGroup$.removeControl(this.controlName$);
|
|
@@ -215,7 +226,7 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
215
226
|
if (this.theDatasource) {
|
|
216
227
|
const optionsList = [...this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject())];
|
|
217
228
|
optionsList?.unshift({ key: 'Select', value: this.pConn$.getLocalizedValue('Select...', '', '') });
|
|
218
|
-
this.options
|
|
229
|
+
this.options = optionsList;
|
|
219
230
|
}
|
|
220
231
|
|
|
221
232
|
this.actionsApi = this.pConn$.getActionsApi();
|
|
@@ -239,6 +250,9 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
239
250
|
this.localePath,
|
|
240
251
|
this.pConn$.getLocaleRuleNameFromKeys(this.localeClass, this.localeContext, this.localeName)
|
|
241
252
|
);
|
|
253
|
+
|
|
254
|
+
this.localizedValue = this.options$?.find(opt => opt.key === this.value$)?.value || this.localizedValue;
|
|
255
|
+
this.getDatapageData();
|
|
242
256
|
// trigger display of error message with field control
|
|
243
257
|
if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
|
|
244
258
|
const timer = interval(100).subscribe(() => {
|
|
@@ -278,7 +292,7 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
278
292
|
}
|
|
279
293
|
|
|
280
294
|
columns = preProcessColumns(columns) || [];
|
|
281
|
-
if (
|
|
295
|
+
if (listType !== 'associated' && typeof datasource === 'string') {
|
|
282
296
|
this.getData(datasource, parameters, columns, context, listType);
|
|
283
297
|
}
|
|
284
298
|
}
|
|
@@ -309,7 +323,7 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
309
323
|
optionsData.push(obj);
|
|
310
324
|
});
|
|
311
325
|
optionsData?.unshift({ key: 'Select', value: this.pConn$.getLocalizedValue('Select...', '', '') });
|
|
312
|
-
this.options
|
|
326
|
+
this.options = optionsData;
|
|
313
327
|
});
|
|
314
328
|
});
|
|
315
329
|
}
|
|
@@ -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() {
|
|
@@ -31,10 +31,11 @@ export class ListViewActionButtonsComponent {
|
|
|
31
31
|
this.pConn$
|
|
32
32
|
.getActionsApi()
|
|
33
33
|
.submitEmbeddedDataModal(this.context$)
|
|
34
|
-
.then(() => {
|
|
34
|
+
.then(() => {
|
|
35
|
+
this.closeActionsDialog.emit();
|
|
36
|
+
})
|
|
35
37
|
.finally(() => {
|
|
36
38
|
this.isDisabled = false;
|
|
37
39
|
});
|
|
38
|
-
this.closeActionsDialog.emit();
|
|
39
40
|
}
|
|
40
41
|
}
|
|
@@ -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() {
|