@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
package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/FileUtility.tsx
ADDED
|
@@ -0,0 +1,653 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import TextField from '@mui/material/TextField';
|
|
3
|
+
|
|
4
|
+
import { Utils } from '../../../helpers/utils';
|
|
5
|
+
|
|
6
|
+
import download from 'downloadjs';
|
|
7
|
+
// import SummaryList from '../../SummaryList';
|
|
8
|
+
// import ActionButtonsForFileUtil from '../ActionButtonsForFileUtil';
|
|
9
|
+
import './FileUtility.css';
|
|
10
|
+
import { IconButton, Menu, MenuItem, Button, CircularProgress, Card, debounce } from '@mui/material';
|
|
11
|
+
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
|
12
|
+
|
|
13
|
+
import { validateMaxSize } from '../../../helpers/attachmentShared';
|
|
14
|
+
import { getResolvedConstantValue } from '../../../helpers/object-utils';
|
|
15
|
+
import { getComponentFromRegistry } from '@pega/sdk-react';
|
|
16
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
17
|
+
|
|
18
|
+
interface FileUtilityProps extends PConnProps {
|
|
19
|
+
// If any, enter additional props that only exist on this component
|
|
20
|
+
caseId?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default function FileUtility(props: FileUtilityProps) {
|
|
24
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
25
|
+
const SummaryList = getComponentFromRegistry('SummaryList');
|
|
26
|
+
const ActionButtonsForFileUtil = getComponentFromRegistry('ActionButtonsForFileUtil');
|
|
27
|
+
|
|
28
|
+
const { getPConnect, caseId } = props;
|
|
29
|
+
const thePConn = getPConnect();
|
|
30
|
+
const caseID = caseId ?? getResolvedConstantValue(thePConn, PCore.getConstants().CASE_INFO.CASE_INFO_ID);
|
|
31
|
+
const required = true;
|
|
32
|
+
const listTemp = {
|
|
33
|
+
data: [],
|
|
34
|
+
count: 0
|
|
35
|
+
};
|
|
36
|
+
const [list, setList] = useState(listTemp);
|
|
37
|
+
const headerSvgIcon$ = Utils.getImageSrc('paper-clip', Utils.getSDKStaticConentUrl());
|
|
38
|
+
const closeSvgIcon = Utils.getImageSrc('times', Utils.getSDKStaticConentUrl());
|
|
39
|
+
const configProps: any = thePConn.resolveConfigProps(thePConn.getConfigProps());
|
|
40
|
+
|
|
41
|
+
const header = configProps.label;
|
|
42
|
+
const fileTemp = {
|
|
43
|
+
showfileModal: false,
|
|
44
|
+
fileList: [],
|
|
45
|
+
attachedFiles: [],
|
|
46
|
+
fileMainButtons: [
|
|
47
|
+
{
|
|
48
|
+
actionID: 'attach',
|
|
49
|
+
jsAction: 'attachFiles',
|
|
50
|
+
name: thePConn.getLocalizedValue('Attach files', '', '')
|
|
51
|
+
}
|
|
52
|
+
], // 2nd and 3rd args empty string until typedef marked correctly
|
|
53
|
+
fileSecondaryButtons: [
|
|
54
|
+
{
|
|
55
|
+
actionID: 'cancel',
|
|
56
|
+
jsAction: 'cancel',
|
|
57
|
+
name: thePConn.getLocalizedValue('Cancel', '', '')
|
|
58
|
+
}
|
|
59
|
+
] // 2nd and 3rd args empty string until typedef marked correctly
|
|
60
|
+
};
|
|
61
|
+
const [fileData, setFileData] = useState(fileTemp);
|
|
62
|
+
const linkTemp = {
|
|
63
|
+
showLinkModal: false,
|
|
64
|
+
linksList: [],
|
|
65
|
+
attachedLinks: [],
|
|
66
|
+
linkMainButtons: [
|
|
67
|
+
{
|
|
68
|
+
actionID: 'attach',
|
|
69
|
+
jsAction: 'attachLinks',
|
|
70
|
+
name: thePConn.getLocalizedValue('Attach links', '', '')
|
|
71
|
+
}
|
|
72
|
+
], // 2nd and 3rd args empty string until typedef marked correctly
|
|
73
|
+
linkSecondaryButtons: [
|
|
74
|
+
{
|
|
75
|
+
actionID: 'cancel',
|
|
76
|
+
jsAction: 'cancel',
|
|
77
|
+
name: thePConn.getLocalizedValue('Cancel', '', '')
|
|
78
|
+
}
|
|
79
|
+
] // 2nd and 3rd args empty string until typedef marked correctly
|
|
80
|
+
};
|
|
81
|
+
const [linkData, setLinkData] = useState(linkTemp);
|
|
82
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
83
|
+
const open = Boolean(anchorEl);
|
|
84
|
+
const [link, setLink] = useState({ title: '', url: '', disable: true });
|
|
85
|
+
const [inProgress, setProgress] = useState(false);
|
|
86
|
+
const [showViewAllModal, setViewAll] = useState(false);
|
|
87
|
+
const [vaItems, setFullAttachments] = useState([]);
|
|
88
|
+
|
|
89
|
+
function addAttachments(attsFromResp: any[] = []) {
|
|
90
|
+
attsFromResp = attsFromResp.map(respAtt => {
|
|
91
|
+
const updatedAtt = {
|
|
92
|
+
...respAtt,
|
|
93
|
+
meta: `${respAtt.category} . ${Utils.generateDateTime(respAtt.createTime, 'DateTime-Since')}, ${respAtt.createdBy}`
|
|
94
|
+
};
|
|
95
|
+
if (updatedAtt.type === 'FILE') {
|
|
96
|
+
updatedAtt.nameWithExt = updatedAtt.fileName;
|
|
97
|
+
}
|
|
98
|
+
return updatedAtt;
|
|
99
|
+
});
|
|
100
|
+
return attsFromResp;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function getListUtilityItemProps({ att, cancelFile, downloadFile, deleteFile, removeFile }) {
|
|
104
|
+
let actions;
|
|
105
|
+
|
|
106
|
+
if (att.progress && att.progress !== 100) {
|
|
107
|
+
actions = [
|
|
108
|
+
{
|
|
109
|
+
id: `Cancel-${att.ID}`,
|
|
110
|
+
text: thePConn.getLocalizedValue('Cancel', '', ''), // 2nd and 3rd args empty string until typedef marked correctly
|
|
111
|
+
icon: 'times',
|
|
112
|
+
onClick: cancelFile
|
|
113
|
+
}
|
|
114
|
+
];
|
|
115
|
+
} else if (att.links) {
|
|
116
|
+
const isFile = att.type === 'FILE';
|
|
117
|
+
const ID = att.ID.replace(/\s/gi, '');
|
|
118
|
+
const actionsMap = new Map([
|
|
119
|
+
[
|
|
120
|
+
'download',
|
|
121
|
+
{
|
|
122
|
+
id: `download-${ID}`,
|
|
123
|
+
text: isFile ? thePConn.getLocalizedValue('Download', '', '') : thePConn.getLocalizedValue('Open', '', ''), // 2nd and 3rd args empty string until typedef marked correctly
|
|
124
|
+
icon: isFile ? 'download' : 'open',
|
|
125
|
+
onClick: downloadFile
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
[
|
|
129
|
+
'delete',
|
|
130
|
+
{
|
|
131
|
+
id: `Delete-${ID}`,
|
|
132
|
+
text: thePConn.getLocalizedValue('Delete', '', ''), // 2nd and 3rd args empty string until typedef marked correctly
|
|
133
|
+
icon: 'trash',
|
|
134
|
+
onClick: deleteFile
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
]);
|
|
138
|
+
actions = [];
|
|
139
|
+
actionsMap.forEach((action, actionKey) => {
|
|
140
|
+
if (att.links[actionKey]) {
|
|
141
|
+
actions.push(action);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
} else if (att.error) {
|
|
145
|
+
actions = [
|
|
146
|
+
{
|
|
147
|
+
id: `Remove-${att.ID}`,
|
|
148
|
+
text: thePConn.getLocalizedValue('Remove', '', ''), // 2nd and 3rd args empty string until typedef marked correctly
|
|
149
|
+
icon: 'trash',
|
|
150
|
+
onClick: removeFile
|
|
151
|
+
}
|
|
152
|
+
];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return {
|
|
156
|
+
id: att.ID,
|
|
157
|
+
visual: {
|
|
158
|
+
icon: Utils.getIconForAttachment(att),
|
|
159
|
+
progress: att.progress === 100 ? undefined : att.progress
|
|
160
|
+
},
|
|
161
|
+
primary: {
|
|
162
|
+
type: att.type,
|
|
163
|
+
name: att.name,
|
|
164
|
+
icon: 'open',
|
|
165
|
+
click: downloadFile
|
|
166
|
+
},
|
|
167
|
+
secondary: {
|
|
168
|
+
text: att.meta
|
|
169
|
+
},
|
|
170
|
+
actions
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function fileDownload(data, fileName, ext) {
|
|
175
|
+
const file = ext ? `${fileName}.${ext}` : fileName;
|
|
176
|
+
download(atob(data), file);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function downloadAttachedFile(att: any) {
|
|
180
|
+
const attachUtils = PCore.getAttachmentUtils();
|
|
181
|
+
const { ID, name, extension, type } = att;
|
|
182
|
+
const context = thePConn.getContextName();
|
|
183
|
+
|
|
184
|
+
attachUtils
|
|
185
|
+
// @ts-expect-error - 3rd parameter "responseEncoding" is optional
|
|
186
|
+
.downloadAttachment(ID, context)
|
|
187
|
+
.then((content: any) => {
|
|
188
|
+
if (type === 'FILE') {
|
|
189
|
+
fileDownload(content.data, name, extension);
|
|
190
|
+
} else if (type === 'URL') {
|
|
191
|
+
let { data } = content;
|
|
192
|
+
if (!/^(http|https):\/\//.test(data)) {
|
|
193
|
+
data = `//${data}`;
|
|
194
|
+
}
|
|
195
|
+
window.open(content.data, '_blank');
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
.catch();
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function deleteAttachedFile(att: any) {
|
|
202
|
+
const attachUtils = PCore.getAttachmentUtils();
|
|
203
|
+
const { ID } = att;
|
|
204
|
+
const context = thePConn.getContextName();
|
|
205
|
+
|
|
206
|
+
attachUtils
|
|
207
|
+
.deleteAttachment(ID, context)
|
|
208
|
+
.then(() => {
|
|
209
|
+
getAttachments();
|
|
210
|
+
})
|
|
211
|
+
.catch();
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const getAttachments = () => {
|
|
215
|
+
const attachmentUtils = PCore.getAttachmentUtils();
|
|
216
|
+
|
|
217
|
+
if (caseID && caseID !== '') {
|
|
218
|
+
const attPromise = attachmentUtils.getCaseAttachments(caseID, thePConn.getContextName());
|
|
219
|
+
|
|
220
|
+
attPromise.then((resp: any) => {
|
|
221
|
+
const arFullListAttachments = addAttachments(resp);
|
|
222
|
+
const attachmentsCount = arFullListAttachments.length;
|
|
223
|
+
const arItems: any = arFullListAttachments.slice(0, 3).map(att => {
|
|
224
|
+
return getListUtilityItemProps({
|
|
225
|
+
att,
|
|
226
|
+
downloadFile: !att.progress ? () => downloadAttachedFile(att) : null,
|
|
227
|
+
cancelFile: null,
|
|
228
|
+
deleteFile: !att.progress ? () => deleteAttachedFile(att) : null,
|
|
229
|
+
removeFile: null
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
const viewAllarItems: any = arFullListAttachments.map(att => {
|
|
233
|
+
return getListUtilityItemProps({
|
|
234
|
+
att,
|
|
235
|
+
downloadFile: !att.progress ? () => downloadAttachedFile(att) : null,
|
|
236
|
+
cancelFile: null,
|
|
237
|
+
deleteFile: !att.progress ? () => deleteAttachedFile(att) : null,
|
|
238
|
+
removeFile: null
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
setProgress(false);
|
|
242
|
+
setList(current => {
|
|
243
|
+
return { ...current, count: attachmentsCount, data: arItems };
|
|
244
|
+
});
|
|
245
|
+
setFullAttachments(viewAllarItems);
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
const debouncedGetAttachments = debounce(getAttachments, 1000);
|
|
251
|
+
|
|
252
|
+
useEffect(() => {
|
|
253
|
+
debouncedGetAttachments();
|
|
254
|
+
}, []);
|
|
255
|
+
|
|
256
|
+
useEffect(() => {
|
|
257
|
+
const attachSubObject = {
|
|
258
|
+
matcher: 'ATTACHMENTS',
|
|
259
|
+
criteria: {
|
|
260
|
+
ID: caseID
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
const attachSubId = PCore.getMessagingServiceManager().subscribe(attachSubObject, debouncedGetAttachments, getPConnect().getContextName());
|
|
264
|
+
|
|
265
|
+
return function cleanup() {
|
|
266
|
+
PCore.getMessagingServiceManager().unsubscribe(attachSubId);
|
|
267
|
+
};
|
|
268
|
+
}, []);
|
|
269
|
+
|
|
270
|
+
useEffect(() => {
|
|
271
|
+
thePConn.registerAdditionalProps({
|
|
272
|
+
lastRefreshTime: `@P ${PCore.getConstants().SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME}`
|
|
273
|
+
});
|
|
274
|
+
}, [thePConn]);
|
|
275
|
+
|
|
276
|
+
function setNewFiles(arFiles) {
|
|
277
|
+
let index = 0;
|
|
278
|
+
for (const file of arFiles) {
|
|
279
|
+
if (!validateMaxSize(file, '5')) {
|
|
280
|
+
file.error = true;
|
|
281
|
+
file.meta = 'File is too big. Max allowed size is 5MB.';
|
|
282
|
+
}
|
|
283
|
+
file.mimeType = file.type;
|
|
284
|
+
file.icon = Utils.getIconFromFileType(file.type);
|
|
285
|
+
file.ID = `${new Date().getTime()}I${index}`;
|
|
286
|
+
index += 1;
|
|
287
|
+
}
|
|
288
|
+
return arFiles;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function getFiles(arFiles: any[]): any[] {
|
|
292
|
+
return setNewFiles(arFiles);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function uploadMyFiles(event) {
|
|
296
|
+
// alert($event.target.files[0]); // outputs the first file
|
|
297
|
+
const arFiles = getFiles(event.target.files);
|
|
298
|
+
// convert FileList to an array
|
|
299
|
+
const myFiles: any = Array.from(arFiles);
|
|
300
|
+
|
|
301
|
+
const arFileList$: any = myFiles.map((att: any) => {
|
|
302
|
+
return getListUtilityItemProps({
|
|
303
|
+
att,
|
|
304
|
+
downloadFile: !att.progress ? () => downloadAttachedFile(att) : null,
|
|
305
|
+
cancelFile: null,
|
|
306
|
+
deleteFile: !att.progress ? () => deleteAttachedFile(att) : null,
|
|
307
|
+
removeFile: null
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
setFileData(current => {
|
|
311
|
+
return { ...current, fileList: arFileList$, attachedFiles: myFiles };
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
const handleClick = event => {
|
|
316
|
+
setAnchorEl(event.currentTarget);
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
const handleClose = () => {
|
|
320
|
+
setAnchorEl(null);
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
function onAddFilesClick() {
|
|
324
|
+
setFileData(current => {
|
|
325
|
+
return { ...current, showfileModal: true };
|
|
326
|
+
});
|
|
327
|
+
setAnchorEl(null);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function removeFileFromList(item: any) {
|
|
331
|
+
let attachedFiles: any = fileData.attachedFiles;
|
|
332
|
+
let fileList: any = fileData.fileList;
|
|
333
|
+
if (item !== null) {
|
|
334
|
+
attachedFiles = attachedFiles.filter(ele => ele.ID !== item.id);
|
|
335
|
+
fileList = fileList.filter(ele => ele.id !== item.id);
|
|
336
|
+
setFileData(current => {
|
|
337
|
+
return { ...current, fileList, attachedFiles };
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
function closeFilePopup() {
|
|
343
|
+
setFileData(current => {
|
|
344
|
+
return { ...current, showfileModal: false };
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
function onAttachFiles() {
|
|
349
|
+
const attachmentUtils = PCore.getAttachmentUtils();
|
|
350
|
+
const caseID = thePConn.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID, ''); // 2nd arg empty string until typedef marked correctly
|
|
351
|
+
const onUploadProgress = () => {};
|
|
352
|
+
const errorHandler = () => {};
|
|
353
|
+
closeFilePopup();
|
|
354
|
+
if (fileData.attachedFiles && fileData.attachedFiles.length > 0) {
|
|
355
|
+
setProgress(true);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
Promise.allSettled(
|
|
359
|
+
fileData.attachedFiles.map(file => attachmentUtils.uploadAttachment(file, onUploadProgress, errorHandler, thePConn.getContextName()))
|
|
360
|
+
)
|
|
361
|
+
.then((fileResponses: any) => {
|
|
362
|
+
const uploadedFiles: any = [];
|
|
363
|
+
fileResponses.forEach(fileResponse => {
|
|
364
|
+
if (fileResponse.status === 'fulfilled') {
|
|
365
|
+
uploadedFiles.push(fileResponse.value);
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
if (uploadedFiles.length > 0) {
|
|
369
|
+
(attachmentUtils.linkAttachmentsToCase(caseID, uploadedFiles, 'File', thePConn.getContextName()) as Promise<any>)
|
|
370
|
+
.then(() => {
|
|
371
|
+
setFileData(current => {
|
|
372
|
+
return { ...current, fileList: [], attachedFiles: [] };
|
|
373
|
+
});
|
|
374
|
+
getAttachments();
|
|
375
|
+
})
|
|
376
|
+
.catch();
|
|
377
|
+
}
|
|
378
|
+
})
|
|
379
|
+
.catch();
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
function onAddLinksClick() {
|
|
383
|
+
setLinkData(current => {
|
|
384
|
+
return { ...current, showLinkModal: true };
|
|
385
|
+
});
|
|
386
|
+
setAnchorEl(null);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
function closeAddLinksPopup() {
|
|
390
|
+
setLinkData(current => {
|
|
391
|
+
return { ...current, showLinkModal: false };
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
const fieldlinkOnChange = event => {
|
|
396
|
+
const title = event.target.value;
|
|
397
|
+
setLink(current => {
|
|
398
|
+
const updatedData = { ...current, title };
|
|
399
|
+
updatedData.disable = !(updatedData.title && updatedData.url);
|
|
400
|
+
return updatedData;
|
|
401
|
+
});
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
function fieldurlOnChange(event) {
|
|
405
|
+
const url = event.target.value;
|
|
406
|
+
setLink(current => {
|
|
407
|
+
const updatedData = { ...current, url };
|
|
408
|
+
updatedData.disable = !(updatedData.title && updatedData.url);
|
|
409
|
+
return updatedData;
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
function addLink() {
|
|
414
|
+
// copy list locally
|
|
415
|
+
const localList: any = linkData.linksList.slice();
|
|
416
|
+
const url = link.url;
|
|
417
|
+
if (!/^(http|https):\/\//.test(link.url)) {
|
|
418
|
+
link.url = `http://${link.url}`;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// list for display
|
|
422
|
+
let oLink: any = {};
|
|
423
|
+
oLink.icon = 'chain';
|
|
424
|
+
oLink.ID = `${new Date().getTime()}`;
|
|
425
|
+
oLink = getListUtilityItemProps({
|
|
426
|
+
att: oLink,
|
|
427
|
+
downloadFile: null,
|
|
428
|
+
cancelFile: null,
|
|
429
|
+
deleteFile: null,
|
|
430
|
+
removeFile: null
|
|
431
|
+
});
|
|
432
|
+
oLink.type = 'URL';
|
|
433
|
+
oLink.primary.type = oLink.type;
|
|
434
|
+
oLink.visual.icon = 'chain';
|
|
435
|
+
oLink.primary.name = link.title;
|
|
436
|
+
oLink.primary.icon = 'open';
|
|
437
|
+
oLink.secondary.text = url;
|
|
438
|
+
|
|
439
|
+
localList.push(oLink);
|
|
440
|
+
|
|
441
|
+
// list for actually attachments
|
|
442
|
+
const attachedListTemp: any = linkData.attachedLinks.slice();
|
|
443
|
+
const attachedLink: any = {};
|
|
444
|
+
attachedLink.id = oLink.id;
|
|
445
|
+
attachedLink.linkTitle = link.title;
|
|
446
|
+
attachedLink.type = oLink.type;
|
|
447
|
+
attachedLink.url = url;
|
|
448
|
+
|
|
449
|
+
attachedListTemp.push(attachedLink);
|
|
450
|
+
setLinkData(current => {
|
|
451
|
+
return {
|
|
452
|
+
...current,
|
|
453
|
+
linksList: localList,
|
|
454
|
+
attachedLinks: attachedListTemp
|
|
455
|
+
};
|
|
456
|
+
});
|
|
457
|
+
// clear values
|
|
458
|
+
setLink({ title: '', url: '', disable: true });
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function removeLinksFromList(item: any) {
|
|
462
|
+
let attachedLinks: any = linkData.attachedLinks;
|
|
463
|
+
let linksList: any = linkData.linksList;
|
|
464
|
+
if (item !== null) {
|
|
465
|
+
attachedLinks = attachedLinks.filter(ele => ele.id !== item.id);
|
|
466
|
+
linksList = linksList.filter(ele => ele.id !== item.id);
|
|
467
|
+
setLinkData(current => {
|
|
468
|
+
return { ...current, linksList, attachedLinks };
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
function onAttachLinks() {
|
|
474
|
+
const attachmentUtils = PCore.getAttachmentUtils();
|
|
475
|
+
const caseID = thePConn.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID, ''); // 2nd arg empty string until typedef marked correctly
|
|
476
|
+
const links = linkData.attachedLinks;
|
|
477
|
+
closeAddLinksPopup();
|
|
478
|
+
const linksToAttach = links.map((item: any) => ({
|
|
479
|
+
type: 'URL',
|
|
480
|
+
category: 'URL',
|
|
481
|
+
url: item.url,
|
|
482
|
+
name: item.linkTitle
|
|
483
|
+
}));
|
|
484
|
+
|
|
485
|
+
if (linksToAttach && linksToAttach.length > 0) {
|
|
486
|
+
setProgress(true);
|
|
487
|
+
(attachmentUtils.linkAttachmentsToCase(caseID, linksToAttach, 'URL', thePConn.getContextName()) as Promise<any>)
|
|
488
|
+
.then(() => {
|
|
489
|
+
setLinkData(current => {
|
|
490
|
+
return { ...current, linksList: [], attachedLinks: [] };
|
|
491
|
+
});
|
|
492
|
+
getAttachments();
|
|
493
|
+
})
|
|
494
|
+
.catch(() => setProgress(false));
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
return (
|
|
499
|
+
<Card className='psdk-utility' id='file-utility'>
|
|
500
|
+
{inProgress && (
|
|
501
|
+
<div className='progress-div'>
|
|
502
|
+
<CircularProgress />
|
|
503
|
+
</div>
|
|
504
|
+
)}
|
|
505
|
+
<div className='psdk-header'>
|
|
506
|
+
<img className='psdk-file-utility-card-svg-icon' src={headerSvgIcon$} />
|
|
507
|
+
<div className='header-text'>{header}</div>
|
|
508
|
+
<div className='psdk-utility-count' id='attachments-count'>
|
|
509
|
+
{list.count}
|
|
510
|
+
</div>
|
|
511
|
+
<div style={{ flexGrow: 1 }} />
|
|
512
|
+
<div>
|
|
513
|
+
<IconButton
|
|
514
|
+
id='long-button'
|
|
515
|
+
aria-controls={open ? 'simple-menu' : undefined}
|
|
516
|
+
aria-expanded={open ? 'true' : undefined}
|
|
517
|
+
aria-haspopup='true'
|
|
518
|
+
onClick={handleClick}
|
|
519
|
+
size='large'
|
|
520
|
+
>
|
|
521
|
+
<MoreVertIcon />
|
|
522
|
+
</IconButton>
|
|
523
|
+
<Menu id='simple-menu' anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={handleClose}>
|
|
524
|
+
<MenuItem style={{ fontSize: '14px' }} onClick={onAddFilesClick}>
|
|
525
|
+
{thePConn.getLocalizedValue('Add files', '', '')}
|
|
526
|
+
</MenuItem>{' '}
|
|
527
|
+
{/* 2nd and 3rd args empty string until typedef marked correctly */}
|
|
528
|
+
<MenuItem style={{ fontSize: '14px' }} onClick={onAddLinksClick}>
|
|
529
|
+
{thePConn.getLocalizedValue('Add links', '', '')}
|
|
530
|
+
</MenuItem>{' '}
|
|
531
|
+
{/* 2nd and 3rd args empty string until typedef marked correctly */}
|
|
532
|
+
</Menu>
|
|
533
|
+
</div>
|
|
534
|
+
</div>
|
|
535
|
+
{list.data.length > 0 && (
|
|
536
|
+
<div style={{ marginTop: '1rem' }}>
|
|
537
|
+
<SummaryList arItems$={list.data} />
|
|
538
|
+
</div>
|
|
539
|
+
)}
|
|
540
|
+
{list.count > 3 && (
|
|
541
|
+
<div className='psdk-utility-view-all'>
|
|
542
|
+
<Button style={{ textTransform: 'none' }} color='primary' onClick={() => setViewAll(true)}>
|
|
543
|
+
View all
|
|
544
|
+
</Button>
|
|
545
|
+
</div>
|
|
546
|
+
)}
|
|
547
|
+
{fileData.showfileModal && (
|
|
548
|
+
<div className='psdk-dialog-background'>
|
|
549
|
+
<div className='psdk-modal-file-top'>
|
|
550
|
+
<h3>{thePConn.getLocalizedValue('Add local files', '', '')}</h3>
|
|
551
|
+
<div className='psdk-modal-body'>
|
|
552
|
+
<div className='psdk-modal-file-selector'>
|
|
553
|
+
<label htmlFor='upload-files'>
|
|
554
|
+
<input style={{ display: 'none' }} id='upload-files' name='upload-files' type='file' multiple onChange={uploadMyFiles} />
|
|
555
|
+
<Button variant='outlined' color='primary' component='span'>
|
|
556
|
+
{thePConn.getLocalizedValue('Attach files', '', '')}
|
|
557
|
+
</Button>{' '}
|
|
558
|
+
{/* 2nd and 3rd args empty string until typedef marked correctly */}
|
|
559
|
+
</label>
|
|
560
|
+
</div>
|
|
561
|
+
{fileData.fileList.length > 0 && (
|
|
562
|
+
<div style={{ marginTop: '1rem' }}>
|
|
563
|
+
<SummaryList menuIconOverride$='trash' arItems$={fileData.fileList} menuIconOverrideAction$={removeFileFromList} />
|
|
564
|
+
</div>
|
|
565
|
+
)}
|
|
566
|
+
{fileData.fileList.length === 0 && <div />}
|
|
567
|
+
<ActionButtonsForFileUtil
|
|
568
|
+
arMainButtons={fileData.fileMainButtons}
|
|
569
|
+
arSecondaryButtons={fileData.fileSecondaryButtons}
|
|
570
|
+
primaryAction={onAttachFiles}
|
|
571
|
+
secondaryAction={closeFilePopup}
|
|
572
|
+
/>
|
|
573
|
+
</div>
|
|
574
|
+
</div>
|
|
575
|
+
</div>
|
|
576
|
+
)}
|
|
577
|
+
{linkData.showLinkModal && (
|
|
578
|
+
<div className='psdk-dialog-background'>
|
|
579
|
+
<div className='psdk-modal-file-top'>
|
|
580
|
+
<h3>{thePConn.getLocalizedValue('Add links', '', '')}</h3> {/* 2nd and 3rd args empty string until typedef marked correctly */}
|
|
581
|
+
<div className='psdk-modal-body'>
|
|
582
|
+
<div className='psdk-modal-links-row'>
|
|
583
|
+
<div className='psdk-links-two-column'>
|
|
584
|
+
<div className='psdk-modal-link-data'>
|
|
585
|
+
<TextField
|
|
586
|
+
fullWidth
|
|
587
|
+
variant='outlined'
|
|
588
|
+
label='Link title'
|
|
589
|
+
size='small'
|
|
590
|
+
required={required}
|
|
591
|
+
value={link.title}
|
|
592
|
+
onChange={fieldlinkOnChange}
|
|
593
|
+
/>
|
|
594
|
+
</div>
|
|
595
|
+
<div className='psdk-modal-link-data'>
|
|
596
|
+
<TextField
|
|
597
|
+
fullWidth
|
|
598
|
+
variant='outlined'
|
|
599
|
+
label='URL'
|
|
600
|
+
size='small'
|
|
601
|
+
required={required}
|
|
602
|
+
value={link.url}
|
|
603
|
+
onChange={fieldurlOnChange}
|
|
604
|
+
/>
|
|
605
|
+
</div>
|
|
606
|
+
</div>
|
|
607
|
+
<div className='psdk-modal-link-add'>
|
|
608
|
+
<Button
|
|
609
|
+
className='psdk-add-link-action'
|
|
610
|
+
color='primary'
|
|
611
|
+
variant='contained'
|
|
612
|
+
component='span'
|
|
613
|
+
onClick={addLink}
|
|
614
|
+
disabled={link.disable}
|
|
615
|
+
>
|
|
616
|
+
{thePConn.getLocalizedValue('Add link', '', '')}
|
|
617
|
+
</Button>{' '}
|
|
618
|
+
{/* 2nd and 3rd args empty string until typedef marked correctly */}
|
|
619
|
+
</div>
|
|
620
|
+
</div>
|
|
621
|
+
{linkData.linksList.length > 0 && (
|
|
622
|
+
<div style={{ marginTop: '1rem' }}>
|
|
623
|
+
<SummaryList menuIconOverride$='trash' arItems$={linkData.linksList} menuIconOverrideAction$={removeLinksFromList} />
|
|
624
|
+
</div>
|
|
625
|
+
)}
|
|
626
|
+
<ActionButtonsForFileUtil
|
|
627
|
+
arMainButtons={linkData.linkMainButtons}
|
|
628
|
+
arSecondaryButtons={linkData.linkSecondaryButtons}
|
|
629
|
+
primaryAction={onAttachLinks}
|
|
630
|
+
secondaryAction={closeAddLinksPopup}
|
|
631
|
+
/>
|
|
632
|
+
</div>
|
|
633
|
+
</div>
|
|
634
|
+
</div>
|
|
635
|
+
)}
|
|
636
|
+
{showViewAllModal && (
|
|
637
|
+
<div className='psdk-dialog-background'>
|
|
638
|
+
<div className='psdk-modal-file-top'>
|
|
639
|
+
<div className='psdk-view-all-header'>
|
|
640
|
+
<h3>{thePConn.getLocalizedValue('Attachments', '', '')}</h3> {/* 2nd and 3rd args empty string until typedef marked correctly */}
|
|
641
|
+
<button type='button' className='psdk-close-button' onClick={() => setViewAll(false)}>
|
|
642
|
+
<img className='psdk-utility-card-actions-svg-icon' src={closeSvgIcon} />
|
|
643
|
+
</button>
|
|
644
|
+
</div>
|
|
645
|
+
<div className='psdk-view-all-body'>
|
|
646
|
+
<SummaryList arItems$={vaItems} />
|
|
647
|
+
</div>
|
|
648
|
+
</div>
|
|
649
|
+
</div>
|
|
650
|
+
)}
|
|
651
|
+
</Card>
|
|
652
|
+
);
|
|
653
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './FileUtility';
|