@pega/angular-sdk-overrides 0.25.17 → 0.25.19

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.
@@ -20,61 +20,67 @@
20
20
  width: auto;
21
21
  }
22
22
 
23
- .mat-datepicker-content,
24
- .time-container {
25
- box-shadow:
26
- 0px 2px 4px -1px rgba(0, 0, 0, 0.2),
27
- 0px 4px 5px 0px rgba(0, 0, 0, 0.14),
28
- 0px 1px 10px 0px rgba(0, 0, 0, 0.12);
29
- display: block;
30
- border-radius: 4px;
31
- background-color: var(--mat-datepicker-calendar-container-background-color);
32
- color: var(--mat-datepicker-calendar-container-text-color);
23
+ .owl-dt-container {
24
+ background-color: var(--mat-sys-surface-container);
25
+ color: var(--mat-sys-on-surface);
33
26
  }
34
27
 
35
- .mat-calendar-body-cell-content {
36
- color: var(--mat-datepicker-calendar-date-text-color);
37
- border-color: var(--mat-datepicker-calendar-date-outline-color);
28
+ .owl-dt-container-row,
29
+ .owl-dt-container-info .owl-dt-container-range:last-child {
30
+ border-color: var(--mat-sys-outline-variant);
38
31
  }
39
32
 
40
- .mat-calendar-body-selected {
41
- background-color: var(--mat-datepicker-calendar-date-selected-state-background-color);
42
- color: var(--mat-datepicker-calendar-date-selected-state-text-color);
33
+ .owl-dt-calendar-control,
34
+ .owl-dt-calendar-table .owl-dt-calendar-cell {
35
+ color: var(--mat-sys-on-surface);
43
36
  }
44
37
 
45
- .mat-calendar-body-cell-content {
46
- border: none !important;
38
+ .owl-dt-calendar-table .owl-dt-calendar-header,
39
+ .owl-dt-calendar-table .owl-dt-calendar-cell-disabled > .owl-dt-calendar-cell-content:not(.owl-dt-calendar-cell-selected) {
40
+ color: var(--mat-sys-on-surface-variant);
47
41
  }
48
42
 
49
- .mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover
50
- > .mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical) {
51
- background-color: var(--mat-datepicker-calendar-date-hover-state-background-color);
43
+ .owl-dt-calendar-table .owl-dt-calendar-header .owl-dt-calendar-table-divider::after {
44
+ background-color: var(--mat-sys-outline-variant);
52
45
  }
53
46
 
54
- .mat-calendar-arrow {
55
- fill: var(--mat-datepicker-calendar-period-button-icon-color);
47
+ .owl-dt-calendar-table .owl-dt-calendar-cell-today:not(.owl-dt-calendar-cell-selected) {
48
+ border-color: var(--mat-sys-outline);
56
49
  }
57
50
 
58
- .mat-calendar-table-header th {
59
- text-align: center;
60
- padding: 0 0 8px 0;
61
- color: var(--mat-datepicker-calendar-header-text-color);
62
- font-size: var(--mat-datepicker-calendar-header-text-size);
63
- font-weight: var(--mat-datepicker-calendar-header-text-weight);
51
+ .owl-dt-calendar-table .owl-dt-calendar-cell-selected {
52
+ background-color: var(--mat-sys-primary);
53
+ color: var(--mat-sys-on-primary);
64
54
  }
65
55
 
66
- .mat-datepicker-content .mat-calendar-previous-button,
67
- .mat-datepicker-content .mat-calendar-next-button {
68
- color: var(--mat-datepicker-calendar-navigation-button-icon-color);
56
+ .owl-dt-calendar-table .owl-dt-calendar-cell-active:focus > .owl-dt-calendar-cell-content:not(.owl-dt-calendar-cell-selected),
57
+ .owl-dt-calendar-table :not(.owl-dt-calendar-cell-disabled):hover > .owl-dt-calendar-cell-content:not(.owl-dt-calendar-cell-selected),
58
+ .owl-dt-calendar-control .owl-dt-calendar-control-content .owl-dt-calendar-control-button:hover,
59
+ .owl-dt-control-period-button:hover > .owl-dt-control-button-content,
60
+ .owl-dt-container-control-button:hover .owl-dt-control-button-content,
61
+ .owl-dt-control:focus > .owl-dt-control-content {
62
+ background-color: var(--mat-sys-surface-container-high);
69
63
  }
70
64
 
71
- .mat-calendar-table-header-divider::after {
72
- content: '';
73
- position: absolute;
74
- top: 0;
75
- left: -8px;
76
- right: -8px;
77
- height: 1px;
78
- background: var(--mat-datepicker-calendar-header-divider-color);
65
+ .owl-dt-timer-content .owl-dt-timer-input {
66
+ border-color: var(--mat-sys-outline);
67
+ background-color: var(--mat-sys-surface-container-highest);
68
+ color: var(--mat-sys-on-surface);
69
+ }
70
+
71
+ .owl-dt-container-buttons,
72
+ .owl-dt-container-info .owl-dt-container-info-active,
73
+ .owl-dt-timer-hour12 {
74
+ color: var(--mat-sys-primary);
75
+ }
76
+
77
+ .owl-dt-control-arrow-button[disabled] {
78
+ color: var(--mat-sys-on-surface-variant);
79
+ }
80
+
81
+ .owl-dt-timer-hour12 .owl-dt-timer-hour12-box:focus .owl-dt-control-button-content,
82
+ .owl-dt-timer-hour12 .owl-dt-timer-hour12-box:hover .owl-dt-control-button-content {
83
+ background-color: var(--mat-sys-primary);
84
+ color: var(--mat-sys-on-primary);
79
85
  }
80
86
  }
@@ -95,6 +95,12 @@ export class DateTimeComponent extends FieldBase implements OnInit, OnDestroy {
95
95
  }
96
96
 
97
97
  fieldOnDateChange(event: any) {
98
+ // owl picker emits null when the typed text can't be parsed; clear the input instead of defaulting to now
99
+ if (!event.value) {
100
+ this.fieldControl.setValue('');
101
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, '');
102
+ return;
103
+ }
98
104
  // this comes from the date pop up
99
105
  if (typeof event.value === 'object') {
100
106
  // convert date to pega "date" format
@@ -104,4 +110,25 @@ export class DateTimeComponent extends FieldBase implements OnInit, OnDestroy {
104
110
  }
105
111
  handleEvent(this.actionsApi, 'changeNblur', this.propName, event.value);
106
112
  }
113
+
114
+ override getErrorMessage() {
115
+ // look for validation messages for json, pre-defined or just an error pushed from workitem (400)
116
+ if (this.fieldControl.hasError('message')) {
117
+ return this.angularPConnectData.validateMessage ?? '';
118
+ }
119
+
120
+ if (this.fieldControl.hasError('required')) {
121
+ return 'You must enter a value';
122
+ }
123
+
124
+ if (this.fieldControl.hasError('owlDateTimeParse')) {
125
+ return `${this.fieldControl.errors?.['owlDateTimeParse'].text} is not a valid date time value`;
126
+ }
127
+
128
+ if (this.fieldControl.errors) {
129
+ return 'Invalid date time value';
130
+ }
131
+
132
+ return '';
133
+ }
107
134
  }
@@ -11,12 +11,14 @@
11
11
  <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
12
12
  <mat-select
13
13
  [value]="value$"
14
+ [placeholder]="placeholderText"
14
15
  [required]="bRequired$"
15
16
  [disabled]="bDisabled$"
16
17
  [attr.data-test-id]="testId"
17
18
  (selectionChange)="fieldOnChange($event)"
18
19
  [formControl]="fieldControl"
19
20
  >
21
+ <mat-option>{{ placeholderText }}</mat-option>
20
22
  <mat-option *ngFor="let opt of options$" [value]="opt.key">
21
23
  {{ getLocalizedOptionValue(opt) }}
22
24
  </mat-option>
@@ -80,16 +80,19 @@ export class DropdownComponent extends FieldBase implements OnInit, OnDestroy {
80
80
  localeName = '';
81
81
  localePath = '';
82
82
  localizedValue = '';
83
+ placeholderText = '';
83
84
 
84
85
  set options(options: IOption[]) {
85
86
  this.options$ = options;
86
87
  if (this.displayMode$) {
87
88
  this.value$ = this.options$?.find(option => option.key === this.value$)?.value || this.value$;
88
89
  this.localizedValue = this.pConn$.getLocalizedValue(
89
- this.value$ === 'Select...' ? '' : this.value$,
90
+ this.value$,
90
91
  this.localePath,
91
92
  this.pConn$.getLocaleRuleNameFromKeys(this.localeClass, this.localeContext, this.localeName)
92
93
  );
94
+
95
+ this.cdRef.markForCheck();
93
96
  }
94
97
  }
95
98
 
@@ -115,20 +118,15 @@ export class DropdownComponent extends FieldBase implements OnInit, OnDestroy {
115
118
  const { value, fieldMetadata, datasource } = configProps;
116
119
 
117
120
  this.value$ = value;
121
+ this.placeholderText = this.pConn$.getLocalizedValue(this.placeholder || 'Select...', '', '');
118
122
 
119
123
  if (!isEqual(datasource, this.theDatasource)) {
120
124
  // inbound datasource is different, so update theDatasource
121
125
  this.theDatasource = datasource || null;
122
126
  }
123
127
 
124
- if (this.value$ === '' && !this.bReadonly$) {
125
- this.value$ = 'Select';
126
- }
127
-
128
128
  if (this.theDatasource) {
129
- const optionsList = [...this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject())];
130
- optionsList?.unshift({ key: 'Select', value: this.pConn$.getLocalizedValue('Select...', '', '') });
131
- this.options = optionsList;
129
+ this.options = this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject());
132
130
  }
133
131
 
134
132
  this.actionsApi = this.pConn$.getActionsApi();
@@ -215,27 +213,21 @@ export class DropdownComponent extends FieldBase implements OnInit, OnDestroy {
215
213
  };
216
214
  optionsData.push(obj);
217
215
  });
218
- optionsData?.unshift({ key: 'Select', value: this.pConn$.getLocalizedValue('Select...', '', '') });
219
216
  this.options = optionsData;
220
217
  });
221
218
  });
222
219
  }
223
220
 
224
- isSelected(buttonValue: string): boolean {
225
- return this.value$ === buttonValue;
226
- }
227
-
228
221
  fieldOnChange(event: any) {
229
- if (event?.value === 'Select') {
230
- event.value = '';
231
- }
232
- handleEvent(this.actionsApi, 'changeNblur', this.propName, event.value);
222
+ // The reset option has no value; Pega expects '' for a cleared field
223
+ const value = event.value ?? '';
224
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
233
225
 
234
226
  this.pConn$.clearErrorMessages({
235
227
  property: this.propName
236
228
  });
237
229
  if (this.onRecordChange) {
238
- this.onRecordChange.emit(event.value);
230
+ this.onRecordChange.emit(value);
239
231
  }
240
232
  }
241
233
 
@@ -1,4 +1,4 @@
1
- import { Directive, inject, Input, OnDestroy, OnInit } from '@angular/core';
1
+ import { Directive, inject, Input, OnDestroy, OnInit, ChangeDetectorRef } from '@angular/core';
2
2
  import { FormControl, FormGroup } from '@angular/forms';
3
3
 
4
4
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
@@ -11,6 +11,7 @@ export class FieldBase implements OnInit, OnDestroy {
11
11
 
12
12
  protected angularPConnect = inject(AngularPConnectService);
13
13
  protected utils = inject(Utils);
14
+ protected cdRef = inject(ChangeDetectorRef);
14
15
 
15
16
  protected angularPConnectData: AngularPConnectData = {};
16
17
 
@@ -110,7 +110,6 @@ export class NavbarComponent implements OnInit, OnDestroy {
110
110
 
111
111
  // making a copy, so can add info
112
112
  this.navPages$ = JSON.parse(JSON.stringify(this.pages$));
113
- // @ts-ignore
114
113
  const localeReference = PCore.getLocaleUtils().getPortalLocaleReference() || this.pConn$.getValue('.pyLocaleReference');
115
114
  this.navPages$.forEach(page => {
116
115
  const destinationObject: any = {};
@@ -88,8 +88,7 @@ export class ReferenceComponent implements OnInit, OnDestroy, OnChanges {
88
88
  }
89
89
  };
90
90
 
91
- // @ts-expect-error - createComponent expects string but null is passed for unused parameters (matches React SDK pattern)
92
- const viewComponent: any = pConnect.createComponent(viewObject, null, null, {
91
+ const viewComponent: any = pConnect.createComponent(viewObject, '', 0, {
93
92
  pageReference: context && context.startsWith('@CLASS') ? '' : context
94
93
  });
95
94
 
@@ -71,7 +71,6 @@ export class AdvancedSearchComponent implements OnInit, OnChanges {
71
71
  const [firstChildMeta] = rawViewMetadata.children;
72
72
 
73
73
  const localizedVal = PCore.getLocaleUtils().getLocaleValue;
74
- // @ts-ignore
75
74
  const cache = PCore.getNavigationUtils().getComponentCache(searchSelectCacheKey) ?? {};
76
75
 
77
76
  this.editableFieldComp = firstChildPConnect().createComponent({
@@ -210,8 +210,7 @@ export class SearchGroupsComponent implements OnInit, OnDestroy, OnChanges {
210
210
  isValidInput(formValues)
211
211
  ) {
212
212
  if (this.isValidatorField) {
213
- // @ts-ignore
214
- PCore.getMessageManager().clearContextMessages({ context: transientItemID });
213
+ PCore.getMessageManager().clearContextMessages({ context: this.transientItemID });
215
214
  }
216
215
 
217
216
  this.previousFormValues = formValues;
@@ -220,13 +219,13 @@ export class SearchGroupsComponent implements OnInit, OnDestroy, OnChanges {
220
219
  PCore.getPubSubUtils().publish(PCore.getEvents().getTransientEvent().UPDATE_PROMOTED_FILTERS, {
221
220
  payload: formValues,
222
221
  showRecords: true,
223
- viewName: this.getPConnect.getCurrentView()
222
+ viewName: this.getPConnect().getCurrentView()
224
223
  });
225
224
  }
226
225
 
227
226
  this.state.activeGroupId = this.activeGroupId;
228
227
  this.state.searchFields = changes;
229
- this.state.selectedCategory = this.getPConnect.getCurrentView();
228
+ this.state.selectedCategory = this.getPConnect().getCurrentView();
230
229
  const options = componentCachePersistUtils.getComponentStateOptions(this.getPConnect);
231
230
  componentCachePersistUtils.setComponentCache({
232
231
  cacheKey: this.searchSelectCacheKey,
@@ -89,7 +89,6 @@ export class AppShellComponent implements OnInit, OnDestroy {
89
89
  PCore.getEnvironmentInfo().setEnvironmentInfo({ ...PCore.getEnvironmentInfo().environmentInfoObject, pyPortalTemplate: 'wss' } as any);
90
90
  }
91
91
 
92
- // @ts-ignore - Property 'pyCaseTypesAvailableToCreateDP' does not exist on type pxApplication
93
92
  const caseTypesAvailableToCreateDP = PCore.getEnvironmentInfo().environmentInfoObject?.pxApplication?.pyCaseTypesAvailableToCreateDP;
94
93
  if (caseTypesAvailableToCreateDP) {
95
94
  const portalID = this.pConn$.getValue('.pyOwner');
@@ -398,7 +398,6 @@ export class DataReferenceComponent implements OnInit, OnDestroy {
398
398
  if (['Dropdown', 'Checkbox', 'RadioButtons'].includes(type) && !config.deferDatasource && config.datasource) {
399
399
  const isCardVariant = config.variant === 'card';
400
400
  const hasParameters = this.rawViewMetadata.config?.parameters;
401
- // @ts-ignore
402
401
  const isDeferDataPageCallEnabled = isCardVariant && hasParameters && !this.firstChildPConnect()?.getSharedDataPageForReferenceList();
403
402
 
404
403
  const useDropDownDataSource = (isCardVariant && (this.dropDownDataSource || isDeferDataPageCallEnabled)) || (!isCardVariant && hasParameters);
@@ -127,7 +127,6 @@ export function getData(deferLoadedTabs, tabCountSources, currentTabId, data) {
127
127
  });
128
128
  } else if (calculatedFieldsWithoutValue.length) {
129
129
  PCore.getViewRuleApi()
130
- // @ts-ignore
131
130
  .getCalculatedFields(
132
131
  pConn.getCaseInfo().getKey(),
133
132
  pConn.getCurrentView(),
@@ -346,7 +346,6 @@ export class ListViewComponent implements OnInit, OnDestroy {
346
346
  }
347
347
 
348
348
  getFieldsMetadata(refList) {
349
- // @ts-ignore - 3rd parameter "associationFilter" should be optional for getDataViewMetadata method
350
349
  return PCore.getAnalyticsUtils().getDataViewMetadata(refList, this.showDynamicFields);
351
350
  }
352
351
 
@@ -217,7 +217,7 @@ export const updateFieldLabels = (fields, configFields, primaryFieldsViewIndex,
217
217
  let label = configFields[i].config?.label;
218
218
  if (isFLProperty(label)) {
219
219
  label = getFieldLabel(configFields[i].config);
220
- } else if (label.startsWith('@')) {
220
+ } else if (label?.startsWith('@')) {
221
221
  label = label.substring(3);
222
222
  }
223
223
  if (pConnect) {
@@ -32,7 +32,6 @@ export const evaluateAllowRowAction = (allowRowDelete, rowData) => {
32
32
  if (allowRowDelete === undefined || allowRowDelete === true) return true;
33
33
  if (allowRowDelete.startsWith?.('@E ')) {
34
34
  const expression = allowRowDelete.replace('@E ', '');
35
- // @ts-ignore - Expected 3 arguments, but got 2
36
35
  return PCore.getExpressionEngine().evaluate(expression, rowData);
37
36
  }
38
37
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/angular-sdk-overrides",
3
- "version": "0.25.17",
3
+ "version": "0.25.19",
4
4
  "description": "Angular SDK - Code for overriding components",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"