@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,258 @@
|
|
|
1
|
+
import { useEffect, useState, useCallback, useRef } from 'react';
|
|
2
|
+
import { Box, TextField, Alert } from '@mui/material';
|
|
3
|
+
import AddLocationAltIcon from '@mui/icons-material/AddLocationAlt';
|
|
4
|
+
import InputAdornment from '@mui/material/InputAdornment';
|
|
5
|
+
import IconButton from '@mui/material/IconButton';
|
|
6
|
+
import { GoogleMap, Marker, useLoadScript } from '@react-google-maps/api';
|
|
7
|
+
import { getComponentFromRegistry } from '@pega/sdk-react';
|
|
8
|
+
import type { PConnFieldProps } from '@pega/sdk-react';
|
|
9
|
+
import handleEvent from '../../helpers/event-utils';
|
|
10
|
+
|
|
11
|
+
import './Location.css';
|
|
12
|
+
|
|
13
|
+
interface LocationProps extends PConnFieldProps {
|
|
14
|
+
coordinates?: string;
|
|
15
|
+
onlyCoordinates?: boolean;
|
|
16
|
+
showMap?: boolean;
|
|
17
|
+
showMapReadOnly?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const mapContainerStyle = {
|
|
21
|
+
width: '100%',
|
|
22
|
+
height: '300px',
|
|
23
|
+
marginTop: '0px'
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const defaultCenter = {
|
|
27
|
+
lat: 18.5204,
|
|
28
|
+
lng: 73.8567
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const disabledMapOptions = {
|
|
32
|
+
gestureHandling: 'none',
|
|
33
|
+
keyboardShortcuts: false,
|
|
34
|
+
disableDefaultUI: true,
|
|
35
|
+
clickableIcons: false,
|
|
36
|
+
zoomControl: false,
|
|
37
|
+
mapTypeControl: false,
|
|
38
|
+
scaleControl: false,
|
|
39
|
+
streetViewControl: false,
|
|
40
|
+
rotateControl: false,
|
|
41
|
+
fullscreenControl: false
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default function Location(props: LocationProps) {
|
|
45
|
+
const TextInput = getComponentFromRegistry('TextInput');
|
|
46
|
+
const FieldValueList = getComponentFromRegistry('FieldValueList');
|
|
47
|
+
|
|
48
|
+
const {
|
|
49
|
+
getPConnect,
|
|
50
|
+
label,
|
|
51
|
+
required = false,
|
|
52
|
+
disabled = false,
|
|
53
|
+
value = '',
|
|
54
|
+
validatemessage,
|
|
55
|
+
status,
|
|
56
|
+
readOnly = false,
|
|
57
|
+
testId,
|
|
58
|
+
displayMode,
|
|
59
|
+
hideLabel = false,
|
|
60
|
+
placeholder,
|
|
61
|
+
helperText,
|
|
62
|
+
coordinates = '',
|
|
63
|
+
onlyCoordinates = false,
|
|
64
|
+
showMap,
|
|
65
|
+
showMapReadOnly
|
|
66
|
+
} = props;
|
|
67
|
+
|
|
68
|
+
const pConn = getPConnect();
|
|
69
|
+
const actions = pConn.getActionsApi();
|
|
70
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
71
|
+
const coordPropName = (pConn.getStateProps() as any).coordinates;
|
|
72
|
+
|
|
73
|
+
const [inputValue, setInputValue] = useState<string>(value ?? '');
|
|
74
|
+
const [mapCenter, setMapCenter] = useState(defaultCenter);
|
|
75
|
+
const [markerPosition, setMarkerPosition] = useState<google.maps.LatLngLiteral | null>(null);
|
|
76
|
+
|
|
77
|
+
const inputRef = useRef<HTMLInputElement | null>(null);
|
|
78
|
+
const autocompleteRef = useRef<google.maps.places.Autocomplete | null>(null);
|
|
79
|
+
|
|
80
|
+
const { isLoaded } = useLoadScript({
|
|
81
|
+
googleMapsApiKey: pConn.getGoogleMapsAPIKey?.() || '',
|
|
82
|
+
libraries: ['places', 'geocoding']
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const hasError = status === 'error' && !!validatemessage && !disabled;
|
|
86
|
+
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (onlyCoordinates && coordinates) {
|
|
89
|
+
setInputValue(coordinates);
|
|
90
|
+
} else {
|
|
91
|
+
setInputValue(value ?? '');
|
|
92
|
+
}
|
|
93
|
+
if (coordinates) {
|
|
94
|
+
const [lat, lng] = coordinates.split(',').map(parseFloat);
|
|
95
|
+
|
|
96
|
+
if (!isNaN(lat) && !isNaN(lng)) {
|
|
97
|
+
setMapCenter({ lat, lng });
|
|
98
|
+
setMarkerPosition({ lat, lng });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}, [value, coordinates, onlyCoordinates]);
|
|
102
|
+
|
|
103
|
+
const handleChange = useCallback(
|
|
104
|
+
(event: React.ChangeEvent<HTMLInputElement>) => {
|
|
105
|
+
const newValue = event.target.value ?? '';
|
|
106
|
+
setInputValue(newValue);
|
|
107
|
+
handleEvent(actions, 'changeNblur', propName, newValue);
|
|
108
|
+
|
|
109
|
+
if (newValue === '' && coordPropName) {
|
|
110
|
+
actions.updateFieldValue(coordPropName, '');
|
|
111
|
+
setMarkerPosition(null);
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
[actions, propName, coordPropName]
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
const handlePlaceChanged = useCallback(() => {
|
|
118
|
+
if (autocompleteRef.current) {
|
|
119
|
+
const place = autocompleteRef.current.getPlace();
|
|
120
|
+
if (place.geometry?.location) {
|
|
121
|
+
const lat = place.geometry.location.lat();
|
|
122
|
+
const lng = place.geometry.location.lng();
|
|
123
|
+
const address = place.formatted_address || place.name || '';
|
|
124
|
+
const coordinateString = `${lat}, ${lng}`;
|
|
125
|
+
|
|
126
|
+
setMapCenter({ lat, lng });
|
|
127
|
+
setMarkerPosition({ lat, lng });
|
|
128
|
+
|
|
129
|
+
if (onlyCoordinates) {
|
|
130
|
+
setInputValue(coordinateString);
|
|
131
|
+
handleEvent(actions, 'changeNblur', propName, coordinateString);
|
|
132
|
+
if (coordPropName) {
|
|
133
|
+
actions.updateFieldValue(coordPropName, coordinateString);
|
|
134
|
+
}
|
|
135
|
+
} else {
|
|
136
|
+
setInputValue(address);
|
|
137
|
+
handleEvent(actions, 'changeNblur', propName, address);
|
|
138
|
+
if (coordPropName) {
|
|
139
|
+
actions.updateFieldValue(coordPropName, coordinateString);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}, [actions, propName, coordPropName, onlyCoordinates]);
|
|
145
|
+
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
if (isLoaded && inputRef.current && !autocompleteRef.current) {
|
|
148
|
+
autocompleteRef.current = new google.maps.places.Autocomplete(inputRef.current);
|
|
149
|
+
autocompleteRef.current.addListener('place_changed', handlePlaceChanged);
|
|
150
|
+
}
|
|
151
|
+
}, [isLoaded, handlePlaceChanged]);
|
|
152
|
+
|
|
153
|
+
const handleGetCurrentLocation = useCallback(() => {
|
|
154
|
+
if (navigator.geolocation) {
|
|
155
|
+
navigator.geolocation.getCurrentPosition(
|
|
156
|
+
position => {
|
|
157
|
+
const lat = position.coords.latitude;
|
|
158
|
+
const lng = position.coords.longitude;
|
|
159
|
+
const coordinateString = `${lat}, ${lng}`;
|
|
160
|
+
|
|
161
|
+
setMapCenter({ lat, lng });
|
|
162
|
+
setMarkerPosition({ lat, lng });
|
|
163
|
+
|
|
164
|
+
if (onlyCoordinates) {
|
|
165
|
+
setInputValue(coordinateString);
|
|
166
|
+
handleEvent(actions, 'changeNblur', propName, coordinateString);
|
|
167
|
+
if (coordPropName) {
|
|
168
|
+
actions.updateFieldValue(coordPropName, coordinateString);
|
|
169
|
+
}
|
|
170
|
+
} else {
|
|
171
|
+
const geocoder = new window.google.maps.Geocoder();
|
|
172
|
+
geocoder.geocode({ location: { lat, lng } }, (results, responseStatus) => {
|
|
173
|
+
if (responseStatus === 'OK' && results && results[0]) {
|
|
174
|
+
const address = results[0].formatted_address;
|
|
175
|
+
setInputValue(address);
|
|
176
|
+
handleEvent(actions, 'changeNblur', propName, address);
|
|
177
|
+
if (coordPropName) {
|
|
178
|
+
actions.updateFieldValue(coordPropName, coordinateString);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
error => {
|
|
185
|
+
console.error('Error getting current location: ', error);
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
}, [actions, propName, coordPropName, onlyCoordinates]);
|
|
190
|
+
|
|
191
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
192
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
196
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const map = (
|
|
200
|
+
<div style={{ opacity: disabled ? 0.7 : 1 }}>
|
|
201
|
+
<Box mt={1} style={{ flex: 1 }}>
|
|
202
|
+
<GoogleMap mapContainerStyle={mapContainerStyle} center={mapCenter} zoom={14} options={disabled ? disabledMapOptions : undefined}>
|
|
203
|
+
{markerPosition && <Marker position={markerPosition} />}
|
|
204
|
+
</GoogleMap>
|
|
205
|
+
</Box>
|
|
206
|
+
</div>
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
if (readOnly) {
|
|
210
|
+
return (
|
|
211
|
+
<div>
|
|
212
|
+
<TextInput {...props} />
|
|
213
|
+
{isLoaded && showMapReadOnly && map}
|
|
214
|
+
</div>
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const testProps: any = { 'data-test-id': testId };
|
|
219
|
+
|
|
220
|
+
return (
|
|
221
|
+
<div>
|
|
222
|
+
{hasError && (
|
|
223
|
+
<Alert severity='error' sx={{ mb: 1 }}>
|
|
224
|
+
{validatemessage}
|
|
225
|
+
</Alert>
|
|
226
|
+
)}
|
|
227
|
+
|
|
228
|
+
{isLoaded && (
|
|
229
|
+
<TextField
|
|
230
|
+
fullWidth
|
|
231
|
+
label={hideLabel ? '' : label}
|
|
232
|
+
required={required}
|
|
233
|
+
disabled={disabled}
|
|
234
|
+
error={hasError}
|
|
235
|
+
placeholder={placeholder ?? 'Search location'}
|
|
236
|
+
helperText={helperText}
|
|
237
|
+
value={inputValue}
|
|
238
|
+
onChange={handleChange}
|
|
239
|
+
inputRef={inputRef}
|
|
240
|
+
slotProps={{
|
|
241
|
+
input: {
|
|
242
|
+
endAdornment: (
|
|
243
|
+
<InputAdornment position='end'>
|
|
244
|
+
<IconButton onClick={handleGetCurrentLocation} disabled={disabled} edge='end'>
|
|
245
|
+
<AddLocationAltIcon />
|
|
246
|
+
</IconButton>
|
|
247
|
+
</InputAdornment>
|
|
248
|
+
),
|
|
249
|
+
inputProps: { ...testProps }
|
|
250
|
+
}
|
|
251
|
+
}}
|
|
252
|
+
/>
|
|
253
|
+
)}
|
|
254
|
+
|
|
255
|
+
{isLoaded && showMap && map}
|
|
256
|
+
</div>
|
|
257
|
+
);
|
|
258
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Location';
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { Autocomplete, TextField } from '@mui/material';
|
|
3
|
+
import { doSearch, getDisplayFieldsMetaData, useDeepMemo, preProcessColumns, getGroupDataForItemsTree } from './utils';
|
|
4
|
+
import { insertInstruction, deleteInstruction } from '../../helpers/instructions-utils';
|
|
5
|
+
import { debounce } from 'throttle-debounce';
|
|
6
|
+
|
|
7
|
+
export default function Multiselect(props) {
|
|
8
|
+
const {
|
|
9
|
+
getPConnect,
|
|
10
|
+
label,
|
|
11
|
+
placeholder,
|
|
12
|
+
referenceList,
|
|
13
|
+
selectionKey,
|
|
14
|
+
primaryField,
|
|
15
|
+
initialCaseClass,
|
|
16
|
+
showSecondaryInSearchOnly = false,
|
|
17
|
+
listType = '',
|
|
18
|
+
isGroupData = false,
|
|
19
|
+
referenceType,
|
|
20
|
+
secondaryFields,
|
|
21
|
+
groupDataSource = [],
|
|
22
|
+
parameters = {},
|
|
23
|
+
matchPosition = 'contains',
|
|
24
|
+
maxResultsDisplay,
|
|
25
|
+
groupColumnsConfig = [{}],
|
|
26
|
+
selectionList,
|
|
27
|
+
value
|
|
28
|
+
} = props;
|
|
29
|
+
let { datasource = [], columns = [{}] } = props;
|
|
30
|
+
|
|
31
|
+
if (referenceList.length > 0) {
|
|
32
|
+
datasource = referenceList;
|
|
33
|
+
columns = [
|
|
34
|
+
{
|
|
35
|
+
value: primaryField,
|
|
36
|
+
display: 'true',
|
|
37
|
+
useForSearch: true,
|
|
38
|
+
primary: 'true'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
value: selectionKey,
|
|
42
|
+
setProperty: selectionKey,
|
|
43
|
+
key: 'true'
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
let secondaryColumns: any = [];
|
|
47
|
+
if (secondaryFields) {
|
|
48
|
+
secondaryColumns = secondaryFields.map(secondaryField => ({
|
|
49
|
+
value: secondaryField,
|
|
50
|
+
display: 'true',
|
|
51
|
+
secondary: 'true',
|
|
52
|
+
useForSearch: 'true'
|
|
53
|
+
}));
|
|
54
|
+
} else {
|
|
55
|
+
secondaryColumns = [
|
|
56
|
+
{
|
|
57
|
+
value: selectionKey,
|
|
58
|
+
display: 'true',
|
|
59
|
+
secondary: 'true',
|
|
60
|
+
useForSearch: 'true'
|
|
61
|
+
}
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
if (referenceType === 'Case') {
|
|
65
|
+
columns = [...columns, ...secondaryColumns];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const [inputValue, setInputValue] = useState(value);
|
|
69
|
+
const [selectedItems, setSelectedItems] = useState([]);
|
|
70
|
+
|
|
71
|
+
const dataConfig = useDeepMemo(() => {
|
|
72
|
+
return {
|
|
73
|
+
dataSource: datasource,
|
|
74
|
+
groupDataSource,
|
|
75
|
+
isGroupData,
|
|
76
|
+
showSecondaryInSearchOnly,
|
|
77
|
+
parameters,
|
|
78
|
+
matchPosition,
|
|
79
|
+
listType,
|
|
80
|
+
maxResultsDisplay: maxResultsDisplay || '100',
|
|
81
|
+
columns: preProcessColumns(columns),
|
|
82
|
+
groupColumnsConfig: preProcessColumns(groupColumnsConfig)
|
|
83
|
+
};
|
|
84
|
+
}, [
|
|
85
|
+
datasource,
|
|
86
|
+
groupDataSource,
|
|
87
|
+
isGroupData,
|
|
88
|
+
showSecondaryInSearchOnly,
|
|
89
|
+
parameters,
|
|
90
|
+
matchPosition,
|
|
91
|
+
listType,
|
|
92
|
+
maxResultsDisplay,
|
|
93
|
+
columns,
|
|
94
|
+
groupColumnsConfig
|
|
95
|
+
]);
|
|
96
|
+
const groupsDisplayFieldMeta = useMemo(
|
|
97
|
+
() => (listType !== 'associated' ? getDisplayFieldsMetaData(dataConfig.groupColumnsConfig) : null),
|
|
98
|
+
[dataConfig.groupColumnsConfig]
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
const itemsTreeBaseData = getGroupDataForItemsTree(groupDataSource, groupsDisplayFieldMeta, showSecondaryInSearchOnly) || [];
|
|
102
|
+
|
|
103
|
+
const [itemsTree, setItemsTree] = useState(
|
|
104
|
+
isGroupData ? getGroupDataForItemsTree(groupDataSource, groupsDisplayFieldMeta, showSecondaryInSearchOnly) : []
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
const displayFieldMeta = listType !== 'associated' ? getDisplayFieldsMetaData(dataConfig.columns) : null;
|
|
108
|
+
const getCaseListBasedOnParamsDebounced: any = useRef();
|
|
109
|
+
const pConn = getPConnect();
|
|
110
|
+
const contextName = pConn.getContextName();
|
|
111
|
+
const listActions = pConn.getListActions();
|
|
112
|
+
const dataApiObj: any = useRef();
|
|
113
|
+
|
|
114
|
+
// main search function trigger
|
|
115
|
+
const getCaseListBasedOnParams = async (searchText, group, selectedRows, currentItemsTree, isTriggeredFromSearch = false) => {
|
|
116
|
+
if (referenceList && referenceList.length > 0) {
|
|
117
|
+
selectedRows = await listActions.getSelectedRows(true);
|
|
118
|
+
|
|
119
|
+
selectedRows =
|
|
120
|
+
selectedRows &&
|
|
121
|
+
selectedRows.map(item => {
|
|
122
|
+
return {
|
|
123
|
+
id: item[selectionKey.startsWith('.') ? selectionKey.substring(1) : selectionKey],
|
|
124
|
+
primary: item[primaryField.startsWith('.') ? primaryField.substring(1) : primaryField]
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
setSelectedItems(selectedRows);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// if items tree is null or text search is triggered then always should use fresh data object, we use the original object
|
|
131
|
+
const initalItemsTree = isTriggeredFromSearch || !currentItemsTree ? [...itemsTreeBaseData] : [...currentItemsTree];
|
|
132
|
+
const res = await doSearch(
|
|
133
|
+
searchText,
|
|
134
|
+
group,
|
|
135
|
+
initialCaseClass,
|
|
136
|
+
displayFieldMeta,
|
|
137
|
+
dataApiObj.current,
|
|
138
|
+
initalItemsTree,
|
|
139
|
+
isGroupData,
|
|
140
|
+
showSecondaryInSearchOnly,
|
|
141
|
+
selectedRows || []
|
|
142
|
+
);
|
|
143
|
+
setItemsTree(res);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
if (referenceList && referenceList.length > 0) {
|
|
148
|
+
pConn.setReferenceList(selectionList);
|
|
149
|
+
}
|
|
150
|
+
}, [pConn]);
|
|
151
|
+
|
|
152
|
+
useEffect(() => {
|
|
153
|
+
getCaseListBasedOnParamsDebounced.current = debounce(500, getCaseListBasedOnParams);
|
|
154
|
+
}, []);
|
|
155
|
+
|
|
156
|
+
useEffect(() => {
|
|
157
|
+
if (listType !== 'associated') {
|
|
158
|
+
PCore.getDataApi()
|
|
159
|
+
?.init(dataConfig, contextName)
|
|
160
|
+
.then(dataObj => {
|
|
161
|
+
dataApiObj.current = dataObj;
|
|
162
|
+
if (!isGroupData) {
|
|
163
|
+
getCaseListBasedOnParamsDebounced.current(inputValue ?? '', '', [...selectedItems], [...itemsTree]);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}, [dataConfig, listType, dataConfig.columns, inputValue, dataConfig.groupColumnsConfig, showSecondaryInSearchOnly]);
|
|
168
|
+
|
|
169
|
+
const onSearchHandler = ev => {
|
|
170
|
+
const searchText = ev.target.value;
|
|
171
|
+
setInputValue(searchText);
|
|
172
|
+
getCaseListBasedOnParamsDebounced.current(searchText, '', [...selectedItems], [...itemsTree], true);
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
const setSelectedItemsForReferenceList = item => {
|
|
176
|
+
// Clear error messages if any
|
|
177
|
+
const propName = pConn.getStateProps().selectionList;
|
|
178
|
+
pConn.clearErrorMessages({
|
|
179
|
+
property: propName
|
|
180
|
+
});
|
|
181
|
+
const { selected } = item;
|
|
182
|
+
if (selected) {
|
|
183
|
+
insertInstruction(pConn, selectionList, selectionKey, primaryField, item);
|
|
184
|
+
} else {
|
|
185
|
+
deleteInstruction(pConn, selectionList, selectionKey, item);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const handleChange = (event, newSelectedValues) => {
|
|
190
|
+
let clickedItem;
|
|
191
|
+
let updatedItems: any = [];
|
|
192
|
+
if (newSelectedValues && newSelectedValues.length > 0) {
|
|
193
|
+
updatedItems = newSelectedValues.map(ele => {
|
|
194
|
+
ele.selected = true;
|
|
195
|
+
return ele;
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
if (newSelectedValues.length > selectedItems.length) {
|
|
199
|
+
clickedItem = newSelectedValues.filter(item => !selectedItems.some((ele: any) => ele.id === item.id));
|
|
200
|
+
} else {
|
|
201
|
+
clickedItem = selectedItems.filter((item: any) => !newSelectedValues.some((ele: any) => ele.id === item.id));
|
|
202
|
+
clickedItem[0].selected = false;
|
|
203
|
+
}
|
|
204
|
+
itemsTree.forEach(ele => {
|
|
205
|
+
ele.selected = !!updatedItems.find(item => item.id === ele.id);
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
setSelectedItems(updatedItems);
|
|
209
|
+
setItemsTree(itemsTree);
|
|
210
|
+
|
|
211
|
+
setInputValue('');
|
|
212
|
+
|
|
213
|
+
// if this is a referenceList case
|
|
214
|
+
if (referenceList) setSelectedItemsForReferenceList(clickedItem[0]);
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
return (
|
|
218
|
+
<Autocomplete
|
|
219
|
+
multiple
|
|
220
|
+
fullWidth
|
|
221
|
+
options={itemsTree}
|
|
222
|
+
disableCloseOnSelect
|
|
223
|
+
// getOptionSelected={(option: any, val: any) => option?.primary === val?.primary}
|
|
224
|
+
getOptionLabel={(option: any) => option?.primary}
|
|
225
|
+
onChange={handleChange}
|
|
226
|
+
value={selectedItems}
|
|
227
|
+
// renderOption={(_props, option: any, { selected }) => (
|
|
228
|
+
// <>
|
|
229
|
+
// <Checkbox icon={icon} checkedIcon={checkedIcon} style={{ marginRight: 8 }} checked={selected} />
|
|
230
|
+
// {option.primary}
|
|
231
|
+
// </>
|
|
232
|
+
// )}
|
|
233
|
+
renderInput={params => (
|
|
234
|
+
<TextField {...params} variant='outlined' fullWidth label={label} placeholder={placeholder} size='small' onChange={onSearchHandler} />
|
|
235
|
+
)}
|
|
236
|
+
/>
|
|
237
|
+
);
|
|
238
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Multiselect';
|