@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
|
@@ -12,11 +12,11 @@ Entry-point template for embedded table data in a form or detail view. Routes to
|
|
|
12
12
|
|
|
13
13
|
## Pega Metadata
|
|
14
14
|
|
|
15
|
-
- **Registration keys:** `SimpleTable`, `SimpleTableManual`, `SimpleTableSelect`, `SimpleTableSelectReadonly` (all in
|
|
15
|
+
- **Registration keys:** `SimpleTable`, `SimpleTableManual`, `SimpleTableSelect`, `SimpleTableSelectReadonly` (all in the project's component map)
|
|
16
16
|
- **Category:** Data display / Form template — embedded table
|
|
17
|
-
- **Extends:**
|
|
17
|
+
- **Extends:** The project's base component interface
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Inputs
|
|
20
20
|
|
|
21
21
|
| Prop | Type | Required | Description |
|
|
22
22
|
| ---------------------- | ---------- | -------- | ----------------------------------------------------------------------------------------- |
|
|
@@ -29,35 +29,18 @@ Entry-point template for embedded table data in a form or detail view. Routes to
|
|
|
29
29
|
| `readOnly` | `boolean` | No | Alternative read-only flag |
|
|
30
30
|
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
31
31
|
|
|
32
|
-
##
|
|
32
|
+
## Implementation Structure
|
|
33
33
|
|
|
34
34
|
### SimpleTable (router)
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
import { getComponentFromRegistry } from '@pega/sdk-react';
|
|
38
|
-
import { buildMetaForListView, getContext } from '../../../helpers/simpleTableHelpers';
|
|
36
|
+
**Module Setup:** The component depends on the project's component registry (to resolve `ListView`, `FieldGroupTemplate`, and `SimpleTableManual`) and the project's simple-table helper utilities (`buildMetaForListView` and `getContext`).
|
|
39
37
|
|
|
40
|
-
|
|
41
|
-
const ListView = getComponentFromRegistry('ListView');
|
|
42
|
-
const FieldGroupTemplate = getComponentFromRegistry('FieldGroupTemplate');
|
|
43
|
-
const SimpleTableManual = getComponentFromRegistry('SimpleTableManual');
|
|
44
|
-
const { getPConnect, multiRecordDisplayAs, allowTableEdit, fieldMetadata, displayMode, ... } = props;
|
|
38
|
+
**Main Component Logic** — steps in order:
|
|
45
39
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
// 2. Route: reference list (read-only ListView)
|
|
52
|
-
if (fieldMetadata?.type === 'Page List' && fieldMetadata?.dataRetrievalType === 'refer') {
|
|
53
|
-
const metaForListView = buildMetaForListView(...);
|
|
54
|
-
return <ListView {...listViewProps} bInForm={true} displayMode={displayMode} />;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// 3. Route: editable table
|
|
58
|
-
return <SimpleTableManual {...props} contextClass={contextClass} />;
|
|
59
|
-
}
|
|
60
|
-
```
|
|
40
|
+
1. Resolve `ListView`, `FieldGroupTemplate`, and `SimpleTableManual` from the project's component registry; receive `getPConnect`, `multiRecordDisplayAs`, `allowTableEdit`, `fieldMetadata`, `displayMode`, and other relevant inputs.
|
|
41
|
+
2. **Route to `fieldGroup`:** when `multiRecordDisplayAs === 'fieldGroup'`, render `FieldGroupTemplate` with all inputs plus `contextClass`.
|
|
42
|
+
3. **Route to a read-only reference list:** when `fieldMetadata?.type === 'Page List'` and `fieldMetadata?.dataRetrievalType === 'refer'`, build `metaForListView` via `buildMetaForListView(...)` and render `ListView` with the list-view inputs plus `bInForm: true` and `displayMode`.
|
|
43
|
+
4. **Route to the editable table:** otherwise, render `SimpleTableManual` with all inputs plus `contextClass`.
|
|
61
44
|
|
|
62
45
|
### SimpleTableManual (editable table — ~600+ lines)
|
|
63
46
|
|
|
@@ -72,38 +55,21 @@ Key structural outline:
|
|
|
72
55
|
|
|
73
56
|
### SimpleTableSelect (selection wrapper)
|
|
74
57
|
|
|
75
|
-
|
|
76
|
-
const ListView = getComponentFromRegistry('ListView');
|
|
77
|
-
const PromotedFilters = getComponentFromRegistry('PromotedFilters');
|
|
78
|
-
// Build additionalTableConfig with selectionMode, compositeKeys
|
|
79
|
-
// If promoted filters exist: <PromotedFilters ... />
|
|
80
|
-
// Else: <ListView {...listViewProps} />
|
|
81
|
-
```
|
|
58
|
+
Retrieve `ListView` and `PromotedFilters` from the component registry. Build an `additionalTableConfig` incorporating `selectionMode` and `compositeKeys`. When promoted filters are configured, render `<PromotedFilters ... />`; otherwise render `<ListView {...listViewProps} />` directly.
|
|
82
59
|
|
|
83
60
|
### SimpleTableSelectReadonly (link + modal)
|
|
84
61
|
|
|
85
|
-
|
|
86
|
-
// Renders SemanticLink per selected item (comma-separated)
|
|
87
|
-
// If list > 5 items: show "(N Total)" link that opens modal
|
|
88
|
-
// Modal: <Dialog><SimpleTableManual readOnly ... /></Dialog>
|
|
89
|
-
```
|
|
62
|
+
Renders a `SemanticLink` per selected item (comma-separated). When the list has more than 5 items, show a "(N Total)" link that opens a modal. The modal renders a `<Dialog>` wrapping a read-only `<SimpleTableManual readOnly ... />`.
|
|
90
63
|
|
|
91
64
|
## Behavioral Contract
|
|
92
65
|
|
|
93
66
|
### SimpleTable — Routing Logic
|
|
94
67
|
|
|
95
|
-
|
|
96
|
-
if multiRecordDisplayAs === 'fieldGroup':
|
|
97
|
-
→ render FieldGroupTemplate
|
|
98
|
-
else if fieldMetadata.dataRetrievalType === 'refer':
|
|
99
|
-
→ render ListView (read-only, bInForm: true)
|
|
100
|
-
else:
|
|
101
|
-
→ render SimpleTableManual (editable table)
|
|
102
|
-
```
|
|
68
|
+
When `multiRecordDisplayAs === 'fieldGroup'`, render `FieldGroupTemplate`. Otherwise, when `fieldMetadata.dataRetrievalType === 'refer'`, render `ListView` (read-only, `bInForm: true`). Otherwise, render `SimpleTableManual` (the editable table).
|
|
103
69
|
|
|
104
70
|
### SimpleTableManual — Full Editable Table
|
|
105
71
|
|
|
106
|
-
Full
|
|
72
|
+
Full editable table with add/delete rows, inline editing, sort, filter, and column customization (~600+ lines).
|
|
107
73
|
|
|
108
74
|
Key behaviors:
|
|
109
75
|
|
|
@@ -127,7 +93,7 @@ Wraps `ListView` with additional selection configuration:
|
|
|
127
93
|
|
|
128
94
|
1. Renders a link/chip showing the current selection count.
|
|
129
95
|
2. On click: opens a `<Dialog>` containing a `<SimpleTableManual>` in read-only mode.
|
|
130
|
-
3.
|
|
96
|
+
3. Inputs: same as `SimpleTableManual` but all fields locked (no add/delete/edit).
|
|
131
97
|
|
|
132
98
|
## Visual Specifications
|
|
133
99
|
|
|
@@ -168,23 +134,18 @@ Wraps `ListView` with additional selection configuration:
|
|
|
168
134
|
|
|
169
135
|
- `FieldGroupTemplate` (for `multiRecordDisplayAs === 'fieldGroup'` routing)
|
|
170
136
|
- `ListView` (for `dataRetrievalType === 'refer'` routing)
|
|
171
|
-
- `buildView` from
|
|
172
|
-
-
|
|
137
|
+
- `buildView` from the project's field-group utility helpers (for inline cell rendering in SimpleTableManual)
|
|
138
|
+
- The design system's table, dialog, popover, icon button, button, and checkbox components.
|
|
173
139
|
|
|
174
140
|
## Design System Mapping
|
|
175
141
|
|
|
176
142
|
**UI control type:** Embedded data table with routing to field group, read-only list, or fully editable table.
|
|
177
143
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
| Sub-variant | Default (CSS only) | MUI |
|
|
181
|
-
| ------------------------- | ----------------------------- | -------------------- |
|
|
182
|
-
| SimpleTableManual | `<table>` + custom controls | MUI `<Table>` |
|
|
183
|
-
| SimpleTableSelect | Custom table + radio/checkbox | `<ListView>` wrapper |
|
|
184
|
-
| SimpleTableSelectReadonly | Link + `<dialog>` | Chip + `<Dialog>` |
|
|
185
|
-
|
|
186
|
-
When implementing in a specific design system:
|
|
144
|
+
When implementing in a specific design system, map the following:
|
|
187
145
|
|
|
146
|
+
- **SimpleTableManual** → use the DS's table component with add/delete row controls and inline editing
|
|
147
|
+
- **SimpleTableSelect** → use `ListView` with selection mode enabled, optionally with promoted filters
|
|
148
|
+
- **SimpleTableSelectReadonly** → render selected values as chips/links that open a modal with full list view
|
|
188
149
|
- Always check `multiRecordDisplayAs === 'fieldGroup'` first — this bypasses the table entirely
|
|
189
150
|
- `SimpleTableManual` add/delete row controls must be hidden when `readOnly === true` or `displayMode === 'DISPLAY_ONLY'`
|
|
190
151
|
- `SimpleTableSelect` uses the same `ListView` but adds selection callbacks
|
package/templates/react-sdk-reference/.ai-common/skills/template-skills/SingleReferenceReadOnly.md
CHANGED
|
@@ -12,86 +12,45 @@ Renders a single data reference field in read-only mode. For fields that were di
|
|
|
12
12
|
|
|
13
13
|
## Pega Metadata
|
|
14
14
|
|
|
15
|
-
- **Registration key:** `SingleReferenceReadOnly` (in
|
|
15
|
+
- **Registration key:** `SingleReferenceReadOnly` (in the project's component map)
|
|
16
16
|
- **Category:** Display template — read-only reference
|
|
17
|
-
- **Extends:**
|
|
18
|
-
|
|
19
|
-
##
|
|
20
|
-
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
| `label`
|
|
24
|
-
| `displayAs`
|
|
25
|
-
| `value`
|
|
26
|
-
| `caseClass`
|
|
27
|
-
| `text`
|
|
28
|
-
| `caseID`
|
|
29
|
-
| `contextPage`
|
|
30
|
-
| `resourceParams`
|
|
31
|
-
| `resourcePayload`
|
|
32
|
-
| `
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
referenceType?: string;
|
|
47
|
-
hideLabel?: boolean;
|
|
48
|
-
dataRelationshipContext?: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export default function SingleReferenceReadOnly(props: SingleReferenceReadOnlyProps) {
|
|
52
|
-
const {
|
|
53
|
-
getPConnect, displayAs = '', ruleClass = '', label = '',
|
|
54
|
-
type = '', displayMode = '', referenceType = '',
|
|
55
|
-
hideLabel = false, dataRelationshipContext = null, config,
|
|
56
|
-
} = props;
|
|
57
|
-
|
|
58
|
-
const editableComponents = ['AutoComplete', 'SimpleTableSelect', 'Dropdown'];
|
|
59
|
-
|
|
60
|
-
// 1. For editable field types: build SemanticLink config
|
|
61
|
-
if (editableComponents.includes(type)) {
|
|
62
|
-
config.caseClass = ruleClass;
|
|
63
|
-
config.text = config.primaryField;
|
|
64
|
-
config.caseID = config.value;
|
|
65
|
-
config.contextPage = `@P .${dataRelationshipContext}`;
|
|
66
|
-
config.resourceParams = { workID: displayAs === 'table' ? config.selectionKey : config.value };
|
|
67
|
-
config.resourcePayload = { caseClassName: ruleClass };
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// 2. Create SemanticLink component
|
|
71
|
-
const component = getPConnect().createComponent(
|
|
72
|
-
{ type: 'SemanticLink', config: { ...config, label, displayMode, referenceType, hideLabel, dataRelationshipContext } },
|
|
73
|
-
'', 0, {},
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
// 3. Render: label + semantic link in row layout
|
|
77
|
-
return (
|
|
78
|
-
<FormRow>
|
|
79
|
-
<Label>{label}</Label>
|
|
80
|
-
{component}
|
|
81
|
-
</FormRow>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
```
|
|
17
|
+
- **Extends:** the project's base component interface
|
|
18
|
+
|
|
19
|
+
## Inputs
|
|
20
|
+
|
|
21
|
+
| Input | Type | Required | Description |
|
|
22
|
+
| ------------------------- | ---------- | -------- | --------------------------------------------------------- |
|
|
23
|
+
| `label` | `string` | Yes | Field label |
|
|
24
|
+
| `displayAs` | `string` | Yes | The edit-mode display type this field was configured with |
|
|
25
|
+
| `value` | `string` | No | Current field value (display text) |
|
|
26
|
+
| `caseClass` | `string` | No | Class identifier for the referenced case |
|
|
27
|
+
| `text` | `string` | No | Display text for the semantic link |
|
|
28
|
+
| `caseID` | `string` | No | Case ID for the semantic link |
|
|
29
|
+
| `contextPage` | `string` | No | Context page identifier |
|
|
30
|
+
| `resourceParams` | `object` | No | Parameters for the referenced resource |
|
|
31
|
+
| `resourcePayload` | `object` | No | Payload for resource navigation |
|
|
32
|
+
| `dataRelationshipContext` | `string` | No | Data relationship context identifier |
|
|
33
|
+
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
34
|
+
|
|
35
|
+
## Implementation Structure
|
|
36
|
+
|
|
37
|
+
**Module Setup:** This component requires the project's base component interface. Define a component input contract extending the base interface with `config` (object), optional `displayAs`, optional `ruleClass`, optional `label`, optional `displayMode`, `type` (string), optional `referenceType`, optional `hideLabel`, and optional `dataRelationshipContext`.
|
|
38
|
+
|
|
39
|
+
**Main Component Logic** — steps in order:
|
|
40
|
+
|
|
41
|
+
1. Receive inputs: `getPConnect`, `displayAs` (default `''`), `ruleClass` (default `''`), `label` (default `''`), `type` (default `''`), `displayMode` (default `''`), `referenceType` (default `''`), `hideLabel` (default `false`), `dataRelationshipContext` (default `null`), and `config`.
|
|
42
|
+
2. Define `editableComponents = ['AutoComplete', 'SimpleTableSelect', 'Dropdown']`.
|
|
43
|
+
3. **For editable field types** (when `type` is in `editableComponents`), mutate `config` to add semantic link configuration: `caseClass = ruleClass`; `text = config.primaryField`; `caseID = config.value`; `contextPage = '@P .' + dataRelationshipContext`; `resourceParams = { workID: displayAs === 'table' ? config.selectionKey : config.value }`; `resourcePayload = { caseClassName: ruleClass }`.
|
|
44
|
+
4. Create the `SemanticLink` component via `getPConnect().createComponent({ type: 'SemanticLink', config: { ...config, label, displayMode, referenceType, hideLabel, dataRelationshipContext } }, '', 0, {})`.
|
|
45
|
+
5. Render a form row containing a label showing `label`, followed by the created component.
|
|
85
46
|
|
|
86
47
|
## Behavioral Contract
|
|
87
48
|
|
|
88
49
|
### Editable Component Check
|
|
89
50
|
|
|
90
|
-
|
|
91
|
-
editableComponents = ['AutoComplete', 'SimpleTableSelect', 'Dropdown']
|
|
92
|
-
```
|
|
51
|
+
`editableComponents = ['AutoComplete', 'SimpleTableSelect', 'Dropdown']`.
|
|
93
52
|
|
|
94
|
-
If `
|
|
53
|
+
If `type` is in `editableComponents`:
|
|
95
54
|
|
|
96
55
|
1. Build config with: `caseClass`, `text`, `caseID`, `contextPage`, `resourceParams`, `resourcePayload`.
|
|
97
56
|
2. Create: `createComponent({ type: 'SemanticLink', config: { ...builtConfig } })`.
|
|
@@ -99,18 +58,11 @@ If `displayAs` is in `editableComponents`:
|
|
|
99
58
|
|
|
100
59
|
Else:
|
|
101
60
|
|
|
102
|
-
- Render a plain read-only display
|
|
61
|
+
- Render a plain read-only display with a label and value text.
|
|
103
62
|
|
|
104
63
|
### Layout
|
|
105
64
|
|
|
106
|
-
For both variants, wrap with
|
|
107
|
-
|
|
108
|
-
```tsx
|
|
109
|
-
<FormControl variant="standard" sx={{ flexDirection: 'row' }}>
|
|
110
|
-
<FormLabel sx={{ marginRight: '2rem' }}>{label}</FormLabel>
|
|
111
|
-
{semanLinkOrValue}
|
|
112
|
-
</FormControl>
|
|
113
|
-
```
|
|
65
|
+
For both variants, wrap the label and the semantic link (or plain value) in a row-oriented form control: a container styled with row direction, containing a label element (with right margin) showing `label`, followed by the semantic link or value.
|
|
114
66
|
|
|
115
67
|
## Visual Specifications
|
|
116
68
|
|
|
@@ -128,33 +80,24 @@ For both variants, wrap with:
|
|
|
128
80
|
|
|
129
81
|
## Edge Cases & Special Logic
|
|
130
82
|
|
|
131
|
-
- `
|
|
132
|
-
- `createComponent` returns a
|
|
83
|
+
- `type` check is case-sensitive — values are `'AutoComplete'`, `'SimpleTableSelect'`, `'Dropdown'` (exact match).
|
|
84
|
+
- `createComponent` returns a renderable component — render it via the project's component registry conventions.
|
|
133
85
|
- If `text` is empty/undefined, the semantic link shows the `caseID` as fallback text.
|
|
134
86
|
- `SemanticLink` navigation requires `caseClass` and `caseID` — if either is missing, fall back to plain read-only display.
|
|
135
87
|
|
|
136
88
|
## Dependencies
|
|
137
89
|
|
|
138
|
-
-
|
|
90
|
+
- The project's component registry — for rendering the `SemanticLink`
|
|
139
91
|
- `getPConnect().createComponent()` — creates the SemanticLink component config
|
|
140
|
-
- MUI: `<FormControl>`, `<FormLabel>`
|
|
141
92
|
|
|
142
93
|
## Design System Mapping
|
|
143
94
|
|
|
144
95
|
**UI control type:** Read-only reference field — semantic link for navigable references, plain label otherwise.
|
|
145
96
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
| Design System | Semantic Link | Plain Read-Only |
|
|
149
|
-
| ------------------ | --------------------------------------------- | ------------------- |
|
|
150
|
-
| Default (CSS only) | `<a>` with case navigation | `<span>` |
|
|
151
|
-
| MUI | `SemanticLink` rendered via `createComponent` | `<Typography>` |
|
|
152
|
-
| Ant Design | `<Typography.Link>` | `<Typography.Text>` |
|
|
153
|
-
| Chakra UI | `<Link>` | `<Text>` |
|
|
154
|
-
| Shadcn/ui | Custom link | `<span>` |
|
|
155
|
-
|
|
156
|
-
When implementing in a specific design system:
|
|
97
|
+
When implementing in a specific design system, map the following:
|
|
157
98
|
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
99
|
+
- For editable field types (`'AutoComplete'`, `'SimpleTableSelect'`, `'Dropdown'`), render a semantic link that navigates to the referenced case.
|
|
100
|
+
- For other field types, render a plain read-only label with the value text.
|
|
101
|
+
- `SemanticLink` must be rendered via `createComponent` — do not implement the link logic directly in this component.
|
|
102
|
+
- Horizontal label + value layout (row direction) is required.
|
|
103
|
+
- The wrapper should be a form-control-style container with flex row direction and appropriate spacing between label and value.
|
|
@@ -12,78 +12,47 @@ Renders a horizontal tab bar for navigating between case view sections. Uses sha
|
|
|
12
12
|
|
|
13
13
|
## Pega Metadata
|
|
14
14
|
|
|
15
|
-
- **Registration key:** `SubTabs` (in
|
|
15
|
+
- **Registration key:** `SubTabs` (in the project's component map)
|
|
16
16
|
- **Category:** Navigation template
|
|
17
|
-
- **Extends:**
|
|
18
|
-
|
|
19
|
-
##
|
|
20
|
-
|
|
21
|
-
|
|
|
22
|
-
| ------------- |
|
|
23
|
-
| `children` |
|
|
24
|
-
| `getPConnect` |
|
|
25
|
-
|
|
26
|
-
##
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const [currentTabId, setCurrentTabId] = useState('0');
|
|
42
|
-
const [tabItems, setTabitem] = useState<any[]>([]);
|
|
43
|
-
|
|
44
|
-
// 3. Update tab items when currentTabId changes
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
setTabitem(getTransientTabs(availableTabs, currentTabId, tabItems));
|
|
47
|
-
}, [currentTabId]);
|
|
48
|
-
|
|
49
|
-
// 4. Tab click
|
|
50
|
-
const handleTabClick = (id, index: string) => {
|
|
51
|
-
setCurrentTabId(index);
|
|
52
|
-
tabClick(index, availableTabs, currentTabId, setCurrentTabId, tabItems);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// 5. Render: TabContext + Tabs (scrollable) + TabPanels (no heading)
|
|
56
|
-
return (
|
|
57
|
-
<TabContext value={currentTabId.toString()}>
|
|
58
|
-
<TabBar onChange={handleTabClick} value={currentTabId} variant="scrollable">
|
|
59
|
-
{tabItems.map(tab => <Tab key={tab.id} label={tab.name} value={tab.id} />)}
|
|
60
|
-
</TabBar>
|
|
61
|
-
{tabItems.map(tab => (
|
|
62
|
-
<TabPanel key={tab.id} value={tab.id} tabIndex={+tab.id}>
|
|
63
|
-
{tab.content || 'No content exists'}
|
|
64
|
-
</TabPanel>
|
|
65
|
-
))}
|
|
66
|
-
</TabContext>
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
> **Key difference from `DetailsSubTabs`:** No heading, uses `'tabsSubs'` identifier, `getVisibleTabs` called directly (not in useEffect).
|
|
17
|
+
- **Extends:** the project's base component interface
|
|
18
|
+
|
|
19
|
+
## Inputs
|
|
20
|
+
|
|
21
|
+
| Input | Type | Required | Description |
|
|
22
|
+
| ------------- | ---------------- | -------- | --------------------------------------------------- |
|
|
23
|
+
| `children` | child node array | Yes | `children[0]` is the deferred-loaded tabs container |
|
|
24
|
+
| `getPConnect` | function | Yes | PConnect getter |
|
|
25
|
+
|
|
26
|
+
## Implementation Structure
|
|
27
|
+
|
|
28
|
+
**Module Setup:** The component requires access to a framework utility for converting children to an array, local state and lifecycle effect primitives, `getTransientTabs`, `getVisibleTabs`, and `tabClick` from the local tab utilities module, and the project's base component interface.
|
|
29
|
+
|
|
30
|
+
**Main Component Logic** — steps in order:
|
|
31
|
+
|
|
32
|
+
1. Receive inputs: extract `children` (defaulting to an empty array).
|
|
33
|
+
2. Extract the deferred tabs container: convert children to an array and take the first element.
|
|
34
|
+
3. Compute `availableTabs` via `getVisibleTabs(deferLoadedTabs, 'tabsSubs')`.
|
|
35
|
+
4. Declare local state: `currentTabId` (string, initialized to `'0'`) and `tabItems` (array, initialized empty).
|
|
36
|
+
5. In a lifecycle effect keyed on `currentTabId`, update `tabItems` via `getTransientTabs(availableTabs, currentTabId, tabItems)`.
|
|
37
|
+
6. Define a tab-click handler that sets `currentTabId` to the clicked index and calls `tabClick(index, availableTabs, currentTabId, setCurrentTabId, tabItems)`.
|
|
38
|
+
7. Render a tab context wrapping a scrollable tab bar (one tab per `tabItems` entry, labeled `tab.name`) and a set of tab panels (each showing `tab.content` or a "No content exists" fallback) — no section heading is rendered.
|
|
39
|
+
|
|
40
|
+
> **Key difference from `DetailsSubTabs`:** No heading, uses `'tabsSubs'` identifier, `getVisibleTabs` called directly (not inside a lifecycle effect).
|
|
72
41
|
|
|
73
42
|
## Behavioral Contract
|
|
74
43
|
|
|
75
|
-
1. **Extract deferred tabs:** `deferLoadedTabs =
|
|
44
|
+
1. **Extract deferred tabs:** `deferLoadedTabs` = first element of the children array.
|
|
76
45
|
2. **State:** `currentTabId` (string, default `'0'`), `tabItems` (array).
|
|
77
|
-
3. **Compute visible tabs:** `getVisibleTabs(deferLoadedTabs, 'tabsSubs')`
|
|
78
|
-
4. **Transient tabs:** `
|
|
46
|
+
3. **Compute visible tabs:** `getVisibleTabs(deferLoadedTabs, 'tabsSubs')` → `availableTabs`.
|
|
47
|
+
4. **Transient tabs:** lifecycle effect keyed on `currentTabId` → update `tabItems` via `getTransientTabs(availableTabs, currentTabId, tabItems)`.
|
|
79
48
|
5. **Tab click:** `tabClick(index, availableTabs, currentTabId, setCurrentTabId, tabItems)` from `tabUtils`.
|
|
80
49
|
6. **Render:**
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
- One
|
|
50
|
+
- A tab context container bound to `currentTabId`
|
|
51
|
+
- A scrollable tab bar with change handler — one tab per `tabItems` entry
|
|
52
|
+
- One tab panel per `tabItems` entry with `tab.content` or empty fallback text "No content exists"
|
|
84
53
|
7. No section heading (unlike `DetailsSubTabs`).
|
|
85
54
|
|
|
86
|
-
> **Difference from `DetailsSubTabs`:** SubTabs has no `label`/`showLabel`
|
|
55
|
+
> **Difference from `DetailsSubTabs`:** SubTabs has no `label`/`showLabel` inputs and no heading. Uses `'tabsSubs'` identifier for `getVisibleTabs` (vs `'detailsSubTabs'`).
|
|
87
56
|
|
|
88
57
|
## Visual Specifications
|
|
89
58
|
|
|
@@ -104,25 +73,16 @@ See `DetailsSubTabs.md` for shared edge cases. Additional:
|
|
|
104
73
|
|
|
105
74
|
## Dependencies
|
|
106
75
|
|
|
107
|
-
- `getTransientTabs`, `getVisibleTabs`, `tabClick` from
|
|
108
|
-
-
|
|
109
|
-
- `Tab`, `Tabs` from `@mui/material`
|
|
76
|
+
- `getTransientTabs`, `getVisibleTabs`, `tabClick` from the local tab utilities module (`tabUtils`)
|
|
77
|
+
- A design-system tab container, tab bar, and tab panel component (see below)
|
|
110
78
|
|
|
111
79
|
## Design System Mapping
|
|
112
80
|
|
|
113
81
|
**UI control type:** Tab navigation container — no heading, deferred content loading.
|
|
114
82
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
| Design System | Recommended Component |
|
|
118
|
-
| ------------------ | -------------------------------------------------------- |
|
|
119
|
-
| Default (CSS only) | Custom tab bar with CSS underline indicator |
|
|
120
|
-
| MUI | `<TabContext>` + `<Tabs>` + `<TabPanel>` from `@mui/lab` |
|
|
121
|
-
| Ant Design | `<Tabs>` with `items` array |
|
|
122
|
-
| Chakra UI | `<Tabs>` + `<TabList>` + `<TabPanels>` |
|
|
123
|
-
| Shadcn/ui | `<Tabs>` + `<TabsList>` + `<TabsContent>` |
|
|
83
|
+
When implementing in a specific design system, map the following: a tab context container that holds the current tab value; a scrollable tab bar component that emits a change event with the selected index; individual tab items with label text; and tab panel containers that display content for the active tab. In a CSS-only approach, use a custom tab bar with an underline indicator. Other design systems provide equivalent compound tab components.
|
|
124
84
|
|
|
125
|
-
When implementing
|
|
85
|
+
When implementing:
|
|
126
86
|
|
|
127
87
|
- Use `getVisibleTabs(tabs, 'tabsSubs')` — the identifier string must be `'tabsSubs'`
|
|
128
88
|
- No heading above the tab bar (unlike `DetailsSubTabs`)
|