@pega/angular-sdk-overrides 0.242.3 → 0.242.4
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.scss +2 -1
- package/lib/field/currency/currency.component.html +3 -3
- package/lib/field/currency/currency.component.ts +14 -11
- package/lib/field/date-time/date-time.component.ts +2 -2
- package/lib/field/decimal/decimal.component.html +3 -3
- package/lib/field/decimal/decimal.component.ts +16 -13
- package/lib/field/dropdown/dropdown.component.ts +108 -7
- package/lib/field/percentage/percentage.component.html +2 -3
- package/lib/field/percentage/percentage.component.ts +16 -10
- package/lib/field/time/time.component.ts +1 -1
- package/lib/infra/view/view.component.html +1 -1
- package/lib/infra/view/view.component.ts +5 -1
- package/lib/template/default-form/default-form.component.html +0 -4
- package/lib/template/default-form/default-form.component.ts +0 -19
- package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
- package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +6 -1
- package/lib/template/field-value-list/field-value-list.component.scss +1 -0
- package/lib/template/list-view/list-view.component.html +3 -0
- package/lib/template/list-view/list-view.component.scss +11 -0
- package/lib/template/list-view/list-view.component.ts +21 -1
- package/lib/template/simple-table-manual/simple-table-manual.component.scss +1 -0
- package/package.json +1 -1
package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.psdk-case-summary-fields {
|
|
52
|
-
padding: calc(2 * 0.5rem);
|
|
52
|
+
// padding: calc(2 * 0.5rem);
|
|
53
53
|
display: grid;
|
|
54
54
|
grid-row-gap: calc(2 * 0.5rem);
|
|
55
55
|
}
|
|
@@ -90,6 +90,7 @@
|
|
|
90
90
|
grid-template-columns: 1fr;
|
|
91
91
|
grid-column-gap: calc(2 * 0.5rem);
|
|
92
92
|
grid-row-gap: calc(1 * 0.5rem);
|
|
93
|
+
margin: 0;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
.psdk-csf-secondary-field {
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
matInput
|
|
14
14
|
currencyMask
|
|
15
15
|
[options]="{
|
|
16
|
-
prefix:
|
|
17
|
-
thousands:
|
|
18
|
-
decimal:
|
|
16
|
+
prefix: currencySymbol,
|
|
17
|
+
thousands: thousandSeparator,
|
|
18
|
+
decimal: decimalSeparator,
|
|
19
19
|
align: 'left',
|
|
20
20
|
nullable: true,
|
|
21
21
|
precision: decimalPrecision,
|
|
@@ -52,9 +52,9 @@ export class CurrencyComponent implements OnInit, OnDestroy {
|
|
|
52
52
|
currencyOptions: Object = {};
|
|
53
53
|
|
|
54
54
|
fieldControl = new FormControl<number | null>(null, { updateOn: 'blur' });
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
currencySymbol: string;
|
|
56
|
+
thousandSeparator: string;
|
|
57
|
+
decimalSeparator: string;
|
|
58
58
|
inputMode: any;
|
|
59
59
|
decimalPrecision: number | undefined;
|
|
60
60
|
formattedValue: string;
|
|
@@ -136,9 +136,9 @@ export class CurrencyComponent implements OnInit, OnDestroy {
|
|
|
136
136
|
const currencyISOCode = this.configProps$?.currencyISOCode ?? '';
|
|
137
137
|
|
|
138
138
|
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
139
|
-
this.
|
|
140
|
-
this.
|
|
141
|
-
this.
|
|
139
|
+
this.currencySymbol = theSymbols.theCurrencySymbol;
|
|
140
|
+
this.thousandSeparator = theSymbols.theDigitGroupSeparator;
|
|
141
|
+
this.decimalSeparator = theSymbols.theDecimalIndicator;
|
|
142
142
|
this.formatter = this.configProps$.formatter;
|
|
143
143
|
|
|
144
144
|
if (this.displayMode$ === 'DISPLAY_ONLY' || this.displayMode$ === 'STACKED_LARGE_VAL') {
|
|
@@ -201,11 +201,14 @@ export class CurrencyComponent implements OnInit, OnDestroy {
|
|
|
201
201
|
const propName = this.pConn$?.getStateProps().value;
|
|
202
202
|
let value = event?.target?.value;
|
|
203
203
|
value = value?.substring(1);
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
204
|
+
// replacing thousand separator with empty string as not required in api call
|
|
205
|
+
const thousandSep = this.thousandSeparator === '.' ? '\\.' : this.thousandSeparator;
|
|
206
|
+
let regExp = new RegExp(String.raw`${thousandSep}`, 'g');
|
|
207
|
+
value = value?.replace(regExp, '');
|
|
208
|
+
// replacing decimal separator with '.'
|
|
209
|
+
if (this.decimalSeparator !== '.') {
|
|
210
|
+
regExp = new RegExp(String.raw`${this.decimalSeparator}`, 'g');
|
|
211
|
+
value = value.replace(regExp, '.');
|
|
209
212
|
}
|
|
210
213
|
handleEvent(actionsApi, 'changeNblur', propName, value);
|
|
211
214
|
}
|
|
@@ -76,7 +76,7 @@ export class DateTimeComponent implements OnInit, OnDestroy {
|
|
|
76
76
|
) {}
|
|
77
77
|
|
|
78
78
|
ngOnInit(): void {
|
|
79
|
-
this.placeholder = `${this.theDateFormat.dateFormatStringLC}, hh:mm
|
|
79
|
+
this.placeholder = `${this.theDateFormat.dateFormatStringLC}, hh:mm A`;
|
|
80
80
|
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
81
81
|
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
82
82
|
this.controlName$ = this.angularPConnect.getComponentID(this);
|
|
@@ -143,7 +143,7 @@ export class DateTimeComponent implements OnInit, OnDestroy {
|
|
|
143
143
|
|
|
144
144
|
if (this.displayMode$ === 'DISPLAY_ONLY' || this.displayMode$ === 'STACKED_LARGE_VAL') {
|
|
145
145
|
this.formattedValue$ = format(this.value$, 'datetime', {
|
|
146
|
-
format: `${this.theDateFormat.dateFormatString} hh:mm
|
|
146
|
+
format: `${this.theDateFormat.dateFormatString} hh:mm A`
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
matInput
|
|
12
12
|
currencyMask
|
|
13
13
|
[options]="{
|
|
14
|
-
prefix:
|
|
15
|
-
thousands:
|
|
16
|
-
decimal:
|
|
14
|
+
prefix: currencySymbol,
|
|
15
|
+
thousands: thousandSeparator,
|
|
16
|
+
decimal: decimalSeparator,
|
|
17
17
|
align: 'left',
|
|
18
18
|
nullable: true,
|
|
19
19
|
precision: decimalPrecision,
|
|
@@ -58,9 +58,9 @@ export class DecimalComponent implements OnInit, OnDestroy {
|
|
|
58
58
|
placeholder: string;
|
|
59
59
|
|
|
60
60
|
fieldControl = new FormControl<number | null>(null, null);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
decimalSeparator: string;
|
|
62
|
+
thousandSeparator: string;
|
|
63
|
+
currencySymbol = '';
|
|
64
64
|
decimalPrecision: number | undefined;
|
|
65
65
|
formatter;
|
|
66
66
|
formattedValue: any;
|
|
@@ -143,8 +143,8 @@ export class DecimalComponent implements OnInit, OnDestroy {
|
|
|
143
143
|
const currencyISOCode = this.configProps$?.currencyISOCode ?? '';
|
|
144
144
|
|
|
145
145
|
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
146
|
-
this.
|
|
147
|
-
this.
|
|
146
|
+
this.decimalSeparator = theSymbols.theDecimalIndicator;
|
|
147
|
+
this.thousandSeparator = showGroupSeparators ? theSymbols.theDigitGroupSeparator : '';
|
|
148
148
|
|
|
149
149
|
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
150
150
|
this.formatter = this.configProps$.formatter;
|
|
@@ -183,9 +183,7 @@ export class DecimalComponent implements OnInit, OnDestroy {
|
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
if (this.bReadonly$ && this.formatter === 'Currency') {
|
|
186
|
-
this.
|
|
187
|
-
} else {
|
|
188
|
-
this.currSym = '';
|
|
186
|
+
this.currencySymbol = theSymbols.theCurrencySymbol;
|
|
189
187
|
}
|
|
190
188
|
this.decimalPrecision = this.configProps$?.decimalPrecision ?? 2;
|
|
191
189
|
|
|
@@ -196,11 +194,16 @@ export class DecimalComponent implements OnInit, OnDestroy {
|
|
|
196
194
|
const actionsApi = this.pConn$?.getActionsApi();
|
|
197
195
|
const propName = this.pConn$?.getStateProps().value;
|
|
198
196
|
let value = event?.target?.value;
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
value = value?.replace(
|
|
197
|
+
// replacing thousand separator with empty string as not required in api call
|
|
198
|
+
if (this.configProps$.showGroupSeparators) {
|
|
199
|
+
const thousandSep = this.thousandSeparator === '.' ? '\\.' : this.thousandSeparator;
|
|
200
|
+
const regExp = new RegExp(String.raw`${thousandSep}`, 'g');
|
|
201
|
+
value = value?.replace(regExp, '');
|
|
202
|
+
}
|
|
203
|
+
// replacing decimal separator with '.'
|
|
204
|
+
if (this.decimalSeparator !== '.') {
|
|
205
|
+
const regExp = new RegExp(String.raw`${this.decimalSeparator}`, 'g');
|
|
206
|
+
value = value.replace(regExp, '.');
|
|
204
207
|
}
|
|
205
208
|
handleEvent(actionsApi, 'changeNblur', propName, value);
|
|
206
209
|
}
|
|
@@ -5,12 +5,47 @@ import { MatOptionModule } from '@angular/material/core';
|
|
|
5
5
|
import { MatSelectModule } from '@angular/material/select';
|
|
6
6
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
7
7
|
import { interval } from 'rxjs';
|
|
8
|
+
import isEqual from 'fast-deep-equal';
|
|
8
9
|
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
10
|
+
import { DatapageService } from '@pega/angular-sdk-components';
|
|
9
11
|
import { Utils } from '@pega/angular-sdk-components';
|
|
10
12
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
11
13
|
import { handleEvent } from '@pega/angular-sdk-components';
|
|
12
14
|
import { PConnFieldProps } from '@pega/angular-sdk-components';
|
|
13
15
|
|
|
16
|
+
function flattenParameters(params = {}) {
|
|
17
|
+
const flatParams = {};
|
|
18
|
+
Object.keys(params).forEach(key => {
|
|
19
|
+
const { name, value: theVal } = params[key];
|
|
20
|
+
flatParams[name] = theVal;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return flatParams;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function preProcessColumns(columnList) {
|
|
27
|
+
return columnList.map(col => {
|
|
28
|
+
const tempColObj = { ...col };
|
|
29
|
+
tempColObj.value = col.value && col.value.startsWith('.') ? col.value.substring(1) : col.value;
|
|
30
|
+
return tempColObj;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function getDisplayFieldsMetaData(columnList) {
|
|
35
|
+
const displayColumns = columnList.filter(col => col.display === 'true');
|
|
36
|
+
const metaDataObj: any = { key: '', primary: '', secondary: [] };
|
|
37
|
+
const keyCol = columnList.filter(col => col.key === 'true');
|
|
38
|
+
metaDataObj.key = keyCol.length > 0 ? keyCol[0].value : 'auto';
|
|
39
|
+
for (let index = 0; index < displayColumns.length; index += 1) {
|
|
40
|
+
if (displayColumns[index].primary === 'true') {
|
|
41
|
+
metaDataObj.primary = displayColumns[index].value;
|
|
42
|
+
} else {
|
|
43
|
+
metaDataObj.secondary.push(displayColumns[index].value);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return metaDataObj;
|
|
47
|
+
}
|
|
48
|
+
|
|
14
49
|
interface IOption {
|
|
15
50
|
key: string;
|
|
16
51
|
value: string;
|
|
@@ -22,6 +57,11 @@ interface DropdownProps extends PConnFieldProps {
|
|
|
22
57
|
datasource?: any[];
|
|
23
58
|
onRecordChange?: any;
|
|
24
59
|
fieldMetadata?: any;
|
|
60
|
+
listType?: string;
|
|
61
|
+
columns?: any[];
|
|
62
|
+
deferDatasource?: boolean;
|
|
63
|
+
datasourceMetadata?: any;
|
|
64
|
+
parameters?: any;
|
|
25
65
|
}
|
|
26
66
|
|
|
27
67
|
@Component({
|
|
@@ -53,7 +93,7 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
53
93
|
testId = '';
|
|
54
94
|
helperText: string;
|
|
55
95
|
hideLabel: any;
|
|
56
|
-
|
|
96
|
+
theDatasource: any[] | null;
|
|
57
97
|
fieldControl = new FormControl('', null);
|
|
58
98
|
fieldMetadata: any[];
|
|
59
99
|
localeContext = '';
|
|
@@ -67,7 +107,8 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
67
107
|
constructor(
|
|
68
108
|
private angularPConnect: AngularPConnectService,
|
|
69
109
|
private cdRef: ChangeDetectorRef,
|
|
70
|
-
private utils: Utils
|
|
110
|
+
private utils: Utils,
|
|
111
|
+
private dataPageService: DatapageService
|
|
71
112
|
) {}
|
|
72
113
|
|
|
73
114
|
ngOnInit(): void {
|
|
@@ -78,8 +119,9 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
78
119
|
// Then, continue on with other initialization
|
|
79
120
|
|
|
80
121
|
// call updateSelf when initializing
|
|
81
|
-
// this.updateSelf();
|
|
82
122
|
this.checkAndUpdate();
|
|
123
|
+
// this should get called afer checkAndUpdate
|
|
124
|
+
this.getDatapageData();
|
|
83
125
|
|
|
84
126
|
if (this.formGroup$) {
|
|
85
127
|
// add control to formGroup
|
|
@@ -122,7 +164,6 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
122
164
|
updateSelf(): void {
|
|
123
165
|
// moved this from ngOnInit() and call this from there instead...
|
|
124
166
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as DropdownProps;
|
|
125
|
-
|
|
126
167
|
if (this.configProps$.value != undefined) {
|
|
127
168
|
this.value$ = this.configProps$.value;
|
|
128
169
|
}
|
|
@@ -132,6 +173,7 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
132
173
|
this.label$ = this.configProps$.label;
|
|
133
174
|
this.helperText = this.configProps$.helperText;
|
|
134
175
|
this.hideLabel = this.configProps$.hideLabel;
|
|
176
|
+
const datasource = this.configProps$.datasource;
|
|
135
177
|
// timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
136
178
|
setTimeout(() => {
|
|
137
179
|
if (this.configProps$.required != null) {
|
|
@@ -140,6 +182,11 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
140
182
|
this.cdRef.detectChanges();
|
|
141
183
|
});
|
|
142
184
|
|
|
185
|
+
if (!isEqual(datasource, this.theDatasource)) {
|
|
186
|
+
// inbound datasource is different, so update theDatasource
|
|
187
|
+
this.theDatasource = datasource || null;
|
|
188
|
+
}
|
|
189
|
+
|
|
143
190
|
if (this.configProps$.visibility != null) {
|
|
144
191
|
this.bVisible$ = this.utils.getBooleanValue(this.configProps$.visibility);
|
|
145
192
|
}
|
|
@@ -161,14 +208,18 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
161
208
|
|
|
162
209
|
this.componentReference = this.pConn$.getStateProps().value;
|
|
163
210
|
|
|
164
|
-
const optionsList = [...this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject())];
|
|
165
|
-
optionsList?.unshift({ key: 'Select', value: this.pConn$.getLocalizedValue('Select...', '', '') });
|
|
166
|
-
this.options$ = optionsList;
|
|
167
211
|
if (this.value$ === '' && !this.bReadonly$) {
|
|
168
212
|
this.value$ = 'Select';
|
|
169
213
|
}
|
|
170
214
|
|
|
215
|
+
if (this.theDatasource) {
|
|
216
|
+
const optionsList = [...this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject())];
|
|
217
|
+
optionsList?.unshift({ key: 'Select', value: this.pConn$.getLocalizedValue('Select...', '', '') });
|
|
218
|
+
this.options$ = optionsList;
|
|
219
|
+
}
|
|
220
|
+
|
|
171
221
|
this.actionsApi = this.pConn$.getActionsApi();
|
|
222
|
+
|
|
172
223
|
this.propName = this.pConn$.getStateProps().value;
|
|
173
224
|
const className = this.pConn$.getCaseInfo().getClassName();
|
|
174
225
|
const refName = this.propName?.slice(this.propName.lastIndexOf('.') + 1);
|
|
@@ -199,6 +250,56 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
199
250
|
}
|
|
200
251
|
}
|
|
201
252
|
|
|
253
|
+
getDatapageData() {
|
|
254
|
+
const configProps = this.pConn$.getConfigProps() as DropdownProps;
|
|
255
|
+
let { listType, parameters, datasource = [], columns = [] } = configProps;
|
|
256
|
+
const { deferDatasource, datasourceMetadata } = configProps;
|
|
257
|
+
const context = this.pConn$.getContextName();
|
|
258
|
+
if (deferDatasource && datasourceMetadata?.datasource?.name) {
|
|
259
|
+
listType = 'datapage';
|
|
260
|
+
datasource = datasourceMetadata.datasource.name;
|
|
261
|
+
const { parameters: dataSourceParameters, propertyForDisplayText, propertyForValue } = datasourceMetadata.datasource;
|
|
262
|
+
parameters = flattenParameters(dataSourceParameters);
|
|
263
|
+
const displayProp = propertyForDisplayText?.startsWith('@P') ? propertyForDisplayText.substring(3) : propertyForDisplayText;
|
|
264
|
+
const valueProp = propertyForValue?.startsWith('@P') ? propertyForValue.substring(3) : propertyForValue;
|
|
265
|
+
columns = [
|
|
266
|
+
{
|
|
267
|
+
key: 'true',
|
|
268
|
+
setProperty: 'Associated property',
|
|
269
|
+
value: valueProp
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
display: 'true',
|
|
273
|
+
primary: 'true',
|
|
274
|
+
useForSearch: true,
|
|
275
|
+
value: displayProp
|
|
276
|
+
}
|
|
277
|
+
];
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
columns = preProcessColumns(columns) || [];
|
|
281
|
+
if (!this.displayMode$ && listType !== 'associated' && typeof datasource === 'string') {
|
|
282
|
+
this.getData(datasource, parameters, columns, context);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
getData(datasource, parameters, columns, context) {
|
|
287
|
+
this.dataPageService.getDataPageData(datasource, parameters, context).then((results: any) => {
|
|
288
|
+
const optionsData: any[] = [];
|
|
289
|
+
const displayColumn = getDisplayFieldsMetaData(columns);
|
|
290
|
+
results?.forEach(element => {
|
|
291
|
+
const val = element[displayColumn.primary]?.toString();
|
|
292
|
+
const obj = {
|
|
293
|
+
key: element[displayColumn.key] || element.pyGUID,
|
|
294
|
+
value: val
|
|
295
|
+
};
|
|
296
|
+
optionsData.push(obj);
|
|
297
|
+
});
|
|
298
|
+
optionsData?.unshift({ key: 'Select', value: this.pConn$.getLocalizedValue('Select...', '', '') });
|
|
299
|
+
this.options$ = optionsData;
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
|
|
202
303
|
isSelected(buttonValue: string): boolean {
|
|
203
304
|
return this.value$ === buttonValue;
|
|
204
305
|
}
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
[options]="{
|
|
14
14
|
prefix: '',
|
|
15
15
|
suffix: '%',
|
|
16
|
-
thousands:
|
|
17
|
-
decimal:
|
|
16
|
+
thousands: thousandSeparator,
|
|
17
|
+
decimal: decimalSeparator,
|
|
18
18
|
align: 'left',
|
|
19
19
|
nullable: true,
|
|
20
20
|
precision: decimalPrecision,
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
(change)="fieldOnChange()"
|
|
30
30
|
(blur)="fieldOnBlur($event)"
|
|
31
31
|
[readonly]="bReadonly$"
|
|
32
|
-
[value]="value$"
|
|
33
32
|
/>
|
|
34
33
|
<mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
|
|
35
34
|
</mat-form-field>
|
|
@@ -48,8 +48,8 @@ export class PercentageComponent implements OnInit, OnDestroy {
|
|
|
48
48
|
testId: string;
|
|
49
49
|
helperText: string;
|
|
50
50
|
placeholder: string;
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
decimalSeparator: string;
|
|
52
|
+
thousandSeparator: string;
|
|
53
53
|
inputMode: any;
|
|
54
54
|
decimalPrecision: number | undefined;
|
|
55
55
|
fieldControl = new FormControl<number | null>(null, null);
|
|
@@ -121,20 +121,21 @@ export class PercentageComponent implements OnInit, OnDestroy {
|
|
|
121
121
|
const nValue: any = this.configProps$.value;
|
|
122
122
|
if (nValue) {
|
|
123
123
|
this.value$ = nValue;
|
|
124
|
+
this.fieldControl.setValue(nValue);
|
|
124
125
|
}
|
|
125
126
|
this.helperText = this.configProps$.helperText;
|
|
126
127
|
this.placeholder = this.configProps$.placeholder || '';
|
|
127
128
|
const showGroupSeparators = this.configProps$.showGroupSeparators;
|
|
128
129
|
|
|
129
130
|
const theSymbols = getCurrencyCharacters('');
|
|
130
|
-
this.
|
|
131
|
-
this.
|
|
131
|
+
this.decimalSeparator = theSymbols.theDecimalIndicator;
|
|
132
|
+
this.thousandSeparator = showGroupSeparators ? theSymbols.theDigitGroupSeparator : '';
|
|
132
133
|
|
|
133
134
|
this.actionsApi = this.pConn$.getActionsApi();
|
|
134
135
|
this.propName = this.pConn$.getStateProps().value;
|
|
135
136
|
|
|
136
137
|
if (this.displayMode$ === 'DISPLAY_ONLY' || this.displayMode$ === 'STACKED_LARGE_VAL') {
|
|
137
|
-
this.formattedValue = format(nValue, 'percentage');
|
|
138
|
+
this.formattedValue = nValue ? format(nValue, 'percentage') : '';
|
|
138
139
|
}
|
|
139
140
|
|
|
140
141
|
// timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
@@ -187,11 +188,16 @@ export class PercentageComponent implements OnInit, OnDestroy {
|
|
|
187
188
|
fieldOnBlur(event: any) {
|
|
188
189
|
let value = event?.target?.value;
|
|
189
190
|
value = value ? value.replace(/%/g, '') : '';
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
value = value
|
|
191
|
+
// replacing thousand separator with empty string as not required in api call
|
|
192
|
+
if (this.configProps$.showGroupSeparators) {
|
|
193
|
+
const thousandSep = this.thousandSeparator === '.' ? '\\.' : this.thousandSeparator;
|
|
194
|
+
const regExp = new RegExp(String.raw`${thousandSep}`, 'g');
|
|
195
|
+
value = value?.replace(regExp, '');
|
|
196
|
+
}
|
|
197
|
+
// replacing decimal separator with '.'
|
|
198
|
+
if (this.decimalSeparator !== '.') {
|
|
199
|
+
const regExp = new RegExp(String.raw`${this.decimalSeparator}`, 'g');
|
|
200
|
+
value = value.replace(regExp, '.');
|
|
195
201
|
}
|
|
196
202
|
handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
|
|
197
203
|
}
|
|
@@ -129,7 +129,7 @@ export class TimeComponent implements OnInit, OnDestroy {
|
|
|
129
129
|
|
|
130
130
|
if (this.displayMode$ === 'DISPLAY_ONLY' || this.displayMode$ === 'STACKED_LARGE_VAL') {
|
|
131
131
|
this.formattedValue$ = format(this.value$, 'timeonly', {
|
|
132
|
-
format: 'hh:mm
|
|
132
|
+
format: 'hh:mm A'
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div *ngIf="visibility$ !== false" class="ng-view-top">
|
|
2
|
-
<div *ngIf="showLabel$ && label$ && templateName$
|
|
2
|
+
<div *ngIf="showLabel$ && label$ && !noHeaderTemplates.includes(templateName$)" class="template-title-container">
|
|
3
3
|
<span>{{ label$ }}</span>
|
|
4
4
|
</div>
|
|
5
5
|
|
|
@@ -7,6 +7,8 @@ import { getAllFields } from '@pega/angular-sdk-components';
|
|
|
7
7
|
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
8
8
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
9
9
|
|
|
10
|
+
const NO_HEADER_TEMPLATES = ['SubTabs', 'SimpleTable', 'Confirmation', 'DynamicTabs', 'DetailsSubTabs'];
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
13
|
* WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
|
|
12
14
|
* Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and
|
|
@@ -77,13 +79,15 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
77
79
|
|
|
78
80
|
angularPConnectData: AngularPConnectData = {};
|
|
79
81
|
|
|
82
|
+
noHeaderTemplates = NO_HEADER_TEMPLATES;
|
|
83
|
+
|
|
80
84
|
configProps$: ViewProps;
|
|
81
85
|
inheritedProps$: any;
|
|
82
86
|
arChildren$: any[];
|
|
83
87
|
templateName$: string;
|
|
84
88
|
title$ = '';
|
|
85
89
|
label$ = '';
|
|
86
|
-
showLabel$ =
|
|
90
|
+
showLabel$ = false;
|
|
87
91
|
visibility$ = true;
|
|
88
92
|
|
|
89
93
|
constructor(
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
<!-- When adding a component here, add the same component in 'region' template as well -->
|
|
2
|
-
<div *ngIf="!NO_HEADER_TEMPLATES.includes(template) && showLabel">
|
|
3
|
-
<div class="template-title-container">{{ label }}</div>
|
|
4
|
-
</div>
|
|
5
1
|
<div *ngIf="instructions" class="psdk-default-form-instruction-text">
|
|
6
2
|
<div key="instructions" id="instruction-text" [innerHTML]="instructions"></div>
|
|
7
3
|
</div>
|
|
@@ -9,7 +9,6 @@ import { FormTemplateBaseComponent } from '@pega/angular-sdk-components';
|
|
|
9
9
|
interface DefaultFormProps {
|
|
10
10
|
// If any, enter additional props that only exist on this component
|
|
11
11
|
NumCols: string;
|
|
12
|
-
template: string;
|
|
13
12
|
instructions: string;
|
|
14
13
|
}
|
|
15
14
|
|
|
@@ -26,32 +25,14 @@ export class DefaultFormComponent extends FormTemplateBaseComponent implements O
|
|
|
26
25
|
|
|
27
26
|
arChildren$: any[];
|
|
28
27
|
divClass$: string;
|
|
29
|
-
template: any;
|
|
30
|
-
showLabel: any;
|
|
31
|
-
label: any;
|
|
32
28
|
instructions: string;
|
|
33
29
|
|
|
34
|
-
NO_HEADER_TEMPLATES = [
|
|
35
|
-
'SubTabs',
|
|
36
|
-
'SimpleTable',
|
|
37
|
-
'Details',
|
|
38
|
-
'DetailsTwoColumn',
|
|
39
|
-
'DetailsThreeColumn',
|
|
40
|
-
'NarrowWideDetails',
|
|
41
|
-
'WideNarrowDetails',
|
|
42
|
-
'Confirmation'
|
|
43
|
-
];
|
|
44
|
-
|
|
45
30
|
constructor(private templateUtils: TemplateUtils) {
|
|
46
31
|
super();
|
|
47
32
|
}
|
|
48
33
|
|
|
49
34
|
ngOnInit(): void {
|
|
50
35
|
const configProps = this.pConn$.getConfigProps() as DefaultFormProps;
|
|
51
|
-
this.template = configProps?.template;
|
|
52
|
-
const propToUse: any = { ...this.pConn$.getInheritedProps() };
|
|
53
|
-
this.showLabel = propToUse?.showLabel;
|
|
54
|
-
this.label = propToUse?.label;
|
|
55
36
|
const kids = this.pConn$.getChildren();
|
|
56
37
|
this.instructions = this.templateUtils.getInstructions(this.pConn$, configProps?.instructions);
|
|
57
38
|
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
<div *ngIf="propsToUse.showLabel && propsToUse.label" class="template-title-container">
|
|
2
|
+
<span>{{ propsToUse.label }}</span>
|
|
3
|
+
</div>
|
|
1
4
|
<mat-tab-group id="dynamic-tabs" mat-stretch-tabs="false" animationDuration="0">
|
|
2
5
|
<mat-tab *ngFor="let tab of tabsItems" [label]="tab.name">
|
|
3
6
|
<component-mapper name="View" [props]="{ pConn$: tab.content.getPConnect() }"></component-mapper>
|
|
@@ -9,6 +9,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
|
9
9
|
interface DynamicTabsProps {
|
|
10
10
|
referenceList: string;
|
|
11
11
|
template: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
showLabel?: boolean;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
@Component({
|
|
@@ -24,6 +26,7 @@ export class DynamicTabsComponent implements OnInit, OnDestroy {
|
|
|
24
26
|
|
|
25
27
|
angularPConnectData: AngularPConnectData = {};
|
|
26
28
|
tabsItems: any[];
|
|
29
|
+
propsToUse: any;
|
|
27
30
|
|
|
28
31
|
constructor(private angularPConnect: AngularPConnectService) {}
|
|
29
32
|
|
|
@@ -54,7 +57,9 @@ export class DynamicTabsComponent implements OnInit, OnDestroy {
|
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
updateSelf() {
|
|
57
|
-
const { referenceList } = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as DynamicTabsProps;
|
|
60
|
+
const { referenceList, label, showLabel } = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as DynamicTabsProps;
|
|
61
|
+
|
|
62
|
+
this.propsToUse = { label, showLabel, ...this.pConn$.getInheritedProps() };
|
|
58
63
|
|
|
59
64
|
const { tablabel } = this.pConn$.getComponentConfig();
|
|
60
65
|
const tablabelProp = PCore.getAnnotationUtils().getPropertyName(tablabel);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<div class="psdk-list-header">
|
|
2
2
|
<div>
|
|
3
|
+
<h3 *ngIf="label" class="label" style="font-weight: bold">
|
|
4
|
+
{{ label }} <span class="results-count">{{ getResultsText() }}</span>
|
|
5
|
+
</h3>
|
|
3
6
|
<mat-form-field class="psdk-search" *ngIf="bShowSearch$">
|
|
4
7
|
<mat-label><img class="psdk-icon-search" src="{{ searchIcon$ }}" /> <span class="psdk-search-label">Search</span> </mat-label>
|
|
5
8
|
<input matInput id="search" (keyup)="applySearch($event)" placeholder="" />
|
|
@@ -165,3 +165,14 @@ tr.mat-mdc-row {
|
|
|
165
165
|
background-color: transparent;
|
|
166
166
|
align-items: center;
|
|
167
167
|
}
|
|
168
|
+
|
|
169
|
+
.results-count {
|
|
170
|
+
opacity: 0.7;
|
|
171
|
+
font-size: 0.8rem;
|
|
172
|
+
font-weight: bold;
|
|
173
|
+
margin-inline-start: 0.625rem;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.label {
|
|
177
|
+
margin: 8px;
|
|
178
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-classes-per-file */
|
|
2
1
|
import { Component, OnInit, Input, ViewChild, forwardRef, OnDestroy } from '@angular/core';
|
|
3
2
|
import { CommonModule } from '@angular/common';
|
|
4
3
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
@@ -29,6 +28,8 @@ declare const window: any;
|
|
|
29
28
|
const SELECTION_MODE = { SINGLE: 'single', MULTI: 'multi' };
|
|
30
29
|
|
|
31
30
|
interface ListViewProps {
|
|
31
|
+
inheritedProps: any;
|
|
32
|
+
title: string | undefined;
|
|
32
33
|
// If any, enter additional props that only exist on this component
|
|
33
34
|
globalSearch?: boolean;
|
|
34
35
|
referenceList?: any;
|
|
@@ -42,6 +43,7 @@ interface ListViewProps {
|
|
|
42
43
|
grouping: string | boolean;
|
|
43
44
|
value: any;
|
|
44
45
|
readonlyContextList: any;
|
|
46
|
+
label?: string;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
export class Group {
|
|
@@ -159,6 +161,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
159
161
|
xRayApis = PCore.getDebugger().getXRayRuntime();
|
|
160
162
|
xRayUid = this.xRayApis.startXRay();
|
|
161
163
|
checkBoxValue: string;
|
|
164
|
+
label?: string = '';
|
|
162
165
|
|
|
163
166
|
constructor(
|
|
164
167
|
private psService: ProgressSpinnerService,
|
|
@@ -192,6 +195,18 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
192
195
|
this.arFilterMainButtons$.push({ actionID: 'submit', jsAction: 'submit', name: 'Submit' });
|
|
193
196
|
this.arFilterSecondaryButtons$.push({ actionID: 'cancel', jsAction: 'cancel', name: 'Cancel' });
|
|
194
197
|
|
|
198
|
+
let title = this.configProps$?.title || this.configProps$?.label || 'List';
|
|
199
|
+
const inheritedProps = this.configProps$?.inheritedProps;
|
|
200
|
+
if (title === 'List' && inheritedProps) {
|
|
201
|
+
for (const inheritedProp of inheritedProps) {
|
|
202
|
+
if (inheritedProp?.prop === 'label') {
|
|
203
|
+
title = inheritedProp?.value;
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
this.label = title;
|
|
209
|
+
|
|
195
210
|
this.searchIcon$ = this.utils.getImageSrc('search', this.utils.getSDKStaticContentUrl());
|
|
196
211
|
setTimeout(() => {
|
|
197
212
|
PCore.getPubSubUtils().subscribe(
|
|
@@ -1380,6 +1395,11 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
1380
1395
|
return listFields;
|
|
1381
1396
|
}
|
|
1382
1397
|
|
|
1398
|
+
getResultsText() {
|
|
1399
|
+
const recordsCount = this.repeatList$?.paginator?.length || 0;
|
|
1400
|
+
return `${recordsCount || 0} result${recordsCount > 1 ? 's' : ''}`;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1383
1403
|
getField(fieldDefs, columnId) {
|
|
1384
1404
|
const fieldsMap = this.getFieldsMap(fieldDefs);
|
|
1385
1405
|
return fieldsMap.get(columnId);
|