@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 @@
|
|
|
1
|
+
export { default } from './SimpleTableManual';
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { getComponentFromRegistry } from '@pega/sdk-react';
|
|
2
|
+
|
|
3
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
4
|
+
|
|
5
|
+
interface SimpleTableSelectProps extends PConnProps {
|
|
6
|
+
// If any, enter additional props that only exist on this component
|
|
7
|
+
label: string;
|
|
8
|
+
referenceList: object[] | string;
|
|
9
|
+
renderMode: string;
|
|
10
|
+
showLabel: boolean;
|
|
11
|
+
promptedFilters: object[];
|
|
12
|
+
viewName: string;
|
|
13
|
+
parameters: any;
|
|
14
|
+
readonlyContextList: object[] | string;
|
|
15
|
+
dataRelationshipContext: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const isSelfReferencedProperty = (param, referenceProp) => {
|
|
19
|
+
const [, parentPropName] = param.split('.');
|
|
20
|
+
return parentPropName === referenceProp;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* SimpleTable react component
|
|
25
|
+
* @param {*} props - props
|
|
26
|
+
*/
|
|
27
|
+
export default function SimpleTableSelect(props: SimpleTableSelectProps) {
|
|
28
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
29
|
+
const ListView = getComponentFromRegistry('ListView');
|
|
30
|
+
const SimpleTable = getComponentFromRegistry('SimpleTable');
|
|
31
|
+
const PromotedFilters = getComponentFromRegistry('PromotedFilters');
|
|
32
|
+
|
|
33
|
+
const { label, getPConnect, renderMode = '', showLabel = true, viewName = '', parameters, dataRelationshipContext = null } = props;
|
|
34
|
+
|
|
35
|
+
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
36
|
+
if (propsToUse.showLabel === false) {
|
|
37
|
+
propsToUse.label = '';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const pConn = getPConnect();
|
|
41
|
+
const { MULTI } = PCore.getConstants().LIST_SELECTION_MODE;
|
|
42
|
+
const { selectionMode, selectionList } = pConn.getConfigProps() as any;
|
|
43
|
+
const isMultiSelectMode = selectionMode === MULTI;
|
|
44
|
+
|
|
45
|
+
if (isMultiSelectMode && renderMode === 'ReadOnly') {
|
|
46
|
+
return <SimpleTable {...props} showLabel={propsToUse.showLabel} />;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const pageReference = pConn.getPageReference();
|
|
50
|
+
let referenceProp = isMultiSelectMode ? selectionList.substring(1) : pageReference.substring(pageReference.lastIndexOf('.') + 1);
|
|
51
|
+
// Replace here to use the context name instead
|
|
52
|
+
let contextPageReference: string | null = null;
|
|
53
|
+
if (props.dataRelationshipContext !== null && selectionMode === 'single') {
|
|
54
|
+
referenceProp = dataRelationshipContext;
|
|
55
|
+
contextPageReference = pageReference.concat('.').concat(referenceProp);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Need to get this written so typedefs work
|
|
59
|
+
const { datasource: { parameters: fieldParameters = {} } = {}, pageClass } = isMultiSelectMode
|
|
60
|
+
? pConn.getFieldMetadata(`@P .${referenceProp}`)
|
|
61
|
+
: pConn.getCurrentPageFieldMetadata(contextPageReference);
|
|
62
|
+
|
|
63
|
+
const compositeKeys: any[] = [];
|
|
64
|
+
Object.values(fieldParameters).forEach((param: any) => {
|
|
65
|
+
if (isSelfReferencedProperty(param, referenceProp)) {
|
|
66
|
+
compositeKeys.push(param.substring(param.lastIndexOf('.') + 1));
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// setting default row height for select table
|
|
71
|
+
const defaultRowHeight = '2';
|
|
72
|
+
|
|
73
|
+
const additionalTableConfig = {
|
|
74
|
+
rowDensity: false,
|
|
75
|
+
enableFreezeColumns: false,
|
|
76
|
+
autoSizeColumns: false,
|
|
77
|
+
resetColumnWidths: false,
|
|
78
|
+
defaultFieldDef: {
|
|
79
|
+
showMenu: false,
|
|
80
|
+
noContextMenu: true,
|
|
81
|
+
grouping: false
|
|
82
|
+
},
|
|
83
|
+
itemKey: '$key',
|
|
84
|
+
defaultRowHeight
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const listViewProps = {
|
|
88
|
+
...props,
|
|
89
|
+
title: propsToUse.label,
|
|
90
|
+
personalization: false,
|
|
91
|
+
grouping: false,
|
|
92
|
+
expandGroups: false,
|
|
93
|
+
reorderFields: false,
|
|
94
|
+
showHeaderIcons: false,
|
|
95
|
+
editing: false,
|
|
96
|
+
globalSearch: true,
|
|
97
|
+
toggleFieldVisibility: false,
|
|
98
|
+
basicMode: true,
|
|
99
|
+
additionalTableConfig,
|
|
100
|
+
compositeKeys,
|
|
101
|
+
viewName,
|
|
102
|
+
parameters
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const filters = (getPConnect().getRawMetadata() as any).config.promotedFilters ?? [];
|
|
106
|
+
|
|
107
|
+
const isSearchable = filters.length > 0;
|
|
108
|
+
|
|
109
|
+
if (isSearchable) {
|
|
110
|
+
return (
|
|
111
|
+
<PromotedFilters
|
|
112
|
+
getPConnect={getPConnect}
|
|
113
|
+
viewName={viewName}
|
|
114
|
+
filters={filters}
|
|
115
|
+
listViewProps={listViewProps}
|
|
116
|
+
pageClass={pageClass}
|
|
117
|
+
parameters={parameters}
|
|
118
|
+
/>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
return <ListView {...listViewProps} />;
|
|
122
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './SimpleTableSelect';
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { createElement, Fragment, useState } from 'react';
|
|
2
|
+
import Button from '@mui/material/Button';
|
|
3
|
+
import Dialog from '@mui/material/Dialog';
|
|
4
|
+
import DialogActions from '@mui/material/DialogActions';
|
|
5
|
+
import DialogContent from '@mui/material/DialogContent';
|
|
6
|
+
import DialogTitle from '@mui/material/DialogTitle';
|
|
7
|
+
import Link from '@mui/material/Link';
|
|
8
|
+
import Typography from '@mui/material/Typography';
|
|
9
|
+
|
|
10
|
+
import { getComponentFromRegistry, PConnectComponent } from '@pega/sdk-react';
|
|
11
|
+
import { Utils } from '../../../helpers/utils';
|
|
12
|
+
import { SIMPLE_TABLE_MANUAL_READONLY } from '../../../field/ObjectReference/utils';
|
|
13
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
14
|
+
|
|
15
|
+
interface SimpleTableSelectReadonlyProps extends PConnProps {
|
|
16
|
+
label?: string;
|
|
17
|
+
referenceList: object[] | string;
|
|
18
|
+
readonlyContextList?: object[];
|
|
19
|
+
primaryField?: string;
|
|
20
|
+
referenceType?: string;
|
|
21
|
+
selectionKey?: string;
|
|
22
|
+
selectionList?: string;
|
|
23
|
+
hideLabel?: boolean;
|
|
24
|
+
variant?: string;
|
|
25
|
+
displayAs?: string;
|
|
26
|
+
displayMode?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default function SimpleTableSelectReadonly(
|
|
30
|
+
props: SimpleTableSelectReadonlyProps,
|
|
31
|
+
) {
|
|
32
|
+
const {
|
|
33
|
+
label = '',
|
|
34
|
+
getPConnect,
|
|
35
|
+
readonlyContextList = [],
|
|
36
|
+
primaryField = '',
|
|
37
|
+
referenceType = '',
|
|
38
|
+
selectionKey = '',
|
|
39
|
+
selectionList = '',
|
|
40
|
+
hideLabel = false,
|
|
41
|
+
displayAs = 'readonly',
|
|
42
|
+
displayMode,
|
|
43
|
+
} = props;
|
|
44
|
+
|
|
45
|
+
const [modalOpen, setModalOpen] = useState(false);
|
|
46
|
+
|
|
47
|
+
const { DATA, CASE } = PCore.getConstants().RESOURCE_TYPES;
|
|
48
|
+
const pConn = getPConnect();
|
|
49
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
50
|
+
const localeCategory = 'SimpleTableSelectReadOnly';
|
|
51
|
+
const PComponent = PConnectComponent;
|
|
52
|
+
|
|
53
|
+
const openModal = () => {
|
|
54
|
+
const rawConfig = (getPConnect().getRawMetadata() as any).config;
|
|
55
|
+
const rawFields = rawConfig?.presets?.[0].children?.[0]?.children || [];
|
|
56
|
+
|
|
57
|
+
const caseFields = rawFields
|
|
58
|
+
.filter(
|
|
59
|
+
(field: any) =>
|
|
60
|
+
field.config.value.includes(`@P .${Utils.getMappedKey('pyID')}`) ||
|
|
61
|
+
field.config.value.includes(`@P ${primaryField}`),
|
|
62
|
+
)
|
|
63
|
+
.map((field: any) => field.config.value);
|
|
64
|
+
|
|
65
|
+
const dataFields = rawFields
|
|
66
|
+
.filter((field: any) => field.config.value.includes(`@P ${primaryField}`))
|
|
67
|
+
.map((field: any) => field.config.value);
|
|
68
|
+
|
|
69
|
+
const defaultFields: any[] = rawConfig?.detailsDisplay || [];
|
|
70
|
+
if (
|
|
71
|
+
defaultFields?.length === 2 &&
|
|
72
|
+
defaultFields[0].config.value === defaultFields[1].config.value
|
|
73
|
+
) {
|
|
74
|
+
defaultFields.splice(0, 1);
|
|
75
|
+
}
|
|
76
|
+
defaultFields.forEach((field: any) => {
|
|
77
|
+
if (
|
|
78
|
+
(referenceType.toUpperCase() === CASE &&
|
|
79
|
+
!caseFields.includes(field?.config?.value)) ||
|
|
80
|
+
(referenceType.toUpperCase() === DATA &&
|
|
81
|
+
!dataFields.includes(field?.config?.value))
|
|
82
|
+
) {
|
|
83
|
+
(
|
|
84
|
+
getPConnect().getRawMetadata() as any
|
|
85
|
+
).config?.presets?.[0].children?.[0]?.children?.unshift(field);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
setModalOpen(true);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const closeModal = () => {
|
|
93
|
+
setModalOpen(false);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const renderModal = () => {
|
|
97
|
+
const SimpleTableManual = getComponentFromRegistry('SimpleTableManual');
|
|
98
|
+
|
|
99
|
+
let readonlyContextObject: { referenceList?: object[] } | undefined;
|
|
100
|
+
if (typeof props.referenceList === 'string') {
|
|
101
|
+
readonlyContextObject = { referenceList: readonlyContextList };
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<Dialog open={modalOpen} onClose={closeModal} maxWidth='md' fullWidth>
|
|
106
|
+
<DialogTitle>{label}</DialogTitle>
|
|
107
|
+
<DialogContent>
|
|
108
|
+
<SimpleTableManual
|
|
109
|
+
{...props}
|
|
110
|
+
{...readonlyContextObject}
|
|
111
|
+
classId={SIMPLE_TABLE_MANUAL_READONLY}
|
|
112
|
+
/>
|
|
113
|
+
</DialogContent>
|
|
114
|
+
<DialogActions>
|
|
115
|
+
<Button onClick={closeModal} variant='contained'>
|
|
116
|
+
{localizedVal('Close', localeCategory)}
|
|
117
|
+
</Button>
|
|
118
|
+
</DialogActions>
|
|
119
|
+
</Dialog>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
let displayComp: any;
|
|
124
|
+
|
|
125
|
+
if (readonlyContextList && readonlyContextList.length > 0) {
|
|
126
|
+
const listLength = readonlyContextList.length;
|
|
127
|
+
const filteredList = ['combobox', 'checkboxgroup'].includes(displayAs)
|
|
128
|
+
? readonlyContextList
|
|
129
|
+
: readonlyContextList.slice(0, 5);
|
|
130
|
+
|
|
131
|
+
displayComp = (
|
|
132
|
+
<div>
|
|
133
|
+
{filteredList.map((child: any, index: number) => {
|
|
134
|
+
const selectionKeyProp = selectionKey.substring(1);
|
|
135
|
+
const primaryFieldProp = primaryField?.substring(1);
|
|
136
|
+
const selectionListProp = selectionList?.substring(1);
|
|
137
|
+
const referenceLabel = child[primaryFieldProp] || '';
|
|
138
|
+
|
|
139
|
+
let resourcePayload = {};
|
|
140
|
+
let resourceParams = {};
|
|
141
|
+
let previewKey = '';
|
|
142
|
+
|
|
143
|
+
if (referenceType.toUpperCase() === CASE) {
|
|
144
|
+
previewKey = child[Utils.getMappedKey('pzInsKey')];
|
|
145
|
+
resourcePayload = { caseClassName: child.classID };
|
|
146
|
+
resourceParams = { workID: child[selectionKeyProp] };
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const metadata = {
|
|
150
|
+
type: 'SemanticLink',
|
|
151
|
+
config: {
|
|
152
|
+
text: referenceLabel,
|
|
153
|
+
resourceParams,
|
|
154
|
+
resourcePayload,
|
|
155
|
+
previewKey,
|
|
156
|
+
referenceType,
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const childPConnectConfig = PCore.createPConnect({
|
|
161
|
+
meta: metadata,
|
|
162
|
+
options: {
|
|
163
|
+
context: pConn.getContextName(),
|
|
164
|
+
pageReference: `${pConn.getPageReference()}.${selectionListProp}[${index}]`,
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<Fragment key={child[selectionKeyProp]}>
|
|
170
|
+
{createElement(PComponent, { ...childPConnectConfig })}
|
|
171
|
+
{index + 1 !== filteredList.length && ', '}
|
|
172
|
+
</Fragment>
|
|
173
|
+
);
|
|
174
|
+
})}
|
|
175
|
+
{listLength > 5 &&
|
|
176
|
+
!['combobox', 'checkboxgroup'].includes(displayAs) && (
|
|
177
|
+
<Link component='button' onClick={openModal} underline='hover'>
|
|
178
|
+
({listLength} {localizedVal('Total', localeCategory)})
|
|
179
|
+
</Link>
|
|
180
|
+
)}
|
|
181
|
+
</div>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
186
|
+
return displayComp ?? <Typography variant='body2'>---</Typography>;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return (
|
|
190
|
+
<div
|
|
191
|
+
style={{
|
|
192
|
+
display: 'flex',
|
|
193
|
+
flexDirection: 'row',
|
|
194
|
+
alignItems: 'baseline',
|
|
195
|
+
gap: '0.5rem',
|
|
196
|
+
}}
|
|
197
|
+
>
|
|
198
|
+
{!hideLabel && label && (
|
|
199
|
+
<Typography variant='body2' color='text.secondary'>
|
|
200
|
+
{label}
|
|
201
|
+
</Typography>
|
|
202
|
+
)}
|
|
203
|
+
{displayComp}
|
|
204
|
+
{renderModal()}
|
|
205
|
+
</div>
|
|
206
|
+
);
|
|
207
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './SimpleTableSelectReadonly';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { FormControl, FormLabel } from '@mui/material';
|
|
2
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
3
|
+
|
|
4
|
+
interface SingleReferenceReadOnlyProps extends PConnProps {
|
|
5
|
+
// If any, enter additional props that only exist on this component
|
|
6
|
+
config: any;
|
|
7
|
+
displayAs?: string;
|
|
8
|
+
ruleClass?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
displayMode?: string;
|
|
11
|
+
type: string;
|
|
12
|
+
referenceType?: string;
|
|
13
|
+
hideLabel?: boolean;
|
|
14
|
+
dataRelationshipContext?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default function SingleReferenceReadOnly(props: SingleReferenceReadOnlyProps) {
|
|
18
|
+
const {
|
|
19
|
+
getPConnect,
|
|
20
|
+
displayAs = '',
|
|
21
|
+
ruleClass = '',
|
|
22
|
+
label = '',
|
|
23
|
+
type = '',
|
|
24
|
+
displayMode = '',
|
|
25
|
+
referenceType = '',
|
|
26
|
+
hideLabel = false,
|
|
27
|
+
dataRelationshipContext = null,
|
|
28
|
+
config
|
|
29
|
+
} = props;
|
|
30
|
+
|
|
31
|
+
const editableComponents = ['AutoComplete', 'SimpleTableSelect', 'Dropdown'];
|
|
32
|
+
|
|
33
|
+
if (editableComponents.includes(type)) {
|
|
34
|
+
config.caseClass = ruleClass;
|
|
35
|
+
config.text = config.primaryField;
|
|
36
|
+
config.caseID = config.value;
|
|
37
|
+
config.contextPage = `@P .${dataRelationshipContext}`;
|
|
38
|
+
config.resourceParams = {
|
|
39
|
+
workID: displayAs === 'table' ? config.selectionKey : config.value
|
|
40
|
+
};
|
|
41
|
+
config.resourcePayload = {
|
|
42
|
+
caseClassName: ruleClass
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const component = getPConnect().createComponent(
|
|
47
|
+
{
|
|
48
|
+
type: 'SemanticLink',
|
|
49
|
+
config: {
|
|
50
|
+
...config,
|
|
51
|
+
label,
|
|
52
|
+
displayMode,
|
|
53
|
+
referenceType,
|
|
54
|
+
hideLabel,
|
|
55
|
+
dataRelationshipContext
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
'',
|
|
59
|
+
0,
|
|
60
|
+
{}
|
|
61
|
+
); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<>
|
|
65
|
+
<FormControl variant='standard' sx={{ display: 'flex', flexDirection: 'row' }}>
|
|
66
|
+
<FormLabel sx={{ marginRight: '2rem' }}>{label}</FormLabel>
|
|
67
|
+
{component}
|
|
68
|
+
</FormControl>
|
|
69
|
+
</>
|
|
70
|
+
);
|
|
71
|
+
}
|
package/templates/react-sdk-reference/src/components/template/SingleReferenceReadOnly/index.tsx
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './SingleReferenceReadOnly';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Children, type PropsWithChildren, useEffect, useState } from 'react';
|
|
2
|
+
import { Tab, Tabs } from '@mui/material';
|
|
3
|
+
import { TabContext, TabPanel } from '@mui/lab';
|
|
4
|
+
|
|
5
|
+
import { getTransientTabs, getVisibleTabs, tabClick } from './tabUtils';
|
|
6
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
7
|
+
|
|
8
|
+
interface SubTabsProps extends PConnProps {
|
|
9
|
+
// If any, enter additional props that only exist on this component
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default function SubTabs(props: PropsWithChildren<SubTabsProps>) {
|
|
13
|
+
const { children = [] } = props;
|
|
14
|
+
|
|
15
|
+
const defaultTabIndex = 0;
|
|
16
|
+
const deferLoadedTabs = Children.toArray(children)[0];
|
|
17
|
+
const availableTabs = getVisibleTabs(deferLoadedTabs, 'tabsSubs');
|
|
18
|
+
const [currentTabId, setCurrentTabId] = useState(defaultTabIndex.toString());
|
|
19
|
+
|
|
20
|
+
const [tabItems, setTabitem] = useState<any[]>([]);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const tempTabItems = getTransientTabs(availableTabs, currentTabId, tabItems);
|
|
23
|
+
setTabitem(tempTabItems);
|
|
24
|
+
}, [currentTabId]);
|
|
25
|
+
|
|
26
|
+
const handleTabClick = (id, index: string) => {
|
|
27
|
+
setCurrentTabId(index);
|
|
28
|
+
tabClick(index, availableTabs, currentTabId, setCurrentTabId, tabItems);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<TabContext value={currentTabId.toString()}>
|
|
33
|
+
<Tabs onChange={handleTabClick} value={currentTabId} variant='scrollable'>
|
|
34
|
+
{tabItems.map((tab: any) => (
|
|
35
|
+
<Tab key={tab.id} label={tab.name} value={tab.id} />
|
|
36
|
+
))}
|
|
37
|
+
</Tabs>
|
|
38
|
+
|
|
39
|
+
{tabItems.map((tab: any) => (
|
|
40
|
+
<TabPanel key={tab.id} value={tab.id} tabIndex={+tab.id}>
|
|
41
|
+
<div>{tab.content ? tab.content : 'No content exists'}</div>
|
|
42
|
+
</TabPanel>
|
|
43
|
+
))}
|
|
44
|
+
</TabContext>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './SubTabs';
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
export const getDeferFriendlyTabs = allTabs => {
|
|
2
|
+
return allTabs.map(tab => {
|
|
3
|
+
const theTabCompConfig = tab.getPConnect().getConfigProps();
|
|
4
|
+
return { type: 'DeferLoad', config: theTabCompConfig };
|
|
5
|
+
});
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const getVisibleTabs = (allTabs, uuid) => {
|
|
9
|
+
let index = 0;
|
|
10
|
+
return allTabs.props
|
|
11
|
+
.getPConnect()
|
|
12
|
+
.getChildren()
|
|
13
|
+
?.filter(child => {
|
|
14
|
+
// US-402838: Filter out tab entries if the config object does not contain the visibility attribute or it evaluates to the boolean true,
|
|
15
|
+
const config = child.getPConnect().getConfigProps();
|
|
16
|
+
|
|
17
|
+
// BUG-642335 - adding isChildDeferLoad prop
|
|
18
|
+
if (child.getPConnect().getComponentName() === 'DeferLoad') {
|
|
19
|
+
const { name: viewName, deferLoadId = `${viewName}_${uuid}_${index}` } = config;
|
|
20
|
+
child.getPConnect().registerAdditionalProps({
|
|
21
|
+
deferLoadId,
|
|
22
|
+
isChildDeferLoad: true,
|
|
23
|
+
lastUpdateCaseTime: '@P caseInfo.lastUpdateTime'
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
index += 1;
|
|
27
|
+
return !('visibility' in config) || config.visibility === true;
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const getTransientTabs = (availableTabs, currentTabId, tabItems) => {
|
|
32
|
+
return (
|
|
33
|
+
availableTabs?.map((child, i) => {
|
|
34
|
+
const config = child.getPConnect().getConfigProps();
|
|
35
|
+
const tabLabel =
|
|
36
|
+
config.label ||
|
|
37
|
+
config.inheritedProps?.find(obj => obj.prop === 'label')?.value ||
|
|
38
|
+
PCore.getLocaleUtils().getLocaleValue('No label specified in config', 'Generic');
|
|
39
|
+
const tabContent = () => {
|
|
40
|
+
if (i.toString() === currentTabId) {
|
|
41
|
+
return tabItems?.[i.toString()]?.content ? tabItems?.[i.toString()]?.content : child.getPConnect().getComponent();
|
|
42
|
+
}
|
|
43
|
+
return tabItems?.[i.toString()]?.content;
|
|
44
|
+
};
|
|
45
|
+
return {
|
|
46
|
+
name: tabLabel,
|
|
47
|
+
id: i.toString(),
|
|
48
|
+
content: tabContent()
|
|
49
|
+
};
|
|
50
|
+
}) || []
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const tabClick = (id, availableTabs, currentTabId, setCurrentTabId, tabItems) => {
|
|
55
|
+
const currentPConn = availableTabs[currentTabId].getPConnect();
|
|
56
|
+
const { deferLoadId } = currentPConn.getConfigProps();
|
|
57
|
+
PCore.getDeferLoadManager().deactivate(deferLoadId, currentPConn.getContextName());
|
|
58
|
+
|
|
59
|
+
setCurrentTabId(id);
|
|
60
|
+
const index = parseInt(id, 10);
|
|
61
|
+
if (tabItems[index]?.content === null) {
|
|
62
|
+
tabItems[index].content = availableTabs[index].getPConnect().getComponent();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const nextPConn = availableTabs[id].getPConnect();
|
|
66
|
+
const { deferLoadId: activeId } = nextPConn?.getConfigProps() || {};
|
|
67
|
+
PCore.getDeferLoadManager().activate(activeId, nextPConn?.getContextName());
|
|
68
|
+
PCore.getDeferLoadManager().refreshComponent(activeId, nextPConn?.getContextName());
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const searchtabsClick = (id, mainTabs, currentTabId, setCurrentTabId) => {
|
|
72
|
+
const currentTab = mainTabs.find(item => item.id === currentTabId && item.visibility());
|
|
73
|
+
const currentPConn = currentTab?.getPConnect();
|
|
74
|
+
const { deferLoadId } = currentPConn?.getConfigProps() ?? {};
|
|
75
|
+
PCore.getDeferLoadManager().deactivate(deferLoadId, currentPConn.getContextName());
|
|
76
|
+
|
|
77
|
+
setCurrentTabId(id);
|
|
78
|
+
const nextActiveTab = mainTabs.find(item => item.id === id && item.visibility());
|
|
79
|
+
if (mainTabs && nextActiveTab?.content === null) {
|
|
80
|
+
nextActiveTab.content = nextActiveTab.getPConnect().getComponent();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const nextPConn = nextActiveTab.getPConnect();
|
|
84
|
+
const { deferLoadId: activeId } = nextPConn.getConfigProps();
|
|
85
|
+
PCore.getDeferLoadManager().activate(activeId, nextPConn.getContextName());
|
|
86
|
+
PCore.getDeferLoadManager().refreshComponent(activeId, nextPConn.getContextName());
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const getTabLabel = tabPConnect => {
|
|
90
|
+
const config = tabPConnect.getConfigProps();
|
|
91
|
+
|
|
92
|
+
const label = config.inheritedProps?.find(obj => obj.prop === 'label')?.value;
|
|
93
|
+
|
|
94
|
+
if (label) {
|
|
95
|
+
return label;
|
|
96
|
+
}
|
|
97
|
+
if (config.label) {
|
|
98
|
+
return config.label;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (tabPConnect.getReferencedView()?.config?.label) {
|
|
102
|
+
return tabPConnect.getReferencedView()?.config?.label;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return PCore.getLocaleUtils().getLocaleValue('No label specified in config', 'Generic');
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const getActiveTabId = (mainTabs, currentTabId) => {
|
|
109
|
+
let firstVisibleTabId = null;
|
|
110
|
+
let updatedActiveId = currentTabId;
|
|
111
|
+
let isCurrentTabFound = false;
|
|
112
|
+
|
|
113
|
+
if (!mainTabs?.length) {
|
|
114
|
+
return updatedActiveId;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
for (let i = 0; i < mainTabs.length; i += 1) {
|
|
118
|
+
const tab = mainTabs[i];
|
|
119
|
+
const tabConfig = tab.getPConnect().getConfigProps();
|
|
120
|
+
const tabId = tab?.id || `${tab.getPConnect().viewName}-${tabConfig.name || getTabLabel(tab.getPConnect())}-${i}`;
|
|
121
|
+
const isTabVisible = !Object.hasOwn(tabConfig, 'visibility') || tabConfig.visibility === true;
|
|
122
|
+
if (isTabVisible && !firstVisibleTabId) {
|
|
123
|
+
firstVisibleTabId = tabId;
|
|
124
|
+
if (isCurrentTabFound) {
|
|
125
|
+
updatedActiveId = firstVisibleTabId;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (tabId === currentTabId) {
|
|
130
|
+
isCurrentTabFound = true;
|
|
131
|
+
if (isTabVisible) {
|
|
132
|
+
break;
|
|
133
|
+
} else if (firstVisibleTabId) {
|
|
134
|
+
updatedActiveId = firstVisibleTabId;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return updatedActiveId;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
*
|
|
143
|
+
* @param {*} deferLoadedTabs list of deferLoadedTabs
|
|
144
|
+
* @param {string} tabViewName (optional) if provided, tabId of the given tabView will be returned
|
|
145
|
+
* @returns {string} a tab id is returned
|
|
146
|
+
*/
|
|
147
|
+
export const getFirstVisibleTabId = (deferLoadedTabs, tabViewName) => {
|
|
148
|
+
let tabIndex = 0;
|
|
149
|
+
|
|
150
|
+
const viewName = deferLoadedTabs?.props?.getPConnect()?.options?.viewName;
|
|
151
|
+
|
|
152
|
+
const deferTabsChildren = deferLoadedTabs.props.getPConnect().getChildren();
|
|
153
|
+
if (tabViewName) {
|
|
154
|
+
const firstVisibleTab = deferTabsChildren?.find((item, index) => {
|
|
155
|
+
const tabConfig = item.getPConnect().getConfigProps();
|
|
156
|
+
if (tabViewName === tabConfig.name) {
|
|
157
|
+
tabIndex = index;
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
return false;
|
|
161
|
+
});
|
|
162
|
+
const tabConfig = firstVisibleTab.getPConnect().getConfigProps();
|
|
163
|
+
|
|
164
|
+
return `${viewName}-${tabConfig.name || getTabLabel(firstVisibleTab.getPConnect())}-${tabIndex}`;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const firstVisibleTab = deferLoadedTabs.props
|
|
168
|
+
.getPConnect()
|
|
169
|
+
.getChildren()
|
|
170
|
+
?.find((item, index) => {
|
|
171
|
+
const tabConfig = item.getPConnect().getConfigProps();
|
|
172
|
+
if (!('visibility' in tabConfig) || tabConfig.visibility === true) {
|
|
173
|
+
tabIndex = index;
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
return false;
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
if (!firstVisibleTab) {
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const tabConfig = firstVisibleTab.getPConnect().getConfigProps();
|
|
184
|
+
return `${viewName}-${tabConfig.name || getTabLabel(firstVisibleTab.getPConnect())}-${tabIndex}`;
|
|
185
|
+
};
|