@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.
Files changed (137) hide show
  1. package/lib/designSystemExtension/alert-banner/alert-banner.component.ts +1 -1
  2. package/lib/designSystemExtension/case-create-stage/case-create-stage.component.ts +1 -1
  3. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.html +7 -4
  4. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +2 -1
  5. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +3 -1
  6. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +1 -1
  7. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +4 -1
  8. package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.html +1 -1
  9. package/lib/designSystemExtension/operator/operator.component.ts +11 -6
  10. package/lib/designSystemExtension/pulse/pulse.component.ts +7 -7
  11. package/lib/field/auto-complete/auto-complete.component.ts +17 -14
  12. package/lib/field/cancel-alert/cancel-alert.component.ts +0 -2
  13. package/lib/field/check-box/check-box.component.html +16 -15
  14. package/lib/field/check-box/check-box.component.scss +14 -1
  15. package/lib/field/check-box/check-box.component.ts +128 -45
  16. package/lib/field/currency/currency.component.html +16 -7
  17. package/lib/field/currency/currency.component.ts +55 -20
  18. package/lib/field/date/date.component.html +1 -6
  19. package/lib/field/date/date.component.ts +22 -39
  20. package/lib/field/date-time/date-time.component.html +6 -7
  21. package/lib/field/date-time/date-time.component.ts +28 -45
  22. package/lib/field/decimal/decimal.component.html +14 -4
  23. package/lib/field/decimal/decimal.component.ts +47 -7
  24. package/lib/field/dropdown/dropdown.component.ts +132 -21
  25. package/lib/field/email/email.component.ts +14 -4
  26. package/lib/field/group/group.component.html +1 -1
  27. package/lib/field/group/group.component.ts +6 -2
  28. package/lib/field/integer/integer.component.html +1 -1
  29. package/lib/field/integer/integer.component.ts +13 -5
  30. package/lib/field/multiselect/multiselect.component.html +33 -0
  31. package/lib/field/multiselect/multiselect.component.scss +7 -0
  32. package/lib/field/multiselect/multiselect.component.spec.ts +21 -0
  33. package/lib/field/multiselect/multiselect.component.ts +369 -0
  34. package/lib/field/multiselect/utils.ts +209 -0
  35. package/lib/field/percentage/percentage.component.html +17 -6
  36. package/lib/field/percentage/percentage.component.ts +51 -12
  37. package/lib/field/phone/phone.component.html +1 -1
  38. package/lib/field/phone/phone.component.ts +11 -14
  39. package/lib/field/radio-buttons/radio-buttons.component.ts +9 -12
  40. package/lib/field/rich-text/config-ext.json +10 -0
  41. package/lib/field/rich-text/rich-text.component.html +1 -1
  42. package/lib/field/rich-text/rich-text.component.ts +8 -6
  43. package/lib/field/scalar-list/scalar-list.component.ts +4 -4
  44. package/lib/field/text/text.component.ts +2 -0
  45. package/lib/field/text-area/text-area.component.html +2 -1
  46. package/lib/field/text-area/text-area.component.ts +13 -8
  47. package/lib/field/text-input/text-input.component.html +1 -1
  48. package/lib/field/text-input/text-input.component.ts +13 -5
  49. package/lib/field/time/time.component.html +3 -2
  50. package/lib/field/time/time.component.ts +23 -7
  51. package/lib/field/url/url.component.html +2 -1
  52. package/lib/field/url/url.component.ts +15 -5
  53. package/lib/field/user-reference/user-reference.component.html +42 -45
  54. package/lib/field/user-reference/user-reference.component.ts +73 -27
  55. package/lib/infra/Containers/base-components/flow-container-base.component.ts +22 -0
  56. package/lib/infra/Containers/base-components/helper.ts +89 -0
  57. package/lib/infra/Containers/flow-container/flow-container.component.html +9 -4
  58. package/lib/infra/Containers/flow-container/flow-container.component.ts +38 -33
  59. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +41 -9
  60. package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +1 -1
  61. package/lib/infra/Containers/view-container/helper.ts +22 -0
  62. package/lib/infra/Containers/view-container/view-container.component.ts +5 -18
  63. package/lib/infra/assignment/assignment.component.ts +37 -39
  64. package/lib/infra/dashboard-filter/dashboard-filter.component.ts +0 -1
  65. package/lib/infra/defer-load/defer-load.component.ts +9 -12
  66. package/lib/infra/multi-step/multi-step.component.html +1 -1
  67. package/lib/infra/multi-step/multi-step.component.scss +1 -0
  68. package/lib/infra/navbar/navbar.component.html +4 -4
  69. package/lib/infra/navbar/navbar.component.ts +9 -6
  70. package/lib/infra/root-container/root-container.component.ts +3 -3
  71. package/lib/infra/stages/stages.component.scss +2 -2
  72. package/lib/infra/view/view.component.html +7 -20
  73. package/lib/infra/view/view.component.ts +21 -3
  74. package/lib/template/app-shell/app-shell.component.ts +20 -2
  75. package/lib/template/banner-page/config-ext.json +9 -0
  76. package/lib/template/base/details-template-base.ts +67 -0
  77. package/lib/template/base/form-template-base.ts +10 -0
  78. package/lib/template/case-summary/case-summary.component.ts +38 -4
  79. package/lib/template/case-view/case-view.component.html +7 -7
  80. package/lib/template/case-view/case-view.component.scss +2 -0
  81. package/lib/template/case-view/case-view.component.ts +8 -19
  82. package/lib/template/confirmation/confirmation.component.ts +1 -1
  83. package/lib/template/data-reference/data-reference.component.ts +37 -43
  84. package/lib/template/default-form/default-form.component.html +0 -4
  85. package/lib/template/default-form/default-form.component.ts +7 -23
  86. package/lib/template/details/details.component.ts +7 -41
  87. package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +6 -39
  88. package/lib/template/details-one-column/details-one-column.component.ts +7 -42
  89. package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
  90. package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -37
  91. package/lib/template/details-three-column/details-three-column.component.ts +7 -43
  92. package/lib/template/details-two-column/details-two-column.component.ts +8 -44
  93. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +7 -42
  94. package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
  95. package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +8 -4
  96. package/lib/template/field-group-template/field-group-template.component.ts +4 -14
  97. package/lib/template/field-value-list/field-value-list.component.html +8 -3
  98. package/lib/template/field-value-list/field-value-list.component.scss +2 -1
  99. package/lib/template/field-value-list/field-value-list.component.ts +1 -0
  100. package/lib/template/inline-dashboard-page/config-ext.json +9 -0
  101. package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -2
  102. package/lib/template/list-view/list-view.component.html +9 -6
  103. package/lib/template/list-view/list-view.component.scss +11 -0
  104. package/lib/template/list-view/list-view.component.ts +60 -32
  105. package/lib/template/list-view/listViewHelpers.ts +1 -2
  106. package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +1 -1
  107. package/lib/template/one-column/one-column.component.ts +4 -3
  108. package/lib/template/one-column-tab/one-column-tab.component.ts +1 -1
  109. package/lib/template/page/page.component.ts +1 -1
  110. package/lib/template/promoted-filters/promoted-filters.component.ts +1 -1
  111. package/lib/template/repeating-structures/repeating-structures.component.ts +2 -3
  112. package/lib/template/simple-table/simple-table.component.ts +0 -2
  113. package/lib/template/simple-table-manual/helpers.ts +2 -2
  114. package/lib/template/simple-table-manual/simple-table-manual.component.html +1 -1
  115. package/lib/template/simple-table-manual/simple-table-manual.component.scss +1 -0
  116. package/lib/template/simple-table-manual/simple-table-manual.component.ts +60 -28
  117. package/lib/template/simple-table-select/simple-table-select.component.ts +5 -7
  118. package/lib/template/three-column/three-column.component.ts +4 -3
  119. package/lib/template/two-column/two-column.component.ts +4 -3
  120. package/lib/template/two-column-tab/two-column-tab.component.ts +1 -1
  121. package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +4 -3
  122. package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +1 -1
  123. package/lib/template/wss-nav-bar/wss-nav-bar.component.html +1 -1
  124. package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +5 -4
  125. package/lib/widget/attachment/attachment.component.html +50 -26
  126. package/lib/widget/attachment/attachment.component.scss +118 -0
  127. package/lib/widget/attachment/attachment.component.ts +256 -503
  128. package/lib/widget/case-history/case-history.component.ts +1 -2
  129. package/lib/widget/feed-container/feed-container.component.ts +7 -11
  130. package/lib/widget/file-utility/file-utility.component.html +2 -2
  131. package/lib/widget/file-utility/file-utility.component.ts +15 -22
  132. package/lib/widget/list-utility/list-utility.component.html +1 -1
  133. package/lib/widget/quick-create/config-ext.json +9 -0
  134. package/lib/widget/quick-create/quick-create.component.ts +1 -1
  135. package/lib/widget/todo/todo.component.html +8 -7
  136. package/lib/widget/todo/todo.component.ts +97 -86
  137. 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 = (this.pConn$.getStateProps() as any).value;
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
- const propName = (this.pConn$.getStateProps() as any).value;
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
- const actionsApi = this.pConn$?.getActionsApi();
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
- fieldOnBlur(event: any) {
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.componentReference = (this.pConn$.getStateProps() as any).value;
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
- this.angularPConnectData.actions?.onChange(this, event);
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
- // PConnect wants to use eventHandler for onBlur
161
- this.angularPConnectData.actions?.onBlur(this, event);
170
+ const value = event?.target?.value;
171
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
162
172
  }
163
173
 
164
174
  getErrorMessage() {
@@ -1,4 +1,4 @@
1
- <ng-container *ngIf="visibility$">
1
+ <ng-container *ngIf="visibility$ && arChildren$.length">
2
2
  <component-mapper
3
3
  name="FieldGroup"
4
4
  [props]="{
@@ -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$.displayMode === 'LABELS_LEFT') {
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', 'LABELS_LEFT');
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($event)"
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 = (this.pConn$.getStateProps() as any).value;
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(event: any) {
159
- this.angularPConnectData.actions?.onChange(this, event);
164
+ fieldOnChange() {
165
+ this.pConn$.clearErrorMessages({
166
+ property: this.propName
167
+ });
160
168
  }
161
169
 
162
170
  fieldOnBlur(event: any) {
163
- // PConnect wants to use eventHandler for onBlur
164
- this.angularPConnectData.actions?.onBlur(this, event);
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,7 @@
1
+ .psdk-full-width {
2
+ width: 100%;
3
+ }
4
+
5
+ ::ng-deep .mat-mdc-form-field-infix {
6
+ padding-left: 10px;
7
+ }
@@ -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
+ });