@pega/sdk 0.0.5 → 0.0.6
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 +764 -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/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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Display-only grid of typed field values for a case summary header. Renders a 2-column grid of read-only fields, each formatted according to its type (text, date, currency, phone, email, checkbox, status, operator, etc.).
|
|
4
4
|
|
|
5
|
-
> **Prerequisite skill:** [`design-system-extension.md`](../design-system-extension.md) — covers architecture,
|
|
5
|
+
> **Prerequisite skill:** [`design-system-extension.md`](../design-system-extension.md) — covers architecture, input contracts, styling patterns, and registration patterns common to ALL DSE components.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -13,70 +13,52 @@ Renders a responsive 2-column read-only grid of field values for a case summary
|
|
|
13
13
|
## Pega Metadata
|
|
14
14
|
|
|
15
15
|
- **Pega Name:** `CaseSummaryFields`
|
|
16
|
-
- **Registration key:** `CaseSummaryFields` (in
|
|
17
|
-
- **Does NOT use `getPConnect` directly** — receives pre-processed `theFields` array as
|
|
16
|
+
- **Registration key:** `CaseSummaryFields` (in the project's component map)
|
|
17
|
+
- **Does NOT use `getPConnect` directly** — receives pre-processed `theFields` array as an input
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Component Inputs
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
The component accepts the following inputs. Define the input contract using the project's framework conventions.
|
|
22
|
+
|
|
23
|
+
| Name | Type | Required | Description |
|
|
22
24
|
| ------------ | ---------------------------------------------- | -------- | ------------------------------------------------------------------------- |
|
|
23
25
|
| `theFields` | `Array<{ type: string; config: FieldConfig }>` | Yes | Array of typed field descriptors to render |
|
|
24
26
|
| `status` | `string` | No | The case status value, injected at position 1 if `showStatus` is true |
|
|
25
27
|
| `showStatus` | `boolean` | No | If `true`, splices a status field entry at position 1 in the fields array |
|
|
26
28
|
|
|
27
|
-
##
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
setFieldsAsGridItems(items);
|
|
61
|
-
}, [theFieldsToRender]);
|
|
62
|
-
|
|
63
|
-
// 3. Status injection (mutates theFields)
|
|
64
|
-
const theFieldsModifiable = theFields;
|
|
65
|
-
if (showStatus && theFields?.[1]?.type !== 'status') {
|
|
66
|
-
const oStatus = { type: 'status', config: { value: status, label: 'Status' } };
|
|
67
|
-
if (theFieldsModifiable.length < 2) theFieldsModifiable.push(oStatus);
|
|
68
|
-
else theFieldsModifiable.splice(1, 0, oStatus);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// 4. Deep equality check before state update (prevents infinite re-render)
|
|
72
|
-
if (!isDeepEqual(theFieldsToRender, theFieldsModifiable)) {
|
|
73
|
-
setFieldsToRender(theFieldsModifiable);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// 5. Render: 2-column grid
|
|
77
|
-
return <GridContainer className="psdk-case-summary-fields">{theFieldsAsGridItems}</GridContainer>;
|
|
78
|
-
}
|
|
79
|
-
```
|
|
29
|
+
## Implementation Structure
|
|
30
|
+
|
|
31
|
+
### Module Setup
|
|
32
|
+
|
|
33
|
+
The component imports the following dependencies:
|
|
34
|
+
|
|
35
|
+
- A state management mechanism (local state for the fields array and rendered grid items)
|
|
36
|
+
- A lifecycle effect to recompute grid items when the fields array changes
|
|
37
|
+
- A deep-equality utility (for comparing field arrays before updates)
|
|
38
|
+
- `getDateFormatInfo` from the project's date-format utilities for locale date format strings
|
|
39
|
+
- `getCurrencyOptions` from the project's currency utilities for currency formatting
|
|
40
|
+
- The `Operator` component retrieved from the project's component registry at runtime
|
|
41
|
+
- `format` from the project's formatting helpers for value formatting (phone, email, date, currency, etc.)
|
|
42
|
+
- Companion styles (for status field and grid styling) co-located following the project's styling convention
|
|
43
|
+
|
|
44
|
+
The component is named `CaseSummaryFields` and accepts the inputs listed in the table above. Define the input contract and export the component following the project's framework conventions.
|
|
45
|
+
|
|
46
|
+
### Component Logic
|
|
47
|
+
|
|
48
|
+
The component performs these steps in order:
|
|
49
|
+
|
|
50
|
+
1. **Resolve Operator** — retrieve the `Operator` component from the project's component registry (allows runtime override).
|
|
51
|
+
2. **Receive inputs** — extract `status`, `showStatus`, and `theFields`.
|
|
52
|
+
3. **Declare state** — two state variables:
|
|
53
|
+
- `theFieldsToRender` (array) — the final fields array after status injection.
|
|
54
|
+
- `theFieldsAsGridItems` (array) — the rendered grid item elements.
|
|
55
|
+
4. **Define `getFieldValue(field)` helper** — a type-based rendering switch (see Behavioral Contract #4 for the full type-to-rendering table).
|
|
56
|
+
5. **Lifecycle effect on `theFieldsToRender`** — when `theFieldsToRender` changes, recompute `theFieldsAsGridItems` by mapping each field:
|
|
57
|
+
- Skip fields where `config.visibility` exists and is `false`.
|
|
58
|
+
- For visible fields, render a grid cell (6 of 12 columns) keyed by `field.config.label`, containing `getFieldValue(field)`.
|
|
59
|
+
6. **Status injection** — if `showStatus` is `true` AND `theFields[1].type !== 'status'`, inject a status entry at position 1 (an object with `type: 'status'` and `config` containing `value` from the `status` input and `label` set to `'Status'`). If the array has fewer than 2 items, append at the end instead.
|
|
60
|
+
7. **Deep equality guard** — only update `theFieldsToRender` with the new array if it is NOT deep-equal to the current `theFieldsToRender` (prevents infinite re-render/change-detection loops).
|
|
61
|
+
8. **Render** — return a grid container with class `psdk-case-summary-fields` containing `theFieldsAsGridItems` (a 2-column layout).
|
|
80
62
|
|
|
81
63
|
### FieldConfig shape (within each item in `theFields`)
|
|
82
64
|
|
|
@@ -94,19 +76,13 @@ export default function CaseSummaryFields(props: CaseSummaryFieldsProps) {
|
|
|
94
76
|
|
|
95
77
|
### 1. Status Field Injection
|
|
96
78
|
|
|
97
|
-
Before rendering, if `showStatus` is `true` AND `theFields[1].type !== 'status'`, inject a status entry at position 1
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
{ type: 'status', config: { value: status, label: 'Status' } }
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
If the fields array has fewer than 2 items, append the status entry at the end.
|
|
79
|
+
Before rendering, if `showStatus` is `true` AND `theFields[1].type !== 'status'`, inject a status entry at position 1 — an object with `type` set to `'status'` and `config` containing `value` (from the `status` input) and `label` set to `'Status'`. If the fields array has fewer than 2 items, append the status entry at the end.
|
|
104
80
|
|
|
105
81
|
### 2. State Management with Deep Equality
|
|
106
82
|
|
|
107
83
|
- Store the final fields array in `theFieldsToRender` state.
|
|
108
|
-
- Only update `theFieldsToRender` if the new value is not deep-equal to the current value (use
|
|
109
|
-
- When `theFieldsToRender` changes, recompute `theFieldsAsGridItems` (via
|
|
84
|
+
- Only update `theFieldsToRender` if the new value is not deep-equal to the current value (use a deep-equality utility).
|
|
85
|
+
- When `theFieldsToRender` changes, recompute `theFieldsAsGridItems` (via a lifecycle effect).
|
|
110
86
|
|
|
111
87
|
### 3. Field Visibility
|
|
112
88
|
|
|
@@ -116,34 +92,34 @@ Skip any field where `config.visibility` exists and is `false`.
|
|
|
116
92
|
|
|
117
93
|
When `field.config.value` is `null` or `''` (empty):
|
|
118
94
|
|
|
119
|
-
- For `caseoperator`: render
|
|
120
|
-
- For all other types: render a read-only
|
|
95
|
+
- For `caseoperator`: render the `Operator` component with `field.config` spread as inputs.
|
|
96
|
+
- For all other types: render a read-only text display element with value `'---'` and the field label.
|
|
121
97
|
|
|
122
98
|
When `field.config.value` is non-empty, switch on `field.type.toLowerCase()`:
|
|
123
99
|
|
|
124
|
-
| Type | Rendering
|
|
125
|
-
| --------------------------------------------- |
|
|
126
|
-
| `textinput`, `decimal`, `integer`, `dropdown` | Read-only
|
|
127
|
-
| `checkbox` | Label: `label \|\| caption`; Value: `value ? trueLabel : falseLabel`; read-only
|
|
128
|
-
| `status` | Read-only
|
|
129
|
-
| `phone` | `<a href={'tel:' + value}>` wrapping a read-only
|
|
130
|
-
| `email` | `<a href={'mailto:' + format(value, 'email')}>` wrapping a read-only
|
|
131
|
-
| `date` | Read-only
|
|
132
|
-
| `datetime` | Read-only
|
|
133
|
-
| `currency` | Read-only
|
|
134
|
-
| `boolean`, `userreference` | Read-only
|
|
135
|
-
| `caseoperator` |
|
|
136
|
-
| default (unknown) | `<span>{type} {value}</span>`
|
|
137
|
-
|
|
138
|
-
All
|
|
100
|
+
| Type | Rendering |
|
|
101
|
+
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
102
|
+
| `textinput`, `decimal`, `integer`, `dropdown` | Read-only text display (no underline) with `value` and `label` |
|
|
103
|
+
| `checkbox` | Label: `label \|\| caption`; Value: `value ? trueLabel : falseLabel`; read-only text display |
|
|
104
|
+
| `status` | Read-only text display with class `psdk-csf-status-style` (uppercase, small, bold) |
|
|
105
|
+
| `phone` | `<a href={'tel:' + value}>` wrapping a read-only text display with pointer cursor |
|
|
106
|
+
| `email` | `<a href={'mailto:' + format(value, 'email')}>` wrapping a read-only text display with pointer cursor |
|
|
107
|
+
| `date` | Read-only text display with `format(value, 'date', { format: dateFormatStringLong })` |
|
|
108
|
+
| `datetime` | Read-only text display with `format(value, 'datetime', { format: dateFormatStringLong + ' hh:mm a' })` |
|
|
109
|
+
| `currency` | Read-only text display with `format(value, 'currency', getCurrencyOptions(currencyISOCode))` |
|
|
110
|
+
| `boolean`, `userreference` | Read-only text display with `format(value, type)` |
|
|
111
|
+
| `caseoperator` | Render the `Operator` component with `field.config` as inputs |
|
|
112
|
+
| default (unknown) | `<span>{type} {value}</span>` |
|
|
113
|
+
|
|
114
|
+
All read-only text display elements use: no underline/border, read-only state, with the field label shown above the value.
|
|
139
115
|
|
|
140
116
|
### 5. Grid Layout
|
|
141
117
|
|
|
142
|
-
Render each visible field in
|
|
118
|
+
Render each visible field in a grid cell (6 of 12 columns — 2-column layout) inside a grid container with class `psdk-case-summary-fields`.
|
|
143
119
|
|
|
144
120
|
## Visual Specifications
|
|
145
121
|
|
|
146
|
-
Derived from
|
|
122
|
+
Derived from the component's companion styles:
|
|
147
123
|
|
|
148
124
|
### Status Field
|
|
149
125
|
|
|
@@ -173,41 +149,32 @@ Derived from `CaseSummaryFields.css`:
|
|
|
173
149
|
|
|
174
150
|
## Edge Cases & Special Logic
|
|
175
151
|
|
|
176
|
-
- Use
|
|
152
|
+
- Use deep equality before updating `theFieldsToRender` to prevent infinite re-render loops.
|
|
177
153
|
- Status splicing mutates `theFields` directly — ensure the original array reference is used (not a copy) when checking `theFields[1].type`.
|
|
178
154
|
- Date format comes from `getDateFormatInfo().dateFormatStringLong` — defaults to locale format.
|
|
179
155
|
- Currency options come from `getCurrencyOptions(field.config?.currencyISOCode)`.
|
|
180
|
-
- The `Operator` component is retrieved
|
|
156
|
+
- The `Operator` component is retrieved from the project's component registry — not imported directly. This allows runtime component override.
|
|
181
157
|
- If `theFields` is null or undefined, initialize to empty to avoid crashes.
|
|
182
158
|
|
|
183
159
|
## Dependencies
|
|
184
160
|
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
-
|
|
161
|
+
- The project's component registry — to retrieve the `Operator` component at runtime
|
|
162
|
+
- A deep-equality utility — for state change detection
|
|
163
|
+
- The project's date-format utility — for locale date format string
|
|
164
|
+
- The project's currency utility — for currency formatting options
|
|
165
|
+
- The project's formatting helper — for formatting phone, email, date, datetime, currency, boolean, userreference values
|
|
190
166
|
- `Operator` component (resolved via registry) — for `caseoperator` type rendering
|
|
191
167
|
|
|
192
168
|
## Design System Mapping
|
|
193
169
|
|
|
194
170
|
**UI control type:** 2-column grid of read-only labeled field values.
|
|
195
171
|
|
|
196
|
-
Listed design systems are examples only.
|
|
197
|
-
|
|
198
|
-
| Design System | Recommended Component |
|
|
199
|
-
| ------------------ | ------------------------------------------------------------------------------------------------------------ |
|
|
200
|
-
| Default (CSS only) | CSS Grid 2-column layout with label/value pairs |
|
|
201
|
-
| MUI | `<Grid container>` with `<Grid size={{ xs: 6 }}>` cells; `<TextField variant='standard' readOnly>` per field |
|
|
202
|
-
| Ant Design | `<Descriptions layout='vertical' column={2}>` with typed item renderers |
|
|
203
|
-
| Chakra UI | `<SimpleGrid columns={2}>` with `<FormControl>` label/value pairs |
|
|
204
|
-
| Shadcn/ui | 2-column grid with `<Label>` / `<p>` pairs |
|
|
205
|
-
|
|
206
172
|
When implementing in a specific design system, map the following:
|
|
207
173
|
|
|
208
|
-
-
|
|
209
|
-
-
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
-
|
|
213
|
-
-
|
|
174
|
+
- **Grid layout** → use the DS's grid system to create a 2-column responsive layout (each cell occupies 6 of 12 columns)
|
|
175
|
+
- **Read-only text display** (label above value, no underline) → use the DS's form field in read-only/display mode, or a simple label/value pair with appropriate typography
|
|
176
|
+
- **Phone field** → wrap in an `<a href='tel:...'>` link with pointer cursor
|
|
177
|
+
- **Email field** → wrap in an `<a href='mailto:...'>` link with pointer cursor
|
|
178
|
+
- **Status field** → uppercase badge/chip or styled text (font-size: 0.75rem, bold, uppercase)
|
|
179
|
+
- **`caseoperator` type** → delegate to the `Operator` component from the registry
|
|
180
|
+
- **Missing/empty value** → always display `'---'`
|
|
@@ -1,81 +1,73 @@
|
|
|
1
1
|
# Skill: DetailsFields
|
|
2
2
|
|
|
3
|
-
Read-only field display component that receives an array of PConnect-aware field objects and renders each as a label/value pair. Delegates value rendering to
|
|
3
|
+
Read-only field display component that receives an array of PConnect-aware field objects and renders each as a label/value pair. Delegates value rendering to the PConnect bridge component in DISPLAY_ONLY mode.
|
|
4
4
|
|
|
5
|
-
> **Prerequisite skill:** [`design-system-extension.md`](../design-system-extension.md) — covers architecture,
|
|
5
|
+
> **Prerequisite skill:** [`design-system-extension.md`](../design-system-extension.md) — covers architecture, input contracts, styling patterns, and registration patterns common to ALL DSE components.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## Component Purpose
|
|
10
10
|
|
|
11
|
-
Renders a vertical list of read-only field name/value pairs for a details/summary panel. Each field is a PConnect-aware object. The component extracts type, label, and view config from each field's PConnect, forces the view into `readOnly + DISPLAY_ONLY` mode, and delegates rendering to
|
|
11
|
+
Renders a vertical list of read-only field name/value pairs for a details/summary panel. Each field is a PConnect-aware object. The component extracts type, label, and view config from each field's PConnect, forces the view into `readOnly + DISPLAY_ONLY` mode, and delegates rendering to the PConnect bridge component.
|
|
12
12
|
|
|
13
13
|
Supports three item layouts:
|
|
14
14
|
|
|
15
15
|
- **Reference type:** Renders the value directly (no label/value grid wrapper).
|
|
16
|
-
- **
|
|
16
|
+
- **Rendered component value:** Renders value in a single full-width cell (no label).
|
|
17
17
|
- **Label + value pair:** Renders label in a 6-col cell and value in a 6-col cell.
|
|
18
18
|
|
|
19
19
|
## Pega Metadata
|
|
20
20
|
|
|
21
21
|
- **Pega Name:** `DetailsFields`
|
|
22
|
-
- **Registration key:** `DetailsFields` (in
|
|
22
|
+
- **Registration key:** `DetailsFields` (in the project's component map)
|
|
23
23
|
- **Does NOT use `getPConnect` on the component itself** — iterates `fields[]` each of which has `.getPConnect()`
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## Component Inputs
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
The component accepts the following inputs. Define the input contract using the project's framework conventions.
|
|
28
|
+
|
|
29
|
+
| Name | Type | Required | Description |
|
|
28
30
|
| -------- | ------- | -------- | ----------------------------------------------------------------------------- |
|
|
29
31
|
| `fields` | `any[]` | Yes | Array of PConnect-aware field objects. Each must have `.getPConnect()` method |
|
|
30
32
|
|
|
31
|
-
##
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<GridRow key={index} style={{ padding: '4px 0' }}>
|
|
70
|
-
<GridItem xs={6}><Label>{field.label}</Label></GridItem>
|
|
71
|
-
<GridItem xs={6}><Value>{formattedValue || '---'}</Value></GridItem>
|
|
72
|
-
</GridRow>
|
|
73
|
-
);
|
|
74
|
-
})}
|
|
75
|
-
</>
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
```
|
|
33
|
+
## Implementation Structure
|
|
34
|
+
|
|
35
|
+
### Module Setup
|
|
36
|
+
|
|
37
|
+
The component imports the following dependencies:
|
|
38
|
+
|
|
39
|
+
- A utility to check if a value is a rendered component element (to distinguish rendered child components from plain string/primitive values)
|
|
40
|
+
- The project's PConnect bridge component — renders PConnect-configured children
|
|
41
|
+
- `format` from the project's formatting helpers — for date value formatting
|
|
42
|
+
|
|
43
|
+
The component is named `DetailsFields` and accepts the inputs listed in the table above. Define the input contract and export the component following the project's framework conventions.
|
|
44
|
+
|
|
45
|
+
### Component Logic
|
|
46
|
+
|
|
47
|
+
The component receives `fields` (defaults to `[]`) as input, then performs two phases:
|
|
48
|
+
|
|
49
|
+
**Phase 1: Build field components array**
|
|
50
|
+
|
|
51
|
+
Iterate over `fields` using `forEach`. For each field:
|
|
52
|
+
|
|
53
|
+
1. Call `field.getPConnect()` to obtain the PConnect instance (`thePConn`).
|
|
54
|
+
2. Get `theCompType = thePConn.getComponentName().toLowerCase()`.
|
|
55
|
+
3. Get `label` from `thePConn.getConfigProps()`.
|
|
56
|
+
4. Get the referenced view config: `configObj = thePConn.getReferencedView()`.
|
|
57
|
+
5. Force display-only mode: set `configObj.config.readOnly = true` and `configObj.config.displayMode = 'DISPLAY_ONLY'`.
|
|
58
|
+
6. For `reference` type components: override the label with `thePConn.getInheritedProps()?.label`.
|
|
59
|
+
7. Render the value by invoking the PConnect bridge component with `thePConn.getReferencedViewPConnect()` as its configuration.
|
|
60
|
+
8. Push an object with `{ type, label, value }` into the field components array.
|
|
61
|
+
|
|
62
|
+
**Phase 2: Render grid items**
|
|
63
|
+
|
|
64
|
+
Return a fragment containing the mapped field components. For each field, choose the layout:
|
|
65
|
+
|
|
66
|
+
- **`type === 'reference'`** — render `field.value` directly with no grid wrapper.
|
|
67
|
+
- **Value is a rendered element/component** — render a grid row with a single 12-column cell containing `field.value` (full width, no label).
|
|
68
|
+
- **Default (primitive/string value)** — render a grid row (with `padding: 4px 0`) containing:
|
|
69
|
+
- A 6-column label cell with body-small text, secondary text color, `fontWeight: 400`.
|
|
70
|
+
- A 6-column value cell with body-small text, primary text color. Format the value using `format(value, 'date')` if `type === 'date'`, otherwise use value as-is. If the formatted value is `undefined` or empty string, display `'---'`.
|
|
79
71
|
|
|
80
72
|
## Behavioral Contract
|
|
81
73
|
|
|
@@ -89,24 +81,24 @@ For each field in `fields`:
|
|
|
89
81
|
4. Call `configObj = thePConn.getReferencedView()` — get the referenced view config object.
|
|
90
82
|
5. Set `configObj.config.readOnly = true` and `configObj.config.displayMode = 'DISPLAY_ONLY'` — forces display-only rendering.
|
|
91
83
|
6. For `reference` type: override label with `thePConn.getInheritedProps().label`.
|
|
92
|
-
7. Render the value using `
|
|
93
|
-
8. Push `{ type: theCompType, label, value:
|
|
84
|
+
7. Render the value using the PConnect bridge component with `thePConn.getReferencedViewPConnect()` as its configuration.
|
|
85
|
+
8. Push `{ type: theCompType, label, value: renderedElement }` into the field components array.
|
|
94
86
|
|
|
95
87
|
### 2. Item Layout (per field component)
|
|
96
88
|
|
|
97
89
|
Choose the layout based on the field:
|
|
98
90
|
|
|
99
|
-
| Condition
|
|
100
|
-
|
|
|
101
|
-
| `type === 'reference'`
|
|
102
|
-
|
|
|
103
|
-
| Default (string/primitive value)
|
|
91
|
+
| Condition | Layout |
|
|
92
|
+
| ------------------------------------- | ------------------------------------------------------ |
|
|
93
|
+
| `type === 'reference'` | Render `field.value` directly with no wrapper |
|
|
94
|
+
| Value is a rendered element/component | Single 12-col cell containing `field.value` (no label) |
|
|
95
|
+
| Default (string/primitive value) | 6-col label cell + 6-col value cell |
|
|
104
96
|
|
|
105
97
|
### 3. Label/Value Grid Row
|
|
106
98
|
|
|
107
|
-
- **Row wrapper:**
|
|
108
|
-
- **Label cell:**
|
|
109
|
-
- **Value cell:**
|
|
99
|
+
- **Row wrapper:** a grid container with spacing and `padding: 4px 0`
|
|
100
|
+
- **Label cell:** 6 of 12 columns containing a body-small text element with secondary text color, `fontWeight: 400`, displaying `field.label`
|
|
101
|
+
- **Value cell:** 6 of 12 columns containing a body-small text element with primary text color, displaying the formatted value
|
|
110
102
|
|
|
111
103
|
### 4. Value Formatting
|
|
112
104
|
|
|
@@ -114,30 +106,30 @@ Choose the layout based on the field:
|
|
|
114
106
|
- For all others: use value as-is.
|
|
115
107
|
- If formatted value is `undefined` or `''`, display `'---'` instead.
|
|
116
108
|
|
|
117
|
-
### 5.
|
|
109
|
+
### 5. Rendered element detection
|
|
118
110
|
|
|
119
|
-
Use
|
|
111
|
+
Use the framework's equivalent of checking if a value is a rendered/component element — if true, render full-width (12 cols) without label.
|
|
120
112
|
|
|
121
113
|
## Visual Specifications
|
|
122
114
|
|
|
123
|
-
Derived from
|
|
115
|
+
Derived from the component's companion styles:
|
|
124
116
|
|
|
125
117
|
### Label
|
|
126
118
|
|
|
127
|
-
| Property | Value
|
|
128
|
-
| ----------- |
|
|
129
|
-
| Display | block
|
|
130
|
-
| Font weight | 400
|
|
131
|
-
| Color | `theme.palette.text.secondary` |
|
|
132
|
-
| Typography |
|
|
119
|
+
| Property | Value |
|
|
120
|
+
| ----------- | ------------------------------------------------------------------------------------- |
|
|
121
|
+
| Display | block |
|
|
122
|
+
| Font weight | 400 |
|
|
123
|
+
| Color | secondary text color (e.g. `theme.palette.text.secondary` or `var(--text-secondary)`) |
|
|
124
|
+
| Typography | body-small (≈ 0.875rem / 14px) |
|
|
133
125
|
|
|
134
126
|
### Value
|
|
135
127
|
|
|
136
|
-
| Property | Value
|
|
137
|
-
| ----------- |
|
|
138
|
-
| Font weight | 400
|
|
139
|
-
| Color | `theme.palette.text.primary` |
|
|
140
|
-
| Typography |
|
|
128
|
+
| Property | Value |
|
|
129
|
+
| ----------- | ------------------------------------------------------------------------------- |
|
|
130
|
+
| Font weight | 400 |
|
|
131
|
+
| Color | primary text color (e.g. `theme.palette.text.primary` or `var(--text-primary)`) |
|
|
132
|
+
| Typography | body-small (≈ 0.875rem / 14px) |
|
|
141
133
|
|
|
142
134
|
### Row Padding
|
|
143
135
|
|
|
@@ -150,48 +142,39 @@ Derived from `DetailsFields.tsx` makeStyles:
|
|
|
150
142
|
- Each row: `display: grid; grid-template-columns: 1fr 1fr; padding: 4px 0; gap: 8px`.
|
|
151
143
|
- Label: `font-size: 0.875rem; font-weight: 400; color: var(--text-secondary); display: block`.
|
|
152
144
|
- Value: `font-size: 0.875rem; font-weight: 400; color: var(--text-primary)`.
|
|
153
|
-
- For a
|
|
145
|
+
- For a rendered element value (full-width): render in a single column spanning full width.
|
|
154
146
|
- For a reference type: render the component directly with no wrapping grid.
|
|
155
147
|
|
|
156
148
|
## Edge Cases & Special Logic
|
|
157
149
|
|
|
158
150
|
- `fields` defaults to `[]` — guard against null/undefined.
|
|
159
151
|
- Reference fields bypass the label/value layout entirely — their rendered output fills the full row.
|
|
160
|
-
-
|
|
152
|
+
- Rendered element values (e.g., from child components) are detected using the framework's element-check utility and rendered full-width without a label cell.
|
|
161
153
|
- The `configObj` mutation (`readOnly = true`, `displayMode = 'DISPLAY_ONLY'`) happens on the object returned by `getReferencedView()` — this is intentional side-effectful configuration.
|
|
162
154
|
- `format(value, 'date')` is only called for `date` type — all other types pass through raw.
|
|
163
155
|
|
|
164
156
|
## Dependencies
|
|
165
157
|
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
158
|
+
- The project's PConnect bridge component — used to render each field in DISPLAY_ONLY mode
|
|
159
|
+
- The project's formatting helper — for date formatting
|
|
160
|
+
- A utility to detect rendered elements (framework equivalent of checking if a value is a component/element)
|
|
169
161
|
- Each `field` in `fields[]` must support `.getPConnect()` returning a PConnect object with:
|
|
170
162
|
- `.getComponentName()` → string
|
|
171
163
|
- `.getConfigProps()` → `{ label: string }`
|
|
172
164
|
- `.getReferencedView()` → mutable config object
|
|
173
|
-
- `.getReferencedViewPConnect()` →
|
|
165
|
+
- `.getReferencedViewPConnect()` → configuration for the PConnect bridge component
|
|
174
166
|
- `.getInheritedProps()` → `{ label?: string }` (for reference type)
|
|
175
167
|
|
|
176
168
|
## Design System Mapping
|
|
177
169
|
|
|
178
170
|
**UI control type:** Vertical list of read-only label/value field pairs with PConnect delegation.
|
|
179
171
|
|
|
180
|
-
Listed design systems are examples only.
|
|
181
|
-
|
|
182
|
-
| Design System | Recommended Component |
|
|
183
|
-
| ------------------ | ----------------------------------------------------------------------------- |
|
|
184
|
-
| Default (CSS only) | CSS grid 2-column rows per field pair |
|
|
185
|
-
| MUI | `<Grid container spacing={1}>` per row with `<Typography>` label and value |
|
|
186
|
-
| Ant Design | `<Descriptions layout='horizontal' column={1}>` with PConnect-rendered values |
|
|
187
|
-
| Chakra UI | `<Grid templateColumns='1fr 1fr'>` rows with `<Text>` label/value |
|
|
188
|
-
| Shadcn/ui | `<div class='grid grid-cols-2'>` rows |
|
|
189
|
-
|
|
190
172
|
When implementing in a specific design system, map the following:
|
|
191
173
|
|
|
192
|
-
-
|
|
193
|
-
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
-
|
|
197
|
-
-
|
|
174
|
+
- **Grid rows** → use the DS's grid system with 2 columns (6/12 + 6/12) per label/value pair
|
|
175
|
+
- **Label** → secondary/muted text, body-small size (~0.875rem), `fontWeight: 400`
|
|
176
|
+
- **Value** → primary text, body-small size (~0.875rem), `fontWeight: 400`
|
|
177
|
+
- **Row padding** → `4px 0` vertical spacing between pairs
|
|
178
|
+
- **Full-width value (rendered element)** → single column spanning full width, no label
|
|
179
|
+
- **Reference type** → render the child component without any label wrapper
|
|
180
|
+
- **Empty value** → display `'---'`
|