@pega/sdk 0.0.14 → 0.0.15
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/README.md +46 -6
- package/dist/index.js +50 -24
- package/package.json +42 -3
- package/templates/angular-sdk-reference/angular.json +1 -2
- package/templates/angular-sdk-reference/extra-webpack.config.cjs +23 -0
- package/templates/angular-sdk-reference/index.html +12 -0
- package/templates/angular-sdk-reference/package.json +0 -1
- package/templates/angular-sdk-reference/src/app/app.component.ts +15 -232
- package/templates/angular-sdk-reference/src/app/pconnect-renderer.component.ts +153 -0
- package/templates/angular-sdk-reference/src/components/fields/auto-complete/auto-complete.component.ts +58 -21
- package/templates/angular-sdk-reference/src/components/fields/checkbox/checkbox.component.ts +8 -3
- package/templates/angular-sdk-reference/src/components/fields/currency/currency.component.ts +22 -7
- package/templates/angular-sdk-reference/src/components/fields/date-input/date-input.component.ts +19 -6
- package/templates/angular-sdk-reference/src/components/fields/dropdown/dropdown.component.ts +24 -7
- package/templates/angular-sdk-reference/src/components/fields/email/email.component.ts +19 -6
- package/templates/angular-sdk-reference/src/components/fields/integer/integer.component.ts +19 -6
- package/templates/angular-sdk-reference/src/components/fields/phone/phone.component.ts +19 -6
- package/templates/angular-sdk-reference/src/components/fields/radio-buttons/radio-buttons.component.ts +16 -5
- package/templates/angular-sdk-reference/src/components/fields/text-area/text-area.component.ts +19 -6
- package/templates/angular-sdk-reference/src/components/fields/text-input/text-input.component.ts +19 -6
- package/templates/angular-sdk-reference/src/components/fields/url-input/url-input.component.ts +26 -7
- package/templates/angular-sdk-reference/src/components/helpers/sdk-helpers.ts +93 -0
- package/templates/angular-sdk-reference/src/components/infra/case-summary/case-summary.component.ts +8 -9
- package/templates/angular-sdk-reference/src/components/infra/case-view/case-view.component.ts +24 -12
- package/templates/angular-sdk-reference/src/components/infra/root-container/root-container.component.ts +21 -15
- package/templates/angular-sdk-reference/src/components/infra/stages/stages.component.ts +21 -10
- package/templates/angular-sdk-reference/src/components/infra/view/view.component.ts +14 -9
- package/templates/angular-sdk-reference/src/components/templates/default-form/default-form.component.ts +12 -8
- package/templates/angular-sdk-reference/tsconfig.app.json +13 -0
- package/templates/angular-sdk-reference/tsconfig.json +2 -5
- package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +65 -31
- package/templates/react-sdk-reference/.ai-common/agents/implementation-expert.md +74 -38
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions-embedded.md +33 -1
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions.md +57 -22
- package/templates/react-sdk-reference/.ai-common/instructions/embedded-component.md +25 -10
- package/templates/react-sdk-reference/.ai-common/prompts/add-component.md +40 -19
- package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +55 -1
- package/templates/react-sdk-reference/.ai-common/prompts/embedded-component-manifest.md +26 -4
- package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +82 -33
- package/templates/react-sdk-reference/.ai-common/prompts/generate-dse-components.md +46 -26
- package/templates/react-sdk-reference/.ai-common/prompts/generate-embedded-components.md +28 -15
- package/templates/react-sdk-reference/.ai-common/prompts/generate-field-components.md +24 -6
- package/templates/react-sdk-reference/.ai-common/prompts/generate-infra-components.md +24 -6
- package/templates/react-sdk-reference/.ai-common/prompts/generate-template-components.md +24 -6
- package/templates/react-sdk-reference/.ai-common/prompts/generate-widget-components.md +24 -6
- package/templates/react-sdk-reference/.ai-common/prompts/identify-components.md +2 -0
- package/templates/react-sdk-reference/.ai-common/prompts/replace-design-system.md +44 -17
- package/templates/react-sdk-reference/.ai-common/skills/connect-pega-server.md +14 -1
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/AssignmentHeader.md +79 -0
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Toast.md +96 -0
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension.md +56 -35
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/analyze-customer-repo.md +29 -3
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/run-and-verify-integration.md +97 -37
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/wire-integration.md +91 -60
- package/templates/react-sdk-reference/.ai-common/skills/field-components.md +13 -1
- package/templates/react-sdk-reference/.ai-common/skills/infra-components.md +13 -1
- package/templates/react-sdk-reference/.ai-common/skills/portal-flow/run-and-verify-portal.md +290 -0
- package/templates/react-sdk-reference/.ai-common/skills/template-components.md +13 -1
- package/templates/react-sdk-reference/.ai-common/skills/widget-components.md +13 -1
- package/templates/react-sdk-reference/assets/icons/trash.svg +3 -0
- package/templates/react-sdk-reference/index.html +0 -1
- package/templates/react-sdk-reference/package.json +2 -2
- package/templates/react-sdk-reference/package.minimal.json +2 -2
- package/templates/react-sdk-reference/sdk-config.json +3 -3
- package/templates/react-sdk-reference/src/FallbackComponent.tsx +1 -1
- package/templates/react-sdk-reference/src/MashupApp.tsx +33 -78
- package/templates/react-sdk-reference/src/PortalApp.tsx +23 -100
- package/templates/react-sdk-reference/src/components/component-map.ts +15 -1
- package/templates/react-sdk-reference/src/components/designSystemExtension/AssignmentHeader/AssignmentHeader.tsx +15 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/AssignmentHeader/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroup/FieldGroup.tsx +1 -1
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroupList/FieldGroupList.tsx +1 -1
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldValueList/FieldValueList.tsx +16 -4
- package/templates/react-sdk-reference/src/components/designSystemExtension/ModalDialog/ModalDialog.tsx +26 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/ModalDialog/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Toast/Toast.tsx +35 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Toast/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +362 -24
- package/templates/react-sdk-reference/src/components/field/CancelAlert/CancelAlert.tsx +1 -1
- package/templates/react-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +3 -1
- package/templates/react-sdk-reference/src/components/field/Currency/Currency.tsx +6 -3
- package/templates/react-sdk-reference/src/components/field/Date/Date.tsx +2 -1
- package/templates/react-sdk-reference/src/components/field/DateTime/DateTime.tsx +2 -1
- package/templates/react-sdk-reference/src/components/field/Decimal/Decimal.tsx +4 -3
- package/templates/react-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +2 -0
- package/templates/react-sdk-reference/src/components/field/Email/Email.tsx +2 -1
- package/templates/react-sdk-reference/src/components/field/EmbeddedDataMulti/EmbeddedDataMulti.tsx +121 -0
- package/templates/react-sdk-reference/src/components/field/EmbeddedDataMulti/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/EmbeddedDataMulti/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Integer/Integer.tsx +2 -1
- package/templates/react-sdk-reference/src/components/field/Location/Location.tsx +1 -1
- package/templates/react-sdk-reference/src/components/field/Multiselect/Multiselect.tsx +40 -20
- package/templates/react-sdk-reference/src/components/field/ObjectReference/ObjectReference.tsx +554 -49
- package/templates/react-sdk-reference/src/components/field/ObjectReference/utils.ts +111 -20
- package/templates/react-sdk-reference/src/components/field/Percentage/Percentage.tsx +4 -3
- package/templates/react-sdk-reference/src/components/field/Phone/Phone.tsx +2 -1
- package/templates/react-sdk-reference/src/components/field/SelectableCard/SelectableCard.tsx +2 -1
- package/templates/react-sdk-reference/src/components/field/TextArea/TextArea.tsx +2 -1
- package/templates/react-sdk-reference/src/components/field/TextInput/TextInput.tsx +2 -1
- package/templates/react-sdk-reference/src/components/field/Time/Time.tsx +2 -1
- package/templates/react-sdk-reference/src/components/field/URL/URL.tsx +2 -1
- package/templates/react-sdk-reference/src/components/field/UserReference/UserReference.tsx +1 -1
- package/templates/react-sdk-reference/src/components/helpers/field-utils.ts +44 -0
- package/templates/react-sdk-reference/src/components/helpers/simpleTableHelpers.ts +19 -7
- package/templates/react-sdk-reference/src/components/infra/ModalViewContainer/DataViewActionButtons/DataViewActionButtons.tsx +97 -0
- package/templates/react-sdk-reference/src/components/infra/ModalViewContainer/DataViewActionButtons/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/infra/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +53 -0
- package/templates/react-sdk-reference/src/components/infra/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +2 -2
- package/templates/react-sdk-reference/src/components/template/CaseSummary/CaseSummary.tsx +3 -1
- package/templates/react-sdk-reference/src/components/template/DataReference/SearchForm.tsx +4 -4
- package/templates/react-sdk-reference/src/components/template/HierarchicalForm/HierarchicalForm.tsx +2 -2
- package/templates/react-sdk-reference/src/components/template/InlineDashboard/InlineDashboard.tsx +1 -1
- package/templates/react-sdk-reference/src/components/template/ListView/ListView.tsx +7 -3
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +173 -99
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +63 -56
- package/templates/react-sdk-reference/src/components/widget/ToDo/ToDo.tsx +1 -1
- package/templates/react-sdk-reference/vite.config.ts +26 -4
- package/templates/angular-sdk-reference/pega-constellationjs-0.26.3-local.tgz +0 -0
- package/templates/angular-sdk-reference/src/helpers/event-utils.ts +0 -18
- package/templates/angular-sdk-reference/src/helpers/utils.ts +0 -38
- package/templates/angular-sdk-reference/src/helpers/versionHelpers.ts +0 -14
- package/templates/react-sdk-reference/.ai-common/instructions/dse-component.md +0 -47
- package/templates/react-sdk-reference/.ai-common/instructions/field-component.md +0 -50
- package/templates/react-sdk-reference/.ai-common/instructions/infra-component.md +0 -76
- package/templates/react-sdk-reference/.ai-common/instructions/template-component.md +0 -43
- package/templates/react-sdk-reference/.ai-common/instructions/widget-component.md +0 -45
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/authenticate.md +0 -311
- package/templates/react-sdk-reference/pega-constellationjs-0.26.3-local.tgz +0 -0
- package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PConnectRendererComponent — Recursive Angular component that renders
|
|
3
|
+
* the PConnect c11nEnv tree as a visual fallback display.
|
|
4
|
+
*
|
|
5
|
+
* This is the Angular equivalent of React's PConnectComponent + FallbackComponent.
|
|
6
|
+
* It uses PConnectObservable from sdk-core to subscribe to state changes
|
|
7
|
+
* and recursively renders the component tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
Component,
|
|
12
|
+
Input,
|
|
13
|
+
OnInit,
|
|
14
|
+
OnDestroy,
|
|
15
|
+
NgZone,
|
|
16
|
+
ChangeDetectorRef,
|
|
17
|
+
} from '@angular/core';
|
|
18
|
+
import { CommonModule } from '@angular/common';
|
|
19
|
+
import { PegaBridgeService } from '@pega/sdk-angular';
|
|
20
|
+
import type { PConnectState, Unsubscribe } from '@pega/sdk-angular';
|
|
21
|
+
|
|
22
|
+
@Component({
|
|
23
|
+
selector: 'app-pconnect-renderer',
|
|
24
|
+
standalone: true,
|
|
25
|
+
imports: [CommonModule],
|
|
26
|
+
template: `
|
|
27
|
+
<div class="node">
|
|
28
|
+
<div class="node-header">{{ componentName }}</div>
|
|
29
|
+
|
|
30
|
+
<pre *ngIf="displayPropsJson" class="node-props">{{
|
|
31
|
+
displayPropsJson
|
|
32
|
+
}}</pre>
|
|
33
|
+
|
|
34
|
+
<!-- Recursively render children -->
|
|
35
|
+
<div *ngIf="childEnvs.length > 0" class="node-children">
|
|
36
|
+
<app-pconnect-renderer
|
|
37
|
+
*ngFor="let child of childEnvs; trackBy: trackByIndex"
|
|
38
|
+
[pConnect]="child"
|
|
39
|
+
></app-pconnect-renderer>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
`,
|
|
43
|
+
styles: [
|
|
44
|
+
`
|
|
45
|
+
.node {
|
|
46
|
+
border: 1px solid #ddd;
|
|
47
|
+
border-radius: 4px;
|
|
48
|
+
margin: 4px;
|
|
49
|
+
padding: 8px;
|
|
50
|
+
font-size: 13px;
|
|
51
|
+
font-family: system-ui, sans-serif;
|
|
52
|
+
}
|
|
53
|
+
.node-header {
|
|
54
|
+
background: #f0f4ff;
|
|
55
|
+
padding: 4px 8px;
|
|
56
|
+
border-radius: 3px;
|
|
57
|
+
font-size: 12px;
|
|
58
|
+
font-weight: 600;
|
|
59
|
+
color: #1a56db;
|
|
60
|
+
margin-bottom: 4px;
|
|
61
|
+
}
|
|
62
|
+
.node-props {
|
|
63
|
+
font-size: 11px;
|
|
64
|
+
color: #555;
|
|
65
|
+
margin: 4px 0;
|
|
66
|
+
max-height: 100px;
|
|
67
|
+
overflow: auto;
|
|
68
|
+
background: #fafafa;
|
|
69
|
+
padding: 4px;
|
|
70
|
+
border-radius: 3px;
|
|
71
|
+
white-space: pre-wrap;
|
|
72
|
+
}
|
|
73
|
+
.node-children {
|
|
74
|
+
padding-left: 12px;
|
|
75
|
+
}
|
|
76
|
+
`,
|
|
77
|
+
],
|
|
78
|
+
})
|
|
79
|
+
export class PConnectRendererComponent implements OnInit, OnDestroy {
|
|
80
|
+
@Input() pConnect!: typeof PConnect;
|
|
81
|
+
|
|
82
|
+
componentName = 'Unknown';
|
|
83
|
+
displayPropsJson = '';
|
|
84
|
+
childEnvs: Array<typeof PConnect> = [];
|
|
85
|
+
|
|
86
|
+
private bridge = new PegaBridgeService();
|
|
87
|
+
private unsubscribe: Unsubscribe | null = null;
|
|
88
|
+
|
|
89
|
+
constructor(
|
|
90
|
+
private ngZone: NgZone,
|
|
91
|
+
private cdr: ChangeDetectorRef,
|
|
92
|
+
) {}
|
|
93
|
+
|
|
94
|
+
ngOnInit(): void {
|
|
95
|
+
if (!this.pConnect) return;
|
|
96
|
+
|
|
97
|
+
// Resolve component name
|
|
98
|
+
const pc = this.pConnect as any;
|
|
99
|
+
this.componentName =
|
|
100
|
+
pc.getComponentName?.() ?? pc.componentName ?? 'Unknown';
|
|
101
|
+
|
|
102
|
+
// Create observable for state changes
|
|
103
|
+
const subscription = this.bridge.observe(this.pConnect).subscribe((state: PConnectState) => {
|
|
104
|
+
this.ngZone.run(() => {
|
|
105
|
+
this.applyState(state);
|
|
106
|
+
this.cdr.markForCheck();
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
this.unsubscribe = () => subscription.unsubscribe();
|
|
110
|
+
|
|
111
|
+
// Resolve children
|
|
112
|
+
this.resolveChildren();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
ngOnDestroy(): void {
|
|
116
|
+
this.unsubscribe?.();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
trackByIndex(index: number): number {
|
|
120
|
+
return index;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
private applyState(state: PConnectState): void {
|
|
124
|
+
// Filter out function props and internal props for display
|
|
125
|
+
const displayProps = Object.fromEntries(
|
|
126
|
+
Object.entries(state.configProps).filter(
|
|
127
|
+
([key, value]) =>
|
|
128
|
+
typeof value !== 'function' &&
|
|
129
|
+
!['getPConnect', 'pConnect', 'visibility'].includes(key),
|
|
130
|
+
),
|
|
131
|
+
);
|
|
132
|
+
const json = JSON.stringify(displayProps, null, 2);
|
|
133
|
+
this.displayPropsJson = json !== '{}' ? json : '';
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
private resolveChildren(): void {
|
|
137
|
+
const pc = this.pConnect as any;
|
|
138
|
+
if (!pc.hasChildren?.()) {
|
|
139
|
+
this.childEnvs = [];
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const children = pc.getChildren?.() as any[];
|
|
144
|
+
if (!children) {
|
|
145
|
+
this.childEnvs = [];
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
this.childEnvs = children.map((childEnv: any) => {
|
|
150
|
+
return childEnv.getPConnect ? childEnv.getPConnect() : childEnv;
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -13,8 +13,7 @@ import { Component, Input } from '@angular/core';
|
|
|
13
13
|
import type { OnInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
14
14
|
import { CommonModule } from '@angular/common';
|
|
15
15
|
import { FormsModule } from '@angular/forms';
|
|
16
|
-
import { handleEvent } from '
|
|
17
|
-
import { getOptionList } from '../../../helpers/utils';
|
|
16
|
+
import { getOptionList, handleEvent } from '../../helpers/sdk-helpers';
|
|
18
17
|
|
|
19
18
|
interface IOption {
|
|
20
19
|
key: string;
|
|
@@ -33,9 +32,18 @@ interface IOption {
|
|
|
33
32
|
</div>
|
|
34
33
|
|
|
35
34
|
<!-- Editable mode -->
|
|
36
|
-
<div
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
<div
|
|
36
|
+
*ngIf="!readOnly && !isDisplayMode"
|
|
37
|
+
style="margin-bottom: 1rem; position: relative;"
|
|
38
|
+
>
|
|
39
|
+
<label
|
|
40
|
+
*ngIf="label"
|
|
41
|
+
style="display: block; margin-bottom: 0.25rem; font-weight: 500; font-size: 0.875rem;"
|
|
42
|
+
>
|
|
43
|
+
{{ label
|
|
44
|
+
}}<span *ngIf="required" style="color: #dc2626; margin-left: 0.25rem;"
|
|
45
|
+
>*</span
|
|
46
|
+
>
|
|
39
47
|
</label>
|
|
40
48
|
<input
|
|
41
49
|
type="text"
|
|
@@ -49,7 +57,9 @@ interface IOption {
|
|
|
49
57
|
(blur)="onBlur()"
|
|
50
58
|
autocomplete="off"
|
|
51
59
|
style="width: 100%; padding: 0.5rem 0.75rem; border-radius: 0.375rem; font-size: 0.875rem; box-sizing: border-box;"
|
|
52
|
-
[style.border]="
|
|
60
|
+
[style.border]="
|
|
61
|
+
validatemessage ? '1px solid #dc2626' : '1px solid #d1d5db'
|
|
62
|
+
"
|
|
53
63
|
/>
|
|
54
64
|
<!-- Dropdown list -->
|
|
55
65
|
<ul
|
|
@@ -123,11 +133,14 @@ export class AutoCompleteComponent implements OnInit, OnChanges {
|
|
|
123
133
|
this.validatemessage = p.validatemessage ?? '';
|
|
124
134
|
this.helperText = p.helperText ?? '';
|
|
125
135
|
this.helperTextToDisplay = this.validatemessage || this.helperText;
|
|
126
|
-
this.isDisplayMode =
|
|
136
|
+
this.isDisplayMode =
|
|
137
|
+
p.displayMode === 'DISPLAY_ONLY' || p.displayMode === 'STACKED_LARGE_VAL';
|
|
127
138
|
|
|
128
139
|
this.pConn = p.getPConnect?.();
|
|
129
140
|
this.actions = this.pConn?.getActionsApi?.();
|
|
130
|
-
this.propName =
|
|
141
|
+
this.propName =
|
|
142
|
+
((this.pConn?.getStateProps?.() as Record<string, unknown>)
|
|
143
|
+
?.value as string) ?? '';
|
|
131
144
|
|
|
132
145
|
// Resolve display value from current options
|
|
133
146
|
this.updateDisplayValue();
|
|
@@ -144,7 +157,9 @@ export class AutoCompleteComponent implements OnInit, OnChanges {
|
|
|
144
157
|
|
|
145
158
|
private filterOptions(): void {
|
|
146
159
|
const text = (this.inputValue ?? '').toLowerCase();
|
|
147
|
-
this.filteredOptions = text
|
|
160
|
+
this.filteredOptions = text
|
|
161
|
+
? this.options.filter((o) => o.value?.toLowerCase().includes(text))
|
|
162
|
+
: [...this.options];
|
|
148
163
|
}
|
|
149
164
|
|
|
150
165
|
private loadOptions(): void {
|
|
@@ -179,21 +194,34 @@ export class AutoCompleteComponent implements OnInit, OnChanges {
|
|
|
179
194
|
|
|
180
195
|
if (this.listType === 'associated') {
|
|
181
196
|
const dataObject = this.pConn?.getDataObject?.('') ?? {};
|
|
182
|
-
const optList = getOptionList(
|
|
183
|
-
|
|
197
|
+
const optList = getOptionList(
|
|
198
|
+
p as Record<string, unknown>,
|
|
199
|
+
dataObject as Record<string, unknown>,
|
|
200
|
+
);
|
|
201
|
+
this.setOptions(
|
|
202
|
+
optList.map((o) => ({ key: o.value, value: o.text ?? o.value })),
|
|
203
|
+
);
|
|
184
204
|
} else if (this.listType === 'datapage' && datasource) {
|
|
185
205
|
const context = this.pConn?.getContextName?.() ?? '';
|
|
186
206
|
const flatParams =
|
|
187
|
-
typeof parameters === 'object' && !Array.isArray(parameters)
|
|
207
|
+
typeof parameters === 'object' && !Array.isArray(parameters)
|
|
208
|
+
? this.flattenParameters(parameters)
|
|
209
|
+
: {};
|
|
188
210
|
(PCore.getDataPageUtils() as any)
|
|
189
211
|
.getDataAsync(datasource, context, flatParams)
|
|
190
212
|
.then((response: any) => {
|
|
191
|
-
const results = Array.isArray(response)
|
|
213
|
+
const results = Array.isArray(response)
|
|
214
|
+
? response
|
|
215
|
+
: (response?.data ?? []);
|
|
192
216
|
const displayColumn = this.getDisplayFieldsMetaData(processedColumns);
|
|
193
|
-
const optionsData: IOption[] = results.map(
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
217
|
+
const optionsData: IOption[] = results.map(
|
|
218
|
+
(element: Record<string, unknown>) => ({
|
|
219
|
+
key: String(
|
|
220
|
+
element[displayColumn.key] ?? element['pyGUID'] ?? '',
|
|
221
|
+
),
|
|
222
|
+
value: String(element[displayColumn.primary] ?? ''),
|
|
223
|
+
}),
|
|
224
|
+
);
|
|
197
225
|
this.setOptions(optionsData);
|
|
198
226
|
})
|
|
199
227
|
.catch(() => {
|
|
@@ -207,7 +235,9 @@ export class AutoCompleteComponent implements OnInit, OnChanges {
|
|
|
207
235
|
this.updateDisplayValue();
|
|
208
236
|
}
|
|
209
237
|
|
|
210
|
-
private flattenParameters(
|
|
238
|
+
private flattenParameters(
|
|
239
|
+
params: Record<string, any> = {},
|
|
240
|
+
): Record<string, unknown> {
|
|
211
241
|
const flat: Record<string, unknown> = {};
|
|
212
242
|
for (const key of Object.keys(params)) {
|
|
213
243
|
const { name, value: val } = params[key];
|
|
@@ -216,10 +246,15 @@ export class AutoCompleteComponent implements OnInit, OnChanges {
|
|
|
216
246
|
return flat;
|
|
217
247
|
}
|
|
218
248
|
|
|
219
|
-
private preProcessColumns(
|
|
249
|
+
private preProcessColumns(
|
|
250
|
+
columnList: Array<Record<string, string>>,
|
|
251
|
+
): Array<Record<string, string>> {
|
|
220
252
|
return columnList.map((col) => {
|
|
221
253
|
const temp = { ...col };
|
|
222
|
-
temp.value =
|
|
254
|
+
temp.value =
|
|
255
|
+
col.value && col.value.startsWith('.')
|
|
256
|
+
? col.value.substring(1)
|
|
257
|
+
: col.value;
|
|
223
258
|
return temp;
|
|
224
259
|
});
|
|
225
260
|
}
|
|
@@ -229,7 +264,9 @@ export class AutoCompleteComponent implements OnInit, OnChanges {
|
|
|
229
264
|
primary: string;
|
|
230
265
|
secondary: string[];
|
|
231
266
|
} {
|
|
232
|
-
const displayColumns = columnList.filter(
|
|
267
|
+
const displayColumns = columnList.filter(
|
|
268
|
+
(col) => col['display'] === 'true',
|
|
269
|
+
);
|
|
233
270
|
const metaData = { key: '', primary: '', secondary: [] as string[] };
|
|
234
271
|
const keyCol = columnList.filter((col) => col['key'] === 'true');
|
|
235
272
|
metaData.key = keyCol.length > 0 ? keyCol[0].value : 'auto';
|
package/templates/angular-sdk-reference/src/components/fields/checkbox/checkbox.component.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { Component, Input } from '@angular/core';
|
|
9
9
|
import type { OnInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
10
10
|
import { CommonModule } from '@angular/common';
|
|
11
|
-
import { handleEvent } from '
|
|
11
|
+
import { handleEvent } from '../../helpers/sdk-helpers';
|
|
12
12
|
|
|
13
13
|
@Component({
|
|
14
14
|
selector: 'pega-checkbox',
|
|
@@ -30,7 +30,10 @@ import { handleEvent } from '../../../helpers/event-utils';
|
|
|
30
30
|
{{ label }}
|
|
31
31
|
<span *ngIf="required" style="color: #dc2626;">*</span>
|
|
32
32
|
</label>
|
|
33
|
-
<div
|
|
33
|
+
<div
|
|
34
|
+
*ngIf="validatemessage"
|
|
35
|
+
style="color: #dc2626; font-size: 0.75rem; margin-top: 0.25rem;"
|
|
36
|
+
>
|
|
34
37
|
{{ validatemessage }}
|
|
35
38
|
</div>
|
|
36
39
|
</div>
|
|
@@ -72,7 +75,9 @@ export class CheckboxComponent implements OnInit, OnChanges {
|
|
|
72
75
|
|
|
73
76
|
const pConn = p.getPConnect?.();
|
|
74
77
|
this.actions = pConn?.getActionsApi?.();
|
|
75
|
-
this.propName =
|
|
78
|
+
this.propName =
|
|
79
|
+
((pConn?.getStateProps?.() as Record<string, unknown>)
|
|
80
|
+
?.value as string) ?? '';
|
|
76
81
|
}
|
|
77
82
|
|
|
78
83
|
onCheckChange(event: Event): void {
|
package/templates/angular-sdk-reference/src/components/fields/currency/currency.component.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { Component, Input } from '@angular/core';
|
|
|
9
9
|
import type { OnInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
10
10
|
import { CommonModule } from '@angular/common';
|
|
11
11
|
import { FormsModule } from '@angular/forms';
|
|
12
|
-
import { handleEvent } from '
|
|
12
|
+
import { handleEvent } from '../../helpers/sdk-helpers';
|
|
13
13
|
|
|
14
14
|
@Component({
|
|
15
15
|
selector: 'pega-currency',
|
|
@@ -17,11 +17,19 @@ import { handleEvent } from '../../../helpers/event-utils';
|
|
|
17
17
|
imports: [CommonModule, FormsModule],
|
|
18
18
|
template: `
|
|
19
19
|
<div *ngIf="!readOnly" style="margin-bottom: 1rem;">
|
|
20
|
-
<label
|
|
21
|
-
|
|
20
|
+
<label
|
|
21
|
+
*ngIf="label"
|
|
22
|
+
style="display: block; margin-bottom: 0.25rem; font-weight: 500; font-size: 0.875rem;"
|
|
23
|
+
>
|
|
24
|
+
{{ label
|
|
25
|
+
}}<span *ngIf="required" style="color: #dc2626; margin-left: 0.25rem;"
|
|
26
|
+
>*</span
|
|
27
|
+
>
|
|
22
28
|
</label>
|
|
23
29
|
<div style="display: flex; align-items: center;">
|
|
24
|
-
<span style="margin-right: 0.25rem; font-size: 0.875rem;">{{
|
|
30
|
+
<span style="margin-right: 0.25rem; font-size: 0.875rem;">{{
|
|
31
|
+
currencySymbol
|
|
32
|
+
}}</span>
|
|
25
33
|
<input
|
|
26
34
|
type="number"
|
|
27
35
|
step="0.01"
|
|
@@ -32,10 +40,15 @@ import { handleEvent } from '../../../helpers/event-utils';
|
|
|
32
40
|
[required]="required"
|
|
33
41
|
(blur)="onBlur($event)"
|
|
34
42
|
style="flex: 1; padding: 0.5rem 0.75rem; border-radius: 0.375rem; font-size: 0.875rem;"
|
|
35
|
-
[style.border]="
|
|
43
|
+
[style.border]="
|
|
44
|
+
validatemessage ? '1px solid #dc2626' : '1px solid #d1d5db'
|
|
45
|
+
"
|
|
36
46
|
/>
|
|
37
47
|
</div>
|
|
38
|
-
<div
|
|
48
|
+
<div
|
|
49
|
+
*ngIf="validatemessage"
|
|
50
|
+
style="color: #dc2626; font-size: 0.75rem; margin-top: 0.25rem;"
|
|
51
|
+
>
|
|
39
52
|
{{ validatemessage }}
|
|
40
53
|
</div>
|
|
41
54
|
</div>
|
|
@@ -85,7 +98,9 @@ export class CurrencyComponent implements OnInit, OnChanges {
|
|
|
85
98
|
|
|
86
99
|
const pConn = p.getPConnect?.();
|
|
87
100
|
this.actions = pConn?.getActionsApi?.();
|
|
88
|
-
this.propName =
|
|
101
|
+
this.propName =
|
|
102
|
+
((pConn?.getStateProps?.() as Record<string, unknown>)
|
|
103
|
+
?.value as string) ?? '';
|
|
89
104
|
}
|
|
90
105
|
|
|
91
106
|
onBlur(event: Event): void {
|
package/templates/angular-sdk-reference/src/components/fields/date-input/date-input.component.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { Component, Input } from '@angular/core';
|
|
|
9
9
|
import type { OnInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
10
10
|
import { CommonModule } from '@angular/common';
|
|
11
11
|
import { FormsModule } from '@angular/forms';
|
|
12
|
-
import { handleEvent } from '
|
|
12
|
+
import { handleEvent } from '../../helpers/sdk-helpers';
|
|
13
13
|
|
|
14
14
|
@Component({
|
|
15
15
|
selector: 'pega-date-input',
|
|
@@ -17,8 +17,14 @@ import { handleEvent } from '../../../helpers/event-utils';
|
|
|
17
17
|
imports: [CommonModule, FormsModule],
|
|
18
18
|
template: `
|
|
19
19
|
<div *ngIf="!readOnly" style="margin-bottom: 1rem;">
|
|
20
|
-
<label
|
|
21
|
-
|
|
20
|
+
<label
|
|
21
|
+
*ngIf="label"
|
|
22
|
+
style="display: block; margin-bottom: 0.25rem; font-weight: 500; font-size: 0.875rem;"
|
|
23
|
+
>
|
|
24
|
+
{{ label
|
|
25
|
+
}}<span *ngIf="required" style="color: #dc2626; margin-left: 0.25rem;"
|
|
26
|
+
>*</span
|
|
27
|
+
>
|
|
22
28
|
</label>
|
|
23
29
|
<input
|
|
24
30
|
type="date"
|
|
@@ -28,9 +34,14 @@ import { handleEvent } from '../../../helpers/event-utils';
|
|
|
28
34
|
[required]="required"
|
|
29
35
|
(change)="onDateChange($event)"
|
|
30
36
|
style="width: 100%; padding: 0.5rem 0.75rem; border-radius: 0.375rem; font-size: 0.875rem;"
|
|
31
|
-
[style.border]="
|
|
37
|
+
[style.border]="
|
|
38
|
+
validatemessage ? '1px solid #dc2626' : '1px solid #d1d5db'
|
|
39
|
+
"
|
|
32
40
|
/>
|
|
33
|
-
<div
|
|
41
|
+
<div
|
|
42
|
+
*ngIf="validatemessage"
|
|
43
|
+
style="color: #dc2626; font-size: 0.75rem; margin-top: 0.25rem;"
|
|
44
|
+
>
|
|
34
45
|
{{ validatemessage }}
|
|
35
46
|
</div>
|
|
36
47
|
</div>
|
|
@@ -76,7 +87,9 @@ export class DateInputComponent implements OnInit, OnChanges {
|
|
|
76
87
|
|
|
77
88
|
const pConn = p.getPConnect?.();
|
|
78
89
|
this.actions = pConn?.getActionsApi?.();
|
|
79
|
-
this.propName =
|
|
90
|
+
this.propName =
|
|
91
|
+
((pConn?.getStateProps?.() as Record<string, unknown>)
|
|
92
|
+
?.value as string) ?? '';
|
|
80
93
|
}
|
|
81
94
|
|
|
82
95
|
onDateChange(event: Event): void {
|
package/templates/angular-sdk-reference/src/components/fields/dropdown/dropdown.component.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { Component, Input } from '@angular/core';
|
|
|
9
9
|
import type { OnInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
10
10
|
import { CommonModule } from '@angular/common';
|
|
11
11
|
import { FormsModule } from '@angular/forms';
|
|
12
|
-
import { handleEvent } from '
|
|
12
|
+
import { handleEvent } from '../../helpers/sdk-helpers';
|
|
13
13
|
|
|
14
14
|
@Component({
|
|
15
15
|
selector: 'pega-dropdown',
|
|
@@ -17,8 +17,14 @@ import { handleEvent } from '../../../helpers/event-utils';
|
|
|
17
17
|
imports: [CommonModule, FormsModule],
|
|
18
18
|
template: `
|
|
19
19
|
<div *ngIf="!readOnly" style="margin-bottom: 1rem;">
|
|
20
|
-
<label
|
|
21
|
-
|
|
20
|
+
<label
|
|
21
|
+
*ngIf="label"
|
|
22
|
+
style="display: block; margin-bottom: 0.25rem; font-weight: 500; font-size: 0.875rem;"
|
|
23
|
+
>
|
|
24
|
+
{{ label
|
|
25
|
+
}}<span *ngIf="required" style="color: #dc2626; margin-left: 0.25rem;"
|
|
26
|
+
>*</span
|
|
27
|
+
>
|
|
22
28
|
</label>
|
|
23
29
|
<select
|
|
24
30
|
[attr.data-testid]="testId"
|
|
@@ -26,16 +32,25 @@ import { handleEvent } from '../../../helpers/event-utils';
|
|
|
26
32
|
[required]="required"
|
|
27
33
|
(change)="onSelectChange($event)"
|
|
28
34
|
style="width: 100%; padding: 0.5rem 0.75rem; border-radius: 0.375rem; font-size: 0.875rem;"
|
|
29
|
-
[style.border]="
|
|
35
|
+
[style.border]="
|
|
36
|
+
validatemessage ? '1px solid #dc2626' : '1px solid #d1d5db'
|
|
37
|
+
"
|
|
30
38
|
>
|
|
31
39
|
<option value="" [selected]="!value">
|
|
32
40
|
{{ placeholder || 'Select...' }}
|
|
33
41
|
</option>
|
|
34
|
-
<option
|
|
42
|
+
<option
|
|
43
|
+
*ngFor="let opt of options"
|
|
44
|
+
[value]="opt.value"
|
|
45
|
+
[selected]="opt.value === value"
|
|
46
|
+
>
|
|
35
47
|
{{ opt.text || opt.value }}
|
|
36
48
|
</option>
|
|
37
49
|
</select>
|
|
38
|
-
<div
|
|
50
|
+
<div
|
|
51
|
+
*ngIf="validatemessage"
|
|
52
|
+
style="color: #dc2626; font-size: 0.75rem; margin-top: 0.25rem;"
|
|
53
|
+
>
|
|
39
54
|
{{ validatemessage }}
|
|
40
55
|
</div>
|
|
41
56
|
</div>
|
|
@@ -89,7 +104,9 @@ export class DropdownComponent implements OnInit, OnChanges {
|
|
|
89
104
|
|
|
90
105
|
const pConn = p.getPConnect?.();
|
|
91
106
|
this.actions = pConn?.getActionsApi?.();
|
|
92
|
-
this.propName =
|
|
107
|
+
this.propName =
|
|
108
|
+
((pConn?.getStateProps?.() as Record<string, unknown>)
|
|
109
|
+
?.value as string) ?? '';
|
|
93
110
|
}
|
|
94
111
|
|
|
95
112
|
onSelectChange(event: Event): void {
|
|
@@ -9,7 +9,7 @@ import { Component, Input } from '@angular/core';
|
|
|
9
9
|
import type { OnInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
10
10
|
import { CommonModule } from '@angular/common';
|
|
11
11
|
import { FormsModule } from '@angular/forms';
|
|
12
|
-
import { handleEvent } from '
|
|
12
|
+
import { handleEvent } from '../../helpers/sdk-helpers';
|
|
13
13
|
|
|
14
14
|
@Component({
|
|
15
15
|
selector: 'pega-email',
|
|
@@ -17,8 +17,14 @@ import { handleEvent } from '../../../helpers/event-utils';
|
|
|
17
17
|
imports: [CommonModule, FormsModule],
|
|
18
18
|
template: `
|
|
19
19
|
<div *ngIf="!readOnly" style="margin-bottom: 1rem;">
|
|
20
|
-
<label
|
|
21
|
-
|
|
20
|
+
<label
|
|
21
|
+
*ngIf="label"
|
|
22
|
+
style="display: block; margin-bottom: 0.25rem; font-weight: 500; font-size: 0.875rem;"
|
|
23
|
+
>
|
|
24
|
+
{{ label
|
|
25
|
+
}}<span *ngIf="required" style="color: #dc2626; margin-left: 0.25rem;"
|
|
26
|
+
>*</span
|
|
27
|
+
>
|
|
22
28
|
</label>
|
|
23
29
|
<input
|
|
24
30
|
type="email"
|
|
@@ -29,9 +35,14 @@ import { handleEvent } from '../../../helpers/event-utils';
|
|
|
29
35
|
[required]="required"
|
|
30
36
|
(blur)="onBlur($event)"
|
|
31
37
|
style="width: 100%; padding: 0.5rem 0.75rem; border-radius: 0.375rem; font-size: 0.875rem;"
|
|
32
|
-
[style.border]="
|
|
38
|
+
[style.border]="
|
|
39
|
+
validatemessage ? '1px solid #dc2626' : '1px solid #d1d5db'
|
|
40
|
+
"
|
|
33
41
|
/>
|
|
34
|
-
<div
|
|
42
|
+
<div
|
|
43
|
+
*ngIf="validatemessage"
|
|
44
|
+
style="color: #dc2626; font-size: 0.75rem; margin-top: 0.25rem;"
|
|
45
|
+
>
|
|
35
46
|
{{ validatemessage }}
|
|
36
47
|
</div>
|
|
37
48
|
</div>
|
|
@@ -79,7 +90,9 @@ export class EmailComponent implements OnInit, OnChanges {
|
|
|
79
90
|
|
|
80
91
|
const pConn = p.getPConnect?.();
|
|
81
92
|
this.actions = pConn?.getActionsApi?.();
|
|
82
|
-
this.propName =
|
|
93
|
+
this.propName =
|
|
94
|
+
((pConn?.getStateProps?.() as Record<string, unknown>)
|
|
95
|
+
?.value as string) ?? '';
|
|
83
96
|
}
|
|
84
97
|
|
|
85
98
|
onBlur(event: Event): void {
|
|
@@ -9,7 +9,7 @@ import { Component, Input } from '@angular/core';
|
|
|
9
9
|
import type { OnInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
10
10
|
import { CommonModule } from '@angular/common';
|
|
11
11
|
import { FormsModule } from '@angular/forms';
|
|
12
|
-
import { handleEvent } from '
|
|
12
|
+
import { handleEvent } from '../../helpers/sdk-helpers';
|
|
13
13
|
|
|
14
14
|
@Component({
|
|
15
15
|
selector: 'pega-integer',
|
|
@@ -17,8 +17,14 @@ import { handleEvent } from '../../../helpers/event-utils';
|
|
|
17
17
|
imports: [CommonModule, FormsModule],
|
|
18
18
|
template: `
|
|
19
19
|
<div *ngIf="!readOnly" style="margin-bottom: 1rem;">
|
|
20
|
-
<label
|
|
21
|
-
|
|
20
|
+
<label
|
|
21
|
+
*ngIf="label"
|
|
22
|
+
style="display: block; margin-bottom: 0.25rem; font-weight: 500; font-size: 0.875rem;"
|
|
23
|
+
>
|
|
24
|
+
{{ label
|
|
25
|
+
}}<span *ngIf="required" style="color: #dc2626; margin-left: 0.25rem;"
|
|
26
|
+
>*</span
|
|
27
|
+
>
|
|
22
28
|
</label>
|
|
23
29
|
<input
|
|
24
30
|
type="number"
|
|
@@ -30,9 +36,14 @@ import { handleEvent } from '../../../helpers/event-utils';
|
|
|
30
36
|
[required]="required"
|
|
31
37
|
(blur)="onBlur($event)"
|
|
32
38
|
style="width: 100%; padding: 0.5rem 0.75rem; border-radius: 0.375rem; font-size: 0.875rem;"
|
|
33
|
-
[style.border]="
|
|
39
|
+
[style.border]="
|
|
40
|
+
validatemessage ? '1px solid #dc2626' : '1px solid #d1d5db'
|
|
41
|
+
"
|
|
34
42
|
/>
|
|
35
|
-
<div
|
|
43
|
+
<div
|
|
44
|
+
*ngIf="validatemessage"
|
|
45
|
+
style="color: #dc2626; font-size: 0.75rem; margin-top: 0.25rem;"
|
|
46
|
+
>
|
|
36
47
|
{{ validatemessage }}
|
|
37
48
|
</div>
|
|
38
49
|
</div>
|
|
@@ -80,7 +91,9 @@ export class IntegerComponent implements OnInit, OnChanges {
|
|
|
80
91
|
|
|
81
92
|
const pConn = p.getPConnect?.();
|
|
82
93
|
this.actions = pConn?.getActionsApi?.();
|
|
83
|
-
this.propName =
|
|
94
|
+
this.propName =
|
|
95
|
+
((pConn?.getStateProps?.() as Record<string, unknown>)
|
|
96
|
+
?.value as string) ?? '';
|
|
84
97
|
}
|
|
85
98
|
|
|
86
99
|
onBlur(event: Event): void {
|