@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,293 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useState,
|
|
3
|
+
useEffect,
|
|
4
|
+
useMemo,
|
|
5
|
+
useCallback,
|
|
6
|
+
useRef,
|
|
7
|
+
Children,
|
|
8
|
+
type PropsWithChildren,
|
|
9
|
+
type SyntheticEvent,
|
|
10
|
+
} from 'react';
|
|
11
|
+
|
|
12
|
+
import { useGetTabsCount } from '@pega/sdk-react';
|
|
13
|
+
import {
|
|
14
|
+
searchtabsClick as tabClick,
|
|
15
|
+
getActiveTabId,
|
|
16
|
+
getFirstVisibleTabId,
|
|
17
|
+
} from '../SubTabs/tabUtils';
|
|
18
|
+
import { getInstructions } from '../../helpers/template-utils';
|
|
19
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
20
|
+
|
|
21
|
+
const ComponentName = 'HierarchicalForm';
|
|
22
|
+
|
|
23
|
+
const getLandingPageViewName = (contextName: string) => {
|
|
24
|
+
const target = contextName.substring(0, contextName.lastIndexOf('_'));
|
|
25
|
+
const activeContainerItemID =
|
|
26
|
+
PCore.getContainerUtils().getActiveContainerItemName(target);
|
|
27
|
+
const containerItemData = PCore.getContainerUtils().getContainerItemData(
|
|
28
|
+
target,
|
|
29
|
+
activeContainerItemID,
|
|
30
|
+
);
|
|
31
|
+
return containerItemData?.view?.config?.name;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export interface HierarchicalFormProps extends PConnProps {
|
|
35
|
+
tabsVisibility?: Record<string, boolean>;
|
|
36
|
+
template?: string;
|
|
37
|
+
instructions?: string;
|
|
38
|
+
lastUpdateCaseTime?: string | number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function useHierarchicalForm(
|
|
42
|
+
props: PropsWithChildren<HierarchicalFormProps>,
|
|
43
|
+
) {
|
|
44
|
+
const { children = [], getPConnect, tabsVisibility = {}, template } = props;
|
|
45
|
+
const [tabErrors, setTabErrors] = useState<Record<string, any>>({});
|
|
46
|
+
const tabErrorsRef = useRef<Record<string, any>>({});
|
|
47
|
+
const submitAttemptedRef = useRef(false);
|
|
48
|
+
const {
|
|
49
|
+
lastUpdateCaseTime = getPConnect().getValue('caseInfo.lastUpdateTime'),
|
|
50
|
+
} = props;
|
|
51
|
+
const fullCaseId = getPConnect().getValue(
|
|
52
|
+
PCore.getConstants().CASE_INFO.CASE_INFO_ID,
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const deferLoadedTabs: any = Children.toArray(children)[0];
|
|
56
|
+
deferLoadedTabs.props.getPConnect().setInheritedProp('template', template);
|
|
57
|
+
|
|
58
|
+
const navigationKey = useMemo(() => {
|
|
59
|
+
const parentNavKey = `${
|
|
60
|
+
getPConnect().getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID) ||
|
|
61
|
+
getLandingPageViewName(getPConnect().getContextName())
|
|
62
|
+
}`;
|
|
63
|
+
return `${parentNavKey}-${getPConnect().getMetadata()?.name}-${ComponentName}`;
|
|
64
|
+
}, []);
|
|
65
|
+
|
|
66
|
+
const instructions = getInstructions(getPConnect(), props.instructions);
|
|
67
|
+
|
|
68
|
+
const storedTab = (
|
|
69
|
+
PCore.getNavigationUtils().getComponentState(navigationKey) as any
|
|
70
|
+
)?.activeTab;
|
|
71
|
+
|
|
72
|
+
const tabsFromChildren = deferLoadedTabs.props.getPConnect().getChildren();
|
|
73
|
+
|
|
74
|
+
const firstTabId = getFirstVisibleTabId(deferLoadedTabs, undefined);
|
|
75
|
+
|
|
76
|
+
const [currentTabId, setCurrentTabId] = useState(
|
|
77
|
+
getActiveTabId(tabsFromChildren, storedTab || firstTabId),
|
|
78
|
+
);
|
|
79
|
+
const [tabVisibilityStr, setTabVisibilityStr] = useState('');
|
|
80
|
+
const { data: tabData, refreshTabData } = useGetTabsCount(
|
|
81
|
+
deferLoadedTabs,
|
|
82
|
+
'hierarchical',
|
|
83
|
+
currentTabId,
|
|
84
|
+
template,
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const handleCaseRefresh = (message: any) => {
|
|
88
|
+
if (message.subtype === 'tab') {
|
|
89
|
+
refreshTabData();
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
let index = 0;
|
|
95
|
+
let caseSubId = '';
|
|
96
|
+
deferLoadedTabs.props
|
|
97
|
+
.getPConnect()
|
|
98
|
+
.getChildren()
|
|
99
|
+
?.forEach((child: any) => {
|
|
100
|
+
const rawConfigProps = child.getPConnect().getRawConfigProps();
|
|
101
|
+
if ('visibility' in rawConfigProps) {
|
|
102
|
+
tabsVisibility[`${index}`] = rawConfigProps.visibility;
|
|
103
|
+
}
|
|
104
|
+
index += 1;
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
getPConnect().registerAdditionalProps({ tabsVisibility });
|
|
108
|
+
getPConnect().registerAdditionalProps({
|
|
109
|
+
lastUpdateCaseTime: '@P caseInfo.lastUpdateTime',
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
if (fullCaseId) {
|
|
113
|
+
caseSubId = PCore.getMessagingServiceManager()
|
|
114
|
+
.getCaseSubscription(fullCaseId)
|
|
115
|
+
.subscribe({ caseId: fullCaseId }, handleCaseRefresh);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return () => {
|
|
119
|
+
if (fullCaseId)
|
|
120
|
+
PCore.getMessagingServiceManager()
|
|
121
|
+
.getCaseSubscription(fullCaseId)
|
|
122
|
+
.unsubscribe(caseSubId);
|
|
123
|
+
};
|
|
124
|
+
}, []);
|
|
125
|
+
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
refreshTabData();
|
|
128
|
+
}, [lastUpdateCaseTime]);
|
|
129
|
+
|
|
130
|
+
useEffect(() => {
|
|
131
|
+
const isVisibilityAvailable =
|
|
132
|
+
Object.values(tabsVisibility).length > 0 &&
|
|
133
|
+
Object.values(tabsVisibility).every(
|
|
134
|
+
(visibility) => typeof visibility === 'boolean',
|
|
135
|
+
);
|
|
136
|
+
if (isVisibilityAvailable) {
|
|
137
|
+
let str = '';
|
|
138
|
+
Object.keys(tabsVisibility).forEach((key) => {
|
|
139
|
+
str += key + tabsVisibility[key];
|
|
140
|
+
});
|
|
141
|
+
setTabVisibilityStr(str);
|
|
142
|
+
}
|
|
143
|
+
}, [tabsVisibility]);
|
|
144
|
+
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
if (tabData && tabData.length) {
|
|
147
|
+
const activeTabId = getActiveTabId(tabData, currentTabId);
|
|
148
|
+
if (activeTabId !== currentTabId) {
|
|
149
|
+
setCurrentTabId(activeTabId);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}, [tabVisibilityStr, tabData]);
|
|
153
|
+
|
|
154
|
+
useEffect(() => {
|
|
155
|
+
PCore.getNavigationUtils().setComponentState(navigationKey, {
|
|
156
|
+
activeTab: currentTabId,
|
|
157
|
+
});
|
|
158
|
+
const activeTabNavKey = `${getPConnect().getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID)}-CaseView-ActiveTab`;
|
|
159
|
+
PCore.getNavigationUtils().setComponentState(activeTabNavKey, {
|
|
160
|
+
id: currentTabId,
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
return () => {
|
|
164
|
+
if (getPConnect().getContextName()?.includes('/modal')) {
|
|
165
|
+
PCore.getNavigationUtils().setComponentState(navigationKey, {
|
|
166
|
+
activeTab: firstTabId,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
}, [currentTabId, children]);
|
|
171
|
+
|
|
172
|
+
const handleTabClick = useCallback(
|
|
173
|
+
(event: SyntheticEvent, id: string) => {
|
|
174
|
+
tabClick(id, tabData, currentTabId, setCurrentTabId);
|
|
175
|
+
},
|
|
176
|
+
[tabData, currentTabId],
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
const tabItems = useMemo(
|
|
180
|
+
() => tabData?.filter((tab: any) => tab.visibility()) ?? [],
|
|
181
|
+
[tabData, tabVisibilityStr],
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
const tabsRef = useRef(tabItems);
|
|
185
|
+
tabsRef.current = tabItems;
|
|
186
|
+
|
|
187
|
+
const updateTabErrorsOnViewMutate = useCallback(
|
|
188
|
+
(messageObject: any, tab: any) => {
|
|
189
|
+
if (!messageObject.type) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const previousTabErrors = tabErrorsRef.current;
|
|
193
|
+
let currentTabState = previousTabErrors[tab.id] || {};
|
|
194
|
+
const { MESSAGES_TYPE_ERROR } = PCore.getConstants().MESSAGES;
|
|
195
|
+
if (messageObject.type !== MESSAGES_TYPE_ERROR) {
|
|
196
|
+
delete currentTabState[messageObject.fieldName];
|
|
197
|
+
currentTabState =
|
|
198
|
+
Object.keys(currentTabState).length > 0 ? currentTabState : undefined;
|
|
199
|
+
} else {
|
|
200
|
+
currentTabState = {
|
|
201
|
+
...currentTabState,
|
|
202
|
+
[messageObject.fieldName]: messageObject.messages,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
const newErrors = { ...previousTabErrors, [tab.id]: currentTabState };
|
|
206
|
+
tabErrorsRef.current = newErrors;
|
|
207
|
+
setTabErrors(newErrors);
|
|
208
|
+
},
|
|
209
|
+
[],
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
useEffect(() => {
|
|
213
|
+
const rawConfig = '_rawConfig';
|
|
214
|
+
tabItems.forEach((tab: any) => {
|
|
215
|
+
PCore.getContextTreeManager().onViewMutate(
|
|
216
|
+
tab.getPConnect().getContextName(),
|
|
217
|
+
tab.getPConnect().getPageReference(),
|
|
218
|
+
tab.getPConnect()[rawConfig].config?.name,
|
|
219
|
+
(messageObject: any) => updateTabErrorsOnViewMutate(messageObject, tab),
|
|
220
|
+
);
|
|
221
|
+
});
|
|
222
|
+
}, [tabItems, updateTabErrorsOnViewMutate]);
|
|
223
|
+
|
|
224
|
+
const navigateToFirstErrorTab = useCallback(() => {
|
|
225
|
+
const currentErrors = tabErrorsRef.current;
|
|
226
|
+
const firstTabWithError = tabsRef.current.find((tab: any) => {
|
|
227
|
+
const tabErrorState = currentErrors[tab.id];
|
|
228
|
+
return tabErrorState && Object.keys(tabErrorState).length > 0;
|
|
229
|
+
});
|
|
230
|
+
if (firstTabWithError) {
|
|
231
|
+
submitAttemptedRef.current = false;
|
|
232
|
+
setCurrentTabId(firstTabWithError.id);
|
|
233
|
+
}
|
|
234
|
+
}, []);
|
|
235
|
+
|
|
236
|
+
const highlightFirstErrorTab = useCallback(() => {
|
|
237
|
+
submitAttemptedRef.current = true;
|
|
238
|
+
navigateToFirstErrorTab();
|
|
239
|
+
}, [navigateToFirstErrorTab]);
|
|
240
|
+
|
|
241
|
+
useEffect(() => {
|
|
242
|
+
const { CURRENT_ASSIGNMENT_UPDATED } =
|
|
243
|
+
PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS;
|
|
244
|
+
PCore.getPubSubUtils().subscribe(
|
|
245
|
+
CURRENT_ASSIGNMENT_UPDATED,
|
|
246
|
+
() => {
|
|
247
|
+
tabErrorsRef.current = {};
|
|
248
|
+
submitAttemptedRef.current = false;
|
|
249
|
+
setTabErrors({});
|
|
250
|
+
},
|
|
251
|
+
'CURRENT_ASSIGNMENT_UPDATED-HierarchicalForm',
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
PCore.getPubSubUtils().subscribe(
|
|
255
|
+
PCore.getConstants().PUB_SUB_EVENTS.ERROR_ON_FINISH_ASSIGNMENT,
|
|
256
|
+
highlightFirstErrorTab,
|
|
257
|
+
'ERROR_ON_FINISH_ASSIGNMENT-HierarchicalForm',
|
|
258
|
+
);
|
|
259
|
+
|
|
260
|
+
return () => {
|
|
261
|
+
PCore.getPubSubUtils().unsubscribe(
|
|
262
|
+
CURRENT_ASSIGNMENT_UPDATED,
|
|
263
|
+
'CURRENT_ASSIGNMENT_UPDATED-HierarchicalForm',
|
|
264
|
+
);
|
|
265
|
+
PCore.getPubSubUtils().unsubscribe(
|
|
266
|
+
PCore.getConstants().PUB_SUB_EVENTS.ERROR_ON_FINISH_ASSIGNMENT,
|
|
267
|
+
'ERROR_ON_FINISH_ASSIGNMENT-HierarchicalForm',
|
|
268
|
+
);
|
|
269
|
+
};
|
|
270
|
+
}, []);
|
|
271
|
+
|
|
272
|
+
useEffect(() => {
|
|
273
|
+
if (submitAttemptedRef.current) {
|
|
274
|
+
navigateToFirstErrorTab();
|
|
275
|
+
}
|
|
276
|
+
}, [tabErrors, navigateToFirstErrorTab]);
|
|
277
|
+
|
|
278
|
+
const processedTabs = useMemo(() => {
|
|
279
|
+
return tabItems.map((tab) => {
|
|
280
|
+
const errorKeys = Object.keys(tabErrors[tab.id] ?? {});
|
|
281
|
+
const errors =
|
|
282
|
+
errorKeys.length > 0
|
|
283
|
+
? errorKeys.reduce(
|
|
284
|
+
(sum, fieldName) => sum + tabErrors[tab.id][fieldName].length,
|
|
285
|
+
0,
|
|
286
|
+
)
|
|
287
|
+
: undefined;
|
|
288
|
+
return { ...tab, errors };
|
|
289
|
+
});
|
|
290
|
+
}, [tabItems, tabErrors]);
|
|
291
|
+
|
|
292
|
+
return { currentTabId, handleTabClick, processedTabs, instructions };
|
|
293
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './HierarchicalForm';
|
package/templates/react-sdk-reference/src/components/template/InlineDashboard/InlineDashboard.tsx
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { Grid, Typography } from '@mui/material';
|
|
3
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
4
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
5
|
+
|
|
6
|
+
interface InlineDashboardProps extends PConnProps {
|
|
7
|
+
// If any, enter additional props that only exist on this component
|
|
8
|
+
title: string;
|
|
9
|
+
filterPosition?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const useStyles = makeStyles((/* theme */) => ({
|
|
13
|
+
headerStyles: {
|
|
14
|
+
fontWeight: 500,
|
|
15
|
+
fontSize: '1.25rem'
|
|
16
|
+
},
|
|
17
|
+
containerStyles: {
|
|
18
|
+
marginTop: '1rem',
|
|
19
|
+
marginBottom: '1rem'
|
|
20
|
+
},
|
|
21
|
+
colStyles: {
|
|
22
|
+
display: 'grid',
|
|
23
|
+
gap: '1rem',
|
|
24
|
+
alignContent: 'baseline'
|
|
25
|
+
},
|
|
26
|
+
filterContainerStyles: {
|
|
27
|
+
display: 'grid',
|
|
28
|
+
gap: '1rem',
|
|
29
|
+
gridTemplateColumns: 'repeat(7, 1fr);'
|
|
30
|
+
},
|
|
31
|
+
inlineStyles: {
|
|
32
|
+
display: 'grid',
|
|
33
|
+
gap: '1rem',
|
|
34
|
+
alignContent: 'baseline',
|
|
35
|
+
marginTop: '1rem'
|
|
36
|
+
}
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
export default function InlineDashboard(props: PropsWithChildren<InlineDashboardProps>) {
|
|
40
|
+
const classes = useStyles();
|
|
41
|
+
|
|
42
|
+
const { children, title, filterPosition } = props;
|
|
43
|
+
const childrenToRender = children as ReactElement[];
|
|
44
|
+
|
|
45
|
+
const direction = filterPosition === 'inline-start' ? 'row-reverse' : 'row';
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
<Typography variant='h4' className={classes.headerStyles}>
|
|
49
|
+
{title}
|
|
50
|
+
</Typography>
|
|
51
|
+
|
|
52
|
+
{filterPosition === 'block-start' && (
|
|
53
|
+
<Grid container spacing={2} direction='column-reverse' className={classes.containerStyles}>
|
|
54
|
+
<Grid size={{ xs: 12 }} className={classes.colStyles}>
|
|
55
|
+
{childrenToRender[0]}
|
|
56
|
+
</Grid>
|
|
57
|
+
<Grid id='filters' size={{ xs: 12 }} className={classes.filterContainerStyles}>
|
|
58
|
+
{childrenToRender[1]}
|
|
59
|
+
</Grid>
|
|
60
|
+
</Grid>
|
|
61
|
+
)}
|
|
62
|
+
{filterPosition !== 'block-start' && (
|
|
63
|
+
<Grid container spacing={2} direction={direction} className={classes.containerStyles}>
|
|
64
|
+
<Grid size={{ xs: 9 }}>{childrenToRender[0]}</Grid>
|
|
65
|
+
<Grid id='filters' size={{ xs: 3 }} className={classes.inlineStyles}>
|
|
66
|
+
{childrenToRender[1]}
|
|
67
|
+
</Grid>
|
|
68
|
+
</Grid>
|
|
69
|
+
)}
|
|
70
|
+
</>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './InlineDashboard';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useMemo, Children, useEffect, useState, type PropsWithChildren } from 'react';
|
|
2
|
+
|
|
3
|
+
import { buildFilterComponents } from '@pega/sdk-react';
|
|
4
|
+
import { getComponentFromRegistry } from '@pega/sdk-react';
|
|
5
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
6
|
+
|
|
7
|
+
interface InlineDashboardPageProps extends PConnProps {
|
|
8
|
+
// If any, enter additional props that only exist on this component
|
|
9
|
+
title: string;
|
|
10
|
+
icon?: string;
|
|
11
|
+
filterPosition?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default function InlineDashboardPage(props: PropsWithChildren<InlineDashboardPageProps>) {
|
|
15
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
16
|
+
const InlineDashboard = getComponentFromRegistry('InlineDashboard');
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
19
|
+
const { children, getPConnect, icon = '', filterPosition = 'block-start' } = props;
|
|
20
|
+
const [filterComponents, setFilterComponents] = useState([]);
|
|
21
|
+
const childArray = useMemo(() => {
|
|
22
|
+
return Children.toArray(children);
|
|
23
|
+
}, [children]);
|
|
24
|
+
|
|
25
|
+
const allFilters = (getPConnect().getRawMetadata() as any).children[1];
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
setFilterComponents(buildFilterComponents(getPConnect, allFilters));
|
|
29
|
+
}, []);
|
|
30
|
+
|
|
31
|
+
const inlineProps = { ...props };
|
|
32
|
+
inlineProps.children = [];
|
|
33
|
+
// Region layout views
|
|
34
|
+
inlineProps.children[0] = childArray[0];
|
|
35
|
+
// filter items
|
|
36
|
+
inlineProps.children[1] = filterComponents;
|
|
37
|
+
|
|
38
|
+
return <InlineDashboard {...inlineProps} />;
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './InlineDashboardPage';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getComponentFromRegistry } from '@pega/sdk-react';
|
|
2
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
3
|
+
|
|
4
|
+
interface ListPageProps extends PConnProps {
|
|
5
|
+
// If any, enter additional props that only exist on this component
|
|
6
|
+
parameters: object;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function ListPage(props: ListPageProps) {
|
|
10
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
11
|
+
const ListView = getComponentFromRegistry('ListView');
|
|
12
|
+
|
|
13
|
+
// special case for ListView - add in a prop
|
|
14
|
+
const listViewProps = { ...props, bInForm: false };
|
|
15
|
+
return <ListView {...listViewProps} />;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ListPage';
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
const LOCALIZATON_ANNOTATION = '@L ';
|
|
2
|
+
const PROPERTY_ANNOTATION = '@P .';
|
|
3
|
+
const USER_ANNOTATION = '@USER .';
|
|
4
|
+
const ASSOCIATED_ANNOTATION = '@ASSOCIATED .';
|
|
5
|
+
const ASSOCIATION_ANNOTATION = '@CA ';
|
|
6
|
+
|
|
7
|
+
const getDefaultConfig = (fieldMeta, classID, show) => {
|
|
8
|
+
const {
|
|
9
|
+
name,
|
|
10
|
+
label,
|
|
11
|
+
fieldID,
|
|
12
|
+
fieldType,
|
|
13
|
+
dataType,
|
|
14
|
+
type,
|
|
15
|
+
classID: fieldMetaClassID,
|
|
16
|
+
displayAs,
|
|
17
|
+
displayAsLink,
|
|
18
|
+
category,
|
|
19
|
+
associationClassID,
|
|
20
|
+
associationID
|
|
21
|
+
} = fieldMeta;
|
|
22
|
+
return {
|
|
23
|
+
value: (associationClassID ? ASSOCIATION_ANNOTATION : PROPERTY_ANNOTATION).concat(fieldID),
|
|
24
|
+
label: LOCALIZATON_ANNOTATION.concat(name || label),
|
|
25
|
+
fieldType,
|
|
26
|
+
propertyType: dataType || type,
|
|
27
|
+
classID: classID || fieldMetaClassID,
|
|
28
|
+
displayAs,
|
|
29
|
+
displayAsLink,
|
|
30
|
+
category,
|
|
31
|
+
show,
|
|
32
|
+
...(associationClassID ? { associationLabel: LOCALIZATON_ANNOTATION.concat(category) } : {}),
|
|
33
|
+
associationID
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default function getDefaultViewMeta(fieldMeta, classID, showField) {
|
|
38
|
+
const { type, name, displayAs, fieldID, isUserReference, associationID, datasource, label, fieldType } = fieldMeta;
|
|
39
|
+
const mapperKey = type && displayAs ? type.concat(':').concat(displayAs) : type;
|
|
40
|
+
const defaultConfig = getDefaultConfig(fieldMeta, classID, showField);
|
|
41
|
+
let viewMeta;
|
|
42
|
+
switch (mapperKey) {
|
|
43
|
+
case 'True-False:pxCheckbox':
|
|
44
|
+
viewMeta = {
|
|
45
|
+
type: 'Checkbox',
|
|
46
|
+
config: {
|
|
47
|
+
...defaultConfig,
|
|
48
|
+
trueLabel: '@L Yes',
|
|
49
|
+
falseLabel: '@L No',
|
|
50
|
+
caption: LOCALIZATON_ANNOTATION.concat(name || label),
|
|
51
|
+
label: undefined
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
break;
|
|
55
|
+
case 'Decimal:pxCurrency':
|
|
56
|
+
viewMeta = {
|
|
57
|
+
type: 'Currency',
|
|
58
|
+
config: defaultConfig
|
|
59
|
+
};
|
|
60
|
+
break;
|
|
61
|
+
case 'Date Time:pxDateTime':
|
|
62
|
+
case 'Date & time:pxDateTime':
|
|
63
|
+
viewMeta = {
|
|
64
|
+
type: 'DateTime',
|
|
65
|
+
config: defaultConfig
|
|
66
|
+
};
|
|
67
|
+
break;
|
|
68
|
+
case 'Date:pxDateTime':
|
|
69
|
+
case 'Date only:pxDateTime':
|
|
70
|
+
viewMeta = {
|
|
71
|
+
type: 'Date',
|
|
72
|
+
config: defaultConfig
|
|
73
|
+
};
|
|
74
|
+
break;
|
|
75
|
+
case 'Decimal:pxNumber':
|
|
76
|
+
viewMeta = {
|
|
77
|
+
type: 'Decimal',
|
|
78
|
+
config: defaultConfig
|
|
79
|
+
};
|
|
80
|
+
break;
|
|
81
|
+
case 'Text:pxEmail':
|
|
82
|
+
viewMeta = {
|
|
83
|
+
type: 'Email',
|
|
84
|
+
config: defaultConfig
|
|
85
|
+
};
|
|
86
|
+
break;
|
|
87
|
+
case 'Integer:pxInteger':
|
|
88
|
+
viewMeta = {
|
|
89
|
+
type: 'Integer',
|
|
90
|
+
config: defaultConfig
|
|
91
|
+
};
|
|
92
|
+
break;
|
|
93
|
+
case 'Decimal:pxPercentage':
|
|
94
|
+
viewMeta = {
|
|
95
|
+
type: 'Percentage',
|
|
96
|
+
config: defaultConfig
|
|
97
|
+
};
|
|
98
|
+
break;
|
|
99
|
+
case 'Text:pxPhone':
|
|
100
|
+
viewMeta = {
|
|
101
|
+
type: 'Phone',
|
|
102
|
+
config: {
|
|
103
|
+
...defaultConfig,
|
|
104
|
+
datasource: {
|
|
105
|
+
source: '@DATASOURCE D_pyCountryCallingCodeList.pxResults',
|
|
106
|
+
fields: {
|
|
107
|
+
value: '@P .pyCallingCode'
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
break;
|
|
113
|
+
case 'TimeOfDay:pxDateTime':
|
|
114
|
+
viewMeta = {
|
|
115
|
+
type: 'Time',
|
|
116
|
+
config: defaultConfig
|
|
117
|
+
};
|
|
118
|
+
break;
|
|
119
|
+
case 'Text:pxURL':
|
|
120
|
+
case 'Text:pxUrl':
|
|
121
|
+
viewMeta = {
|
|
122
|
+
type: 'URL',
|
|
123
|
+
config: defaultConfig
|
|
124
|
+
};
|
|
125
|
+
break;
|
|
126
|
+
case 'Text:pxTextArea':
|
|
127
|
+
viewMeta = {
|
|
128
|
+
type: 'TextArea',
|
|
129
|
+
config: defaultConfig
|
|
130
|
+
};
|
|
131
|
+
break;
|
|
132
|
+
case 'Text:pxRichTextEditor':
|
|
133
|
+
viewMeta = {
|
|
134
|
+
type: 'RichText',
|
|
135
|
+
config: defaultConfig
|
|
136
|
+
};
|
|
137
|
+
break;
|
|
138
|
+
case 'Text:pxAutoComplete':
|
|
139
|
+
if (isUserReference || fieldType === 'User reference') {
|
|
140
|
+
viewMeta = {
|
|
141
|
+
type: 'UserReference',
|
|
142
|
+
config: {
|
|
143
|
+
...defaultConfig,
|
|
144
|
+
value: USER_ANNOTATION.concat(fieldID),
|
|
145
|
+
placeholder: 'Select...',
|
|
146
|
+
displayAs: 'Search box',
|
|
147
|
+
associationID,
|
|
148
|
+
associationLabel: undefined
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
} else {
|
|
152
|
+
const { tableType = '' } = datasource || {};
|
|
153
|
+
viewMeta = {
|
|
154
|
+
type: 'AutoComplete',
|
|
155
|
+
config: {
|
|
156
|
+
...defaultConfig,
|
|
157
|
+
placeholder: 'Select...',
|
|
158
|
+
listType: 'associated',
|
|
159
|
+
datasource: ASSOCIATED_ANNOTATION.concat(fieldID),
|
|
160
|
+
deferDatasource: tableType === 'DataPage'
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
break;
|
|
165
|
+
case 'Text:pxDropdown':
|
|
166
|
+
if (isUserReference || fieldType === 'User reference') {
|
|
167
|
+
viewMeta = {
|
|
168
|
+
type: 'UserReference',
|
|
169
|
+
config: {
|
|
170
|
+
...defaultConfig,
|
|
171
|
+
value: USER_ANNOTATION.concat(fieldID),
|
|
172
|
+
placeholder: 'Select...',
|
|
173
|
+
displayAs: 'Drop-down list',
|
|
174
|
+
associationID,
|
|
175
|
+
associationLabel: undefined
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
} else {
|
|
179
|
+
const { tableType = '' } = datasource || {};
|
|
180
|
+
viewMeta = {
|
|
181
|
+
type: 'Dropdown',
|
|
182
|
+
config: {
|
|
183
|
+
...defaultConfig,
|
|
184
|
+
placeholder: 'Select...',
|
|
185
|
+
listType: 'associated',
|
|
186
|
+
datasource: ASSOCIATED_ANNOTATION.concat(fieldID),
|
|
187
|
+
deferDatasource: tableType === 'DataPage'
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
break;
|
|
192
|
+
case 'Text:pxRadioButtons':
|
|
193
|
+
{
|
|
194
|
+
const { tableType = '' } = datasource || {};
|
|
195
|
+
viewMeta = {
|
|
196
|
+
type: 'RadioButtons',
|
|
197
|
+
config: {
|
|
198
|
+
...defaultConfig,
|
|
199
|
+
placeholder: 'Select...',
|
|
200
|
+
listType: 'associated',
|
|
201
|
+
datasource: ASSOCIATED_ANNOTATION.concat(fieldID),
|
|
202
|
+
deferDatasource: tableType === 'DataPage'
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
break;
|
|
207
|
+
case 'Text:pxTextInput':
|
|
208
|
+
viewMeta = {
|
|
209
|
+
type: 'TextInput',
|
|
210
|
+
config: defaultConfig
|
|
211
|
+
};
|
|
212
|
+
break;
|
|
213
|
+
default:
|
|
214
|
+
viewMeta = {
|
|
215
|
+
type,
|
|
216
|
+
config: defaultConfig
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
return viewMeta;
|
|
220
|
+
}
|