@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,316 @@
|
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
import download from 'downloadjs';
|
|
3
|
+
import equal from 'fast-deep-equal';
|
|
4
|
+
|
|
5
|
+
import type { FileObject, PageInstructionOptions, ReduxAttachments } from './Attachment.types';
|
|
6
|
+
|
|
7
|
+
export const isContentBinary = (headers: Record<string, string>) => {
|
|
8
|
+
return headers && headers['content-transfer-encoding'] === 'binary';
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const isContentBase64 = (headers: Record<string, string>) => {
|
|
12
|
+
return headers && headers['content-transfer-encoding'] === 'base64';
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const validateFileExtension = (fileObj: Record<string, string>, allowedExtensions: string) => {
|
|
16
|
+
if (!allowedExtensions) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
const allowedExtensionList = allowedExtensions
|
|
20
|
+
.toLowerCase()
|
|
21
|
+
.split(',')
|
|
22
|
+
.map(item => item.replaceAll('.', '').trim());
|
|
23
|
+
const extension = fileObj.name.split('.').pop()?.toLowerCase() || '';
|
|
24
|
+
return allowedExtensionList.includes(extension);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const fileDownload = (data: string | Blob, fileName: string, ext: string | null, headers: Record<string, string>) => {
|
|
28
|
+
const name = ext ? `${fileName}.${ext}` : fileName;
|
|
29
|
+
// Temp fix: downloading EMAIl type attachment as html file
|
|
30
|
+
if (ext === 'html') {
|
|
31
|
+
download(isContentBase64(headers) ? atob(data as string) : data, name, 'text/html');
|
|
32
|
+
} else if (isContentBinary(headers)) {
|
|
33
|
+
download(data, name);
|
|
34
|
+
} else {
|
|
35
|
+
download(atob(data as string), name);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const getIconFromFileType = (fileType: string) => {
|
|
40
|
+
let icon = 'document-doc';
|
|
41
|
+
if (!fileType) return icon;
|
|
42
|
+
if (fileType.startsWith('audio')) {
|
|
43
|
+
icon = 'audio';
|
|
44
|
+
} else if (fileType.startsWith('video')) {
|
|
45
|
+
icon = 'video';
|
|
46
|
+
} else if (fileType.startsWith('image')) {
|
|
47
|
+
icon = 'picture';
|
|
48
|
+
} else if (fileType.includes('pdf')) {
|
|
49
|
+
icon = 'document-pdf';
|
|
50
|
+
} else {
|
|
51
|
+
const [, subtype] = fileType.split('/');
|
|
52
|
+
const foundMatch = (sources: string[]) => {
|
|
53
|
+
return sources.some(key => subtype.includes(key));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
if (foundMatch(['excel', 'spreadsheet'])) {
|
|
57
|
+
icon = 'document-xls';
|
|
58
|
+
} else if (foundMatch(['zip', 'compressed', 'gzip', 'rar', 'tar'])) {
|
|
59
|
+
icon = 'document-compress';
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return icon;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const fileDownloadVar = (content: { data: string; headers: Record<string, string> }, type: string, name: string, extension: string) => {
|
|
67
|
+
if (type === 'FILE' || type === undefined) {
|
|
68
|
+
fileDownload(content.data, name, extension, content.headers);
|
|
69
|
+
} else if (type === 'URL') {
|
|
70
|
+
let { data } = content;
|
|
71
|
+
if (!/^(http|https):\/\//.test(data)) {
|
|
72
|
+
data = `//${data}`;
|
|
73
|
+
}
|
|
74
|
+
window.open(content.data, '_blank');
|
|
75
|
+
} else if (type === 'EMAIL') {
|
|
76
|
+
// Temp Fix: for EMAIL type attachment
|
|
77
|
+
fileDownload(content.data, name, 'html', content.headers);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const getMappedValue = (value: string): string => {
|
|
82
|
+
return PCore.getEnvironmentInfo().getKeyMapping(value) ?? value;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const generateInstructions = (
|
|
86
|
+
files: FileObject[],
|
|
87
|
+
pConn: typeof PConnect,
|
|
88
|
+
attachmentsInModal: ReduxAttachments[] | Pick<ReduxAttachments, 'instruction' | 'fileIndex'>[],
|
|
89
|
+
options: {
|
|
90
|
+
allowMultiple: boolean;
|
|
91
|
+
isMultiAttachmentInInlineEditTable: boolean;
|
|
92
|
+
attachmentCount: number;
|
|
93
|
+
insertPageInstruction: boolean;
|
|
94
|
+
deletePageInstruction: boolean;
|
|
95
|
+
deleteIndex: number;
|
|
96
|
+
}
|
|
97
|
+
) => {
|
|
98
|
+
const { allowMultiple, isMultiAttachmentInInlineEditTable, attachmentCount, insertPageInstruction, deletePageInstruction, deleteIndex } = options;
|
|
99
|
+
const transformedAttachments: ReduxAttachments[] = [];
|
|
100
|
+
let valueRef = pConn.getStateProps().value;
|
|
101
|
+
valueRef = valueRef?.indexOf('.') === 0 ? valueRef.substring(1) : valueRef;
|
|
102
|
+
const uniqueKey = getMappedValue('pzInsKey');
|
|
103
|
+
files.forEach((file, index) => {
|
|
104
|
+
const filename = file.value?.filename || file.props?.name || '';
|
|
105
|
+
const payload = {
|
|
106
|
+
[uniqueKey]: file.value?.ID || file.props?.id,
|
|
107
|
+
FileName: filename,
|
|
108
|
+
Category: '',
|
|
109
|
+
// MimeType: getMimeTypeFromFile(filename),
|
|
110
|
+
FileExtension: filename.split('.').pop() ?? filename,
|
|
111
|
+
error: file.props?.error || null,
|
|
112
|
+
localAttachment: true,
|
|
113
|
+
thumbnail: file.value?.thumbnail
|
|
114
|
+
};
|
|
115
|
+
transformedAttachments.push(payload);
|
|
116
|
+
if (payload.error) {
|
|
117
|
+
return; // Don't process page instructions for error files, skip current iteration
|
|
118
|
+
}
|
|
119
|
+
if (allowMultiple) {
|
|
120
|
+
if (isMultiAttachmentInInlineEditTable) {
|
|
121
|
+
if (insertPageInstruction) {
|
|
122
|
+
attachmentsInModal.push({ ...payload, instruction: 'insert' } as any);
|
|
123
|
+
} else if (deletePageInstruction) {
|
|
124
|
+
(attachmentsInModal as Pick<ReduxAttachments, 'instruction' | 'fileIndex'>[]).push({
|
|
125
|
+
instruction: 'delete',
|
|
126
|
+
fileIndex: deleteIndex
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
} else if (insertPageInstruction) {
|
|
130
|
+
pConn.getListActions().insert({ ID: payload[uniqueKey] }, attachmentCount + index, undefined, {
|
|
131
|
+
skipStateUpdate: true
|
|
132
|
+
});
|
|
133
|
+
} else if (deletePageInstruction) {
|
|
134
|
+
pConn.getListActions().deleteEntry(deleteIndex, undefined, { skipStateUpdate: true });
|
|
135
|
+
}
|
|
136
|
+
} else if (insertPageInstruction) {
|
|
137
|
+
pConn.getListActions().replacePage(`.${valueRef}`, { ID: payload[uniqueKey] }, { skipStateUpdate: true });
|
|
138
|
+
} else if (deletePageInstruction) {
|
|
139
|
+
pConn.getListActions().deletePage(`.${valueRef}`, { skipStateUpdate: true });
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
return transformedAttachments;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const updateReduxState = (
|
|
146
|
+
transformedAttachments: ReduxAttachments[],
|
|
147
|
+
pConn: typeof PConnect,
|
|
148
|
+
valueRef: string,
|
|
149
|
+
options: PageInstructionOptions
|
|
150
|
+
) => {
|
|
151
|
+
const { allowMultiple, isOldAttachment, insertRedux, deleteRedux } = options;
|
|
152
|
+
let deleteIndex = -1;
|
|
153
|
+
|
|
154
|
+
if (allowMultiple || isOldAttachment) {
|
|
155
|
+
transformedAttachments.forEach(attachment => {
|
|
156
|
+
const key = isOldAttachment ? `${valueRef}.pxResults` : valueRef;
|
|
157
|
+
const existingAttachments: ReduxAttachments[] = PCore.getStoreValue(`.${key}`, pConn.getPageReference(), pConn.getContextName()) || [];
|
|
158
|
+
|
|
159
|
+
if (insertRedux) {
|
|
160
|
+
const actionPayLoad = {
|
|
161
|
+
type: 'LIST_ACTION',
|
|
162
|
+
payload: {
|
|
163
|
+
instruction: 'INSERT',
|
|
164
|
+
context: pConn.getContextName(),
|
|
165
|
+
referenceList: `${pConn.getPageReference()}.${key}`,
|
|
166
|
+
listIndex: existingAttachments.length,
|
|
167
|
+
content: attachment
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
PCore.getStore()?.dispatch(actionPayLoad);
|
|
171
|
+
} else if (deleteRedux) {
|
|
172
|
+
const uniqueKey = getMappedValue('pzInsKey');
|
|
173
|
+
deleteIndex = existingAttachments.findIndex(
|
|
174
|
+
existingAttachment =>
|
|
175
|
+
existingAttachment[uniqueKey as keyof ReduxAttachments] === transformedAttachments[0][uniqueKey as keyof ReduxAttachments]
|
|
176
|
+
);
|
|
177
|
+
const actionPayLoad = {
|
|
178
|
+
type: 'LIST_ACTION',
|
|
179
|
+
payload: {
|
|
180
|
+
instruction: 'DELETE',
|
|
181
|
+
context: pConn.getContextName(),
|
|
182
|
+
referenceList: `${pConn.getPageReference()}.${key}`,
|
|
183
|
+
listIndex: deleteIndex
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
PCore.getStore()?.dispatch(actionPayLoad);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
} else if (insertRedux) {
|
|
190
|
+
const actionPayLoad = {
|
|
191
|
+
type: 'LIST_ACTION',
|
|
192
|
+
payload: {
|
|
193
|
+
instruction: 'REPLACE',
|
|
194
|
+
context: pConn.getContextName(),
|
|
195
|
+
referenceList: `${pConn.getPageReference()}.${valueRef}`,
|
|
196
|
+
content: transformedAttachments[0]
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
PCore.getStore()?.dispatch(actionPayLoad);
|
|
200
|
+
} else if (deleteRedux) {
|
|
201
|
+
const actionPayLoad = {
|
|
202
|
+
type: 'LIST_ACTION',
|
|
203
|
+
payload: {
|
|
204
|
+
instruction: 'DELETEPAGE',
|
|
205
|
+
context: pConn.getContextName(),
|
|
206
|
+
referenceList: `${pConn.getPageReference()}.${valueRef}`
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
PCore.getStore()?.dispatch(actionPayLoad);
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export const insertAttachments = (
|
|
214
|
+
files: FileObject[],
|
|
215
|
+
pConn: typeof PConnect,
|
|
216
|
+
attachmentsInModal: ReduxAttachments[],
|
|
217
|
+
options: PageInstructionOptions
|
|
218
|
+
) => {
|
|
219
|
+
const { isMultiAttachmentInInlineEditTable } = options;
|
|
220
|
+
let valueRef = pConn.getStateProps().value;
|
|
221
|
+
valueRef = valueRef?.indexOf('.') === 0 ? valueRef.substring(1) : valueRef;
|
|
222
|
+
const transformedAttachments = generateInstructions(files, pConn, attachmentsInModal, {
|
|
223
|
+
...options,
|
|
224
|
+
insertPageInstruction: true
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
if (isMultiAttachmentInInlineEditTable) {
|
|
228
|
+
return; // For attachments within modal, redux update is not necessary yet, as modal isn't submitted at this stage
|
|
229
|
+
}
|
|
230
|
+
updateReduxState(transformedAttachments, pConn, valueRef, { ...options, insertRedux: true });
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
export const deleteAttachments = (
|
|
234
|
+
files: FileObject[],
|
|
235
|
+
pConn: typeof PConnect,
|
|
236
|
+
attachmentsInModal: Pick<ReduxAttachments, 'instruction' | 'fileIndex'>[],
|
|
237
|
+
options: PageInstructionOptions
|
|
238
|
+
) => {
|
|
239
|
+
const { isMultiAttachmentInInlineEditTable } = options;
|
|
240
|
+
let valueRef = pConn.getStateProps().value;
|
|
241
|
+
valueRef = valueRef?.indexOf('.') === 0 ? valueRef.substring(1) : valueRef;
|
|
242
|
+
const transformedAttachments = generateInstructions(files, pConn, attachmentsInModal, {
|
|
243
|
+
...options,
|
|
244
|
+
deletePageInstruction: true
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
if (isMultiAttachmentInInlineEditTable) {
|
|
248
|
+
return; // For attachments within modal, redux update is not necessary yet, as modal isn't submitted at this stage
|
|
249
|
+
}
|
|
250
|
+
updateReduxState(transformedAttachments, pConn, valueRef, { ...options, deleteRedux: true });
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
export const clearFieldErrorMessages = (pConn: typeof PConnect) => {
|
|
254
|
+
const fieldName = pConn.getStateProps().value;
|
|
255
|
+
PCore.getMessageManager().clearMessages({
|
|
256
|
+
type: PCore.getConstants().MESSAGES.MESSAGES_TYPE_ERROR,
|
|
257
|
+
property: fieldName,
|
|
258
|
+
pageReference: pConn.getPageReference(),
|
|
259
|
+
context: pConn.getContextName()
|
|
260
|
+
});
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export const useFileDownload = (context: string) => {
|
|
264
|
+
return useCallback(
|
|
265
|
+
({
|
|
266
|
+
ID,
|
|
267
|
+
name,
|
|
268
|
+
extension,
|
|
269
|
+
type,
|
|
270
|
+
category,
|
|
271
|
+
responseType
|
|
272
|
+
}: {
|
|
273
|
+
ID: string;
|
|
274
|
+
name: string;
|
|
275
|
+
extension: string;
|
|
276
|
+
type: string;
|
|
277
|
+
category: string;
|
|
278
|
+
responseType: string;
|
|
279
|
+
}) => {
|
|
280
|
+
if (category !== 'pxDocument') {
|
|
281
|
+
(
|
|
282
|
+
PCore.getAttachmentUtils().downloadAttachment(ID, context, responseType) as Promise<{
|
|
283
|
+
data: string;
|
|
284
|
+
headers: Record<string, string>;
|
|
285
|
+
}>
|
|
286
|
+
)
|
|
287
|
+
.then(content => {
|
|
288
|
+
fileDownloadVar(content, type, name, extension);
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
.catch(console.error);
|
|
292
|
+
} else {
|
|
293
|
+
(
|
|
294
|
+
PCore.getAttachmentUtils().downloadDocument(ID, context) as Promise<{
|
|
295
|
+
data: string;
|
|
296
|
+
headers: Record<string, string>;
|
|
297
|
+
}>
|
|
298
|
+
)
|
|
299
|
+
.then(content => {
|
|
300
|
+
fileDownloadVar(content, type, name, extension);
|
|
301
|
+
})
|
|
302
|
+
|
|
303
|
+
.catch(console.error);
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
[context]
|
|
307
|
+
);
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
export const useDeepMemo = (memoFn, key) => {
|
|
311
|
+
const ref: any = useRef();
|
|
312
|
+
if (!ref.current || !equal(key, ref.current.key)) {
|
|
313
|
+
ref.current = { key, value: memoFn() };
|
|
314
|
+
}
|
|
315
|
+
return ref.current.value;
|
|
316
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Attachment';
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import type { Theme } from '@mui/material/styles';
|
|
3
|
+
import withStyles from '@mui/styles/withStyles';
|
|
4
|
+
import createStyles from '@mui/styles/createStyles';
|
|
5
|
+
import Table from '@mui/material/Table';
|
|
6
|
+
import TableBody from '@mui/material/TableBody';
|
|
7
|
+
import TableCell from '@mui/material/TableCell';
|
|
8
|
+
import TableContainer from '@mui/material/TableContainer';
|
|
9
|
+
import TableHead from '@mui/material/TableHead';
|
|
10
|
+
import TableRow from '@mui/material/TableRow';
|
|
11
|
+
import isDeepEqual from 'fast-deep-equal/react';
|
|
12
|
+
|
|
13
|
+
import { Utils } from '../../helpers/utils';
|
|
14
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
15
|
+
|
|
16
|
+
interface CaseHistoryProps extends PConnProps {
|
|
17
|
+
// If any, enter additional props that only exist on this component
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const StyledTableCell = withStyles((theme: Theme) =>
|
|
21
|
+
createStyles({
|
|
22
|
+
head: {
|
|
23
|
+
borderWidth: '1px',
|
|
24
|
+
borderStyle: 'solid',
|
|
25
|
+
borderColor: 'silver',
|
|
26
|
+
backgroundColor: theme.palette.text.disabled,
|
|
27
|
+
color: theme.palette.getContrastText(theme.palette.text.disabled)
|
|
28
|
+
},
|
|
29
|
+
body: {
|
|
30
|
+
borderWidth: '1px',
|
|
31
|
+
borderStyle: 'solid',
|
|
32
|
+
borderColor: 'silver'
|
|
33
|
+
// fontSize: 14,
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
)(TableCell);
|
|
37
|
+
|
|
38
|
+
export default function CaseHistory(props: CaseHistoryProps) {
|
|
39
|
+
const { getPConnect } = props;
|
|
40
|
+
const thePConn = getPConnect();
|
|
41
|
+
// let waitingForData = true;
|
|
42
|
+
|
|
43
|
+
const displayedColumns = [
|
|
44
|
+
{
|
|
45
|
+
label: thePConn.getLocalizedValue('Date', '', ''),
|
|
46
|
+
type: 'DateTime',
|
|
47
|
+
fieldName: 'pxTimeCreated'
|
|
48
|
+
}, // 2nd and 3rd args empty string until typedef marked correctly
|
|
49
|
+
{
|
|
50
|
+
label: thePConn.getLocalizedValue('Description', '', ''),
|
|
51
|
+
type: 'TextInput',
|
|
52
|
+
fieldName: 'pyMessageKey'
|
|
53
|
+
}, // 2nd and 3rd args empty string until typedef marked correctly
|
|
54
|
+
{
|
|
55
|
+
label: thePConn.getLocalizedValue('Performed by', '', ''),
|
|
56
|
+
type: 'TextInput',
|
|
57
|
+
fieldName: 'pyPerformer'
|
|
58
|
+
} // 2nd and 3rd args empty string until typedef marked correctly
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
const rowData: any = useRef([]);
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
63
|
+
const [waitingForData, setWaitingForData] = useState<boolean>(true);
|
|
64
|
+
|
|
65
|
+
const caseID = thePConn.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID, ''); // 2nd arg empty string until typedef marked correctly
|
|
66
|
+
const dataViewName = 'D_pyWorkHistory';
|
|
67
|
+
const context = thePConn.getContextName();
|
|
68
|
+
|
|
69
|
+
function computeRowData(rows: object[]): void {
|
|
70
|
+
const theRowData: object[] = [];
|
|
71
|
+
|
|
72
|
+
rows.forEach((row: any, rowIndex: number) => {
|
|
73
|
+
// Now, for each property in the index of row properties (displayedColumns), add an object
|
|
74
|
+
// to a new array of values
|
|
75
|
+
const rowDisplayValues: any = [];
|
|
76
|
+
|
|
77
|
+
displayedColumns.forEach((column: any, rowValIndex) => {
|
|
78
|
+
const theType = column.type;
|
|
79
|
+
const theFieldName = column.fieldName;
|
|
80
|
+
const theValue =
|
|
81
|
+
theType === 'Date' || theType === 'DateTime' ? Utils.generateDateTime(row[theFieldName], 'DateTime-Short') : row[theFieldName];
|
|
82
|
+
rowDisplayValues[rowValIndex] = theValue;
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
theRowData[rowIndex] = rowDisplayValues;
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
if (!isDeepEqual(theRowData, rowData.current)) {
|
|
89
|
+
// Only update rowData.current when it actually changes (to prevent infinite loop)
|
|
90
|
+
rowData.current = theRowData;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Get the case history data when component mounted/initialized
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
let bCallSetWaitingForData = true;
|
|
97
|
+
|
|
98
|
+
const historyData = PCore.getDataApiUtils().getData(
|
|
99
|
+
dataViewName,
|
|
100
|
+
{ dataViewParameters: [{ CaseInstanceKey: caseID }] } as any,
|
|
101
|
+
context
|
|
102
|
+
) as Promise<any>;
|
|
103
|
+
|
|
104
|
+
historyData.then((historyJSON: any) => {
|
|
105
|
+
const tableDataResults = historyJSON.data.data;
|
|
106
|
+
|
|
107
|
+
// compute the rowData using the tableDataResults
|
|
108
|
+
computeRowData(tableDataResults);
|
|
109
|
+
|
|
110
|
+
// At this point, if we have data ready to render and haven't been asked
|
|
111
|
+
// to NOT call setWaitingForData, we can stop progress indicator
|
|
112
|
+
if (bCallSetWaitingForData) {
|
|
113
|
+
setWaitingForData(false);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
return () => {
|
|
118
|
+
// Inspired by https://juliangaramendy.dev/blog/use-promise-subscription
|
|
119
|
+
// The useEffect closure lets us have access to the bCallSetWaitingForData
|
|
120
|
+
// variable inside the useEffect and inside the "then" clause of the
|
|
121
|
+
// historyData promise
|
|
122
|
+
// So, if this cleanup code gets run before the promise .then is called,
|
|
123
|
+
// we can avoid calling the useState setter which would otherwise show a warning
|
|
124
|
+
bCallSetWaitingForData = false;
|
|
125
|
+
};
|
|
126
|
+
}, []);
|
|
127
|
+
|
|
128
|
+
function getTableHeader() {
|
|
129
|
+
const theRowKey = 'CaseHistory.TableHeader';
|
|
130
|
+
|
|
131
|
+
const theHeaderCells: any[] = displayedColumns.map((headerCol, index) => {
|
|
132
|
+
const theCellKey = `${theRowKey}.${index}`;
|
|
133
|
+
return <StyledTableCell key={theCellKey}>{headerCol.label}</StyledTableCell>;
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
return <TableRow key={theRowKey}>{theHeaderCells}</TableRow>;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function getTableData() {
|
|
140
|
+
const theDataRows: any[] = [];
|
|
141
|
+
|
|
142
|
+
// Note: using rowData.current since we're using useRef as a mutatable
|
|
143
|
+
// value that's only updated when it changes.
|
|
144
|
+
if (rowData.current.length > 0) {
|
|
145
|
+
rowData.current.forEach((dataRow: object[], index) => {
|
|
146
|
+
// using dataRow[0]-dataRow[1] as the array key since it's a unique value
|
|
147
|
+
const theKey = `CaseHistory-${index}`;
|
|
148
|
+
theDataRows.push(
|
|
149
|
+
<TableRow key={theKey}>
|
|
150
|
+
<StyledTableCell>{dataRow[0] ? dataRow[0] : ('---' as any)}</StyledTableCell>
|
|
151
|
+
<StyledTableCell>{dataRow[1] ? dataRow[1] : ('---' as any)}</StyledTableCell>
|
|
152
|
+
<StyledTableCell>{dataRow[2] ? dataRow[2] : ('---' as any)}</StyledTableCell>
|
|
153
|
+
</TableRow>
|
|
154
|
+
);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return theDataRows;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<div id='CaseHistory'>
|
|
163
|
+
<TableContainer>
|
|
164
|
+
<Table>
|
|
165
|
+
<TableHead>{getTableHeader()}</TableHead>
|
|
166
|
+
<TableBody>{getTableData()}</TableBody>
|
|
167
|
+
</Table>
|
|
168
|
+
</TableContainer>
|
|
169
|
+
</div>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CaseHistory';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Button } from '@mui/material';
|
|
2
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
3
|
+
import './ActionButtonsForFileUtil.css';
|
|
4
|
+
|
|
5
|
+
interface ActionButtonsForFileUtilProps extends PConnProps {
|
|
6
|
+
// If any, enter additional props that only exist on this component
|
|
7
|
+
arMainButtons: any[];
|
|
8
|
+
arSecondaryButtons: any[];
|
|
9
|
+
primaryAction: any;
|
|
10
|
+
secondaryAction: any;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function ActionButtonsForFileUtil(props: ActionButtonsForFileUtilProps) {
|
|
14
|
+
return (
|
|
15
|
+
<div className='psdk-actions'>
|
|
16
|
+
<div className='psdk-action-buttons'>
|
|
17
|
+
{props.arSecondaryButtons.map(file => (
|
|
18
|
+
<Button className='secondary-button' color='secondary' variant='contained' key={file.actionID} onClick={props.secondaryAction}>
|
|
19
|
+
{file.name}
|
|
20
|
+
</Button>
|
|
21
|
+
))}
|
|
22
|
+
</div>
|
|
23
|
+
<div className='psdk-action-buttons'>
|
|
24
|
+
{props.arMainButtons.map(file => (
|
|
25
|
+
<Button className='primary-button' color='primary' variant='contained' key={file.actionID} onClick={props.primaryAction}>
|
|
26
|
+
{file.name}
|
|
27
|
+
</Button>
|
|
28
|
+
))}
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ActionButtonsForFileUtil';
|
package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/FileUtility.css
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
.psdk-utility {
|
|
2
|
+
width: 100%;
|
|
3
|
+
padding: 0.625rem 0rem;
|
|
4
|
+
text-align: left;
|
|
5
|
+
/* background-color: var(--utility-background-color); */
|
|
6
|
+
border-radius: 0.6125rem;
|
|
7
|
+
margin: 0.3125rem 0rem;
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.psdk-header {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.psdk-file-utility-card-svg-icon {
|
|
17
|
+
width: 1.4rem;
|
|
18
|
+
display: inline-block;
|
|
19
|
+
filter: var(--svg-color);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.header-text {
|
|
23
|
+
font-size: 1rem;
|
|
24
|
+
font-weight: bold;
|
|
25
|
+
padding: 0px 5px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.psdk-utility-count {
|
|
29
|
+
background: var(--utility-count-background-color);
|
|
30
|
+
border-radius: calc(1.125 * 0.5rem);
|
|
31
|
+
font-size: 0.75rem;
|
|
32
|
+
font-weight: bold;
|
|
33
|
+
text-align: center;
|
|
34
|
+
width: 1.25rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.psdk-dialog-background {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
align-items: center;
|
|
42
|
+
height: 100%;
|
|
43
|
+
width: 100%;
|
|
44
|
+
background-color: var(--modal-background-color);
|
|
45
|
+
position: fixed;
|
|
46
|
+
z-index: 999;
|
|
47
|
+
top: 0px;
|
|
48
|
+
left: 0px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.psdk-modal-file-top {
|
|
52
|
+
display: table;
|
|
53
|
+
margin: auto;
|
|
54
|
+
min-width: 650px;
|
|
55
|
+
background-color: var(--modal-top-color);
|
|
56
|
+
border: 1px solid var(--modal-border-color);
|
|
57
|
+
border-radius: 10px;
|
|
58
|
+
padding: 20px;
|
|
59
|
+
box-shadow: 0 0 10px 3px var(--modal-box-shadow-color);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.psdk-modal-file-selector {
|
|
63
|
+
border: 1px dashed;
|
|
64
|
+
width: 100%;
|
|
65
|
+
padding: 0.3rem;
|
|
66
|
+
text-align: center;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.psdk-modal-links-row {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: row;
|
|
72
|
+
justify-content: space-between;
|
|
73
|
+
align-items: center;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.psdk-links-two-column {
|
|
77
|
+
display: grid;
|
|
78
|
+
grid-template-columns: repeat(2, 1fr);
|
|
79
|
+
gap: calc(1rem);
|
|
80
|
+
width: 83%;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.psdk-modal-link-data {
|
|
84
|
+
flex-grow: 3;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.psdk-modal-link-add {
|
|
88
|
+
flex-grow: 1;
|
|
89
|
+
margin-left: 10px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.psdk-add-link-action {
|
|
93
|
+
text-transform: unset !important;
|
|
94
|
+
font-size: 14px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.psdk-utility-view-all {
|
|
98
|
+
width: 100%;
|
|
99
|
+
display: flex;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.psdk-view-all-header {
|
|
104
|
+
display: flex;
|
|
105
|
+
justify-content: space-between;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.psdk-close-button {
|
|
109
|
+
border: none;
|
|
110
|
+
background: none;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.psdk-view-all-body {
|
|
115
|
+
max-height: 500px;
|
|
116
|
+
overflow-y: auto;
|
|
117
|
+
overflow-x: hidden;
|
|
118
|
+
}
|