@pega/angular-sdk-overrides 23.1.10 → 24.2.10
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/alert-banner/alert-banner.component.ts +1 -1
- package/lib/designSystemExtension/case-create-stage/case-create-stage.component.ts +1 -1
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.html +7 -4
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +2 -1
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +3 -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 +4 -1
- package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.html +1 -1
- package/lib/designSystemExtension/operator/operator.component.ts +11 -6
- package/lib/designSystemExtension/pulse/pulse.component.ts +7 -7
- package/lib/field/auto-complete/auto-complete.component.ts +17 -14
- package/lib/field/cancel-alert/cancel-alert.component.ts +0 -2
- package/lib/field/check-box/check-box.component.html +16 -15
- package/lib/field/check-box/check-box.component.scss +14 -1
- package/lib/field/check-box/check-box.component.ts +128 -45
- package/lib/field/currency/currency.component.html +16 -7
- package/lib/field/currency/currency.component.ts +55 -20
- package/lib/field/date/date.component.html +1 -6
- package/lib/field/date/date.component.ts +22 -39
- package/lib/field/date-time/date-time.component.html +6 -7
- package/lib/field/date-time/date-time.component.ts +28 -45
- package/lib/field/decimal/decimal.component.html +14 -4
- package/lib/field/decimal/decimal.component.ts +47 -7
- package/lib/field/dropdown/dropdown.component.ts +132 -21
- package/lib/field/email/email.component.ts +14 -4
- package/lib/field/group/group.component.html +1 -1
- package/lib/field/group/group.component.ts +6 -2
- package/lib/field/integer/integer.component.html +1 -1
- package/lib/field/integer/integer.component.ts +13 -5
- package/lib/field/multiselect/multiselect.component.html +33 -0
- package/lib/field/multiselect/multiselect.component.scss +7 -0
- package/lib/field/multiselect/multiselect.component.spec.ts +21 -0
- package/lib/field/multiselect/multiselect.component.ts +369 -0
- package/lib/field/multiselect/utils.ts +209 -0
- package/lib/field/percentage/percentage.component.html +17 -6
- package/lib/field/percentage/percentage.component.ts +51 -12
- package/lib/field/phone/phone.component.html +1 -1
- package/lib/field/phone/phone.component.ts +11 -14
- package/lib/field/radio-buttons/radio-buttons.component.ts +9 -12
- package/lib/field/rich-text/config-ext.json +10 -0
- package/lib/field/rich-text/rich-text.component.html +1 -1
- package/lib/field/rich-text/rich-text.component.ts +8 -6
- package/lib/field/scalar-list/scalar-list.component.ts +4 -4
- package/lib/field/text/text.component.ts +2 -0
- package/lib/field/text-area/text-area.component.html +2 -1
- package/lib/field/text-area/text-area.component.ts +13 -8
- package/lib/field/text-input/text-input.component.html +1 -1
- package/lib/field/text-input/text-input.component.ts +13 -5
- package/lib/field/time/time.component.html +3 -2
- package/lib/field/time/time.component.ts +23 -7
- package/lib/field/url/url.component.html +2 -1
- package/lib/field/url/url.component.ts +15 -5
- package/lib/field/user-reference/user-reference.component.html +42 -45
- package/lib/field/user-reference/user-reference.component.ts +73 -27
- package/lib/infra/Containers/base-components/flow-container-base.component.ts +22 -0
- package/lib/infra/Containers/base-components/helper.ts +89 -0
- package/lib/infra/Containers/flow-container/flow-container.component.html +9 -4
- package/lib/infra/Containers/flow-container/flow-container.component.ts +38 -33
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +41 -9
- package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +1 -1
- package/lib/infra/Containers/view-container/helper.ts +22 -0
- package/lib/infra/Containers/view-container/view-container.component.ts +5 -18
- package/lib/infra/assignment/assignment.component.ts +37 -39
- package/lib/infra/dashboard-filter/dashboard-filter.component.ts +0 -1
- package/lib/infra/defer-load/defer-load.component.ts +9 -12
- package/lib/infra/multi-step/multi-step.component.html +1 -1
- package/lib/infra/multi-step/multi-step.component.scss +1 -0
- package/lib/infra/navbar/navbar.component.html +4 -4
- package/lib/infra/navbar/navbar.component.ts +9 -6
- package/lib/infra/root-container/root-container.component.ts +3 -3
- package/lib/infra/stages/stages.component.scss +2 -2
- package/lib/infra/view/view.component.html +7 -20
- package/lib/infra/view/view.component.ts +21 -3
- package/lib/template/app-shell/app-shell.component.ts +20 -2
- package/lib/template/banner-page/config-ext.json +9 -0
- package/lib/template/base/details-template-base.ts +67 -0
- package/lib/template/base/form-template-base.ts +10 -0
- package/lib/template/case-summary/case-summary.component.ts +38 -4
- package/lib/template/case-view/case-view.component.html +7 -7
- package/lib/template/case-view/case-view.component.scss +2 -0
- package/lib/template/case-view/case-view.component.ts +8 -19
- package/lib/template/confirmation/confirmation.component.ts +1 -1
- package/lib/template/data-reference/data-reference.component.ts +37 -43
- package/lib/template/default-form/default-form.component.html +0 -4
- package/lib/template/default-form/default-form.component.ts +7 -23
- package/lib/template/details/details.component.ts +7 -41
- package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +6 -39
- package/lib/template/details-one-column/details-one-column.component.ts +7 -42
- package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
- package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -37
- package/lib/template/details-three-column/details-three-column.component.ts +7 -43
- package/lib/template/details-two-column/details-two-column.component.ts +8 -44
- package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +7 -42
- package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
- package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +8 -4
- package/lib/template/field-group-template/field-group-template.component.ts +4 -14
- package/lib/template/field-value-list/field-value-list.component.html +8 -3
- package/lib/template/field-value-list/field-value-list.component.scss +2 -1
- package/lib/template/field-value-list/field-value-list.component.ts +1 -0
- package/lib/template/inline-dashboard-page/config-ext.json +9 -0
- package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -2
- package/lib/template/list-view/list-view.component.html +9 -6
- package/lib/template/list-view/list-view.component.scss +11 -0
- package/lib/template/list-view/list-view.component.ts +60 -32
- package/lib/template/list-view/listViewHelpers.ts +1 -2
- package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +1 -1
- package/lib/template/one-column/one-column.component.ts +4 -3
- package/lib/template/one-column-tab/one-column-tab.component.ts +1 -1
- package/lib/template/page/page.component.ts +1 -1
- package/lib/template/promoted-filters/promoted-filters.component.ts +1 -1
- package/lib/template/repeating-structures/repeating-structures.component.ts +2 -3
- package/lib/template/simple-table/simple-table.component.ts +0 -2
- package/lib/template/simple-table-manual/helpers.ts +2 -2
- package/lib/template/simple-table-manual/simple-table-manual.component.html +1 -1
- package/lib/template/simple-table-manual/simple-table-manual.component.scss +1 -0
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +60 -28
- package/lib/template/simple-table-select/simple-table-select.component.ts +5 -7
- package/lib/template/three-column/three-column.component.ts +4 -3
- package/lib/template/two-column/two-column.component.ts +4 -3
- package/lib/template/two-column-tab/two-column-tab.component.ts +1 -1
- package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +4 -3
- package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +1 -1
- package/lib/template/wss-nav-bar/wss-nav-bar.component.html +1 -1
- package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +5 -4
- package/lib/widget/attachment/attachment.component.html +50 -26
- package/lib/widget/attachment/attachment.component.scss +118 -0
- package/lib/widget/attachment/attachment.component.ts +256 -503
- package/lib/widget/case-history/case-history.component.ts +1 -2
- package/lib/widget/feed-container/feed-container.component.ts +7 -11
- package/lib/widget/file-utility/file-utility.component.html +2 -2
- package/lib/widget/file-utility/file-utility.component.ts +15 -22
- package/lib/widget/list-utility/list-utility.component.html +1 -1
- package/lib/widget/quick-create/config-ext.json +9 -0
- package/lib/widget/quick-create/quick-create.component.ts +1 -1
- package/lib/widget/todo/todo.component.html +8 -7
- package/lib/widget/todo/todo.component.ts +97 -86
- package/package.json +1 -1
|
@@ -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 = '';
|
|
@@ -61,11 +101,14 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
61
101
|
localeName = '';
|
|
62
102
|
localePath = '';
|
|
63
103
|
localizedValue = '';
|
|
104
|
+
actionsApi: Object;
|
|
105
|
+
propName: string;
|
|
64
106
|
|
|
65
107
|
constructor(
|
|
66
108
|
private angularPConnect: AngularPConnectService,
|
|
67
109
|
private cdRef: ChangeDetectorRef,
|
|
68
|
-
private utils: Utils
|
|
110
|
+
private utils: Utils,
|
|
111
|
+
private dataPageService: DatapageService
|
|
69
112
|
) {}
|
|
70
113
|
|
|
71
114
|
ngOnInit(): void {
|
|
@@ -76,8 +119,9 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
76
119
|
// Then, continue on with other initialization
|
|
77
120
|
|
|
78
121
|
// call updateSelf when initializing
|
|
79
|
-
// this.updateSelf();
|
|
80
122
|
this.checkAndUpdate();
|
|
123
|
+
// this should get called afer checkAndUpdate
|
|
124
|
+
this.getDatapageData();
|
|
81
125
|
|
|
82
126
|
if (this.formGroup$) {
|
|
83
127
|
// add control to formGroup
|
|
@@ -120,7 +164,6 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
120
164
|
updateSelf(): void {
|
|
121
165
|
// moved this from ngOnInit() and call this from there instead...
|
|
122
166
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as DropdownProps;
|
|
123
|
-
|
|
124
167
|
if (this.configProps$.value != undefined) {
|
|
125
168
|
this.value$ = this.configProps$.value;
|
|
126
169
|
}
|
|
@@ -130,6 +173,7 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
130
173
|
this.label$ = this.configProps$.label;
|
|
131
174
|
this.helperText = this.configProps$.helperText;
|
|
132
175
|
this.hideLabel = this.configProps$.hideLabel;
|
|
176
|
+
const datasource = this.configProps$.datasource;
|
|
133
177
|
// timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
134
178
|
setTimeout(() => {
|
|
135
179
|
if (this.configProps$.required != null) {
|
|
@@ -138,6 +182,11 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
138
182
|
this.cdRef.detectChanges();
|
|
139
183
|
});
|
|
140
184
|
|
|
185
|
+
if (!isEqual(datasource, this.theDatasource)) {
|
|
186
|
+
// inbound datasource is different, so update theDatasource
|
|
187
|
+
this.theDatasource = datasource || null;
|
|
188
|
+
}
|
|
189
|
+
|
|
141
190
|
if (this.configProps$.visibility != null) {
|
|
142
191
|
this.bVisible$ = this.utils.getBooleanValue(this.configProps$.visibility);
|
|
143
192
|
}
|
|
@@ -157,19 +206,23 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
157
206
|
this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
|
|
158
207
|
}
|
|
159
208
|
|
|
160
|
-
this.componentReference =
|
|
209
|
+
this.componentReference = this.pConn$.getStateProps().value;
|
|
161
210
|
|
|
162
|
-
// @ts-ignore - parameter “contextName” for getDataObject method should be optional
|
|
163
|
-
const optionsList = [...this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject())];
|
|
164
|
-
optionsList?.unshift({ key: 'Select', value: this.pConn$.getLocalizedValue('Select...', '', '') });
|
|
165
|
-
this.options$ = optionsList;
|
|
166
211
|
if (this.value$ === '' && !this.bReadonly$) {
|
|
167
212
|
this.value$ = 'Select';
|
|
168
213
|
}
|
|
169
214
|
|
|
170
|
-
|
|
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
|
+
|
|
221
|
+
this.actionsApi = this.pConn$.getActionsApi();
|
|
222
|
+
|
|
223
|
+
this.propName = this.pConn$.getStateProps().value;
|
|
171
224
|
const className = this.pConn$.getCaseInfo().getClassName();
|
|
172
|
-
const refName = propName?.slice(propName.lastIndexOf('.') + 1);
|
|
225
|
+
const refName = this.propName?.slice(this.propName.lastIndexOf('.') + 1);
|
|
173
226
|
|
|
174
227
|
this.fieldMetadata = this.configProps$.fieldMetadata;
|
|
175
228
|
const metaData = Array.isArray(this.fieldMetadata) ? this.fieldMetadata.filter(field => field?.classID === className)[0] : this.fieldMetadata;
|
|
@@ -184,7 +237,6 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
184
237
|
this.localizedValue = this.pConn$.getLocalizedValue(
|
|
185
238
|
this.value$,
|
|
186
239
|
this.localePath,
|
|
187
|
-
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'.
|
|
188
240
|
this.pConn$.getLocaleRuleNameFromKeys(this.localeClass, this.localeContext, this.localeName)
|
|
189
241
|
);
|
|
190
242
|
// trigger display of error message with field control
|
|
@@ -198,6 +250,70 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
198
250
|
}
|
|
199
251
|
}
|
|
200
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, listType);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
getData(dataSource, parameters, columns, context, listType) {
|
|
287
|
+
const dataConfig: any = {
|
|
288
|
+
columns,
|
|
289
|
+
dataSource,
|
|
290
|
+
deferDatasource: true,
|
|
291
|
+
listType,
|
|
292
|
+
parameters,
|
|
293
|
+
matchPosition: 'contains',
|
|
294
|
+
maxResultsDisplay: '5000',
|
|
295
|
+
cacheLifeSpan: 'form'
|
|
296
|
+
};
|
|
297
|
+
PCore.getDataApi()
|
|
298
|
+
.init(dataConfig, context)
|
|
299
|
+
.then((dataApiObj: any) => {
|
|
300
|
+
const optionsData: any[] = [];
|
|
301
|
+
const displayColumn = getDisplayFieldsMetaData(columns);
|
|
302
|
+
dataApiObj?.fetchData('').then(response => {
|
|
303
|
+
response.data?.forEach(element => {
|
|
304
|
+
const val = element[displayColumn.primary]?.toString();
|
|
305
|
+
const obj = {
|
|
306
|
+
key: element[displayColumn.key] || element.pyGUID,
|
|
307
|
+
value: val
|
|
308
|
+
};
|
|
309
|
+
optionsData.push(obj);
|
|
310
|
+
});
|
|
311
|
+
optionsData?.unshift({ key: 'Select', value: this.pConn$.getLocalizedValue('Select...', '', '') });
|
|
312
|
+
this.options$ = optionsData;
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
|
|
201
317
|
isSelected(buttonValue: string): boolean {
|
|
202
318
|
return this.value$ === buttonValue;
|
|
203
319
|
}
|
|
@@ -206,24 +322,19 @@ export class DropdownComponent implements OnInit, OnDestroy {
|
|
|
206
322
|
if (event?.value === 'Select') {
|
|
207
323
|
event.value = '';
|
|
208
324
|
}
|
|
209
|
-
|
|
210
|
-
const propName = (this.pConn$?.getStateProps() as any).value;
|
|
211
|
-
handleEvent(actionsApi, 'changeNblur', propName, event.value);
|
|
325
|
+
handleEvent(this.actionsApi, 'changeNblur', this.propName, event.value);
|
|
212
326
|
if (this.configProps$?.onRecordChange) {
|
|
213
327
|
this.configProps$.onRecordChange(event);
|
|
214
328
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
// PConnect wants to use eventHandler for onBlur
|
|
219
|
-
this.angularPConnectData.actions?.onBlur(this, event);
|
|
329
|
+
this.pConn$.clearErrorMessages({
|
|
330
|
+
property: this.propName
|
|
331
|
+
});
|
|
220
332
|
}
|
|
221
333
|
|
|
222
334
|
getLocalizedOptionValue(opt: IOption) {
|
|
223
335
|
return this.pConn$.getLocalizedValue(
|
|
224
336
|
opt.value,
|
|
225
337
|
this.localePath,
|
|
226
|
-
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'.
|
|
227
338
|
this.pConn$.getLocaleRuleNameFromKeys(this.localeClass, this.localeContext, this.localeName)
|
|
228
339
|
);
|
|
229
340
|
}
|
|
@@ -8,6 +8,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
|
|
|
8
8
|
import { Utils } from '@pega/angular-sdk-components';
|
|
9
9
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
10
10
|
import { PConnFieldProps } from '@pega/angular-sdk-components';
|
|
11
|
+
import { handleEvent } from '@pega/angular-sdk-components';
|
|
11
12
|
|
|
12
13
|
interface EmailProps extends PConnFieldProps {
|
|
13
14
|
// If any, enter additional props that only exist on Email here
|
|
@@ -43,6 +44,8 @@ export class EmailComponent implements OnInit, OnDestroy {
|
|
|
43
44
|
placeholder: string;
|
|
44
45
|
|
|
45
46
|
fieldControl = new FormControl('', null);
|
|
47
|
+
actionsApi: Object;
|
|
48
|
+
propName: string;
|
|
46
49
|
|
|
47
50
|
constructor(
|
|
48
51
|
private angularPConnect: AngularPConnectService,
|
|
@@ -139,7 +142,10 @@ export class EmailComponent implements OnInit, OnDestroy {
|
|
|
139
142
|
this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
|
|
140
143
|
}
|
|
141
144
|
|
|
142
|
-
this.
|
|
145
|
+
this.actionsApi = this.pConn$.getActionsApi();
|
|
146
|
+
this.propName = this.pConn$.getStateProps().value;
|
|
147
|
+
|
|
148
|
+
this.componentReference = this.pConn$.getStateProps().value;
|
|
143
149
|
|
|
144
150
|
// trigger display of error message with field control
|
|
145
151
|
if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
|
|
@@ -153,12 +159,16 @@ export class EmailComponent implements OnInit, OnDestroy {
|
|
|
153
159
|
}
|
|
154
160
|
|
|
155
161
|
fieldOnChange(event: any) {
|
|
156
|
-
|
|
162
|
+
const value = event?.target?.value;
|
|
163
|
+
handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
|
|
164
|
+
this.pConn$.clearErrorMessages({
|
|
165
|
+
property: this.propName
|
|
166
|
+
});
|
|
157
167
|
}
|
|
158
168
|
|
|
159
169
|
fieldOnBlur(event: any) {
|
|
160
|
-
|
|
161
|
-
this.
|
|
170
|
+
const value = event?.target?.value;
|
|
171
|
+
handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
|
|
162
172
|
}
|
|
163
173
|
|
|
164
174
|
getErrorMessage() {
|
|
@@ -69,12 +69,16 @@ export class GroupComponent implements OnInit {
|
|
|
69
69
|
this.instructions$ = this.configProps$.instructions;
|
|
70
70
|
this.collapsible$ = this.configProps$.collapsible;
|
|
71
71
|
|
|
72
|
-
if (this.configProps$.
|
|
72
|
+
if (this.configProps$.visibility === undefined) {
|
|
73
|
+
this.visibility$ = this.pConn$.getComputedVisibility();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (this.configProps$.displayMode === 'DISPLAY_ONLY') {
|
|
73
77
|
if (this.configProps$.visibility === undefined) this.visibility$ = true;
|
|
74
78
|
|
|
75
79
|
this.arChildren$.forEach(child => {
|
|
76
80
|
const pConn = child.getPConnect();
|
|
77
|
-
pConn.setInheritedProp('displayMode', '
|
|
81
|
+
pConn.setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
78
82
|
pConn.setInheritedProp('readOnly', true);
|
|
79
83
|
|
|
80
84
|
return child;
|
|
@@ -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()"
|
|
19
19
|
(blur)="fieldOnBlur($event)"
|
|
20
20
|
/>
|
|
21
21
|
<mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
|
|
@@ -8,6 +8,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
|
|
|
8
8
|
import { Utils } from '@pega/angular-sdk-components';
|
|
9
9
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
10
10
|
import { PConnFieldProps } from '@pega/angular-sdk-components';
|
|
11
|
+
import { handleEvent } from '@pega/angular-sdk-components';
|
|
11
12
|
|
|
12
13
|
interface IntegerProps extends PConnFieldProps {
|
|
13
14
|
// If any, enter additional props that only exist on Integer here
|
|
@@ -43,6 +44,8 @@ export class IntegerComponent implements OnInit, OnDestroy {
|
|
|
43
44
|
placeholder: string;
|
|
44
45
|
|
|
45
46
|
fieldControl = new FormControl<number | null>(null, null);
|
|
47
|
+
actionsApi: Object;
|
|
48
|
+
propName: string;
|
|
46
49
|
|
|
47
50
|
constructor(
|
|
48
51
|
private angularPConnect: AngularPConnectService,
|
|
@@ -115,6 +118,9 @@ export class IntegerComponent implements OnInit, OnDestroy {
|
|
|
115
118
|
this.helperText = this.configProps$.helperText;
|
|
116
119
|
this.placeholder = this.configProps$.placeholder || '';
|
|
117
120
|
|
|
121
|
+
this.actionsApi = this.pConn$.getActionsApi();
|
|
122
|
+
this.propName = this.pConn$.getStateProps().value;
|
|
123
|
+
|
|
118
124
|
// timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
119
125
|
setTimeout(() => {
|
|
120
126
|
if (this.configProps$.required != null) {
|
|
@@ -142,7 +148,7 @@ export class IntegerComponent implements OnInit, OnDestroy {
|
|
|
142
148
|
this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
|
|
143
149
|
}
|
|
144
150
|
|
|
145
|
-
this.componentReference =
|
|
151
|
+
this.componentReference = this.pConn$.getStateProps().value;
|
|
146
152
|
|
|
147
153
|
// trigger display of error message with field control
|
|
148
154
|
if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
|
|
@@ -155,13 +161,15 @@ export class IntegerComponent implements OnInit, OnDestroy {
|
|
|
155
161
|
}
|
|
156
162
|
}
|
|
157
163
|
|
|
158
|
-
fieldOnChange(
|
|
159
|
-
this.
|
|
164
|
+
fieldOnChange() {
|
|
165
|
+
this.pConn$.clearErrorMessages({
|
|
166
|
+
property: this.propName
|
|
167
|
+
});
|
|
160
168
|
}
|
|
161
169
|
|
|
162
170
|
fieldOnBlur(event: any) {
|
|
163
|
-
|
|
164
|
-
this.
|
|
171
|
+
const value = event?.target?.value;
|
|
172
|
+
handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
|
|
165
173
|
}
|
|
166
174
|
|
|
167
175
|
getErrorMessage() {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<div [formGroup]="formGroup$">
|
|
2
|
+
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic">
|
|
3
|
+
<mat-label>{{ label$ }}</mat-label>
|
|
4
|
+
<mat-chip-grid #chipGrid>
|
|
5
|
+
<ng-container *ngFor="let select of selectedItems">
|
|
6
|
+
<mat-chip-row (removed)="removeChip(select)">
|
|
7
|
+
{{ select.primary }}
|
|
8
|
+
<button matChipRemove>
|
|
9
|
+
<mat-icon>cancel</mat-icon>
|
|
10
|
+
</button>
|
|
11
|
+
</mat-chip-row>
|
|
12
|
+
</ng-container>
|
|
13
|
+
</mat-chip-grid>
|
|
14
|
+
<input
|
|
15
|
+
matInput
|
|
16
|
+
[placeholder]="placeholder"
|
|
17
|
+
[formControl]="fieldControl"
|
|
18
|
+
[value]="value$"
|
|
19
|
+
[required]="bRequired$"
|
|
20
|
+
[matAutocomplete]="auto"
|
|
21
|
+
(input)="fieldOnChange($event)"
|
|
22
|
+
[matChipInputFor]="chipGrid"
|
|
23
|
+
/>
|
|
24
|
+
<mat-autocomplete #auto="matAutocomplete">
|
|
25
|
+
<mat-option *ngFor="let item of itemsTree" [value]="item.primary" (click)="optionClicked($event, item)">
|
|
26
|
+
<mat-checkbox [checked]="item.selected" (click)="optionClicked($event, item)">
|
|
27
|
+
<span>{{ item.primary }}</span>
|
|
28
|
+
</mat-checkbox>
|
|
29
|
+
</mat-option>
|
|
30
|
+
</mat-autocomplete>
|
|
31
|
+
<mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
|
|
32
|
+
</mat-form-field>
|
|
33
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { MultiselectComponent } from './multiselect.component';
|
|
4
|
+
|
|
5
|
+
describe('MultiselectComponent', () => {
|
|
6
|
+
let component: MultiselectComponent;
|
|
7
|
+
let fixture: ComponentFixture<MultiselectComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [MultiselectComponent]
|
|
12
|
+
});
|
|
13
|
+
fixture = TestBed.createComponent(MultiselectComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|