@pega/sdk 0.0.5 → 0.0.7
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 +10 -3
- package/dist/index.js +828 -165
- package/package.json +1 -1
- package/templates/react-native-sdk-reference/.claude/settings.json +5 -0
- package/templates/react-native-sdk-reference/.prettierignore +17 -0
- package/templates/react-native-sdk-reference/.vscode/extensions.json +1 -0
- package/templates/react-native-sdk-reference/.vscode/settings.json +7 -0
- package/templates/react-native-sdk-reference/AGENTS.md +3 -0
- package/templates/react-native-sdk-reference/CLAUDE.md +1 -0
- package/templates/react-native-sdk-reference/README.md +56 -0
- package/templates/react-native-sdk-reference/app.json +40 -5
- package/templates/react-native-sdk-reference/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
- package/templates/react-native-sdk-reference/assets/expo.icon/Assets/grid.png +0 -0
- package/templates/react-native-sdk-reference/assets/expo.icon/icon.json +35 -0
- package/templates/react-native-sdk-reference/assets/icons/bell.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/clock.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/cross.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/donut.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/gear.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/globe.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/internet.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/music.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/right-arrow.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/speed.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/MediaCo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/adaptive-icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-background.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-foreground.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-monochrome.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-badge-white.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-badge.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/favicon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/logo-glow.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/partial-react-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo@2x.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo@3x.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/splash-icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/tutorial-web.png +0 -0
- package/templates/react-native-sdk-reference/eslint.config.mjs +68 -0
- package/templates/react-native-sdk-reference/package.json +59 -14
- package/templates/react-native-sdk-reference/pega-constellationjs-0.26.3.tgz +0 -0
- package/templates/react-native-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-native-sdk-reference/pega-sdk-types-0.1.0.tgz +0 -0
- package/templates/react-native-sdk-reference/sdk-config.json +31 -9
- package/templates/react-native-sdk-reference/src/app/_layout.tsx +38 -0
- package/templates/react-native-sdk-reference/src/app/home/_layout.tsx +39 -0
- package/templates/react-native-sdk-reference/src/app/home/contact.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/home/index.tsx +36 -0
- package/templates/react-native-sdk-reference/src/app/home/shop.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/home/your-services.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/index.tsx +72 -0
- package/templates/react-native-sdk-reference/src/app/workarea.tsx +135 -0
- package/templates/react-native-sdk-reference/src/bridge/Context/StoreContext.ts +4 -0
- package/templates/react-native-sdk-reference/src/bridge/RootComponent.tsx +12 -0
- package/templates/react-native-sdk-reference/src/bridge/react_pconnect.jsx +334 -0
- package/templates/react-native-sdk-reference/src/components/common/DisplayField.tsx +29 -0
- package/templates/react-native-sdk-reference/src/components/common/FormFieldWrapper.tsx +5 -0
- package/templates/react-native-sdk-reference/src/components/common/HelperText.tsx +11 -0
- package/templates/react-native-sdk-reference/src/components/common/LabelText.tsx +22 -0
- package/templates/react-native-sdk-reference/src/components/common/inputTheme.ts +17 -0
- package/templates/react-native-sdk-reference/src/components/design-system/AutoComplete.tsx +126 -0
- package/templates/react-native-sdk-reference/src/components/design-system/FieldGroup.tsx +72 -0
- package/templates/react-native-sdk-reference/src/components/design-system/Radio.tsx +61 -0
- package/templates/react-native-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +196 -0
- package/templates/react-native-sdk-reference/src/components/field/AutoComplete/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +89 -0
- package/templates/react-native-sdk-reference/src/components/field/Checkbox/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Currency/Currency.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/Currency/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Date/Date.tsx +94 -0
- package/templates/react-native-sdk-reference/src/components/field/Date/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +211 -0
- package/templates/react-native-sdk-reference/src/components/field/Dropdown/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Email/Email.tsx +81 -0
- package/templates/react-native-sdk-reference/src/components/field/Email/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Group/Group.tsx +47 -0
- package/templates/react-native-sdk-reference/src/components/field/Group/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Integer/Integer.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/Integer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Phone/Phone.tsx +85 -0
- package/templates/react-native-sdk-reference/src/components/field/Phone/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/field/RadioButtons/RadioButtons.tsx +118 -0
- package/templates/react-native-sdk-reference/src/components/field/RadioButtons/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/field/TextArea/TextArea.tsx +86 -0
- package/templates/react-native-sdk-reference/src/components/field/TextArea/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/TextInput/TextInput.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/TextInput/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/URL/URL.tsx +86 -0
- package/templates/react-native-sdk-reference/src/components/field/URL/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/helpers/data_page.ts +20 -0
- package/templates/react-native-sdk-reference/src/components/helpers/event-utils.ts +20 -0
- package/templates/react-native-sdk-reference/src/components/helpers/instructions-utils.ts +57 -0
- package/templates/react-native-sdk-reference/src/components/helpers/state-utils.tsx +46 -0
- package/templates/react-native-sdk-reference/src/components/helpers/template-utils.ts +75 -0
- package/templates/react-native-sdk-reference/src/components/helpers/utils.ts +339 -0
- package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/ActionButtons.tsx +63 -0
- package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Assignment/Assignment.tsx +348 -0
- package/templates/react-native-sdk-reference/src/components/infra/Assignment/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/AssignmentCard.tsx +56 -0
- package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/FlowContainer.tsx +57 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/helpers.ts +137 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/RootContainer.tsx +52 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/helper.ts +128 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/index.tsx +59 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/ViewContainer.tsx +31 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/helper.ts +39 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/helper.ts +9 -0
- package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/ErrorBoundary.tsx +53 -0
- package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/MultiStep/MultiStep.tsx +24 -0
- package/templates/react-native-sdk-reference/src/components/infra/MultiStep/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/Reference.tsx +68 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/utils.ts +16 -0
- package/templates/react-native-sdk-reference/src/components/infra/Region/Region.tsx +10 -0
- package/templates/react-native-sdk-reference/src/components/infra/Region/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/View/View.tsx +49 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/DefaultForm.tsx +38 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/utils/index.ts +28 -0
- package/templates/react-native-sdk-reference/src/components/template/Details/Details.tsx +82 -0
- package/templates/react-native-sdk-reference/src/components/template/Details/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/template/OneColumn/OneColumn.tsx +29 -0
- package/templates/react-native-sdk-reference/src/components/template/OneColumn/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/context/LoaderContext.tsx +42 -0
- package/templates/react-native-sdk-reference/src/mediaco/AdvBanner.tsx +62 -0
- package/templates/react-native-sdk-reference/src/mediaco/Header.tsx +60 -0
- package/templates/react-native-sdk-reference/src/mediaco/HomeScreen.tsx +78 -0
- package/templates/react-native-sdk-reference/src/mediaco/QuickActions.tsx +68 -0
- package/templates/react-native-sdk-reference/src/mediaco/ResolutionScreen.tsx +48 -0
- package/templates/react-native-sdk-reference/src/mediaco/SafeArea.tsx +11 -0
- package/templates/react-native-sdk-reference/src/mediaco/TabBar.tsx +102 -0
- package/templates/react-native-sdk-reference/src/mediaco/YourServices.tsx +90 -0
- package/templates/react-native-sdk-reference/src/sdk-pega-component-map.ts +64 -0
- package/templates/react-native-sdk-reference/src/types/PConnProps.d.ts +41 -0
- package/templates/react-native-sdk-reference/src/utils/auth.ts +62 -0
- package/templates/react-native-sdk-reference/src/utils/init-pcore.ts +37 -0
- package/templates/react-native-sdk-reference/src/utils/pcore-polyfills.ts +66 -0
- package/templates/react-native-sdk-reference/tsconfig.json +9 -8
- package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +171 -0
- package/templates/react-sdk-reference/.ai-common/agents/implementation-expert.md +25 -26
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions-embedded.md +119 -0
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions.md +70 -121
- package/templates/react-sdk-reference/.ai-common/instructions/component-map.md +7 -19
- package/templates/react-sdk-reference/.ai-common/instructions/dse-component.md +10 -40
- package/templates/react-sdk-reference/.ai-common/instructions/embedded-component.md +134 -0
- package/templates/react-sdk-reference/.ai-common/instructions/field-component.md +15 -43
- package/templates/react-sdk-reference/.ai-common/instructions/template-component.md +11 -63
- package/templates/react-sdk-reference/.ai-common/instructions/widget-component.md +12 -57
- package/templates/react-sdk-reference/.ai-common/mcp/claude-code.mcp.json +8 -0
- package/templates/react-sdk-reference/.ai-common/mcp/copilot.mcp.json +8 -0
- package/templates/react-sdk-reference/.ai-common/mcp/cursor.mcp.json +11 -0
- package/templates/react-sdk-reference/.ai-common/prompts/add-component.md +45 -71
- package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +98 -0
- package/templates/react-sdk-reference/.ai-common/prompts/embedded-component-manifest.md +155 -0
- package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +67 -237
- package/templates/react-sdk-reference/.ai-common/prompts/generate-dse-components.md +26 -77
- package/templates/react-sdk-reference/.ai-common/prompts/generate-embedded-components.md +315 -0
- package/templates/react-sdk-reference/.ai-common/prompts/generate-field-components.md +31 -80
- package/templates/react-sdk-reference/.ai-common/prompts/generate-template-components.md +43 -99
- package/templates/react-sdk-reference/.ai-common/prompts/generate-widget-components.md +33 -83
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/AlertBanner.md +60 -74
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Banner.md +64 -84
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/CaseSummaryFields.md +76 -109
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/DetailsFields.md +84 -101
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroup.md +62 -87
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroupList.md +56 -76
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldValueList.md +61 -85
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Operator.md +84 -107
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Pulse.md +36 -44
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/RichTextEditor.md +125 -189
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/WssQuickCreate.md +34 -50
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension.md +57 -179
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/analyze-customer-repo.md +130 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/authenticate.md +311 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/run-and-verify-integration.md +156 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/wire-integration.md +476 -0
- package/templates/react-sdk-reference/.ai-common/skills/field-components.md +120 -242
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +71 -212
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/CancelAlert.md +47 -209
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Checkbox.md +90 -259
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Currency.md +75 -169
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Date.md +65 -160
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/DateTime.md +59 -157
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Decimal.md +55 -134
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Dropdown.md +61 -185
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Email.md +60 -138
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Group.md +40 -99
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Integer.md +44 -111
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Location.md +57 -165
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Multiselect.md +41 -122
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +32 -130
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Percentage.md +48 -112
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Phone.md +43 -153
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/RadioButtons.md +76 -183
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/RichText.md +59 -176
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/ScalarList.md +30 -123
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/SelectableCard.md +47 -178
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/SemanticLink.md +31 -117
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextArea.md +51 -106
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextContent.md +22 -75
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextInput.md +54 -116
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Time.md +46 -100
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/URL.md +44 -93
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +40 -167
- package/templates/react-sdk-reference/.ai-common/skills/infra-components.md +165 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/ActionButtons.md +122 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/MultiStep.md +178 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/Stages.md +140 -0
- package/templates/react-sdk-reference/.ai-common/skills/template-components.md +74 -228
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/AdvancedSearch.md +66 -167
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/AppShell.md +57 -170
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/BannerPage.md +41 -76
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseSummary.md +53 -109
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseView.md +86 -289
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseViewActionsMenu.md +60 -185
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/Confirmation.md +66 -115
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DataReference.md +33 -68
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultForm.md +53 -133
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultPage.md +39 -82
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/Details.md +38 -91
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsSubTabs.md +47 -101
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsThreeColumn.md +27 -34
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsTwoColumn.md +25 -40
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DynamicTabs.md +34 -104
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/FieldGroupTemplate.md +46 -147
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/HierarchicalForm.md +139 -100
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboard.md +43 -82
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboardPage.md +47 -80
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListPage.md +16 -29
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +43 -228
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/MultiReferenceReadOnly.md +20 -65
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/NarrowWide.md +49 -97
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/OneColumn.md +37 -71
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/PromotedFilters.md +58 -148
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SelfServiceCaseView.md +82 -107
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SimpleTable.md +21 -60
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SingleReferenceReadOnly.md +43 -100
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SubTabs.md +36 -76
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/TwoColumn.md +41 -90
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/WideNarrow.md +36 -43
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/WssNavBar.md +25 -115
- package/templates/react-sdk-reference/.ai-common/skills/widget-components.md +38 -174
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/AppAnnouncement.md +30 -57
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Attachment.md +55 -101
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/CaseHistory.md +38 -121
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/FileUtility.md +37 -98
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Followers.md +18 -33
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/QuickCreate.md +26 -91
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/SummaryItem.md +28 -120
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/ToDo.md +41 -272
- package/templates/react-sdk-reference/package.json +1 -1
- package/templates/react-sdk-reference/pega-auth-0.2.44.tgz +0 -0
- package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +13 -3
- package/templates/react-native-sdk-reference/.github/AGENTS.md +0 -23
- package/templates/react-native-sdk-reference/.github/copilot-instructions.md +0 -40
- package/templates/react-native-sdk-reference/.github/skills/pega-sdk-component.md +0 -48
- package/templates/react-native-sdk-reference/App.tsx +0 -49
- package/templates/react-native-sdk-reference/expo-env.d.ts +0 -3
- package/templates/react-sdk-reference/pega-auth-0.2.42.tgz +0 -0
|
@@ -12,83 +12,30 @@ Unlike `SubTabs` or `DetailsSubTabs` where tabs are defined statically in metada
|
|
|
12
12
|
|
|
13
13
|
## Pega Metadata
|
|
14
14
|
|
|
15
|
-
- **Registration key:** `DynamicTabs` (in
|
|
15
|
+
- **Registration key:** `DynamicTabs` (in the project's component map)
|
|
16
16
|
- **Category:** Navigation template — data-driven
|
|
17
|
-
- **Extends:**
|
|
17
|
+
- **Extends:** the project's base component interface
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Inputs
|
|
20
20
|
|
|
21
|
-
|
|
|
21
|
+
| Input | Type | Required | Description |
|
|
22
22
|
| --------------- | ---------- | -------- | --------------------------------------------------------- |
|
|
23
23
|
| `referenceList` | `string` | Yes | Property path to the reference list (e.g. `'.pxResults'`) |
|
|
24
24
|
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
25
25
|
|
|
26
|
-
##
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export default function DynamicTabs(props: DynamicTabsProps) {
|
|
40
|
-
const { referenceList, showLabel, label, getPConnect } = props;
|
|
41
|
-
const pConnect = getPConnect();
|
|
42
|
-
const propsToUse = { label, showLabel, ...pConnect.getInheritedProps() };
|
|
43
|
-
|
|
44
|
-
// 1. Resolve tab label property from annotation
|
|
45
|
-
const { tablabel } = pConnect.getComponentConfig();
|
|
46
|
-
const tablabelProp = PCore.getAnnotationUtils().getPropertyName(tablabel);
|
|
47
|
-
|
|
48
|
-
// 2. Get reference list data
|
|
49
|
-
const referenceListData: any = pConnect.getValue(`${referenceList}.pxResults`, '');
|
|
50
|
-
|
|
51
|
-
// 3. Memoized tab views — set display-only mode, build views
|
|
52
|
-
const memoisedTabViews = useMemo(() => {
|
|
53
|
-
pConnect.setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
54
|
-
pConnect.setInheritedProp('readOnly', true);
|
|
55
|
-
return referenceListData && Children.toArray(
|
|
56
|
-
referenceListData.map((item, index) => (
|
|
57
|
-
<React.Fragment key={item[tablabelProp]}>
|
|
58
|
-
{buildView(pConnect, index, '')}
|
|
59
|
-
</React.Fragment>
|
|
60
|
-
))
|
|
61
|
-
);
|
|
62
|
-
}, [referenceListData]);
|
|
63
|
-
|
|
64
|
-
// 4. Tab state
|
|
65
|
-
const [panelShown, changePanel] = useState(0);
|
|
66
|
-
const handleTabClick = (e, id) => changePanel(parseInt(id, 10));
|
|
67
|
-
|
|
68
|
-
// 5. Build tab items from reference list data
|
|
69
|
-
const tabItems = referenceListData?.map((item, i) => ({
|
|
70
|
-
name: item[tablabelProp] || PCore.getLocaleUtils().getLocaleValue('No label specified in config', 'Generic'),
|
|
71
|
-
id: i,
|
|
72
|
-
})) || [];
|
|
73
|
-
|
|
74
|
-
// 6. Render: optional heading + TabContext + scrollable Tabs + TabPanels
|
|
75
|
-
return (
|
|
76
|
-
<>
|
|
77
|
-
{propsToUse.label && <h3>{propsToUse.label}</h3>}
|
|
78
|
-
<TabContext value={panelShown.toString()}>
|
|
79
|
-
<TabBar onChange={handleTabClick} value={panelShown} variant="scrollable" scrollButtons="auto">
|
|
80
|
-
{tabItems.map(tab => <Tab key={tab.id} label={tab.name} value={tab.id} />)}
|
|
81
|
-
</TabBar>
|
|
82
|
-
{tabItems.map(tab => (
|
|
83
|
-
<TabPanel key={tab.id} value={tab.id.toString()} tabIndex={+tab.id}>
|
|
84
|
-
{memoisedTabViews?.[tab.id] || 'No content exists'}
|
|
85
|
-
</TabPanel>
|
|
86
|
-
))}
|
|
87
|
-
</TabContext>
|
|
88
|
-
</>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
```
|
|
26
|
+
## Implementation Structure
|
|
27
|
+
|
|
28
|
+
**Module Setup:** This component requires the `buildView` helper (from the project's field-group utilities) and the project's base component interface. Define a component input contract extending the base component interface with `showLabel: boolean`, `label: string`, and optional `referenceList?: any[]`.
|
|
29
|
+
|
|
30
|
+
**Main Component Logic** — steps in order:
|
|
31
|
+
|
|
32
|
+
1. Receive inputs: `referenceList`, `showLabel`, `label`, and `getPConnect`; call `getPConnect()` once into `pConnect`; merge inherited inputs into `inputsToUse = { label, showLabel, ...pConnect.getInheritedProps() }`.
|
|
33
|
+
2. **Resolve tab label property:** read `tablabel` from `pConnect.getComponentConfig()`, then resolve it to a raw property path via `PCore.getAnnotationUtils().getPropertyName(tablabel)` into `tablabelProp`.
|
|
34
|
+
3. **Get reference list data:** `referenceListData = pConnect.getValue(referenceList + '.pxResults', '')`.
|
|
35
|
+
4. **Memoized tab views** (recomputed only when `referenceListData` changes): force display-only mode via `pConnect.setInheritedProp('displayMode', 'DISPLAY_ONLY')` and `pConnect.setInheritedProp('readOnly', true)`; then, if `referenceListData` is present, map each row to a keyed fragment (keyed by `item[tablabelProp]`) wrapping `buildView(pConnect, index, '')`, and normalize the result to an array.
|
|
36
|
+
5. Declare local state `panelShown` (number, default `0`) with a click handler that parses the clicked tab's id as an integer and updates the state.
|
|
37
|
+
6. **Build tab items:** map `referenceListData` to `{ name, id }` objects, where `name` is `item[tablabelProp]` or, if missing, the localized fallback `PCore.getLocaleUtils().getLocaleValue('No label specified in config', 'Generic')`, and `id` is the row index; default to an empty array when there's no data.
|
|
38
|
+
7. Render: an optional heading element (shown when `inputsToUse.label` is set); a tab context (value = `panelShown` as a string) wrapping a scrollable tab bar with auto scroll buttons (one tab item per `tabItems` entry, labeled `tab.name`, valued `tab.id`) and one tab panel per `tabItems` entry (keyed and valued by `tab.id`, `tabIndex` set to the numeric id) showing `memoisedTabViews?.[tab.id]` or a "No content exists" fallback.
|
|
92
39
|
|
|
93
40
|
## Behavioral Contract
|
|
94
41
|
|
|
@@ -101,32 +48,22 @@ export default function DynamicTabs(props: DynamicTabsProps) {
|
|
|
101
48
|
|
|
102
49
|
### Reference List Data
|
|
103
50
|
|
|
104
|
-
|
|
105
|
-
referenceListData = pConnect.getValue(referenceList + '.pxResults')
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Returns an array of row objects.
|
|
51
|
+
`referenceListData` is obtained via `pConnect.getValue(referenceList + '.pxResults')` and returns an array of row objects.
|
|
109
52
|
|
|
110
53
|
### Tab Views
|
|
111
54
|
|
|
112
|
-
For each row index `i
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
tabView = buildView(pConnect, i, '')
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Memoized — recalculate only when `referenceListData` changes.
|
|
55
|
+
For each row index `i`, the tab view is `buildView(pConnect, i, '')`. Memoized computation — recalculate only when `referenceListData` changes.
|
|
119
56
|
|
|
120
57
|
### State
|
|
121
58
|
|
|
122
|
-
- `currentPanel`: index of active tab (number, default `0`).
|
|
123
|
-
- `changePanel(index)`:
|
|
59
|
+
- `currentPanel`: index of active tab (number, default `0`) — managed as local state.
|
|
60
|
+
- `changePanel(index)`: updates the local state to the new index.
|
|
124
61
|
|
|
125
62
|
### Render
|
|
126
63
|
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
-
|
|
64
|
+
- A tab context wrapper with value = `currentPanel` as a string.
|
|
65
|
+
- A scrollable tab bar — one tab item per row, labeled with the resolved tab label and valued with the row index as a string.
|
|
66
|
+
- One tab panel per row containing `tabView[i]`.
|
|
130
67
|
|
|
131
68
|
## Visual Specifications
|
|
132
69
|
|
|
@@ -140,34 +77,27 @@ Identical tab bar appearance to `SubTabs`.
|
|
|
140
77
|
## Edge Cases & Special Logic
|
|
141
78
|
|
|
142
79
|
- `referenceListData` may be undefined on first render — default to empty array, render no tabs.
|
|
143
|
-
- `tablabel` may be a reference annotation like `@[FIELD/.pyLabel]` — `getPropertyName` resolves it to the raw field path.
|
|
144
|
-
- `buildView` is memoized on `referenceListData` — if the list changes, tab views must be regenerated.
|
|
145
|
-
- `changePanel` receives the raw index (number) but
|
|
80
|
+
- `tablabel` may be a reference annotation like `@[FIELD/.pyLabel]` — `PCore.getAnnotationUtils().getPropertyName()` resolves it to the raw field path.
|
|
81
|
+
- `buildView` is wrapped in a memoized computation keyed on `referenceListData` — if the list changes, tab views must be regenerated.
|
|
82
|
+
- `changePanel` receives the raw index (number) but the tab context value is a string — always convert the index to a string.
|
|
146
83
|
- Empty reference list — show a "No items" empty state instead of an empty tab bar.
|
|
147
84
|
|
|
148
85
|
## Dependencies
|
|
149
86
|
|
|
150
|
-
- `buildView` from
|
|
87
|
+
- `buildView` from the project's field-group utilities — generates the content view for each tab
|
|
151
88
|
- `PCore.getAnnotationUtils().getPropertyName()` — resolves annotation to property path
|
|
152
|
-
- `
|
|
153
|
-
-
|
|
89
|
+
- `PCore.getLocaleUtils().getLocaleValue()` — provides localized fallback label
|
|
90
|
+
- A tab component from your chosen design system — for rendering the tab bar and panels
|
|
154
91
|
|
|
155
92
|
## Design System Mapping
|
|
156
93
|
|
|
157
94
|
**UI control type:** Data-driven tab navigation — tab count and labels from a reference list.
|
|
158
95
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
| Design System | Recommended Component |
|
|
162
|
-
| ------------------ | ------------------------------------------------ |
|
|
163
|
-
| Default (CSS only) | Custom tab bar, dynamically generated from array |
|
|
164
|
-
| MUI | `<TabContext>` + `<Tabs>` + `<TabPanel>` |
|
|
165
|
-
| Ant Design | `<Tabs items={dynamicItems}>` |
|
|
166
|
-
| Chakra UI | `<Tabs>` with dynamic `<TabList>/<TabPanels>` |
|
|
167
|
-
| Shadcn/ui | `<Tabs>` with mapped triggers and content |
|
|
168
|
-
|
|
169
|
-
When implementing in a specific design system:
|
|
96
|
+
When implementing in a specific design system, map the following:
|
|
170
97
|
|
|
98
|
+
- A tab context/container that tracks the active panel by string value
|
|
99
|
+
- A scrollable tab bar with auto scroll buttons, rendering one tab per data row
|
|
100
|
+
- A tab panel container that shows the content for the active tab
|
|
171
101
|
- `tablabelProp` resolution via `PCore.getAnnotationUtils().getPropertyName()` is required — do not hardcode the label field
|
|
172
102
|
- `buildView(pConnect, rowIndex, '')` generates the content for each tab — the empty string third arg means no specific child config lookup
|
|
173
103
|
- Tab count is entirely data-driven — handle 0, 1, and many tab cases
|
package/templates/react-sdk-reference/.ai-common/skills/template-skills/FieldGroupTemplate.md
CHANGED
|
@@ -10,41 +10,40 @@ Repeating field group template. Renders a list of field group rows from a refere
|
|
|
10
10
|
>
|
|
11
11
|
> This template manages a repeating list of field groups with add/delete actions. It MUST NOT be reduced to a simple delegation to `FieldGroup` or `FieldGroupList`. The following are MANDATORY:
|
|
12
12
|
>
|
|
13
|
-
> 1. `getReferenceList(pConn)` from
|
|
14
|
-
> 2. `buildView(pConn, index, lookForChildInConfig)` from
|
|
13
|
+
> 1. `getReferenceList(pConn)` from the project's field-group utility helpers — resolves the reference list path
|
|
14
|
+
> 2. `buildView(pConn, index, lookForChildInConfig)` from the project's field-group utility helpers — builds each row's view
|
|
15
15
|
> 3. `pConn.setReferenceList(resolvedList)` — sets the reference list on PConnect
|
|
16
16
|
> 4. `pConn.getListActions().initDefaultPageInstructions(resolvedList)` — initializes list instructions
|
|
17
|
-
> 5.
|
|
17
|
+
> 5. A synchronous layout effect for list initialization (must run before paint, not a standard lifecycle effect)
|
|
18
18
|
> 6. Add/delete record handlers using `pConn.getListActions().insert()` and `.deleteEntry()`
|
|
19
|
-
> 7.
|
|
19
|
+
> 7. A memoized computation for `MemoisedChildren` built from referenceList iteration plus `buildView`
|
|
20
20
|
> 8. `allowActions` handling (allowAdd, allowDelete)
|
|
21
21
|
> 9. `isReadonlyMode` check switching between FieldGroupList (edit) and FieldGroup (read-only)
|
|
22
22
|
>
|
|
23
23
|
> **Minimum Implementation Checklist:**
|
|
24
24
|
>
|
|
25
|
-
> - [ ] `getReferenceList` and `buildView`
|
|
25
|
+
> - [ ] `getReferenceList` and `buildView` sourced from the project's field-group utility helpers
|
|
26
26
|
> - [ ] `pConn.getListActions()` used for insert/delete
|
|
27
|
-
> - [ ]
|
|
27
|
+
> - [ ] Synchronous layout effect for `initDefaultPageInstructions`
|
|
28
28
|
> - [ ] `addRecord` and `deleteFieldGroupItem` handlers
|
|
29
|
-
> - [ ] Edit mode
|
|
30
|
-
> - [ ] Read-only mode
|
|
31
|
-
> - [ ] `allowActions` / `allowTableEdit`
|
|
29
|
+
> - [ ] Edit mode renders a FieldGroupList with items, onAdd, and onDelete
|
|
30
|
+
> - [ ] Read-only mode renders FieldGroup instances with `buildView` children
|
|
31
|
+
> - [ ] `allowActions` / `allowTableEdit` inputs respected
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
35
35
|
## Component Purpose
|
|
36
36
|
|
|
37
|
-
Renders a repeating list of field group rows sourced from a PConnect reference list. In edit mode, rows can be added and deleted via list actions. In read-only mode (DISPLAY_ONLY), delegates to a read-only
|
|
37
|
+
Renders a repeating list of field group rows sourced from a PConnect reference list. In edit mode, rows can be added and deleted via list actions. In read-only mode (DISPLAY_ONLY), delegates to a read-only FieldGroup renderer. Each row is built via `buildView`.
|
|
38
38
|
|
|
39
39
|
## Pega Metadata
|
|
40
40
|
|
|
41
|
-
- **Registration key:** `FieldGroupTemplate` (in
|
|
41
|
+
- **Registration key:** `FieldGroupTemplate` (in the project's component map)
|
|
42
42
|
- **Category:** Form template — repeating
|
|
43
|
-
- **Extends:** `PConnProps`
|
|
44
43
|
|
|
45
|
-
##
|
|
44
|
+
## Inputs
|
|
46
45
|
|
|
47
|
-
|
|
|
46
|
+
| Input | Type | Required | Description |
|
|
48
47
|
| ---------------- | ---------- | -------- | ---------------------------------------------------------------- |
|
|
49
48
|
| `label` | `string` | Yes | Section heading |
|
|
50
49
|
| `showLabel` | `boolean` | No | Whether to show the heading. Default `true` |
|
|
@@ -54,98 +53,21 @@ Renders a repeating list of field group rows sourced from a PConnect reference l
|
|
|
54
53
|
| `readOnly` | `boolean` | No | Alternative read-only flag |
|
|
55
54
|
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
fieldHeader?: string;
|
|
73
|
-
allowTableEdit: boolean;
|
|
74
|
-
allowActions?: any;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
78
|
-
const FieldGroup = getComponentFromRegistry('FieldGroup');
|
|
79
|
-
const FieldGroupList = getComponentFromRegistry('FieldGroupList');
|
|
80
|
-
|
|
81
|
-
const {
|
|
82
|
-
referenceList = [], renderMode, contextClass, getPConnect,
|
|
83
|
-
lookForChildInConfig, heading = '', displayMode, fieldHeader,
|
|
84
|
-
allowActions, allowTableEdit: allowAddEdit,
|
|
85
|
-
} = props;
|
|
86
|
-
const pConn = getPConnect();
|
|
87
|
-
const resolvedList = getReferenceList(pConn);
|
|
88
|
-
pConn.setReferenceList(resolvedList);
|
|
89
|
-
const pageReference = `${pConn.getPageReference()}${resolvedList}`;
|
|
90
|
-
const isReadonlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY';
|
|
91
|
-
const HEADING = heading ?? 'Row';
|
|
92
|
-
|
|
93
|
-
// 1. Resolve allowAdd/allowDelete from allowActions or allowTableEdit
|
|
94
|
-
const hasAllowActions = Object.keys(allowActions ?? {}).length > 0;
|
|
95
|
-
const { allowAdd: actionAdd, allowDelete: actionDelete } = allowActions ?? {};
|
|
96
|
-
const allowAdd = hasAllowActions ? (actionAdd ?? true) : (allowAddEdit ?? true);
|
|
97
|
-
const allowDelete = hasAllowActions ? (actionDelete ?? true) : (allowAddEdit ?? true);
|
|
98
|
-
|
|
99
|
-
// 2. Init page instructions on mount (edit mode only)
|
|
100
|
-
useLayoutEffect(() => {
|
|
101
|
-
if (!isReadonlyMode) {
|
|
102
|
-
pConn.getListActions().initDefaultPageInstructions(resolvedList);
|
|
103
|
-
}
|
|
104
|
-
}, [referenceList?.length]);
|
|
105
|
-
|
|
106
|
-
// 3. Dynamic header per row
|
|
107
|
-
const getDynamicHeaderProp = (item, index) => {
|
|
108
|
-
if (fieldHeader === 'propertyRef' && heading && item[heading.substring(1)])
|
|
109
|
-
return item[heading.substring(1)];
|
|
110
|
-
return `Row ${index + 1}`;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
// 4. Add/delete handlers
|
|
114
|
-
const addRecord = () => {
|
|
115
|
-
if (PCore.getPCoreVersion()?.includes('8.7'))
|
|
116
|
-
pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference);
|
|
117
|
-
else pConn.getListActions().insert({}, referenceList.length);
|
|
118
|
-
};
|
|
119
|
-
const deleteRecord = (index) => {
|
|
120
|
-
if (PCore.getPCoreVersion()?.includes('8.7'))
|
|
121
|
-
pConn.getListActions().deleteEntry(index, pageReference);
|
|
122
|
-
else pConn.getListActions().deleteEntry(index);
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
// 5. Edit mode: auto-add first row if empty, render FieldGroupList
|
|
126
|
-
if (!isReadonlyMode) {
|
|
127
|
-
if (referenceList.length === 0 && allowAdd) addRecord();
|
|
128
|
-
const items = useMemo(() => referenceList.map((item, index) => ({
|
|
129
|
-
id: index,
|
|
130
|
-
name: fieldHeader === 'propertyRef' ? getDynamicHeaderProp(item, index) : `${HEADING} ${index + 1}`,
|
|
131
|
-
children: buildView(pConn, index, lookForChildInConfig),
|
|
132
|
-
})), [referenceList?.length]);
|
|
133
|
-
return <FieldGroupList items={items}
|
|
134
|
-
onAdd={allowAdd ? addRecord : undefined}
|
|
135
|
-
onDelete={allowDelete ? deleteRecord : undefined} />;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// 6. Read-only mode: FieldGroup per row
|
|
139
|
-
pConn.setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
140
|
-
const readOnlyList = useMemo(() => referenceList.map((item, index) => (
|
|
141
|
-
<FieldGroup key={item[heading] || `field-group-row-${index}`}
|
|
142
|
-
name={fieldHeader === 'propertyRef' ? getDynamicHeaderProp(item, index) : `${HEADING} ${index + 1}`}>
|
|
143
|
-
{buildView(pConn, index, lookForChildInConfig)}
|
|
144
|
-
</FieldGroup>
|
|
145
|
-
)), []);
|
|
146
|
-
return <div>{readOnlyList}</div>;
|
|
147
|
-
}
|
|
148
|
-
```
|
|
56
|
+
Additional inputs accepted: `referenceList` (array, defaults to empty), `contextClass` (string, required), `renderMode` (string, optional), `heading` (string, defaults to empty), `lookForChildInConfig` (boolean, optional), `allowActions` (object, optional).
|
|
57
|
+
|
|
58
|
+
## Main Component Logic
|
|
59
|
+
|
|
60
|
+
Steps in order:
|
|
61
|
+
|
|
62
|
+
1. Retrieve FieldGroup and FieldGroupList from the project's component registry.
|
|
63
|
+
2. Receive inputs: `referenceList` (default empty array), `renderMode`, `contextClass`, `getPConnect`, `lookForChildInConfig`, `heading` (default empty string), `displayMode`, `fieldHeader`, `allowActions`, and `allowTableEdit` (alias `allowAddEdit`).
|
|
64
|
+
3. Call `getPConnect()` into `pConn`. Resolve the reference list path via `getReferenceList(pConn)` into `resolvedList` and register it via `pConn.setReferenceList(resolvedList)`. Build `pageReference` by concatenating `pConn.getPageReference()` with `resolvedList`. Determine `isReadonlyMode` when `renderMode === 'ReadOnly'` or `displayMode === 'DISPLAY_ONLY'`. Default `HEADING` to `heading` or `'Row'`.
|
|
65
|
+
4. **Resolve add/delete permissions:** check whether `allowActions` has any keys (`hasAllowActions`). Destructure `allowAdd`/`allowDelete` from it as `actionAdd`/`actionDelete`. Compute final `allowAdd`/`allowDelete` flags — when `hasAllowActions` is true, use `actionAdd ?? true` / `actionDelete ?? true`; otherwise fall back to `allowAddEdit ?? true` for both.
|
|
66
|
+
5. **Init page instructions on mount** (edit mode only): inside a synchronous layout effect (must run before paint) keyed on `referenceList` length, when not in read-only mode, call `pConn.getListActions().initDefaultPageInstructions(resolvedList)`. This MUST be a synchronous layout effect, not a standard lifecycle effect, to avoid visual flicker during list initialization.
|
|
67
|
+
6. Define `getDynamicHeaderProp(item, index)`: if `fieldHeader === 'propertyRef'` and `heading` resolves a value on `item` (via `item[heading.substring(1)]`), return that value; otherwise return a default label like "Row N".
|
|
68
|
+
7. Define `addRecord`: if `PCore.getPCoreVersion()` includes `'8.7'`, call `pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference)`; otherwise call `pConn.getListActions().insert({}, referenceList.length)`. Define `deleteRecord(index)` similarly, calling `pConn.getListActions().deleteEntry(index, pageReference)` on 8.7 or `pConn.getListActions().deleteEntry(index)` otherwise.
|
|
69
|
+
8. **Edit mode:** if not read-only, auto-add a first row when `referenceList` is empty and `allowAdd` is true. Produce a memoized computation (keyed on `referenceList` length) by mapping `referenceList` to objects of shape `{ id: index, name: <dynamic or default heading>, children: buildView(pConn, index, lookForChildInConfig) }`. Render FieldGroupList with `items`, `onAdd` (when `allowAdd` is true), and `onDelete` (when `allowDelete` is true).
|
|
70
|
+
9. **Read-only mode:** force `pConn.setInheritedProp('displayMode', 'DISPLAY_ONLY')`. Produce a memoized computation (run once) by mapping `referenceList` to one FieldGroup per row (keyed by `item[heading]` or a fallback row key, named via the dynamic/default heading) containing `buildView(pConn, index, lookForChildInConfig)`. Render the list inside a wrapping container.
|
|
149
71
|
|
|
150
72
|
## Behavioral Contract
|
|
151
73
|
|
|
@@ -153,21 +75,19 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
153
75
|
|
|
154
76
|
If `displayMode === 'DISPLAY_ONLY'` or `readOnly === true`:
|
|
155
77
|
|
|
156
|
-
1.
|
|
157
|
-
2. Render
|
|
78
|
+
1. Call `pConn.setInheritedProp('displayMode', 'DISPLAY_ONLY')`.
|
|
79
|
+
2. Render a FieldGroup (from the component registry) per row — the design system component that shows data in a read-only layout.
|
|
158
80
|
|
|
159
81
|
### Edit Mode
|
|
160
82
|
|
|
161
|
-
1. **Get reference list:** `resolvedList = getReferenceList(pConn)` — extracts the
|
|
162
|
-
2. **Set reference list:** `pConn.setReferenceList(resolvedList)` — ensures the pConn has the resolved list.
|
|
163
|
-
3. **Build row views:** For each row index `i`, call `buildView(pConn, i,
|
|
164
|
-
4. **Render
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
- `
|
|
168
|
-
- `
|
|
169
|
-
- `fieldHeader`: evaluated property ref for dynamic row heading
|
|
170
|
-
- `allowActions`: from `allowTableEdit` prop (controls visibility of add/delete buttons)
|
|
83
|
+
1. **Get reference list:** `resolvedList = getReferenceList(pConn)` — extracts the reference list path string.
|
|
84
|
+
2. **Set reference list:** `pConn.setReferenceList(resolvedList)` — ensures the pConn has the resolved list registered.
|
|
85
|
+
3. **Build row views:** For each row index `i`, call `buildView(pConn, i, lookForChildInConfig)` to get the PConnect view for that row.
|
|
86
|
+
4. **Render FieldGroupList** — the design system component for edit mode, receiving:
|
|
87
|
+
- Memoized items array for row content
|
|
88
|
+
- `onAdd`: calls `pConn.getListActions().insert(...)` with version-appropriate arguments
|
|
89
|
+
- `onDelete(index)`: calls `pConn.getListActions().deleteEntry(...)` with version-appropriate arguments
|
|
90
|
+
- Row headings: dynamic (from `fieldHeader` property ref) or default ("Row N")
|
|
171
91
|
|
|
172
92
|
### `allowActions` Override
|
|
173
93
|
|
|
@@ -182,50 +102,29 @@ If the field group is inside a read-only context (parent has set `readOnly` or `
|
|
|
182
102
|
- Dynamic heading from `fieldHeader` property value (e.g. `"Active"`, `"Pending"`).
|
|
183
103
|
- Row fields in a grid layout.
|
|
184
104
|
- Delete button (trash icon) per row.
|
|
185
|
-
- Add row button at the bottom (e.g.
|
|
105
|
+
- Add row button at the bottom (e.g. "+ Add row").
|
|
186
106
|
|
|
187
107
|
### Read-Only Mode
|
|
188
108
|
|
|
189
109
|
- Section heading at top (if `showLabel`).
|
|
190
110
|
- Flat list of rows — no add/delete controls.
|
|
191
111
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
- Row section: `border: 1px solid var(--border-color); border-radius: 4px; padding: 1rem; margin-bottom: 0.5rem`.
|
|
195
|
-
- Add button: text button, below the last row.
|
|
196
|
-
- Delete button: icon button, top-right of each row section.
|
|
112
|
+
Use companion styles to achieve row cards with a border, border-radius, padding, and bottom margin. The add button appears as a text-style button below the last row. The delete button appears as an icon button at the top-right of each row section.
|
|
197
113
|
|
|
198
114
|
## Edge Cases & Special Logic
|
|
199
115
|
|
|
200
116
|
- `getReferenceList(pConn)` returns `undefined` if the reference list is not yet loaded — guard and render empty list.
|
|
201
117
|
- `buildView(pConn, index, true)` — third argument `lookForChildInConfig=true` — required for embedded field groups.
|
|
202
118
|
- Row index must be passed to `deleteEntry` as a number (not string).
|
|
203
|
-
- `fieldHeader` is a property ref like `'.pyStatusWork'` — evaluate it per-row via `
|
|
204
|
-
-
|
|
119
|
+
- `fieldHeader` is a property ref like `'.pyStatusWork'` — evaluate it per-row via `item[heading.substring(1)]` to get the display label for each row heading.
|
|
120
|
+
- FieldGroupList and FieldGroup are design system extension components registered in the project's component registry.
|
|
205
121
|
|
|
206
122
|
## Dependencies
|
|
207
123
|
|
|
208
|
-
- `getReferenceList`, `buildView` from
|
|
209
|
-
-
|
|
210
|
-
-
|
|
211
|
-
- `PConnectComponent` from `@pega/sdk-react` — used inside `buildView`
|
|
124
|
+
- `getReferenceList`, `buildView` from the project's field-group utility helpers
|
|
125
|
+
- The project's component registry to retrieve FieldGroupList (edit mode) and FieldGroup (read-only mode)
|
|
126
|
+
- The project's base component interface for rendering child PConnect views inside `buildView`
|
|
212
127
|
|
|
213
128
|
## Design System Mapping
|
|
214
129
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
Listed design systems are examples only.
|
|
218
|
-
|
|
219
|
-
| Design System | Recommended Component |
|
|
220
|
-
| ------------------ | ------------------------------------------------------------------ |
|
|
221
|
-
| Default (CSS only) | Custom row card list with add/delete buttons |
|
|
222
|
-
| MUI | `<Paper>` per row + `<IconButton>` for delete + `<Button>` for add |
|
|
223
|
-
| Ant Design | `<Form.List>` with `<Card>` per row |
|
|
224
|
-
| Chakra UI | Custom repeating section with `<Box>` rows |
|
|
225
|
-
| Shadcn/ui | Custom list with `<Card>` per row + `<Button variant='ghost'>` |
|
|
226
|
-
|
|
227
|
-
When implementing in a specific design system:
|
|
228
|
-
|
|
229
|
-
- The add/delete controls must be hidden when `allowActions` is false
|
|
230
|
-
- Row heading is dynamic — evaluate `fieldHeader` property ref per row
|
|
231
|
-
- `buildView` generates child PConnect views — render them inside each row section
|
|
130
|
+
Use repeating row cards for the edit mode layout. Each row should be a bordered card containing the fields generated by `buildView`. Provide an add button (text style) below the last row and a delete button (icon style) at the top-right of each row card. The design system's grouping or card primitive is the natural fit for each row. In read-only mode, use a simpler flat list of labelled groups without action controls. Hide add/delete controls when `allowActions` is false. The row heading is dynamic — evaluate the `fieldHeader` property ref per row.
|