@pega/sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +111 -0
- package/SECURITY.md +10 -0
- package/dist/index.js +753 -0
- package/package.json +41 -0
- package/templates/angular-sdk-reference/.github/AGENTS.md +23 -0
- package/templates/angular-sdk-reference/.github/copilot-instructions.md +40 -0
- package/templates/angular-sdk-reference/.github/skills/pega-sdk-component.md +48 -0
- package/templates/angular-sdk-reference/angular.json +34 -0
- package/templates/angular-sdk-reference/package.json +31 -0
- package/templates/angular-sdk-reference/sdk-config.json +26 -0
- package/templates/angular-sdk-reference/src/app/app.component.ts +54 -0
- package/templates/angular-sdk-reference/src/index.html +12 -0
- package/templates/angular-sdk-reference/src/main.ts +4 -0
- package/templates/angular-sdk-reference/src/styles.css +19 -0
- package/templates/angular-sdk-reference/tsconfig.json +32 -0
- package/templates/react-native-sdk-reference/.github/AGENTS.md +23 -0
- package/templates/react-native-sdk-reference/.github/copilot-instructions.md +40 -0
- package/templates/react-native-sdk-reference/.github/skills/pega-sdk-component.md +48 -0
- package/templates/react-native-sdk-reference/App.tsx +51 -0
- package/templates/react-native-sdk-reference/app.json +11 -0
- package/templates/react-native-sdk-reference/package.json +22 -0
- package/templates/react-native-sdk-reference/sdk-config.json +14 -0
- package/templates/react-native-sdk-reference/tsconfig.json +12 -0
- package/templates/react-sdk-reference/.github/copilot-instructions.md +185 -0
- package/templates/react-sdk-reference/.github/instructions/component-map.instructions.md +40 -0
- package/templates/react-sdk-reference/.github/instructions/dse-component.instructions.md +77 -0
- package/templates/react-sdk-reference/.github/instructions/field-component.instructions.md +73 -0
- package/templates/react-sdk-reference/.github/instructions/template-component.instructions.md +94 -0
- package/templates/react-sdk-reference/.github/instructions/widget-component.instructions.md +89 -0
- package/templates/react-sdk-reference/.github/prompts/add-component.prompt.md +21 -0
- package/templates/react-sdk-reference/.github/prompts/component-manifest.json +111 -0
- package/templates/react-sdk-reference/.github/prompts/identify-components.prompt.md +110 -0
- package/templates/react-sdk-reference/.github/prompts/replace-all-fields.prompt.md +48 -0
- package/templates/react-sdk-reference/.github/prompts/replace-component.prompt.md +81 -0
- package/templates/react-sdk-reference/.github/prompts/replace-design-system.prompt.md +524 -0
- package/templates/react-sdk-reference/.github/prompts/replace-field.prompt.md +41 -0
- package/templates/react-sdk-reference/.github/prompts/swap-design-system.prompt.md +49 -0
- package/templates/react-sdk-reference/.github/skills/component-contracts.md +140 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/AlertBanner.md +135 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Banner.md +149 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/CaseSummaryFields.md +154 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/DetailsFields.md +144 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/FieldGroup.md +131 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/FieldGroupList.md +111 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/FieldValueList.md +115 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Operator.md +149 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Pulse.md +83 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/RichTextEditor.md +206 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/WssQuickCreate.md +135 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension.md +249 -0
- package/templates/react-sdk-reference/.github/skills/field-components.md +262 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/AutoComplete.md +112 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/CancelAlert.md +203 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Checkbox.md +158 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Currency.md +106 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Date.md +99 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/DateTime.md +103 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Decimal.md +98 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Dropdown.md +114 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Email.md +107 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Group.md +90 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Integer.md +87 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Location.md +136 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Multiselect.md +164 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/ObjectReference.md +164 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Percentage.md +92 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Phone.md +110 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/RadioButtons.md +146 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/RichText.md +138 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/ScalarList.md +124 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/SelectableCard.md +216 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/SemanticLink.md +148 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/TextArea.md +96 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/TextContent.md +101 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/TextInput.md +104 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Time.md +88 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/URL.md +85 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/UserReference.md +180 -0
- package/templates/react-sdk-reference/.github/skills/run-and-verify.md +68 -0
- package/templates/react-sdk-reference/.github/skills/swap-design-system.md +105 -0
- package/templates/react-sdk-reference/.github/skills/template-components.md +285 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/AdvancedSearch.md +144 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/AppShell.md +122 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/BannerPage.md +83 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseSummary.md +100 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseView.md +131 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseViewActionsMenu.md +126 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/Confirmation.md +107 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DataReference.md +120 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DefaultForm.md +102 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DefaultPage.md +110 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/Details.md +88 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DetailsSubTabs.md +95 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DetailsThreeColumn.md +78 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DetailsTwoColumn.md +78 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DynamicTabs.md +101 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/FieldGroupTemplate.md +109 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/HierarchicalForm.md +113 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/InlineDashboard.md +104 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/InlineDashboardPage.md +85 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/ListPage.md +68 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/ListView.md +139 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/MultiReferenceReadOnly.md +80 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/NarrowWide.md +141 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/OneColumn.md +109 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/PromotedFilters.md +124 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/SelfServiceCaseView.md +135 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/SimpleTable.md +127 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/SingleReferenceReadOnly.md +103 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/SubTabs.md +79 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/TwoColumn.md +131 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/WideNarrow.md +150 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/WssNavBar.md +135 -0
- package/templates/react-sdk-reference/.github/skills/widget-components.md +234 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/AppAnnouncement.md +82 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/Attachment.md +146 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/CaseHistory.md +107 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/FileUtility.md +200 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/Followers.md +99 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/QuickCreate.md +114 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/SummaryItem.md +167 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/ToDo.md +190 -0
- package/templates/react-sdk-reference/AGENTS.md +59 -0
- package/templates/react-sdk-reference/assets/icons/analytics-good-solid.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/cart-solid.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/headset.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/mobile-phone-solid.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/money-solid.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/multi-device-solid.svg +3 -0
- package/templates/react-sdk-reference/index.html +36 -0
- package/templates/react-sdk-reference/package.json +52 -0
- package/templates/react-sdk-reference/sdk-config.json +26 -0
- package/templates/react-sdk-reference/src/AppSelector.tsx +18 -0
- package/templates/react-sdk-reference/src/FallbackComponent.tsx +40 -0
- package/templates/react-sdk-reference/src/MashupApp.styles.ts +105 -0
- package/templates/react-sdk-reference/src/MashupApp.tsx +254 -0
- package/templates/react-sdk-reference/src/PortalApp.tsx +175 -0
- package/templates/react-sdk-reference/src/components/component-map.ts +255 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/AlertBanner/AlertBanner.tsx +91 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/AlertBanner/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Banner/Banner.css +39 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Banner/Banner.tsx +53 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Banner/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +16 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +270 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/CaseSummaryFields/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/DetailsFields/DetailsFields.tsx +164 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/DetailsFields/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroup/FieldGroup.tsx +79 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroup/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroupList/FieldGroupList.tsx +58 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroupList/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldValueList/FieldValueList.tsx +84 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldValueList/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Operator/Operator.tsx +220 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Operator/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Pulse/Pulse.tsx +33 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Pulse/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/RichTextEditor/RichTextEditor.tsx +201 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/RichTextEditor/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.css +33 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +48 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/WssQuickCreate/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +218 -0
- package/templates/react-sdk-reference/src/components/field/AutoComplete/config-ext.json +10 -0
- package/templates/react-sdk-reference/src/components/field/AutoComplete/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/CancelAlert/CancelAlert.css +24 -0
- package/templates/react-sdk-reference/src/components/field/CancelAlert/CancelAlert.tsx +148 -0
- package/templates/react-sdk-reference/src/components/field/CancelAlert/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +263 -0
- package/templates/react-sdk-reference/src/components/field/Checkbox/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/field/Checkbox/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Currency/Currency.tsx +111 -0
- package/templates/react-sdk-reference/src/components/field/Currency/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/field/Currency/currency-utils.ts +67 -0
- package/templates/react-sdk-reference/src/components/field/Currency/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Date/Date.tsx +94 -0
- package/templates/react-sdk-reference/src/components/field/Date/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/field/Date/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/DateTime/DateTime.tsx +101 -0
- package/templates/react-sdk-reference/src/components/field/DateTime/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/DateTime/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Decimal/Decimal.tsx +122 -0
- package/templates/react-sdk-reference/src/components/field/Decimal/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Decimal/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +238 -0
- package/templates/react-sdk-reference/src/components/field/Dropdown/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Dropdown/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Email/Email.tsx +96 -0
- package/templates/react-sdk-reference/src/components/field/Email/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Email/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Group/Group.tsx +41 -0
- package/templates/react-sdk-reference/src/components/field/Group/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/Group/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Integer/Integer.tsx +100 -0
- package/templates/react-sdk-reference/src/components/field/Integer/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Integer/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Location/Location.css +4 -0
- package/templates/react-sdk-reference/src/components/field/Location/Location.tsx +258 -0
- package/templates/react-sdk-reference/src/components/field/Location/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Location/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Multiselect/Multiselect.tsx +238 -0
- package/templates/react-sdk-reference/src/components/field/Multiselect/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Multiselect/utils.ts +230 -0
- package/templates/react-sdk-reference/src/components/field/ObjectReference/ObjectReference.tsx +235 -0
- package/templates/react-sdk-reference/src/components/field/ObjectReference/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/ObjectReference/utils.ts +111 -0
- package/templates/react-sdk-reference/src/components/field/Percentage/Percentage.tsx +112 -0
- package/templates/react-sdk-reference/src/components/field/Percentage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Percentage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Phone/Phone.tsx +113 -0
- package/templates/react-sdk-reference/src/components/field/Phone/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Phone/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/RadioButtons/RadioButtons.tsx +158 -0
- package/templates/react-sdk-reference/src/components/field/RadioButtons/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/RadioButtons/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/RichText/RichText.css +79 -0
- package/templates/react-sdk-reference/src/components/field/RichText/RichText.tsx +98 -0
- package/templates/react-sdk-reference/src/components/field/RichText/config-ext.json +10 -0
- package/templates/react-sdk-reference/src/components/field/RichText/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/ScalarList/ScalarList.tsx +63 -0
- package/templates/react-sdk-reference/src/components/field/ScalarList/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/ScalarList/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/SelectableCard/SelectableCard.tsx +189 -0
- package/templates/react-sdk-reference/src/components/field/SelectableCard/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/SelectableCard/utils.tsx +223 -0
- package/templates/react-sdk-reference/src/components/field/SemanticLink/SemanticLink.tsx +208 -0
- package/templates/react-sdk-reference/src/components/field/SemanticLink/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/SemanticLink/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/SemanticLink/utils.ts +49 -0
- package/templates/react-sdk-reference/src/components/field/TextArea/TextArea.tsx +94 -0
- package/templates/react-sdk-reference/src/components/field/TextArea/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/TextArea/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/TextContent/TextContent.tsx +46 -0
- package/templates/react-sdk-reference/src/components/field/TextContent/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/TextContent/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/TextInput/TextInput.tsx +92 -0
- package/templates/react-sdk-reference/src/components/field/TextInput/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/TextInput/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Time/Time.tsx +79 -0
- package/templates/react-sdk-reference/src/components/field/Time/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Time/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/URL/URL.tsx +89 -0
- package/templates/react-sdk-reference/src/components/field/URL/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/URL/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/UserReference/UserReference.tsx +198 -0
- package/templates/react-sdk-reference/src/components/field/UserReference/UserReferenceUtils.ts +13 -0
- package/templates/react-sdk-reference/src/components/field/UserReference/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/UserReference/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/helpers/attachmentShared.ts +6 -0
- package/templates/react-sdk-reference/src/components/helpers/case-utils.tsx +99 -0
- package/templates/react-sdk-reference/src/components/helpers/common-utils.ts +26 -0
- package/templates/react-sdk-reference/src/components/helpers/data_page.ts +20 -0
- package/templates/react-sdk-reference/src/components/helpers/date-format-utils.ts +76 -0
- package/templates/react-sdk-reference/src/components/helpers/event-utils.ts +20 -0
- package/templates/react-sdk-reference/src/components/helpers/field-group-utils.ts +63 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/Boolean.ts +21 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/Currency.ts +77 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/CurrencyMap.ts +913 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/Date.ts +71 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/common.ts +14 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +130 -0
- package/templates/react-sdk-reference/src/components/helpers/instructions-utils.ts +38 -0
- package/templates/react-sdk-reference/src/components/helpers/object-utils.ts +10 -0
- package/templates/react-sdk-reference/src/components/helpers/reactContextHelpers.ts +3 -0
- package/templates/react-sdk-reference/src/components/helpers/simpleTableHelpers.ts +452 -0
- package/templates/react-sdk-reference/src/components/helpers/state-utils.tsx +43 -0
- package/templates/react-sdk-reference/src/components/helpers/template-utils.ts +76 -0
- package/templates/react-sdk-reference/src/components/helpers/utils.ts +349 -0
- package/templates/react-sdk-reference/src/components/helpers/versionHelpers.ts +14 -0
- package/templates/react-sdk-reference/src/components/index.ts +8 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/AdvancedSearch.tsx +86 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroup/persistUtils.ts +52 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +329 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/hooks.ts +37 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/utils.ts +29 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/TemplateContext.ts +11 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/AppShell/AppShell.css +35 -0
- package/templates/react-sdk-reference/src/components/template/AppShell/AppShell.tsx +259 -0
- package/templates/react-sdk-reference/src/components/template/AppShell/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/BannerPage/BannerPage.tsx +54 -0
- package/templates/react-sdk-reference/src/components/template/BannerPage/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/template/BannerPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/CaseSummary/CaseSummary.tsx +79 -0
- package/templates/react-sdk-reference/src/components/template/CaseSummary/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/CaseSummary/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/CaseView/CaseView.tsx +261 -0
- package/templates/react-sdk-reference/src/components/template/CaseView/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/CaseView/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +117 -0
- package/templates/react-sdk-reference/src/components/template/CaseViewActionsMenu/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Confirmation/Confirmation.tsx +102 -0
- package/templates/react-sdk-reference/src/components/template/Confirmation/config-ext.json +11 -0
- package/templates/react-sdk-reference/src/components/template/Confirmation/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/DataReference.tsx +590 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/DataReferenceAdvancedSearchContext.ts +10 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/SearchForm.tsx +213 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/utils.ts +90 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/DefaultForm.css +34 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/DefaultForm.tsx +74 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/utils/index.ts +26 -0
- package/templates/react-sdk-reference/src/components/template/DefaultPage/DefaultPage.tsx +108 -0
- package/templates/react-sdk-reference/src/components/template/DefaultPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/Details/Details.tsx +74 -0
- package/templates/react-sdk-reference/src/components/template/Details/Details/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +58 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsSubTabs/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsSubTabs/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +79 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsThreeColumn/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsThreeColumn/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +79 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsTwoColumn/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsTwoColumn/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/DynamicTabs/DynamicTabs.tsx +79 -0
- package/templates/react-sdk-reference/src/components/template/Details/DynamicTabs/config.json +36 -0
- package/templates/react-sdk-reference/src/components/template/Details/DynamicTabs/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/FieldGroupTemplate/FieldGroupTemplate.tsx +116 -0
- package/templates/react-sdk-reference/src/components/template/FieldGroupTemplate/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/HierarchicalForm/HierarchicalForm.tsx +58 -0
- package/templates/react-sdk-reference/src/components/template/HierarchicalForm/hooks.ts +293 -0
- package/templates/react-sdk-reference/src/components/template/HierarchicalForm/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboard/InlineDashboard.tsx +72 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboard/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboardPage/InlineDashboardPage.tsx +39 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboardPage/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboardPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/ListPage/ListPage.tsx +16 -0
- package/templates/react-sdk-reference/src/components/template/ListPage/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/template/ListPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/ListView/DefaultViewMeta.ts +220 -0
- package/templates/react-sdk-reference/src/components/template/ListView/ListView.css +10 -0
- package/templates/react-sdk-reference/src/components/template/ListView/ListView.tsx +1391 -0
- package/templates/react-sdk-reference/src/components/template/ListView/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/ListView/hooks.ts +93 -0
- package/templates/react-sdk-reference/src/components/template/ListView/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/ListView/utils.ts +781 -0
- package/templates/react-sdk-reference/src/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +52 -0
- package/templates/react-sdk-reference/src/components/template/MultiReferenceReadOnly/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWide/NarrowWide.css +19 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWide/NarrowWide.tsx +37 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWide/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +85 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideDetails/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideDetails/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.css +19 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +22 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +28 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWidePage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWidePage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/ObjectPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumn/OneColumn.tsx +32 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumn/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumn/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnPage/OneColumnPage.tsx +17 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnPage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnTab/OneColumnTab.tsx +11 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnTab/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnTab/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/PromotedFilters/PromotedFilters.css +7 -0
- package/templates/react-sdk-reference/src/components/template/PromotedFilters/PromotedFilters.tsx +204 -0
- package/templates/react-sdk-reference/src/components/template/PromotedFilters/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SelfServiceCaseView/SelfServiceCaseView.tsx +153 -0
- package/templates/react-sdk-reference/src/components/template/SelfServiceCaseView/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTable/SimpleTable.tsx +126 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTable/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTable/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +985 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableManual/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +122 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelect/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelectReadonly/SimpleTableSelectReadonly.tsx +207 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelectReadonly/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +71 -0
- package/templates/react-sdk-reference/src/components/template/SingleReferenceReadOnly/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SubTabs/SubTabs.tsx +46 -0
- package/templates/react-sdk-reference/src/components/template/SubTabs/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/SubTabs/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SubTabs/tabUtils.ts +185 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/TwoColumn.css +12 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/TwoColumn.tsx +54 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +17 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnPage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.css +12 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +54 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrow/WideNarrow.css +19 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrow/WideNarrow.tsx +37 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrow/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +96 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowDetails/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowDetails/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.css +19 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +22 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +28 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowPage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WssNavBar/WssNavBar.css +11 -0
- package/templates/react-sdk-reference/src/components/template/WssNavBar/WssNavBar.tsx +160 -0
- package/templates/react-sdk-reference/src/components/template/WssNavBar/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/utils.tsx +58 -0
- package/templates/react-sdk-reference/src/components/widget/AppAnnouncement/AppAnnouncement.tsx +60 -0
- package/templates/react-sdk-reference/src/components/widget/AppAnnouncement/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/AppAnnouncement/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/Attachment.css +95 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/Attachment.tsx +541 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/Attachment.types.ts +96 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/AttachmentUtils.ts +316 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/CaseHistory/CaseHistory.tsx +171 -0
- package/templates/react-sdk-reference/src/components/widget/CaseHistory/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/CaseHistory/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.css +13 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +32 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/ActionButtonsForFileUtil/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/FileUtility.css +118 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/FileUtility.tsx +653 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/Followers/Followers.tsx +43 -0
- package/templates/react-sdk-reference/src/components/widget/Followers/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/Followers/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/QuickCreate/QuickCreate.tsx +88 -0
- package/templates/react-sdk-reference/src/components/widget/QuickCreate/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/widget/QuickCreate/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryItem/SummaryItem.css +76 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryItem/SummaryItem.tsx +89 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryItem/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryList/SummaryList.tsx +23 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryList/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/ToDo/ToDo.css +81 -0
- package/templates/react-sdk-reference/src/components/widget/ToDo/ToDo.tsx +507 -0
- package/templates/react-sdk-reference/src/components/widget/ToDo/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/ToDo/index.tsx +1 -0
- package/templates/react-sdk-reference/src/main.tsx +13 -0
- package/templates/react-sdk-reference/src/mui-theme-augmentation.d.ts +6 -0
- package/templates/react-sdk-reference/tsconfig.json +24 -0
- package/templates/react-sdk-reference/vite.config.ts +65 -0
- package/templates/wc-sdk-reference/.github/AGENTS.md +23 -0
- package/templates/wc-sdk-reference/.github/copilot-instructions.md +40 -0
- package/templates/wc-sdk-reference/.github/skills/pega-sdk-component.md +48 -0
- package/templates/wc-sdk-reference/index.html +21 -0
- package/templates/wc-sdk-reference/package.json +19 -0
- package/templates/wc-sdk-reference/sdk-config.json +19 -0
- package/templates/wc-sdk-reference/src/index.ts +98 -0
- package/templates/wc-sdk-reference/tsconfig.json +21 -0
- package/templates/wc-sdk-reference/vite.config.ts +8 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Tab,
|
|
4
|
+
Tabs,
|
|
5
|
+
Typography,
|
|
6
|
+
RadioGroup,
|
|
7
|
+
FormControlLabel,
|
|
8
|
+
Radio,
|
|
9
|
+
MenuItem,
|
|
10
|
+
Box,
|
|
11
|
+
TextField,
|
|
12
|
+
} from '@mui/material';
|
|
13
|
+
import Grid from '@mui/material/Grid';
|
|
14
|
+
import { TabContext, TabPanel } from '@mui/lab';
|
|
15
|
+
import {
|
|
16
|
+
Dialog,
|
|
17
|
+
DialogTitle,
|
|
18
|
+
DialogContent,
|
|
19
|
+
DialogActions,
|
|
20
|
+
Button,
|
|
21
|
+
} from '@mui/material';
|
|
22
|
+
|
|
23
|
+
import { useGetTabsCount } from '@pega/sdk-react';
|
|
24
|
+
import {
|
|
25
|
+
searchtabsClick,
|
|
26
|
+
getActiveTabId,
|
|
27
|
+
getFirstVisibleTabId,
|
|
28
|
+
} from '../SubTabs/tabUtils';
|
|
29
|
+
import { getFieldMeta } from './utils';
|
|
30
|
+
|
|
31
|
+
const publishEvent = ({ clearSelections, viewName }) => {
|
|
32
|
+
const payload: any = {};
|
|
33
|
+
|
|
34
|
+
if (clearSelections) {
|
|
35
|
+
payload.clearSelections = clearSelections;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (viewName) {
|
|
39
|
+
payload.viewName = viewName;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
PCore.getPubSubUtils().publish('update-advanced-search-selections', payload);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const checkIfSelectionsExist = (getPConnect) => {
|
|
46
|
+
const { MULTI } = PCore.getConstants().LIST_SELECTION_MODE;
|
|
47
|
+
const {
|
|
48
|
+
selectionMode,
|
|
49
|
+
readonlyContextList,
|
|
50
|
+
contextPage,
|
|
51
|
+
contextClass,
|
|
52
|
+
name,
|
|
53
|
+
} = getPConnect().getConfigProps();
|
|
54
|
+
const isMultiSelectMode = selectionMode === MULTI;
|
|
55
|
+
|
|
56
|
+
const dataRelationshipContext = contextClass && name ? name : null;
|
|
57
|
+
|
|
58
|
+
const { compositeKeys } = getFieldMeta(getPConnect, dataRelationshipContext);
|
|
59
|
+
|
|
60
|
+
let selectionsExist = false;
|
|
61
|
+
if (isMultiSelectMode) {
|
|
62
|
+
selectionsExist = readonlyContextList?.length > 0;
|
|
63
|
+
} else if (contextPage) {
|
|
64
|
+
selectionsExist =
|
|
65
|
+
compositeKeys?.filter(
|
|
66
|
+
(key) => !['', null, undefined].includes(contextPage[key]),
|
|
67
|
+
)?.length > 0;
|
|
68
|
+
}
|
|
69
|
+
return selectionsExist;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const SearchForm = (props) => {
|
|
73
|
+
const { children, getPConnect, searchSelectCacheKey } = props;
|
|
74
|
+
|
|
75
|
+
const deferLoadedTabs = children[2];
|
|
76
|
+
const cache: any =
|
|
77
|
+
PCore.getNavigationUtils().getComponentCache(searchSelectCacheKey) ?? {};
|
|
78
|
+
const { selectedCategory } = cache;
|
|
79
|
+
const firstTabId = getFirstVisibleTabId(deferLoadedTabs, selectedCategory);
|
|
80
|
+
const [open, setOpen] = useState(false);
|
|
81
|
+
const [currentTabId, setCurrentTabId] = useState(
|
|
82
|
+
getActiveTabId(
|
|
83
|
+
deferLoadedTabs.props.getPConnect().getChildren(),
|
|
84
|
+
firstTabId,
|
|
85
|
+
),
|
|
86
|
+
);
|
|
87
|
+
const [nextTabId, setNextTabId] = useState(null); // State to store the next tab ID
|
|
88
|
+
const { getLocaleValue } = PCore.getLocaleUtils();
|
|
89
|
+
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
const { data: tabData } = useGetTabsCount(
|
|
92
|
+
deferLoadedTabs,
|
|
93
|
+
'searchForm',
|
|
94
|
+
currentTabId,
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
const handleTabClick = (event) => {
|
|
98
|
+
const tabId: any = event.target.value;
|
|
99
|
+
const viewName = tabData
|
|
100
|
+
.find((tab) => tab.id === currentTabId)
|
|
101
|
+
.getPConnect()
|
|
102
|
+
.getConfigProps().name;
|
|
103
|
+
|
|
104
|
+
if (checkIfSelectionsExist(getPConnect)) {
|
|
105
|
+
setNextTabId(tabId); // Store the next tab ID
|
|
106
|
+
setOpen(true); // Open the dialog
|
|
107
|
+
} else {
|
|
108
|
+
// @ts-ignore
|
|
109
|
+
publishEvent({ viewName, tabId });
|
|
110
|
+
searchtabsClick(tabId, tabData, currentTabId, setCurrentTabId);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const clearSelectionAndSwitchTab = () => {
|
|
115
|
+
const viewName = tabData
|
|
116
|
+
.find((tab) => tab.id === currentTabId)
|
|
117
|
+
.getPConnect()
|
|
118
|
+
.getConfigProps().name;
|
|
119
|
+
publishEvent({ clearSelections: true, viewName });
|
|
120
|
+
searchtabsClick(nextTabId, tabData, currentTabId, setCurrentTabId);
|
|
121
|
+
setOpen(false);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const onDialogClose = () => {
|
|
125
|
+
setOpen(false); // Close the dialog
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const tabItems = tabData?.filter((tab) => tab.visibility()) || [];
|
|
129
|
+
const propsToUse = { ...getPConnect().getInheritedProps() };
|
|
130
|
+
|
|
131
|
+
let searchCategoriesComp;
|
|
132
|
+
if (tabItems.length > 3) {
|
|
133
|
+
searchCategoriesComp = (
|
|
134
|
+
<Grid container spacing={2}>
|
|
135
|
+
<TextField
|
|
136
|
+
value={currentTabId}
|
|
137
|
+
select
|
|
138
|
+
onChange={handleTabClick}
|
|
139
|
+
fullWidth
|
|
140
|
+
>
|
|
141
|
+
{tabItems.map((tab) => (
|
|
142
|
+
<MenuItem key={tab.id} value={tab.id}>
|
|
143
|
+
{tab.name}
|
|
144
|
+
</MenuItem>
|
|
145
|
+
))}
|
|
146
|
+
</TextField>
|
|
147
|
+
</Grid>
|
|
148
|
+
);
|
|
149
|
+
} else if (tabItems.length > 1) {
|
|
150
|
+
searchCategoriesComp = (
|
|
151
|
+
<RadioGroup row value={currentTabId} onChange={handleTabClick}>
|
|
152
|
+
{tabItems.map((tab) => (
|
|
153
|
+
<FormControlLabel
|
|
154
|
+
key={tab.id}
|
|
155
|
+
value={tab.id}
|
|
156
|
+
control={<Radio />}
|
|
157
|
+
label={tab.name}
|
|
158
|
+
/>
|
|
159
|
+
))}
|
|
160
|
+
</RadioGroup>
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return (
|
|
165
|
+
<Box display='flex' flexDirection='column' gap={2}>
|
|
166
|
+
<Typography variant='h5'>{propsToUse.label}</Typography>
|
|
167
|
+
{searchCategoriesComp}
|
|
168
|
+
<TabContext value={currentTabId}>
|
|
169
|
+
<Tabs
|
|
170
|
+
style={{ display: 'none' }}
|
|
171
|
+
value={currentTabId}
|
|
172
|
+
onChange={(e, newValue) => setCurrentTabId(newValue)}
|
|
173
|
+
>
|
|
174
|
+
{tabItems.map((tab) => (
|
|
175
|
+
<Tab key={tab.id} label={tab.name} value={tab.id} />
|
|
176
|
+
))}
|
|
177
|
+
</Tabs>
|
|
178
|
+
{tabItems.map((tab) => (
|
|
179
|
+
<TabPanel style={{ padding: '0px' }} key={tab.id} value={tab.id}>
|
|
180
|
+
<div className='search-form'>{tab.content}</div>
|
|
181
|
+
</TabPanel>
|
|
182
|
+
))}
|
|
183
|
+
</TabContext>
|
|
184
|
+
<Dialog open={open} onClose={onDialogClose}>
|
|
185
|
+
<DialogTitle>
|
|
186
|
+
{getLocaleValue('Discard selections?', 'DataReference')}
|
|
187
|
+
</DialogTitle>
|
|
188
|
+
<DialogContent>
|
|
189
|
+
<div>
|
|
190
|
+
{getLocaleValue(
|
|
191
|
+
'When changing search categories, any previous selections will be lost.',
|
|
192
|
+
'DataReference',
|
|
193
|
+
)}
|
|
194
|
+
</div>
|
|
195
|
+
</DialogContent>
|
|
196
|
+
<DialogActions>
|
|
197
|
+
<Button onClick={onDialogClose} variant='outlined' color='primary'>
|
|
198
|
+
{getLocaleValue('Go back', 'ModalContainer')}
|
|
199
|
+
</Button>
|
|
200
|
+
<Button
|
|
201
|
+
onClick={clearSelectionAndSwitchTab}
|
|
202
|
+
variant='contained'
|
|
203
|
+
color='primary'
|
|
204
|
+
>
|
|
205
|
+
{getLocaleValue('Discard', 'ModalContainer')}
|
|
206
|
+
</Button>
|
|
207
|
+
</DialogActions>
|
|
208
|
+
</Dialog>
|
|
209
|
+
</Box>
|
|
210
|
+
);
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export default SearchForm;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DataReference';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
const isSelfReferencedProperty = (param, referenceProp) => {
|
|
2
|
+
const [, parentPropName] = param.split('.');
|
|
3
|
+
const referencePropParent = referenceProp?.split('.').pop();
|
|
4
|
+
return parentPropName === referencePropParent;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export function getFieldMeta(getPConnect, dataRelationshipContext) {
|
|
8
|
+
const pConn = getPConnect();
|
|
9
|
+
const { selectionMode, selectionList } = pConn.getConfigProps();
|
|
10
|
+
const { MULTI } = PCore.getConstants().LIST_SELECTION_MODE;
|
|
11
|
+
|
|
12
|
+
const isMultiSelectMode = selectionMode === MULTI;
|
|
13
|
+
|
|
14
|
+
const pageReference = pConn.getPageReference();
|
|
15
|
+
let referenceProp = isMultiSelectMode ? selectionList.substring(1) : pageReference.substring(pageReference.lastIndexOf('.') + 1);
|
|
16
|
+
// Replace here to use the context name instead
|
|
17
|
+
let contextPageReference = null;
|
|
18
|
+
if (dataRelationshipContext !== null && selectionMode === 'single') {
|
|
19
|
+
referenceProp = dataRelationshipContext;
|
|
20
|
+
contextPageReference = pageReference.concat('.').concat(referenceProp);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const fieldMetadata =
|
|
24
|
+
(isMultiSelectMode ? pConn.getFieldMetadata(`${referenceProp}`) : pConn.getCurrentPageFieldMetadata(contextPageReference)) ?? {};
|
|
25
|
+
const { datasource: { parameters: fieldParameters = {} } = {} } = fieldMetadata;
|
|
26
|
+
const compositeKeys: any = [];
|
|
27
|
+
Object.values(fieldParameters).forEach((param: any) => {
|
|
28
|
+
if (isSelfReferencedProperty(param, referenceProp)) compositeKeys.push(param.substring(param.lastIndexOf('.') + 1));
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return { compositeKeys, fieldMetadata };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* returns array of self-referenced properties of the datasource
|
|
36
|
+
* Ex: returns ["@P .DataRef.pyGUID", "@P .DataRef.customerID"]
|
|
37
|
+
*/
|
|
38
|
+
const getCompositeKeys = (pConnect, property) => {
|
|
39
|
+
const fieldMetadata = pConnect.getFieldMetadata(property) || {};
|
|
40
|
+
const { datasource: { parameters: fieldParameters = {} } = {} } = fieldMetadata;
|
|
41
|
+
const compositeKeys: any = [];
|
|
42
|
+
Object.values(fieldParameters).forEach(param => {
|
|
43
|
+
if (isSelfReferencedProperty(param, property)) {
|
|
44
|
+
compositeKeys.push(param);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return compositeKeys;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const getFirstChildConfig = ({
|
|
51
|
+
firstChildMeta,
|
|
52
|
+
getPConnect,
|
|
53
|
+
rawViewMetadata,
|
|
54
|
+
contextClass,
|
|
55
|
+
dataReferenceConfigToChild,
|
|
56
|
+
isCreateNewReferenceEnabled,
|
|
57
|
+
disableStartingFieldsForReference,
|
|
58
|
+
pyID
|
|
59
|
+
}) => {
|
|
60
|
+
const config = {
|
|
61
|
+
...firstChildMeta.config,
|
|
62
|
+
...dataReferenceConfigToChild
|
|
63
|
+
};
|
|
64
|
+
const compositeKeys = getCompositeKeys(getPConnect(), dataReferenceConfigToChild?.dataRelationshipContext);
|
|
65
|
+
return {
|
|
66
|
+
...config,
|
|
67
|
+
viewName: getPConnect().getCurrentView(),
|
|
68
|
+
referenceList: config.referenceList ?? rawViewMetadata.config.referenceList,
|
|
69
|
+
parameters: rawViewMetadata.config.parameters,
|
|
70
|
+
localeReference: rawViewMetadata.config.localeReference,
|
|
71
|
+
contextClass: config.contextClass || rawViewMetadata?.config?.contextClass || rawViewMetadata?.config?.targetObjectClass,
|
|
72
|
+
allowAddingNewRecords: firstChildMeta.type === 'SimpleTableSelect' && isCreateNewReferenceEnabled ? true : undefined,
|
|
73
|
+
actions: firstChildMeta.type === 'SimpleTableSelect' &&
|
|
74
|
+
isCreateNewReferenceEnabled && [
|
|
75
|
+
{
|
|
76
|
+
action: 'ADD_CASE',
|
|
77
|
+
config: {
|
|
78
|
+
label: '@L Add',
|
|
79
|
+
caseType: contextClass,
|
|
80
|
+
inputFields: disableStartingFieldsForReference
|
|
81
|
+
? {}
|
|
82
|
+
: {
|
|
83
|
+
[`.pyAddCaseContextPage.${pyID}`]: `@P .${pyID}`
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
compositeKeys
|
|
89
|
+
};
|
|
90
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.psdk-default-form-one-column {
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
4
|
+
gap: calc(1rem);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.psdk-default-form-two-column {
|
|
8
|
+
display: grid;
|
|
9
|
+
grid-template-columns: repeat(2, 1fr);
|
|
10
|
+
gap: calc(1rem);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.psdk-default-form-three-column {
|
|
14
|
+
display: grid;
|
|
15
|
+
grid-template-columns: repeat(3, 1fr);
|
|
16
|
+
gap: calc(1rem);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.psdk-default-form-three-column .grid-column {
|
|
20
|
+
grid-column: 1 / span 3;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.psdk-default-form-two-column .grid-column {
|
|
24
|
+
grid-column: 1 / span 2;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.psdk-default-form-one-column .grid-column {
|
|
28
|
+
grid-column: 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.psdk-default-form-instruction-text {
|
|
32
|
+
padding-top: 0.625rem;
|
|
33
|
+
padding-bottom: 0.625rem;
|
|
34
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { createElement, type PropsWithChildren } from 'react';
|
|
2
|
+
|
|
3
|
+
import { getInstructions } from '../../helpers/template-utils';
|
|
4
|
+
import { PConnectComponent } from '@pega/sdk-react';
|
|
5
|
+
import connectToState from '../../helpers/state-utils';
|
|
6
|
+
|
|
7
|
+
import { getKeyForMappedField, mapStateToProps } from './utils';
|
|
8
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
9
|
+
|
|
10
|
+
import './DefaultForm.css';
|
|
11
|
+
|
|
12
|
+
interface DefaultFormProps extends PConnProps {
|
|
13
|
+
// If any, enter additional props that only exist on this component
|
|
14
|
+
NumCols: string;
|
|
15
|
+
instructions: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const Child = connectToState(mapStateToProps)((props) => {
|
|
19
|
+
const { key, visibility, ...rest } = props;
|
|
20
|
+
|
|
21
|
+
return createElement(PConnectComponent, { ...rest, key, visibility });
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export default function DefaultForm(
|
|
25
|
+
props: PropsWithChildren<DefaultFormProps>,
|
|
26
|
+
) {
|
|
27
|
+
const { getPConnect, NumCols = '1' } = props;
|
|
28
|
+
const instructions = getInstructions(getPConnect(), props.instructions);
|
|
29
|
+
|
|
30
|
+
let divClass: string;
|
|
31
|
+
|
|
32
|
+
const numCols = NumCols || '1';
|
|
33
|
+
switch (numCols) {
|
|
34
|
+
case '1':
|
|
35
|
+
divClass = 'psdk-default-form-one-column';
|
|
36
|
+
break;
|
|
37
|
+
case '2':
|
|
38
|
+
divClass = 'psdk-default-form-two-column';
|
|
39
|
+
break;
|
|
40
|
+
case '3':
|
|
41
|
+
divClass = 'psdk-default-form-three-column';
|
|
42
|
+
break;
|
|
43
|
+
default:
|
|
44
|
+
divClass = 'psdk-default-form-one-column';
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// debugger;
|
|
49
|
+
|
|
50
|
+
// repoint the children because they are in a region and we need to not render the region
|
|
51
|
+
// to take the children and create components for them, put in an array and pass as the
|
|
52
|
+
// defaultForm kids
|
|
53
|
+
const arChildren = getPConnect().getChildren()[0].getPConnect().getChildren();
|
|
54
|
+
const dfChildren = arChildren?.map((kid) => (
|
|
55
|
+
<Child key={getKeyForMappedField(kid)} {...kid} />
|
|
56
|
+
));
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<>
|
|
60
|
+
{instructions && (
|
|
61
|
+
<div className='psdk-default-form-instruction-text'>
|
|
62
|
+
{/* server performs sanitization method for instructions html content */}
|
|
63
|
+
{}
|
|
64
|
+
<div
|
|
65
|
+
key='instructions'
|
|
66
|
+
id='instruction-text'
|
|
67
|
+
dangerouslySetInnerHTML={{ __html: instructions }}
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
)}
|
|
71
|
+
<div className={divClass}>{dfChildren}</div>
|
|
72
|
+
</>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DefaultForm';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const mapStateToProps: any = (_, ownProps) => {
|
|
2
|
+
const { getPConnect } = ownProps;
|
|
3
|
+
|
|
4
|
+
return {
|
|
5
|
+
visibility: getPConnect().getComputedVisibility(),
|
|
6
|
+
getPConnect
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const getKeyForMappedField = field => {
|
|
11
|
+
if (Array.isArray(field)) {
|
|
12
|
+
return field
|
|
13
|
+
.map(item => {
|
|
14
|
+
return getKeyForMappedField(item);
|
|
15
|
+
})
|
|
16
|
+
.join('__');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const pConnect = field?.getPConnect?.();
|
|
20
|
+
|
|
21
|
+
if (pConnect?.meta) {
|
|
22
|
+
return JSON.stringify(pConnect.meta);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return crypto.randomUUID();
|
|
26
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { useMemo, Children } from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import { Grid } from '@mui/material';
|
|
4
|
+
import { getComponentFromRegistry } from '@pega/sdk-react';
|
|
5
|
+
|
|
6
|
+
export interface CommonPageProps {
|
|
7
|
+
/** Page title */
|
|
8
|
+
title: string;
|
|
9
|
+
|
|
10
|
+
/** Page icon */
|
|
11
|
+
icon: string;
|
|
12
|
+
|
|
13
|
+
/** Region children */
|
|
14
|
+
children: ReactNode | ReactNode[];
|
|
15
|
+
|
|
16
|
+
/** Dynamic page pconnect object */
|
|
17
|
+
// getPConnect: () => PConnect;
|
|
18
|
+
|
|
19
|
+
/** Enable GetNextWork in page */
|
|
20
|
+
enableGetNextWork?: boolean;
|
|
21
|
+
|
|
22
|
+
/** GetAI coaches configured in page */
|
|
23
|
+
// coaches?: GenAICoach[];
|
|
24
|
+
|
|
25
|
+
/** Locale reference */
|
|
26
|
+
localeReference: string;
|
|
27
|
+
}
|
|
28
|
+
interface DefaultPageProps extends CommonPageProps {
|
|
29
|
+
/** Default page layout one or two columns */
|
|
30
|
+
layout: 'one-column' | 'two-column' | 'wide-narrow' | 'narrow-wide' | 'dynamic';
|
|
31
|
+
|
|
32
|
+
/** Flag to enable banner/hero */
|
|
33
|
+
enableBanner?: boolean;
|
|
34
|
+
|
|
35
|
+
/** Banner - Heading displayed */
|
|
36
|
+
heading?: string;
|
|
37
|
+
|
|
38
|
+
/** Banner - Message displayed */
|
|
39
|
+
message?: string;
|
|
40
|
+
|
|
41
|
+
/** Banner - Theme of the image */
|
|
42
|
+
imageTheme?: 'light' | 'dark' | undefined;
|
|
43
|
+
|
|
44
|
+
/** Banner - Background image */
|
|
45
|
+
backgroundImage?: string;
|
|
46
|
+
|
|
47
|
+
/** Banner - Background color */
|
|
48
|
+
backgroundColor?: string;
|
|
49
|
+
|
|
50
|
+
/** Banner - Tint image */
|
|
51
|
+
tintImage?: boolean;
|
|
52
|
+
|
|
53
|
+
/** Flag to enable layout model */
|
|
54
|
+
// layoutModel?: GridLayoutModel | undefined;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const COLUMNS_WIDTHS = {
|
|
58
|
+
'one-column': [12],
|
|
59
|
+
'two-column': [6, 6],
|
|
60
|
+
'narrow-wide': [4, 8],
|
|
61
|
+
'wide-narrow': [8, 4]
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default function DefaultPage({
|
|
65
|
+
layout = 'one-column',
|
|
66
|
+
children,
|
|
67
|
+
enableBanner,
|
|
68
|
+
heading = '',
|
|
69
|
+
message = '',
|
|
70
|
+
imageTheme,
|
|
71
|
+
backgroundImage = '',
|
|
72
|
+
backgroundColor = '',
|
|
73
|
+
tintImage
|
|
74
|
+
}: DefaultPageProps) {
|
|
75
|
+
const Banner = getComponentFromRegistry('Banner');
|
|
76
|
+
|
|
77
|
+
const childArray = useMemo(() => {
|
|
78
|
+
return Children.toArray(children);
|
|
79
|
+
}, [children]);
|
|
80
|
+
|
|
81
|
+
if (enableBanner) {
|
|
82
|
+
return (
|
|
83
|
+
<Banner
|
|
84
|
+
variant={layout === 'one-column' ? 'two-column' : layout}
|
|
85
|
+
a={[childArray[0]]}
|
|
86
|
+
b={[childArray[1]]}
|
|
87
|
+
banner={{
|
|
88
|
+
variant: imageTheme,
|
|
89
|
+
backgroundColor,
|
|
90
|
+
title: heading,
|
|
91
|
+
message,
|
|
92
|
+
backgroundImage,
|
|
93
|
+
tintImage
|
|
94
|
+
}}
|
|
95
|
+
/>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<Grid container spacing={1}>
|
|
101
|
+
{childArray.map((child, index) => (
|
|
102
|
+
<Grid key={index} size={COLUMNS_WIDTHS[layout][index]}>
|
|
103
|
+
{child}
|
|
104
|
+
</Grid>
|
|
105
|
+
))}
|
|
106
|
+
</Grid>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DefaultPage';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import Grid from '@mui/material/Grid';
|
|
3
|
+
|
|
4
|
+
import { getComponentFromRegistry, PConnectComponent } from '@pega/sdk-react';
|
|
5
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
6
|
+
|
|
7
|
+
interface DetailsProps extends PConnProps {
|
|
8
|
+
// If any, enter additional props that only exist on this component
|
|
9
|
+
label: string;
|
|
10
|
+
showLabel: boolean;
|
|
11
|
+
showHighlightedData: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default function Details(props: DetailsProps) {
|
|
15
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
16
|
+
const FieldGroup = getComponentFromRegistry('FieldGroup');
|
|
17
|
+
|
|
18
|
+
const { label, showLabel, getPConnect, showHighlightedData } = props;
|
|
19
|
+
|
|
20
|
+
// Get the inherited props from the parent to determine label settings
|
|
21
|
+
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
22
|
+
|
|
23
|
+
// Set display mode prop and re-create the children so this part of the dom tree renders
|
|
24
|
+
// in a readonly (display) mode instead of a editable
|
|
25
|
+
getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
26
|
+
getPConnect().setInheritedProp('readOnly', true);
|
|
27
|
+
const children = (getPConnect().getChildren() as any[]).map(
|
|
28
|
+
(configObject, index) =>
|
|
29
|
+
createElement(PConnectComponent, {
|
|
30
|
+
...configObject,
|
|
31
|
+
|
|
32
|
+
key: index.toString(),
|
|
33
|
+
}),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
// Set up highlighted data to pass in return if is set to show, need raw metadata to pass to createComponent
|
|
37
|
+
let highlightedDataArr = [];
|
|
38
|
+
if (showHighlightedData) {
|
|
39
|
+
const { highlightedData = [] } = (getPConnect().getRawMetadata() as any)
|
|
40
|
+
.config;
|
|
41
|
+
highlightedDataArr = highlightedData.map((field) => {
|
|
42
|
+
field.config.displayMode = 'STACKED_LARGE_VAL';
|
|
43
|
+
|
|
44
|
+
// Mark as status display when using pyStatusWork
|
|
45
|
+
if (field.config.value === '@P .pyStatusWork') {
|
|
46
|
+
field.type = 'TextInput';
|
|
47
|
+
field.config.displayAsStatus = true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return getPConnect().createComponent(field, '', 0, {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
|
|
56
|
+
{showHighlightedData && highlightedDataArr.length > 0 && (
|
|
57
|
+
<Grid container spacing={1} style={{ padding: '0 0 1em' }}>
|
|
58
|
+
{highlightedDataArr.map((child, i) => (
|
|
59
|
+
<Grid size={{ xs: 12 }} key={`hf-${i + 1}`}>
|
|
60
|
+
{child}
|
|
61
|
+
</Grid>
|
|
62
|
+
))}
|
|
63
|
+
</Grid>
|
|
64
|
+
)}
|
|
65
|
+
<Grid container spacing={1}>
|
|
66
|
+
{children.map((child, i) => (
|
|
67
|
+
<Grid size={{ xs: 12 }} key={`r-${i + 1}`}>
|
|
68
|
+
{child}
|
|
69
|
+
</Grid>
|
|
70
|
+
))}
|
|
71
|
+
</Grid>
|
|
72
|
+
</FieldGroup>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Details';
|