@pega/angular-sdk-overrides 0.24.8 → 0.25.1

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 (172) hide show
  1. package/lib/designSystemExtension/alert/alert.component.ts +0 -1
  2. package/lib/designSystemExtension/alert-banner/alert-banner.component.ts +1 -2
  3. package/lib/designSystemExtension/banner/banner.component.ts +0 -1
  4. package/lib/designSystemExtension/case-create-stage/case-create-stage.component.ts +1 -2
  5. package/lib/designSystemExtension/field-group/field-group.component.ts +0 -1
  6. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +2 -1
  7. package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +0 -2
  8. package/lib/designSystemExtension/material-details/material-details.component.ts +0 -1
  9. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +2 -2
  10. package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +10 -2
  11. package/lib/designSystemExtension/material-summary-item/material-summary-item.component.ts +0 -1
  12. package/lib/designSystemExtension/material-summary-list/material-summary-list.component.ts +0 -1
  13. package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.ts +0 -1
  14. package/lib/designSystemExtension/operator/operator.component.html +1 -1
  15. package/lib/designSystemExtension/operator/operator.component.scss +10 -2
  16. package/lib/designSystemExtension/operator/operator.component.ts +5 -5
  17. package/lib/designSystemExtension/pulse/pulse.component.ts +7 -8
  18. package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.ts +0 -1
  19. package/lib/designSystemExtension/wss-quick-create/wss-quick-create.component.ts +0 -1
  20. package/lib/field/auto-complete/auto-complete.component.html +0 -1
  21. package/lib/field/auto-complete/auto-complete.component.ts +31 -16
  22. package/lib/field/cancel-alert/cancel-alert.component.ts +0 -1
  23. package/lib/field/check-box/check-box.component.html +18 -6
  24. package/lib/field/check-box/check-box.component.ts +17 -12
  25. package/lib/field/currency/currency.component.html +4 -4
  26. package/lib/field/currency/currency.component.ts +42 -20
  27. package/lib/field/date/date.component.html +3 -7
  28. package/lib/field/date/date.component.ts +22 -40
  29. package/lib/field/date-time/date-time.component.html +3 -4
  30. package/lib/field/date-time/date-time.component.ts +35 -17
  31. package/lib/field/decimal/decimal.component.html +4 -3
  32. package/lib/field/decimal/decimal.component.ts +47 -22
  33. package/lib/field/dropdown/dropdown.component.html +1 -0
  34. package/lib/field/dropdown/dropdown.component.ts +146 -19
  35. package/lib/field/email/email.component.ts +24 -5
  36. package/lib/field/group/group.component.ts +2 -3
  37. package/lib/field/integer/integer.component.ts +22 -5
  38. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.html +1 -1
  39. package/lib/field/list-view-action-buttons/list-view-action-buttons.component.ts +3 -3
  40. package/lib/field/location/config-ext.json +8 -0
  41. package/lib/field/location/location.component.html +45 -0
  42. package/lib/field/location/location.component.scss +18 -0
  43. package/lib/field/location/location.component.spec.ts +22 -0
  44. package/lib/field/location/location.component.ts +385 -0
  45. package/lib/field/multiselect/multiselect.component.ts +17 -10
  46. package/lib/field/percentage/percentage.component.html +3 -3
  47. package/lib/field/percentage/percentage.component.ts +45 -21
  48. package/lib/field/phone/config-ext.json +1 -1
  49. package/lib/field/phone/phone.component.html +9 -6
  50. package/lib/field/phone/phone.component.scss +9 -0
  51. package/lib/field/phone/phone.component.ts +30 -27
  52. package/lib/field/radio-buttons/radio-buttons.component.html +17 -12
  53. package/lib/field/radio-buttons/radio-buttons.component.ts +13 -10
  54. package/lib/field/rich-text/rich-text.component.ts +19 -9
  55. package/lib/field/scalar-list/scalar-list.component.ts +3 -5
  56. package/lib/field/selectable-card/selectable-card.component.html +40 -0
  57. package/lib/field/selectable-card/selectable-card.component.scss +0 -0
  58. package/lib/field/selectable-card/selectable-card.component.spec.ts +22 -0
  59. package/lib/field/selectable-card/selectable-card.component.ts +255 -0
  60. package/lib/field/semantic-link/semantic-link.component.ts +0 -1
  61. package/lib/field/text/text.component.ts +8 -5
  62. package/lib/field/text-area/text-area.component.html +4 -1
  63. package/lib/field/text-area/text-area.component.ts +22 -6
  64. package/lib/field/text-content/text-content.component.ts +0 -1
  65. package/lib/field/text-input/text-input.component.ts +22 -5
  66. package/lib/field/time/time.component.html +2 -2
  67. package/lib/field/time/time.component.ts +35 -7
  68. package/lib/field/url/url.component.ts +22 -5
  69. package/lib/field/user-reference/user-reference.component.html +40 -46
  70. package/lib/field/user-reference/user-reference.component.ts +111 -21
  71. package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
  72. package/lib/infra/Containers/flow-container/flow-container.component.ts +25 -48
  73. package/lib/infra/Containers/flow-container/helpers.ts +2 -2
  74. package/lib/infra/Containers/hybrid-view-container/hybrid-view-container.component.ts +0 -1
  75. package/lib/infra/Containers/modal-view-container/modal-view-container.component.html +1 -11
  76. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +1 -9
  77. package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +1 -1
  78. package/lib/infra/Containers/view-container/helper.ts +22 -0
  79. package/lib/infra/Containers/view-container/view-container.component.ts +5 -18
  80. package/lib/infra/action-buttons/action-buttons.component.html +1 -1
  81. package/lib/infra/action-buttons/action-buttons.component.ts +0 -1
  82. package/lib/infra/assignment/assignment.component.html +1 -1
  83. package/lib/infra/assignment/assignment.component.ts +82 -41
  84. package/lib/infra/assignment-card/assignment-card.component.html +1 -0
  85. package/lib/infra/assignment-card/assignment-card.component.ts +0 -1
  86. package/lib/infra/dashboard-filter/dashboard-filter.component.ts +0 -1
  87. package/lib/infra/defer-load/defer-load.component.ts +8 -6
  88. package/lib/infra/error-boundary/error-boundary.component.ts +0 -1
  89. package/lib/infra/multi-step/multi-step.component.ts +0 -1
  90. package/lib/infra/navbar/navbar.component.ts +3 -6
  91. package/lib/infra/reference/reference.component.ts +77 -90
  92. package/lib/infra/region/region.component.ts +0 -1
  93. package/lib/infra/root-container/root-container.component.html +2 -15
  94. package/lib/infra/root-container/root-container.component.ts +27 -33
  95. package/lib/infra/stages/stages.component.scss +2 -2
  96. package/lib/infra/stages/stages.component.ts +0 -1
  97. package/lib/infra/view/view.component.html +7 -20
  98. package/lib/infra/view/view.component.ts +20 -3
  99. package/lib/template/app-shell/app-shell.component.ts +20 -3
  100. package/lib/template/banner-page/banner-page.component.ts +0 -1
  101. package/lib/template/base/details-template-base.ts +67 -0
  102. package/lib/template/base/form-template-base.ts +16 -0
  103. package/lib/template/case-summary/case-summary.component.ts +7 -23
  104. package/lib/template/case-view/case-view.component.html +4 -4
  105. package/lib/template/case-view/case-view.component.ts +8 -14
  106. package/lib/template/confirmation/confirmation.component.html +1 -1
  107. package/lib/template/confirmation/confirmation.component.ts +1 -2
  108. package/lib/template/data-reference/data-reference.component.ts +36 -41
  109. package/lib/template/default-form/default-form.component.html +0 -4
  110. package/lib/template/default-form/default-form.component.ts +41 -25
  111. package/lib/template/details/details.component.ts +7 -42
  112. package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +6 -40
  113. package/lib/template/details-one-column/details-one-column.component.ts +7 -43
  114. package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
  115. package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -38
  116. package/lib/template/details-three-column/details-three-column.component.ts +7 -44
  117. package/lib/template/details-two-column/details-two-column.component.ts +8 -45
  118. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +7 -43
  119. package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
  120. package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +8 -4
  121. package/lib/template/field-group-list/field-group-list.component.ts +0 -1
  122. package/lib/template/field-group-template/field-group-template.component.html +7 -7
  123. package/lib/template/field-group-template/field-group-template.component.scss +8 -0
  124. package/lib/template/field-group-template/field-group-template.component.ts +68 -48
  125. package/lib/template/field-value-list/field-value-list.component.html +2 -2
  126. package/lib/template/field-value-list/field-value-list.component.scss +6 -1
  127. package/lib/template/field-value-list/field-value-list.component.ts +0 -1
  128. package/lib/template/inline-dashboard/inline-dashboard.component.ts +0 -1
  129. package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -3
  130. package/lib/template/list-page/list-page.component.ts +0 -1
  131. package/lib/template/list-view/list-view.component.html +6 -1
  132. package/lib/template/list-view/list-view.component.scss +11 -0
  133. package/lib/template/list-view/list-view.component.ts +25 -11
  134. package/lib/template/list-view/listViewHelpers.ts +4 -10
  135. package/lib/template/list-view/utils.ts +2 -5
  136. package/lib/template/multi-reference-readonly/multi-reference-readonly.component.ts +0 -1
  137. package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +1 -2
  138. package/lib/template/one-column/one-column.component.ts +4 -4
  139. package/lib/template/one-column-page/one-column-page.component.ts +0 -1
  140. package/lib/template/one-column-tab/one-column-tab.component.ts +1 -2
  141. package/lib/template/page/page.component.ts +1 -2
  142. package/lib/template/promoted-filters/promoted-filters.component.ts +1 -2
  143. package/lib/template/repeating-structures/repeating-structures.component.ts +1 -2
  144. package/lib/template/simple-table/simple-table.component.ts +0 -1
  145. package/lib/template/simple-table-manual/helpers.ts +126 -10
  146. package/lib/template/simple-table-manual/simple-table-manual.component.html +25 -6
  147. package/lib/template/simple-table-manual/simple-table-manual.component.scss +12 -3
  148. package/lib/template/simple-table-manual/simple-table-manual.component.ts +110 -54
  149. package/lib/template/simple-table-select/simple-table-select.component.ts +3 -4
  150. package/lib/template/single-reference-readonly/single-reference-readonly.component.ts +0 -1
  151. package/lib/template/sub-tabs/sub-tabs.component.ts +0 -1
  152. package/lib/template/three-column/three-column.component.ts +4 -4
  153. package/lib/template/three-column-page/three-column-page.component.ts +0 -1
  154. package/lib/template/two-column/two-column.component.ts +4 -4
  155. package/lib/template/two-column-page/two-column-page.component.ts +0 -1
  156. package/lib/template/two-column-tab/two-column-tab.component.ts +1 -2
  157. package/lib/template/utils.ts +16 -0
  158. package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +4 -4
  159. package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +1 -2
  160. package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +3 -4
  161. package/lib/widget/app-announcement/app-announcement.component.ts +0 -1
  162. package/lib/widget/attachment/attachment.component.ts +9 -13
  163. package/lib/widget/case-history/case-history.component.ts +0 -1
  164. package/lib/widget/feed-container/feed-container.component.ts +7 -10
  165. package/lib/widget/file-utility/file-utility.component.ts +2 -6
  166. package/lib/widget/list-utility/list-utility.component.ts +0 -1
  167. package/lib/widget/quick-create/quick-create.component.ts +0 -1
  168. package/lib/widget/todo/todo.component.html +5 -6
  169. package/lib/widget/todo/todo.component.scss +9 -0
  170. package/lib/widget/todo/todo.component.ts +95 -85
  171. package/lib/widget/utility/utility.component.ts +0 -1
  172. package/package.json +1 -1
@@ -1,9 +1,11 @@
1
1
  import { Component, OnInit, Input, forwardRef, OnDestroy } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
+ import { FormGroup } from '@angular/forms';
3
4
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
4
5
  import { Utils } from '@pega/angular-sdk-components';
5
6
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
6
7
  import { PConnFieldProps } from '@pega/angular-sdk-components';
8
+ import { format } from '@pega/angular-sdk-components';
7
9
 
8
10
  interface TextProps extends PConnFieldProps {
9
11
  // If any, enter additional props that only exist on Text here
@@ -13,11 +15,11 @@ interface TextProps extends PConnFieldProps {
13
15
  selector: 'app-text',
14
16
  templateUrl: './text.component.html',
15
17
  styleUrls: ['./text.component.scss'],
16
- standalone: true,
17
18
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
18
19
  })
19
20
  export class TextComponent implements OnInit, OnDestroy {
20
21
  @Input() pConn$: typeof PConnect;
22
+ @Input() formGroup$: FormGroup;
21
23
  @Input() formatAs$: string;
22
24
 
23
25
  // Used with AngularPConnect
@@ -97,8 +99,9 @@ export class TextComponent implements OnInit, OnDestroy {
97
99
  break;
98
100
  case 'time':
99
101
  if (this.value$) {
100
- const timeParts = this.value$.split(':');
101
- this.formattedValue$ = `${timeParts[0]}:${timeParts[1]}`;
102
+ this.formattedValue$ = format(this.value$, 'timeonly', {
103
+ format: 'hh:mm A'
104
+ });
102
105
  } else {
103
106
  this.formattedValue$ = '';
104
107
  }
@@ -142,7 +145,7 @@ export class TextComponent implements OnInit, OnDestroy {
142
145
  generateDateTime(sVal): string {
143
146
  if (!sVal) return '';
144
147
  if (sVal.length === 10) return this.generateDate(sVal);
145
- const value = sVal.substring(0, sVal.length - 1);
148
+ // const value = sVal.substring(0, sVal.length - 1);
146
149
  // value = new Intl.DateTimeFormat('default', {
147
150
  // year: 'numeric',
148
151
  // month: 'numeric',
@@ -153,6 +156,6 @@ export class TextComponent implements OnInit, OnDestroy {
153
156
  // hour12: true,
154
157
  // }).format(new Date(value))
155
158
 
156
- return this.utils.generateDateTime(value, 'DateTime-Long-YYYY-Custom');
159
+ return this.utils.generateDateTime(sVal, 'DateTime-Long-YYYY-Custom');
157
160
  }
158
161
  }
@@ -2,10 +2,11 @@
2
2
  <component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$, displayMode$ }"></component-mapper>
3
3
  </div>
4
4
  <ng-template #noDisplayMode>
5
- <div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
5
+ <div *ngIf="bHasForm$; else noEdit">
6
6
  <div [formGroup]="formGroup$">
7
7
  <div *ngIf="bVisible$">
8
8
  <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
9
+ <mat-label>{{ label$ }}</mat-label>
9
10
  <textarea
10
11
  matInput
11
12
  rows="5"
@@ -15,8 +16,10 @@
15
16
  [value]="value$"
16
17
  [required]="bRequired$"
17
18
  [disabled]="bDisabled$"
19
+ [readonly]="bReadonly$"
18
20
  [formControl]="fieldControl"
19
21
  (change)="fieldOnChange($event)"
22
+ (blur)="fieldOnBlur($event)"
20
23
  ></textarea>
21
24
  <mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
22
25
  </mat-form-field>
@@ -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 TextAreaProps extends PConnFieldProps {
13
14
  // If any, enter additional props that only exist on TextArea here
@@ -18,7 +19,6 @@ interface TextAreaProps extends PConnFieldProps {
18
19
  selector: 'app-text-area',
19
20
  templateUrl: './text-area.component.html',
20
21
  styleUrls: ['./text-area.component.scss'],
21
- standalone: true,
22
22
  imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, forwardRef(() => ComponentMapperComponent)]
23
23
  })
24
24
  export class TextAreaComponent implements OnInit, OnDestroy {
@@ -44,6 +44,8 @@ export class TextAreaComponent implements OnInit, OnDestroy {
44
44
  helperText: string;
45
45
 
46
46
  fieldControl = new FormControl('', null);
47
+ actionsApi: Object;
48
+ propName: string;
47
49
 
48
50
  constructor(
49
51
  private angularPConnect: AngularPConnectService,
@@ -113,6 +115,9 @@ export class TextAreaComponent implements OnInit, OnDestroy {
113
115
  this.label$ = this.configProps$.label;
114
116
  this.helperText = this.configProps$.helperText;
115
117
 
118
+ this.actionsApi = this.pConn$.getActionsApi();
119
+ this.propName = this.pConn$.getStateProps().value;
120
+
116
121
  // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
117
122
  setTimeout(() => {
118
123
  if (this.configProps$.required != null) {
@@ -140,7 +145,7 @@ export class TextAreaComponent implements OnInit, OnDestroy {
140
145
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
141
146
  }
142
147
 
143
- this.componentReference = (this.pConn$.getStateProps() as any).value;
148
+ this.componentReference = this.pConn$.getStateProps().value;
144
149
 
145
150
  // trigger display of error message with field control
146
151
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -154,13 +159,24 @@ export class TextAreaComponent implements OnInit, OnDestroy {
154
159
  }
155
160
 
156
161
  fieldOnChange(event: any) {
157
- // PConnect wants to use changeHandler for onChange
158
- this.angularPConnectData.actions?.onChange(this, event);
162
+ const oldVal = this.value$ ?? '';
163
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
164
+
165
+ if (isValueChanged) {
166
+ this.pConn$.clearErrorMessages({
167
+ property: this.propName
168
+ });
169
+ }
159
170
  }
160
171
 
161
172
  fieldOnBlur(event: any) {
162
- // PConnect wants to use eventHandler for onBlur
163
- this.angularPConnectData.actions?.onBlur(this, event);
173
+ const oldVal = this.value$ ?? '';
174
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
175
+
176
+ if (isValueChanged) {
177
+ const value = event?.target?.value;
178
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
179
+ }
164
180
  }
165
181
 
166
182
  getErrorMessage() {
@@ -14,7 +14,6 @@ interface TextContentProps extends PConnFieldProps {
14
14
  selector: 'app-text-content',
15
15
  templateUrl: './text-content.component.html',
16
16
  styleUrls: ['./text-content.component.scss'],
17
- standalone: true,
18
17
  imports: [CommonModule]
19
18
  })
20
19
  export class TextContentComponent implements OnInit, OnDestroy {
@@ -8,6 +8,7 @@ import { AngularPConnectService, AngularPConnectData } 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 TextInputProps extends PConnFieldProps {
13
14
  // If any, enter additional props that only exist on TextInput here
@@ -18,7 +19,6 @@ interface TextInputProps extends PConnFieldProps {
18
19
  selector: 'app-text-input',
19
20
  templateUrl: './text-input.component.html',
20
21
  styleUrls: ['./text-input.component.scss'],
21
- standalone: true,
22
22
  imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, forwardRef(() => ComponentMapperComponent)]
23
23
  })
24
24
  export class TextInputComponent implements OnInit, OnDestroy {
@@ -44,6 +44,8 @@ export class TextInputComponent implements OnInit, OnDestroy {
44
44
  placeholder: string;
45
45
 
46
46
  fieldControl = new FormControl('', null);
47
+ actionsApi: Object;
48
+ propName: string;
47
49
 
48
50
  constructor(
49
51
  private angularPConnect: AngularPConnectService,
@@ -113,7 +115,10 @@ export class TextInputComponent implements OnInit, OnDestroy {
113
115
  this.label$ = this.configProps$.label;
114
116
  this.displayMode$ = this.configProps$.displayMode;
115
117
 
116
- this.componentReference = (this.pConn$.getStateProps() as any).value;
118
+ this.componentReference = this.pConn$.getStateProps().value;
119
+
120
+ this.actionsApi = this.pConn$.getActionsApi();
121
+ this.propName = this.pConn$.getStateProps().value;
117
122
 
118
123
  if (this.configProps$.visibility != null) {
119
124
  this.bVisible$ = this.utils.getBooleanValue(this.configProps$.visibility);
@@ -156,12 +161,24 @@ export class TextInputComponent implements OnInit, OnDestroy {
156
161
  }
157
162
 
158
163
  fieldOnChange(event: any) {
159
- this.angularPConnectData.actions?.onChange(this, event);
164
+ const oldVal = this.value$ ?? '';
165
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
166
+
167
+ if (isValueChanged) {
168
+ this.pConn$.clearErrorMessages({
169
+ property: this.propName
170
+ });
171
+ }
160
172
  }
161
173
 
162
174
  fieldOnBlur(event: any) {
163
- // PConnect wants to use eventHandler for onBlur
164
- this.angularPConnectData.actions?.onBlur(this, event);
175
+ const oldVal = this.value$ ?? '';
176
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
177
+
178
+ if (isValueChanged) {
179
+ const value = event?.target?.value;
180
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
181
+ }
165
182
  }
166
183
 
167
184
  getErrorMessage() {
@@ -1,5 +1,5 @@
1
1
  <div *ngIf="displayMode$; else noDisplayMode">
2
- <component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$, displayMode$ }"></component-mapper>
2
+ <component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$: formattedValue$, displayMode$ }"></component-mapper>
3
3
  </div>
4
4
  <ng-template #noDisplayMode>
5
5
  <div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
@@ -23,5 +23,5 @@
23
23
  </div>
24
24
  </ng-template>
25
25
  <ng-template #noEdit>
26
- <component-mapper *ngIf="bVisible$ !== false" name="Text" [props]="{ pConn$, formatAs$: 'text' }"></component-mapper>
26
+ <component-mapper *ngIf="bVisible$ !== false" name="Text" [props]="{ pConn$, formatAs$: 'time' }"></component-mapper>
27
27
  </ng-template>
@@ -8,6 +8,8 @@ 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';
12
+ import { format } from '@pega/angular-sdk-components';
11
13
 
12
14
  interface TimeProps extends PConnFieldProps {
13
15
  // If any, enter additional props that only exist on Time here
@@ -17,7 +19,6 @@ interface TimeProps extends PConnFieldProps {
17
19
  selector: 'app-time',
18
20
  templateUrl: './time.component.html',
19
21
  styleUrls: ['./time.component.scss'],
20
- standalone: true,
21
22
  imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, forwardRef(() => ComponentMapperComponent)]
22
23
  })
23
24
  export class TimeComponent implements OnInit, OnDestroy {
@@ -43,6 +44,9 @@ export class TimeComponent implements OnInit, OnDestroy {
43
44
  placeholder: string;
44
45
 
45
46
  fieldControl = new FormControl('', null);
47
+ actionsApi: Object;
48
+ propName: string;
49
+ formattedValue$: any;
46
50
 
47
51
  constructor(
48
52
  private angularPConnect: AngularPConnectService,
@@ -111,6 +115,9 @@ export class TimeComponent implements OnInit, OnDestroy {
111
115
  this.helperText = this.configProps$.helperText;
112
116
  this.placeholder = this.configProps$.placeholder || '';
113
117
 
118
+ this.actionsApi = this.pConn$.getActionsApi();
119
+ this.propName = this.pConn$.getStateProps().value;
120
+
114
121
  // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
115
122
  setTimeout(() => {
116
123
  if (this.configProps$.required != null) {
@@ -119,6 +126,12 @@ export class TimeComponent implements OnInit, OnDestroy {
119
126
  this.cdRef.detectChanges();
120
127
  });
121
128
 
129
+ if (this.displayMode$ === 'DISPLAY_ONLY' || this.displayMode$ === 'STACKED_LARGE_VAL') {
130
+ this.formattedValue$ = format(this.value$, 'timeonly', {
131
+ format: 'hh:mm A'
132
+ });
133
+ }
134
+
122
135
  if (this.configProps$.visibility != null) {
123
136
  this.bVisible$ = this.utils.getBooleanValue(this.configProps$.visibility);
124
137
  }
@@ -138,7 +151,7 @@ export class TimeComponent implements OnInit, OnDestroy {
138
151
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
139
152
  }
140
153
 
141
- this.componentReference = (this.pConn$.getStateProps() as any).value;
154
+ this.componentReference = this.pConn$.getStateProps().value;
142
155
 
143
156
  // trigger display of error message with field control
144
157
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -152,14 +165,29 @@ export class TimeComponent implements OnInit, OnDestroy {
152
165
  }
153
166
 
154
167
  fieldOnChange(event: any) {
155
- event.value = event.target.value;
156
- this.angularPConnectData.actions?.onChange(this, event);
168
+ const oldVal = this.value$ ?? '';
169
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
170
+
171
+ if (isValueChanged) {
172
+ this.pConn$.clearErrorMessages({
173
+ property: this.propName
174
+ });
175
+ }
157
176
  }
158
177
 
159
178
  fieldOnBlur(event: any) {
160
- // PConnect wants to use eventHandler for onBlur
161
- event.value = event.target.value;
162
- this.angularPConnectData.actions?.onBlur(this, event);
179
+ const oldVal = this.value$ ?? '';
180
+ const isValueChanged = event?.target?.value.toString() !== oldVal.toString();
181
+
182
+ if (isValueChanged) {
183
+ let value = event?.target?.value;
184
+ const hhmmPattern = /^\d{2}:\d{2}$/;
185
+ if (hhmmPattern.test(value)) {
186
+ value = `${value}:00`; // append ":00"
187
+ }
188
+
189
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
190
+ }
163
191
  }
164
192
 
165
193
  getErrorMessage() {
@@ -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 URLProps extends PConnFieldProps {
13
14
  // If any, enter additional props that only exist on URL here
@@ -17,7 +18,6 @@ interface URLProps extends PConnFieldProps {
17
18
  selector: 'app-url',
18
19
  templateUrl: './url.component.html',
19
20
  styleUrls: ['./url.component.scss'],
20
- standalone: true,
21
21
  imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, forwardRef(() => ComponentMapperComponent)]
22
22
  })
23
23
  export class UrlComponent implements OnInit, OnDestroy {
@@ -43,6 +43,8 @@ export class UrlComponent implements OnInit, OnDestroy {
43
43
  placeholder: string;
44
44
 
45
45
  fieldControl = new FormControl('', null);
46
+ actionsApi: Object;
47
+ propName: string;
46
48
 
47
49
  constructor(
48
50
  private angularPConnect: AngularPConnectService,
@@ -113,6 +115,9 @@ export class UrlComponent implements OnInit, OnDestroy {
113
115
  this.helperText = this.configProps$.helperText;
114
116
  this.placeholder = this.configProps$.placeholder || '';
115
117
 
118
+ this.actionsApi = this.pConn$.getActionsApi();
119
+ this.propName = this.pConn$.getStateProps().value;
120
+
116
121
  // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
117
122
  setTimeout(() => {
118
123
  if (this.configProps$.required != null) {
@@ -140,7 +145,7 @@ export class UrlComponent implements OnInit, OnDestroy {
140
145
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
141
146
  }
142
147
 
143
- this.componentReference = (this.pConn$.getStateProps() as any).value;
148
+ this.componentReference = this.pConn$.getStateProps().value;
144
149
 
145
150
  // trigger display of error message with field control
146
151
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -154,12 +159,24 @@ export class UrlComponent implements OnInit, OnDestroy {
154
159
  }
155
160
 
156
161
  fieldOnChange(event: any) {
157
- this.angularPConnectData.actions?.onChange(this, event);
162
+ const oldVal = this.value$ ?? '';
163
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
164
+
165
+ if (isValueChanged) {
166
+ this.pConn$.clearErrorMessages({
167
+ property: this.propName
168
+ });
169
+ }
158
170
  }
159
171
 
160
172
  fieldOnBlur(event: any) {
161
- // PConnect wants to use eventHandler for onBlur
162
- this.angularPConnectData.actions?.onBlur(this, event);
173
+ const oldVal = this.value$ ?? '';
174
+ const isValueChanged = event.target.value.toString() !== oldVal.toString();
175
+
176
+ if (isValueChanged) {
177
+ const value = event?.target?.value;
178
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
179
+ }
163
180
  }
164
181
 
165
182
  getErrorMessage() {
@@ -1,53 +1,47 @@
1
- <div class="psdk-user-reference">
1
+ <div>
2
2
  <div *ngIf="displayMode$; else noDisplayMode">
3
3
  <component-mapper name="FieldValueList" [props]="{ label$, value$, displayMode$ }"></component-mapper>
4
4
  </div>
5
5
  <ng-template #noDisplayMode>
6
- <div *ngIf="type === 'operator'">
7
- <component-mapper name="Operator" [props]="{ pConn$ }"></component-mapper>
8
- </div>
9
- <div [formGroup]="formGroup$" *ngIf="type === 'dropdown'">
10
- <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
11
- <mat-select
12
- [value]="value$"
13
- [required]="bRequired$"
14
- [formControl]="fieldControl"
15
- [attr.data-test-id]="testId"
16
- (selectionChange)="fieldOnChange($event)"
17
- >
18
- <mat-option *ngFor="let opt of options$" [value]="opt.key">
19
- {{ opt.value }}
20
- </mat-option>
21
- </mat-select>
22
- <mat-label>{{ label$ }}</mat-label>
23
- <mat-error *ngIf="fieldControl.invalid">
24
- {{ getErrorMessage() }}
25
- </mat-error>
26
- </mat-form-field>
27
- </div>
28
- <div [formGroup]="formGroup$" *ngIf="type === 'searchbox'">
29
- <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
30
- <mat-label>{{ label$ }}</mat-label>
31
- <input
32
- matInput
33
- [placeholder]="placeholder"
34
- [formControl]="fieldControl"
35
- [value]="value$"
36
- [required]="bRequired$"
37
- [matAutocomplete]="auto"
38
- [attr.data-test-id]="testId"
39
- (change)="fieldOnChange($event)"
40
- (blur)="fieldOnBlur($event)"
41
- />
42
- <mat-autocomplete #auto="matAutocomplete">
43
- <mat-option *ngFor="let opt of filteredOptions | async" [value]="opt.value">
44
- <span>{{ opt.value }}</span>
45
- </mat-option>
46
- </mat-autocomplete>
47
- <mat-error *ngIf="fieldControl.invalid">
48
- {{ getErrorMessage() }}
49
- </mat-error>
50
- </mat-form-field>
6
+ <div class="psdk-user-reference">
7
+ <div *ngIf="this.userID$ && type === 'operator'">
8
+ <component-mapper name="Operator" [props]="{ pConn$, name$: userName$ }"></component-mapper>
9
+ </div>
10
+ <div [formGroup]="formGroup$" *ngIf="type === 'dropdown'">
11
+ <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
12
+ <mat-select [required]="bRequired$" [formControl]="fieldControl" [attr.data-test-id]="testId" (selectionChange)="fieldOnChange($event)">
13
+ <mat-option *ngFor="let opt of options$" [value]="opt.key">
14
+ {{ opt.value }}
15
+ </mat-option>
16
+ </mat-select>
17
+ <mat-label>{{ label$ }}</mat-label>
18
+ <mat-error *ngIf="fieldControl.invalid">
19
+ {{ getErrorMessage() }}
20
+ </mat-error>
21
+ </mat-form-field>
22
+ </div>
23
+ <div [formGroup]="formGroup$" *ngIf="type === 'searchbox'">
24
+ <mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
25
+ <mat-label>{{ label$ }}</mat-label>
26
+ <input
27
+ matInput
28
+ [placeholder]="placeholder"
29
+ [formControl]="fieldControl"
30
+ [required]="bRequired$"
31
+ [matAutocomplete]="auto"
32
+ [attr.data-test-id]="testId"
33
+ (blur)="fieldOnBlur($event)"
34
+ />
35
+ <mat-autocomplete #auto="matAutocomplete" autoActiveFirstOption (optionSelected)="optionChanged($event)">
36
+ <mat-option *ngFor="let opt of filteredOptions | async" [value]="opt.value">
37
+ <span>{{ opt.value }}</span>
38
+ </mat-option>
39
+ </mat-autocomplete>
40
+ <mat-error *ngIf="fieldControl.invalid">
41
+ {{ getErrorMessage() }}
42
+ </mat-error>
43
+ </mat-form-field>
44
+ </div>
51
45
  </div>
52
46
  </ng-template>
53
47
  </div>