@pega/react-sdk-components 23.1.12 → 24.2.10
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/lib/bridge/react_pconnect.d.ts.map +1 -1
- package/lib/bridge/react_pconnect.js +137 -140
- package/lib/bridge/react_pconnect.js.map +1 -1
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts +1 -2
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts.map +1 -1
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js +1 -1
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js.map +1 -1
- package/lib/components/designSystemExtension/Banner/Banner.d.ts +1 -2
- package/lib/components/designSystemExtension/Banner/Banner.d.ts.map +1 -1
- package/lib/components/designSystemExtension/Banner/Banner.js +1 -1
- package/lib/components/designSystemExtension/Banner/Banner.js.map +1 -1
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts +1 -2
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js +13 -13
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
- package/lib/components/designSystemExtension/DetailsFields/DetailsFields.d.ts +1 -2
- package/lib/components/designSystemExtension/DetailsFields/DetailsFields.d.ts.map +1 -1
- package/lib/components/designSystemExtension/DetailsFields/DetailsFields.js +4 -4
- package/lib/components/designSystemExtension/DetailsFields/DetailsFields.js.map +1 -1
- package/lib/components/designSystemExtension/FieldGroup/FieldGroup.d.ts +1 -1
- package/lib/components/designSystemExtension/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js +4 -4
- package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.d.ts +1 -2
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.d.ts.map +1 -1
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js +4 -4
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js.map +1 -1
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.d.ts +1 -2
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js +5 -5
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/designSystemExtension/Operator/Operator.d.ts +1 -2
- package/lib/components/designSystemExtension/Operator/Operator.d.ts.map +1 -1
- package/lib/components/designSystemExtension/Operator/Operator.js +6 -6
- package/lib/components/designSystemExtension/Operator/Operator.js.map +1 -1
- package/lib/components/designSystemExtension/Pulse/Pulse.d.ts +1 -1
- package/lib/components/designSystemExtension/Pulse/Pulse.d.ts.map +1 -1
- package/lib/components/designSystemExtension/Pulse/Pulse.js +2 -2
- package/lib/components/designSystemExtension/Pulse/Pulse.js.map +1 -1
- package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.js +3 -2
- package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.js.map +1 -1
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.d.ts +1 -2
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.d.ts.map +1 -1
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js +1 -1
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js.map +1 -1
- package/lib/components/field/AutoComplete/AutoComplete.d.ts +1 -2
- package/lib/components/field/AutoComplete/AutoComplete.d.ts.map +1 -1
- package/lib/components/field/AutoComplete/AutoComplete.js +4 -4
- package/lib/components/field/AutoComplete/AutoComplete.js.map +1 -1
- package/lib/components/field/CancelAlert/CancelAlert.d.ts +1 -2
- package/lib/components/field/CancelAlert/CancelAlert.d.ts.map +1 -1
- package/lib/components/field/CancelAlert/CancelAlert.js +4 -2
- package/lib/components/field/CancelAlert/CancelAlert.js.map +1 -1
- package/lib/components/field/Checkbox/Checkbox.d.ts +1 -2
- package/lib/components/field/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/field/Checkbox/Checkbox.js +4 -4
- package/lib/components/field/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/field/Currency/Currency.d.ts +2 -2
- package/lib/components/field/Currency/Currency.d.ts.map +1 -1
- package/lib/components/field/Currency/Currency.js +20 -9
- package/lib/components/field/Currency/Currency.js.map +1 -1
- package/lib/components/field/Date/Date.d.ts +1 -2
- package/lib/components/field/Date/Date.d.ts.map +1 -1
- package/lib/components/field/Date/Date.js +18 -9
- package/lib/components/field/Date/Date.js.map +1 -1
- package/lib/components/field/DateTime/DateTime.d.ts +1 -2
- package/lib/components/field/DateTime/DateTime.d.ts.map +1 -1
- package/lib/components/field/DateTime/DateTime.js +30 -8
- package/lib/components/field/DateTime/DateTime.js.map +1 -1
- package/lib/components/field/Decimal/Decimal.d.ts +2 -3
- package/lib/components/field/Decimal/Decimal.d.ts.map +1 -1
- package/lib/components/field/Decimal/Decimal.js +18 -6
- package/lib/components/field/Decimal/Decimal.js.map +1 -1
- package/lib/components/field/Dropdown/Dropdown.d.ts +1 -2
- package/lib/components/field/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/components/field/Dropdown/Dropdown.js +3 -3
- package/lib/components/field/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/field/Email/Email.d.ts +1 -2
- package/lib/components/field/Email/Email.d.ts.map +1 -1
- package/lib/components/field/Email/Email.js +21 -5
- package/lib/components/field/Email/Email.js.map +1 -1
- package/lib/components/field/Group/Group.d.ts +1 -1
- package/lib/components/field/Group/Group.d.ts.map +1 -1
- package/lib/components/field/Group/Group.js +2 -2
- package/lib/components/field/Group/Group.js.map +1 -1
- package/lib/components/field/Integer/Integer.d.ts +1 -2
- package/lib/components/field/Integer/Integer.d.ts.map +1 -1
- package/lib/components/field/Integer/Integer.js +17 -6
- package/lib/components/field/Integer/Integer.js.map +1 -1
- package/lib/components/field/Multiselect/Multiselect.d.ts +2 -0
- package/lib/components/field/Multiselect/Multiselect.d.ts.map +1 -0
- package/lib/components/field/{MultiSelect → Multiselect}/Multiselect.js +12 -8
- package/lib/components/field/Multiselect/Multiselect.js.map +1 -0
- package/lib/components/field/Multiselect/index.d.ts.map +1 -0
- package/lib/components/field/{MultiSelect → Multiselect}/index.js.map +1 -1
- package/lib/components/field/{MultiSelect → Multiselect}/utils.d.ts.map +1 -1
- package/lib/components/field/{MultiSelect → Multiselect}/utils.js.map +1 -1
- package/lib/components/field/Percentage/Percentage.d.ts +3 -2
- package/lib/components/field/Percentage/Percentage.d.ts.map +1 -1
- package/lib/components/field/Percentage/Percentage.js +18 -9
- package/lib/components/field/Percentage/Percentage.js.map +1 -1
- package/lib/components/field/Phone/Phone.d.ts +1 -2
- package/lib/components/field/Phone/Phone.d.ts.map +1 -1
- package/lib/components/field/Phone/Phone.js +16 -10
- package/lib/components/field/Phone/Phone.js.map +1 -1
- package/lib/components/field/RadioButtons/RadioButtons.d.ts +1 -2
- package/lib/components/field/RadioButtons/RadioButtons.d.ts.map +1 -1
- package/lib/components/field/RadioButtons/RadioButtons.js +3 -3
- package/lib/components/field/RadioButtons/RadioButtons.js.map +1 -1
- package/lib/components/field/RichText/RichText.js +1 -1
- package/lib/components/field/RichText/RichText.js.map +1 -1
- package/lib/components/field/ScalarList/ScalarList.d.ts +1 -2
- package/lib/components/field/ScalarList/ScalarList.d.ts.map +1 -1
- package/lib/components/field/ScalarList/ScalarList.js +4 -2
- package/lib/components/field/ScalarList/ScalarList.js.map +1 -1
- package/lib/components/field/SemanticLink/SemanticLink.d.ts +1 -2
- package/lib/components/field/SemanticLink/SemanticLink.d.ts.map +1 -1
- package/lib/components/field/SemanticLink/SemanticLink.js +4 -4
- package/lib/components/field/SemanticLink/SemanticLink.js.map +1 -1
- package/lib/components/field/TextArea/TextArea.d.ts +1 -2
- package/lib/components/field/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/field/TextArea/TextArea.js +20 -4
- package/lib/components/field/TextArea/TextArea.js.map +1 -1
- package/lib/components/field/TextContent/TextContent.d.ts +1 -2
- package/lib/components/field/TextContent/TextContent.d.ts.map +1 -1
- package/lib/components/field/TextContent/TextContent.js +1 -1
- package/lib/components/field/TextContent/TextContent.js.map +1 -1
- package/lib/components/field/TextInput/TextInput.d.ts +1 -2
- package/lib/components/field/TextInput/TextInput.d.ts.map +1 -1
- package/lib/components/field/TextInput/TextInput.js +2 -2
- package/lib/components/field/TextInput/TextInput.js.map +1 -1
- package/lib/components/field/Time/Time.d.ts +1 -2
- package/lib/components/field/Time/Time.d.ts.map +1 -1
- package/lib/components/field/Time/Time.js +30 -7
- package/lib/components/field/Time/Time.js.map +1 -1
- package/lib/components/field/URL/URL.d.ts +1 -2
- package/lib/components/field/URL/URL.d.ts.map +1 -1
- package/lib/components/field/URL/URL.js +19 -4
- package/lib/components/field/URL/URL.js.map +1 -1
- package/lib/components/field/UserReference/UserReference.d.ts +1 -0
- package/lib/components/field/UserReference/UserReference.d.ts.map +1 -1
- package/lib/components/field/UserReference/UserReference.js +9 -2
- package/lib/components/field/UserReference/UserReference.js.map +1 -1
- package/lib/components/helpers/common-utils.d.ts +0 -1
- package/lib/components/helpers/common-utils.d.ts.map +1 -1
- package/lib/components/helpers/common-utils.js +1 -4
- package/lib/components/helpers/common-utils.js.map +1 -1
- package/lib/components/helpers/field-group-utils.js +2 -2
- package/lib/components/helpers/field-group-utils.js.map +1 -1
- package/lib/components/helpers/formatters/common.d.ts +2 -2
- package/lib/components/helpers/formatters/common.d.ts.map +1 -1
- package/lib/components/helpers/simpleTableHelpers.js +1 -1
- package/lib/components/helpers/simpleTableHelpers.js.map +1 -1
- package/lib/components/helpers/state-utils.d.ts +1 -2
- package/lib/components/helpers/state-utils.d.ts.map +1 -1
- package/lib/components/infra/ActionButtons/ActionButtons.d.ts +1 -2
- package/lib/components/infra/ActionButtons/ActionButtons.d.ts.map +1 -1
- package/lib/components/infra/ActionButtons/ActionButtons.js +3 -3
- package/lib/components/infra/ActionButtons/ActionButtons.js.map +1 -1
- package/lib/components/infra/Assignment/Assignment.d.ts +1 -1
- package/lib/components/infra/Assignment/Assignment.d.ts.map +1 -1
- package/lib/components/infra/Assignment/Assignment.js +30 -6
- package/lib/components/infra/Assignment/Assignment.js.map +1 -1
- package/lib/components/infra/AssignmentCard/AssignmentCard.d.ts +1 -1
- package/lib/components/infra/AssignmentCard/AssignmentCard.d.ts.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts +2 -2
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +9 -7
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.d.ts +1 -2
- package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.d.ts.map +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.js +7 -4
- package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.js.map +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts +1 -2
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js +7 -7
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js.map +1 -1
- package/lib/components/infra/Containers/SimpleView/SimpleView.d.ts +3 -3
- package/lib/components/infra/Containers/SimpleView/SimpleView.d.ts.map +1 -1
- package/lib/components/infra/Containers/SimpleView/helper.d.ts +3 -3
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts +1 -2
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.js +1 -1
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.js.map +1 -1
- package/lib/components/infra/Containers/helpers.d.ts +1 -1
- package/lib/components/infra/Containers/helpers.d.ts.map +1 -1
- package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts +1 -1
- package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts.map +1 -1
- package/lib/components/infra/DashboardFilter/DashboardFilter.js +2 -2
- package/lib/components/infra/DashboardFilter/DashboardFilter.js.map +1 -1
- package/lib/components/infra/DashboardFilter/filterUtils.d.ts +1 -2
- package/lib/components/infra/DashboardFilter/filterUtils.d.ts.map +1 -1
- package/lib/components/infra/DashboardFilter/filterUtils.js +2 -2
- package/lib/components/infra/DashboardFilter/filterUtils.js.map +1 -1
- package/lib/components/infra/DeferLoad/DeferLoad.d.ts.map +1 -1
- package/lib/components/infra/DeferLoad/DeferLoad.js +8 -4
- package/lib/components/infra/DeferLoad/DeferLoad.js.map +1 -1
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts +1 -2
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/lib/components/infra/MultiStep/MultiStep.d.ts +2 -2
- package/lib/components/infra/MultiStep/MultiStep.d.ts.map +1 -1
- package/lib/components/infra/MultiStep/MultiStep.js +11 -6
- package/lib/components/infra/MultiStep/MultiStep.js.map +1 -1
- package/lib/components/infra/NavBar/NavBar.css +1 -0
- package/lib/components/infra/NavBar/NavBar.d.ts +1 -2
- package/lib/components/infra/NavBar/NavBar.d.ts.map +1 -1
- package/lib/components/infra/NavBar/NavBar.js +24 -16
- package/lib/components/infra/NavBar/NavBar.js.map +1 -1
- package/lib/components/infra/Reference/Reference.d.ts +1 -2
- package/lib/components/infra/Reference/Reference.d.ts.map +1 -1
- package/lib/components/infra/Region/Region.d.ts +1 -1
- package/lib/components/infra/Region/Region.d.ts.map +1 -1
- package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
- package/lib/components/infra/RootContainer/RootContainer.js +5 -6
- package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
- package/lib/components/infra/Stages/Stages.d.ts +1 -2
- package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
- package/lib/components/infra/Stages/Stages.js +4 -4
- package/lib/components/infra/Stages/Stages.js.map +1 -1
- package/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.d.ts.map +1 -1
- package/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.js +4 -3
- package/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.js.map +1 -1
- package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.d.ts +1 -2
- package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.d.ts.map +1 -1
- package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.js +2 -2
- package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.js.map +1 -1
- package/lib/components/infra/View/View.d.ts +2 -1
- package/lib/components/infra/View/View.d.ts.map +1 -1
- package/lib/components/infra/View/View.js +32 -2
- package/lib/components/infra/View/View.js.map +1 -1
- package/lib/components/template/AppShell/AppShell.d.ts +3 -1
- package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/template/AppShell/AppShell.js +29 -6
- package/lib/components/template/AppShell/AppShell.js.map +1 -1
- package/lib/components/template/BannerPage/BannerPage.d.ts +1 -1
- package/lib/components/template/BannerPage/BannerPage.d.ts.map +1 -1
- package/lib/components/template/CaseSummary/CaseSummary.d.ts +1 -1
- package/lib/components/template/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/components/template/CaseView/CaseView.d.ts +1 -1
- package/lib/components/template/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/template/CaseView/CaseView.js +7 -7
- package/lib/components/template/CaseView/CaseView.js.map +1 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts +1 -2
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts.map +1 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js +7 -7
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js.map +1 -1
- package/lib/components/template/Confirmation/Confirmation.d.ts +1 -1
- package/lib/components/template/Confirmation/Confirmation.d.ts.map +1 -1
- package/lib/components/template/Confirmation/Confirmation.js +2 -1
- package/lib/components/template/Confirmation/Confirmation.js.map +1 -1
- package/lib/components/template/DataReference/DataReference.d.ts +1 -1
- package/lib/components/template/DataReference/DataReference.d.ts.map +1 -1
- package/lib/components/template/DataReference/DataReference.js +3 -3
- package/lib/components/template/DataReference/DataReference.js.map +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.d.ts +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
- package/lib/components/template/DefaultForm/utils/index.d.ts.map +1 -1
- package/lib/components/template/DefaultForm/utils/index.js +2 -6
- package/lib/components/template/DefaultForm/utils/index.js.map +1 -1
- package/lib/components/template/Details/Details/Details.d.ts +1 -2
- package/lib/components/template/Details/Details/Details.d.ts.map +1 -1
- package/lib/components/template/Details/Details/Details.js +3 -3
- package/lib/components/template/Details/Details/Details.js.map +1 -1
- package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.d.ts +1 -1
- package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.d.ts.map +1 -1
- package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.js +3 -3
- package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.js.map +1 -1
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts +1 -2
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts.map +1 -1
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js +3 -3
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js.map +1 -1
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts +1 -2
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts.map +1 -1
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js +3 -3
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js.map +1 -1
- package/lib/components/template/Details/DynamicTabs/DynamicTabs.d.ts +1 -2
- package/lib/components/template/Details/DynamicTabs/DynamicTabs.d.ts.map +1 -1
- package/lib/components/template/Details/DynamicTabs/DynamicTabs.js +4 -3
- package/lib/components/template/Details/DynamicTabs/DynamicTabs.js.map +1 -1
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts +1 -2
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts.map +1 -1
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js +11 -3
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js.map +1 -1
- package/lib/components/template/InlineDashboard/InlineDashboard.d.ts +1 -1
- package/lib/components/template/InlineDashboard/InlineDashboard.d.ts.map +1 -1
- package/lib/components/template/InlineDashboard/InlineDashboard.js +2 -2
- package/lib/components/template/InlineDashboard/InlineDashboard.js.map +1 -1
- package/lib/components/template/InlineDashboardPage/InlineDashboardPage.d.ts +1 -1
- package/lib/components/template/InlineDashboardPage/InlineDashboardPage.d.ts.map +1 -1
- package/lib/components/template/ListPage/ListPage.d.ts +1 -2
- package/lib/components/template/ListPage/ListPage.d.ts.map +1 -1
- package/lib/components/template/ListView/ListView.d.ts +1 -2
- package/lib/components/template/ListView/ListView.d.ts.map +1 -1
- package/lib/components/template/ListView/ListView.js +62 -67
- package/lib/components/template/ListView/ListView.js.map +1 -1
- package/lib/components/template/ListView/utils.js +1 -1
- package/lib/components/template/ListView/utils.js.map +1 -1
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts +1 -2
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts.map +1 -1
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js +1 -1
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.d.ts +1 -1
- package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.d.ts.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts +1 -2
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js +3 -3
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.d.ts +1 -1
- package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.d.ts.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.d.ts +1 -1
- package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.d.ts.map +1 -1
- package/lib/components/template/OneColumn/OneColumn/OneColumn.d.ts +1 -1
- package/lib/components/template/OneColumn/OneColumn/OneColumn.d.ts.map +1 -1
- package/lib/components/template/OneColumn/OneColumn/OneColumn.js +2 -2
- package/lib/components/template/OneColumn/OneColumn/OneColumn.js.map +1 -1
- package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.d.ts +1 -2
- package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.d.ts.map +1 -1
- package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.d.ts +1 -1
- package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.d.ts.map +1 -1
- package/lib/components/template/PromotedFilters/PromotedFilters.d.ts +1 -2
- package/lib/components/template/PromotedFilters/PromotedFilters.d.ts.map +1 -1
- package/lib/components/template/PromotedFilters/PromotedFilters.js +2 -1
- package/lib/components/template/PromotedFilters/PromotedFilters.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts +1 -2
- package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +36 -24
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts +1 -2
- package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts.map +1 -1
- package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.d.ts +1 -2
- package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.d.ts.map +1 -1
- package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.js +1 -1
- package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.js.map +1 -1
- package/lib/components/template/SubTabs/SubTabs.d.ts +1 -1
- package/lib/components/template/SubTabs/SubTabs.d.ts.map +1 -1
- package/lib/components/template/SubTabs/SubTabs.js +2 -2
- package/lib/components/template/SubTabs/SubTabs.js.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.d.ts +1 -1
- package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.d.ts.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.js +2 -2
- package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.js.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.d.ts +1 -2
- package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.d.ts.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.d.ts +1 -1
- package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.d.ts.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.js +2 -2
- package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.js.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.d.ts +1 -1
- package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.d.ts.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts +1 -2
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js +3 -3
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.d.ts +1 -1
- package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.d.ts.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.d.ts +1 -1
- package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.d.ts.map +1 -1
- package/lib/components/template/WssNavBar/WssNavBar.d.ts +1 -2
- package/lib/components/template/WssNavBar/WssNavBar.d.ts.map +1 -1
- package/lib/components/template/WssNavBar/WssNavBar.js +9 -9
- package/lib/components/template/WssNavBar/WssNavBar.js.map +1 -1
- package/lib/components/widget/AppAnnouncement/AppAnnouncement.d.ts +1 -2
- package/lib/components/widget/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
- package/lib/components/widget/AppAnnouncement/AppAnnouncement.js +2 -2
- package/lib/components/widget/AppAnnouncement/AppAnnouncement.js.map +1 -1
- package/lib/components/widget/Attachment/Attachment.d.ts +1 -2
- package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
- package/lib/components/widget/Attachment/Attachment.js +8 -5
- package/lib/components/widget/Attachment/Attachment.js.map +1 -1
- package/lib/components/widget/CaseHistory/CaseHistory.d.ts +1 -2
- package/lib/components/widget/CaseHistory/CaseHistory.d.ts.map +1 -1
- package/lib/components/widget/CaseHistory/CaseHistory.js +8 -7
- package/lib/components/widget/CaseHistory/CaseHistory.js.map +1 -1
- package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.d.ts +1 -2
- package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.d.ts.map +1 -1
- package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.js +1 -1
- package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.js.map +1 -1
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts +1 -2
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts.map +1 -1
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.js +4 -4
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.js.map +1 -1
- package/lib/components/widget/Followers/Followers.d.ts +1 -1
- package/lib/components/widget/Followers/Followers.d.ts.map +1 -1
- package/lib/components/widget/Followers/Followers.js +2 -2
- package/lib/components/widget/Followers/Followers.js.map +1 -1
- package/lib/components/widget/QuickCreate/QuickCreate.d.ts +1 -2
- package/lib/components/widget/QuickCreate/QuickCreate.d.ts.map +1 -1
- package/lib/components/widget/QuickCreate/QuickCreate.js +1 -0
- package/lib/components/widget/QuickCreate/QuickCreate.js.map +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.d.ts +1 -2
- package/lib/components/widget/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.js +3 -3
- package/lib/components/widget/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/widget/SummaryList/SummaryList.d.ts +1 -2
- package/lib/components/widget/SummaryList/SummaryList.d.ts.map +1 -1
- package/lib/components/widget/ToDo/ToDo.d.ts +1 -2
- package/lib/components/widget/ToDo/ToDo.d.ts.map +1 -1
- package/lib/components/widget/ToDo/ToDo.js +59 -16
- package/lib/components/widget/ToDo/ToDo.js.map +1 -1
- package/lib/doc/KeyReleaseUpdates.md +19 -7
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +2 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useFocusFirstField.d.ts +7 -0
- package/lib/hooks/useFocusFirstField.d.ts.map +1 -0
- package/lib/hooks/useFocusFirstField.js +20 -0
- package/lib/hooks/useFocusFirstField.js.map +1 -0
- package/lib/hooks/useScrolltoTop.d.ts +7 -0
- package/lib/hooks/useScrolltoTop.d.ts.map +1 -0
- package/lib/hooks/useScrolltoTop.js +13 -0
- package/lib/hooks/useScrolltoTop.js.map +1 -0
- package/lib/sdk-pega-component-map.d.ts +1 -1
- package/lib/sdk-pega-component-map.js +1 -1
- package/lib/sdk-pega-component-map.js.map +1 -1
- package/lib/theme.d.ts +11 -0
- package/lib/theme.d.ts.map +1 -0
- package/lib/theme.js +31 -0
- package/lib/theme.js.map +1 -0
- package/package.json +1 -1
- package/lib/components/field/MultiSelect/Multiselect.d.ts +0 -3
- package/lib/components/field/MultiSelect/Multiselect.d.ts.map +0 -1
- package/lib/components/field/MultiSelect/Multiselect.js.map +0 -1
- package/lib/components/field/MultiSelect/index.d.ts.map +0 -1
- /package/lib/components/field/{MultiSelect → Multiselect}/index.d.ts +0 -0
- /package/lib/components/field/{MultiSelect → Multiselect}/index.js +0 -0
- /package/lib/components/field/{MultiSelect → Multiselect}/utils.d.ts +0 -0
- /package/lib/components/field/{MultiSelect → Multiselect}/utils.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TwoColumnTab.d.ts","sourceRoot":"","sources":["../../../../../src/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAgB,MAAM,OAAO,CAAC;AAGxD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,UAAU,iBAAkB,SAAQ,UAAU;IAE5C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAUD,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"TwoColumnTab.d.ts","sourceRoot":"","sources":["../../../../../src/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAgB,MAAM,OAAO,CAAC;AAGxD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,UAAU,iBAAkB,SAAQ,UAAU;IAE5C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAUD,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,2CAoC/E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Grid } from '@material
|
|
3
|
-
import
|
|
2
|
+
import { Grid } from '@mui/material';
|
|
3
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
4
4
|
const useStyles = makeStyles(() => ({
|
|
5
5
|
colStyles: {
|
|
6
6
|
display: 'grid',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TwoColumnTab.js","sourceRoot":"","sources":["../../../../../src/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAY,MAAM,
|
|
1
|
+
{"version":3,"file":"TwoColumnTab.js","sourceRoot":"","sources":["../../../../../src/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAY,MAAM,eAAe,CAAC;AAC/C,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAQhD,MAAM,SAAS,GAAG,UAAU,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EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,YACvD,gBAAgB,CAAC,CAAC,CAAC,GACf,EACP,KAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,YACvD,gBAAgB,CAAC,CAAC,CAAC,GACf,IACF,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { PropsWithChildren, ReactElement } from 'react';\nimport { Grid, GridSize } from '@mui/material';\nimport makeStyles from '@mui/styles/makeStyles';\nimport { PConnProps } from '../../../../types/PConnProps';\n\ninterface TwoColumnTabProps extends PConnProps {\n // If any, enter additional props that only exist on this component\n templateCol?: string;\n}\n\nconst useStyles = makeStyles(() => ({\n colStyles: {\n display: 'grid',\n gap: '1rem',\n alignContent: 'baseline'\n }\n}));\n\nexport default function TwoColumnTab(props: PropsWithChildren<TwoColumnTabProps>) {\n const classes = useStyles();\n\n const { children, templateCol = '1fr 1fr' } = props;\n const childrenToRender = children as ReactElement[];\n\n if (childrenToRender.length !== 2) {\n // eslint-disable-next-line no-console\n console.error(`TwoColumn template sees more than 2 columns: ${childrenToRender.length}`);\n }\n\n // Calculate the size\n // Default to assume the 2 columns are evenly split. However, override if templateCol\n // (example value: \"1fr 1fr\")\n let aSize: GridSize = 6;\n let bSize: GridSize = 6;\n\n const colAArray = templateCol\n .replaceAll(/[a-z]+/g, '')\n .split(/\\s/)\n .map(itm => Number(itm));\n const totalCols = colAArray.reduce((v, itm) => itm + v, 0);\n const ratio = 12 / totalCols;\n aSize = (ratio * colAArray[0]) as GridSize;\n bSize = (ratio * colAArray[1]) as GridSize;\n\n return (\n <Grid container spacing={1}>\n <Grid item xs={12} md={aSize} className={classes.colStyles}>\n {childrenToRender[0]}\n </Grid>\n <Grid item xs={12} md={bSize} className={classes.colStyles}>\n {childrenToRender[1]}\n </Grid>\n </Grid>\n );\n}\n"]}
|
|
@@ -8,6 +8,6 @@ interface WideNarrowProps extends PConnProps {
|
|
|
8
8
|
cols?: string;
|
|
9
9
|
icon?: string;
|
|
10
10
|
}
|
|
11
|
-
export default function WideNarrow(props: PropsWithChildren<WideNarrowProps>): JSX.Element;
|
|
11
|
+
export default function WideNarrow(props: PropsWithChildren<WideNarrowProps>): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=WideNarrow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WideNarrow.d.ts","sourceRoot":"","sources":["../../../../../src/components/template/WideNarrow/WideNarrow/WideNarrow.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAgB,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,kBAAkB,CAAC;AAE1B,UAAU,eAAgB,SAAQ,UAAU;IAE1C,CAAC,EAAE,GAAG,CAAC;IACP,CAAC,EAAE,GAAG,CAAC;IAEP,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,iBAAiB,CAAC,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"WideNarrow.d.ts","sourceRoot":"","sources":["../../../../../src/components/template/WideNarrow/WideNarrow/WideNarrow.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAgB,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,kBAAkB,CAAC;AAE1B,UAAU,eAAgB,SAAQ,UAAU;IAE1C,CAAC,EAAE,GAAG,CAAC;IACP,CAAC,EAAE,GAAG,CAAC;IAEP,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,iBAAiB,CAAC,eAAe,CAAC,2CAoB3E"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PConnProps } from '../../../../types/PConnProps';
|
|
3
2
|
interface WideNarrowDetailsProps extends PConnProps {
|
|
4
3
|
showLabel?: boolean;
|
|
5
4
|
label?: string;
|
|
6
5
|
showHighlightedData?: boolean;
|
|
7
6
|
}
|
|
8
|
-
export default function WideNarrowDetails(props: WideNarrowDetailsProps): JSX.Element;
|
|
7
|
+
export default function WideNarrowDetails(props: WideNarrowDetailsProps): import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export {};
|
|
10
9
|
//# sourceMappingURL=WideNarrowDetails.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WideNarrowDetails.d.ts","sourceRoot":"","sources":["../../../../../src/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WideNarrowDetails.d.ts","sourceRoot":"","sources":["../../../../../src/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,UAAU,sBAAuB,SAAQ,UAAU;IAEjD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAID,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAoEtE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { createElement } from 'react';
|
|
3
|
-
import Grid from '@material
|
|
3
|
+
import Grid from '@mui/material/Grid';
|
|
4
4
|
import createPConnectComponent from '../../../../bridge/react_pconnect';
|
|
5
5
|
import { getComponentFromMap } from '../../../../bridge/helpers/sdk_component_map';
|
|
6
6
|
const COLUMN_WIDTHS = [8, 4];
|
|
@@ -12,7 +12,7 @@ export default function WideNarrowDetails(props) {
|
|
|
12
12
|
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
13
13
|
// Set display mode prop and re-create the children so this part of the dom tree renders
|
|
14
14
|
// in a readonly (display) mode instead of a editable
|
|
15
|
-
getPConnect().setInheritedProp('displayMode', '
|
|
15
|
+
getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
16
16
|
getPConnect().setInheritedProp('readOnly', true);
|
|
17
17
|
const children = getPConnect().getChildren()?.map((configObject, index) => {
|
|
18
18
|
let theConfigObject = configObject;
|
|
@@ -36,7 +36,7 @@ export default function WideNarrowDetails(props) {
|
|
|
36
36
|
field.type = 'TextInput';
|
|
37
37
|
field.config.displayAsStatus = true;
|
|
38
38
|
}
|
|
39
|
-
return getPConnect().createComponent(field, '',
|
|
39
|
+
return getPConnect().createComponent(field, '', 0, {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
let theName = '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WideNarrowDetails.js","sourceRoot":"","sources":["../../../../../src/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAkB,MAAM,
|
|
1
|
+
{"version":3,"file":"WideNarrowDetails.js","sourceRoot":"","sources":["../../../../../src/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAkB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AAC,CAAC,CAAa,YACxC,KAAK,IAD0C,KAAK,CAAC,GAAG,CAAC,EAAE,CAEvD,CACR,CAAC,GACG,IACI,CACd,CAAC;AACJ,CAAC","sourcesContent":["import { createElement } from 'react';\nimport Grid, { GridSize } from '@mui/material/Grid';\n\nimport createPConnectComponent from '../../../../bridge/react_pconnect';\nimport { getComponentFromMap } from '../../../../bridge/helpers/sdk_component_map';\n\nimport { PConnProps } from '../../../../types/PConnProps';\n\ninterface WideNarrowDetailsProps extends PConnProps {\n // If any, enter additional props that only exist on this component\n showLabel?: boolean;\n label?: string;\n showHighlightedData?: boolean;\n}\n\nconst COLUMN_WIDTHS = [8, 4];\n\nexport default function WideNarrowDetails(props: WideNarrowDetailsProps) {\n // Get emitted components from map (so we can get any override that may exist)\n const FieldGroup = getComponentFromMap('FieldGroup');\n\n const { label, showLabel = true, getPConnect, showHighlightedData = false } = props;\n\n // Get the inherited props from the parent to determine label settings\n const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };\n\n // Set display mode prop and re-create the children so this part of the dom tree renders\n // in a readonly (display) mode instead of a editable\n getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');\n getPConnect().setInheritedProp('readOnly', true);\n const children = (getPConnect().getChildren() as any[])?.map((configObject, index) => {\n let theConfigObject: object = configObject;\n if (!theConfigObject) {\n theConfigObject = {};\n }\n\n return createElement(createPConnectComponent(), {\n ...theConfigObject,\n // eslint-disable-next-line react/no-array-index-key\n key: index.toString()\n });\n });\n\n // Set up highlighted data to pass in return if is set to show, need raw metadata to pass to createComponent\n let highlightedDataArr = [];\n if (showHighlightedData) {\n const { highlightedData = [] } = (getPConnect().getRawMetadata() as any).config;\n highlightedDataArr = highlightedData.map(field => {\n field.config.displayMode = 'STACKED_LARGE_VAL';\n\n // Mark as status display when using pyStatusWork\n if (field.config.value === '@P .pyStatusWork') {\n field.type = 'TextInput';\n field.config.displayAsStatus = true;\n }\n\n return getPConnect().createComponent(field, '', 0, {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional\n });\n }\n\n let theName = '';\n if (propsToUse?.showLabel && propsToUse.label) {\n theName = propsToUse.label;\n }\n\n return (\n <FieldGroup name={theName}>\n {showHighlightedData && highlightedDataArr.length > 0 && (\n <Grid container spacing={1} style={{ padding: '0 0 1em' }}>\n {highlightedDataArr.map((child, i) => (\n <Grid item xs={COLUMN_WIDTHS[i] as GridSize} key={`hf-${i + 1}`}>\n {child}\n </Grid>\n ))}\n </Grid>\n )}\n <Grid container spacing={1}>\n {children?.map((child, i) => (\n <Grid item xs={COLUMN_WIDTHS[i] as GridSize} key={`r-${i + 1}`}>\n {child}\n </Grid>\n ))}\n </Grid>\n </FieldGroup>\n );\n}\n"]}
|
|
@@ -3,6 +3,6 @@ import { PConnProps } from '../../../../types/PConnProps';
|
|
|
3
3
|
import './WideNarrowForm.css';
|
|
4
4
|
interface WideNarrowFormProps extends PConnProps {
|
|
5
5
|
}
|
|
6
|
-
export default function WideNarrowForm(props: PropsWithChildren<WideNarrowFormProps>): JSX.Element;
|
|
6
|
+
export default function WideNarrowForm(props: PropsWithChildren<WideNarrowFormProps>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=WideNarrowForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WideNarrowForm.d.ts","sourceRoot":"","sources":["../../../../../src/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAgB,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,sBAAsB,CAAC;AAE9B,UAAU,mBAAoB,SAAQ,UAAU;CAE/C;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,iBAAiB,CAAC,mBAAmB,CAAC,
|
|
1
|
+
{"version":3,"file":"WideNarrowForm.d.ts","sourceRoot":"","sources":["../../../../../src/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAgB,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,sBAAsB,CAAC;AAE9B,UAAU,mBAAoB,SAAQ,UAAU;CAE/C;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,iBAAiB,CAAC,mBAAmB,CAAC,2CAanF"}
|
|
@@ -5,6 +5,6 @@ interface WideNarrowPageProps extends PConnProps {
|
|
|
5
5
|
templateCol?: string;
|
|
6
6
|
icon?: string;
|
|
7
7
|
}
|
|
8
|
-
export default function WideNarrowPage(props: PropsWithChildren<WideNarrowPageProps>): JSX.Element;
|
|
8
|
+
export default function WideNarrowPage(props: PropsWithChildren<WideNarrowPageProps>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=WideNarrowPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WideNarrowPage.d.ts","sourceRoot":"","sources":["../../../../../src/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,UAAU,mBAAoB,SAAQ,UAAU;IAE9C,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAMD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,iBAAiB,CAAC,mBAAmB,CAAC,
|
|
1
|
+
{"version":3,"file":"WideNarrowPage.d.ts","sourceRoot":"","sources":["../../../../../src/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,UAAU,mBAAoB,SAAQ,UAAU;IAE9C,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAMD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,iBAAiB,CAAC,mBAAmB,CAAC,2CAYnF"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PConnProps } from '../../../types/PConnProps';
|
|
3
2
|
import './WssNavBar.css';
|
|
4
3
|
interface WssNavBarProps extends PConnProps {
|
|
@@ -16,6 +15,6 @@ interface WssNavBarProps extends PConnProps {
|
|
|
16
15
|
fullImageSrc: string;
|
|
17
16
|
appName: any;
|
|
18
17
|
}
|
|
19
|
-
export default function WssNavBar(props: WssNavBarProps): JSX.Element;
|
|
18
|
+
export default function WssNavBar(props: WssNavBarProps): import("react/jsx-runtime").JSX.Element;
|
|
20
19
|
export {};
|
|
21
20
|
//# sourceMappingURL=WssNavBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WssNavBar.d.ts","sourceRoot":"","sources":["../../../../src/components/template/WssNavBar/WssNavBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WssNavBar.d.ts","sourceRoot":"","sources":["../../../../src/components/template/WssNavBar/WssNavBar.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,iBAAiB,CAAC;AAEzB,UAAU,cAAe,SAAQ,UAAU;IAEzC,OAAO,EAAE,GAAG,CAAC;IACb,QAAQ,EAAE,GAAG,EAAE,CAAC;IAChB,QAAQ,EAAE;QAAE,mBAAmB,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,iBAAiB,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAE3D,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IAEjB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,GAAG,CAAC;CACd;AAuBD,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,EAAE,cAAc,2CA+GtD"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import AppBar from '@material
|
|
5
|
-
import Box from '@material
|
|
6
|
-
import Toolbar from '@material
|
|
7
|
-
import Container from '@material
|
|
8
|
-
import { IconButton, Menu, MenuItem, Typography, Button } from '@material
|
|
9
|
-
import Avatar from '@material
|
|
10
|
-
import MenuIcon from '@
|
|
3
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
4
|
+
import AppBar from '@mui/material/AppBar';
|
|
5
|
+
import Box from '@mui/material/Box';
|
|
6
|
+
import Toolbar from '@mui/material/Toolbar';
|
|
7
|
+
import Container from '@mui/material/Container';
|
|
8
|
+
import { IconButton, Menu, MenuItem, Typography, Button } from '@mui/material';
|
|
9
|
+
import Avatar from '@mui/material/Avatar';
|
|
10
|
+
import MenuIcon from '@mui/icons-material/Menu';
|
|
11
11
|
import { logout } from '@pega/auth/lib/sdk-auth-manager';
|
|
12
12
|
import './WssNavBar.css';
|
|
13
13
|
const useStyles = makeStyles(theme => ({
|
|
@@ -57,7 +57,7 @@ export default function WssNavBar(props) {
|
|
|
57
57
|
}, keepMounted: true, transformOrigin: {
|
|
58
58
|
vertical: 'top',
|
|
59
59
|
horizontal: 'left'
|
|
60
|
-
}, open: Boolean(anchorElNav), onClose: handleCloseNavMenu, children: navLinks.map(link => (_jsx(MenuItem, { onClick: link.onClick, children: _jsx(Typography, { children: link.text }) }, link.text))) })] }), position === 'inline' && _jsx(_Fragment, { children: navLinksContent }), _jsxs(Box, { sx: { flexGrow: 0 }, children: [_jsx(IconButton, { onClick: handleOpenUserMenu, children: _jsx(Avatar, { children: operator.currentUserInitials }) }), _jsx(Menu, { id: 'menu-appbar', anchorEl: anchorElUser, anchorOrigin: {
|
|
60
|
+
}, open: Boolean(anchorElNav), onClose: handleCloseNavMenu, children: navLinks.map(link => (_jsx(MenuItem, { onClick: link.onClick, children: _jsx(Typography, { children: link.text }) }, link.text))) })] }), position === 'inline' && _jsx(_Fragment, { children: navLinksContent }), _jsxs(Box, { sx: { flexGrow: 0 }, children: [_jsx(IconButton, { onClick: handleOpenUserMenu, size: 'large', children: _jsx(Avatar, { children: operator.currentUserInitials }) }), _jsx(Menu, { id: 'menu-appbar', anchorEl: anchorElUser, anchorOrigin: {
|
|
61
61
|
vertical: 'top',
|
|
62
62
|
horizontal: 'right'
|
|
63
63
|
}, keepMounted: true, transformOrigin: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WssNavBar.js","sourceRoot":"","sources":["../../../../src/components/template/WssNavBar/WssNavBar.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"WssNavBar.js","sourceRoot":"","sources":["../../../../src/components/template/WssNavBar/WssNavBar.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAA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AAE,QAAQ,CAAC,mBAAmB,GAAU,GACpC,EACb,KAAC,IAAI,IACH,EAAE,EAAC,aAAa,EAChB,QAAQ,EAAE,YAAY,EACtB,YAAY,EAAE;4CACZ,QAAQ,EAAE,KAAK;4CACf,UAAU,EAAE,OAAO;yCACpB,EACD,WAAW,QACX,eAAe,EAAE;4CACf,QAAQ,EAAE,KAAK;4CACf,UAAU,EAAE,OAAO;yCACpB,EACD,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,EAC3B,OAAO,EAAE,mBAAmB,YAE5B,KAAC,QAAQ,IAAC,OAAO,EAAE,MAAM,YACvB,KAAC,UAAU,cAAE,YAAY,CAAC,SAAS,EAAE,cAAc,CAAC,GAAc,GACzD,GACN,IACH,IACE,EACT,QAAQ,KAAK,OAAO,IAAI,4BAAG,eAAe,GAAI,IACrC,GACL,GACL,CACP,CAAC;AACJ,CAAC","sourcesContent":["import React, { useState } from 'react';\nimport makeStyles from '@mui/styles/makeStyles';\nimport AppBar from '@mui/material/AppBar';\nimport Box from '@mui/material/Box';\nimport Toolbar from '@mui/material/Toolbar';\nimport Container from '@mui/material/Container';\nimport { IconButton, Menu, MenuItem, Typography, Button } from '@mui/material';\nimport Avatar from '@mui/material/Avatar';\nimport MenuIcon from '@mui/icons-material/Menu';\nimport { logout } from '@pega/auth/lib/sdk-auth-manager';\nimport { PConnProps } from '../../../types/PConnProps';\nimport './WssNavBar.css';\n\ninterface WssNavBarProps extends PConnProps {\n // If any, enter additional props that only exist on this component\n appInfo: any;\n navLinks: any[];\n operator: { currentUserInitials: string };\n navDisplayOptions: { alignment: string; position: string };\n // eslint-disable-next-line react/no-unused-prop-types\n portalName: string;\n imageSrc: string;\n // eslint-disable-next-line react/no-unused-prop-types\n fullImageSrc: string;\n appName: any;\n}\n\nconst useStyles = makeStyles(theme => ({\n root: {\n display: 'flex'\n },\n content: {\n flexGrow: 1,\n height: '100vh',\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2)\n },\n appListLogo: {\n width: '3.6rem'\n },\n appName: {\n color: 'white',\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(4),\n fontSize: '1.5rem'\n }\n}));\n\nexport default function WssNavBar(props: WssNavBarProps) {\n const { appInfo, navLinks, operator, navDisplayOptions } = props;\n const { alignment, position } = navDisplayOptions;\n const classes = useStyles();\n\n const [anchorElNav, setAnchorElNav] = useState<null | HTMLElement>(null);\n const [anchorElUser, setAnchorElUser] = useState<null | HTMLElement>(null);\n\n const localizedVal = PCore.getLocaleUtils().getLocaleValue;\n const localeCategory = 'AppShell';\n\n const handleOpenNavMenu = (event: React.MouseEvent<HTMLElement>) => {\n setAnchorElNav(event.currentTarget);\n };\n const handleOpenUserMenu = (event: React.MouseEvent<HTMLElement>) => {\n setAnchorElUser(event.currentTarget);\n };\n\n const handleCloseNavMenu = () => {\n setAnchorElNav(null);\n };\n\n const handleCloseUserMenu = () => {\n setAnchorElUser(null);\n };\n\n const navLinksContent = (\n <Box id='nav-links' sx={{ flexGrow: 1, display: { xs: 'none', md: 'flex' } }} style={{ justifyContent: alignment }}>\n {navLinks.map(link => (\n <Button className='link-style' key={link.text} onClick={link.onClick}>\n {link.text}\n </Button>\n ))}\n </Box>\n );\n\n return (\n <div id='NavBar' className='nav-bar'>\n <AppBar position='static' color='primary'>\n <Container maxWidth='xl'>\n <Toolbar disableGutters style={{ justifyContent: 'space-between' }}>\n <Button id='appName' style={{ textTransform: 'capitalize' }} onClick={appInfo.onClick}>\n <img src={appInfo.imageSrc} className={classes.appListLogo} />\n <span className={classes.appName}>{appInfo.appName}</span>\n </Button>\n <Box sx={{ flexGrow: 1, display: { xs: 'flex', md: 'none' } }}>\n <IconButton\n size='small'\n aria-label='account of current user'\n aria-controls='menu-appbar'\n aria-haspopup='true'\n onClick={handleOpenNavMenu}\n color='inherit'\n >\n <MenuIcon />\n </IconButton>\n <Menu\n id='menu-appbar'\n anchorEl={anchorElNav}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'left'\n }}\n keepMounted\n transformOrigin={{\n vertical: 'top',\n horizontal: 'left'\n }}\n open={Boolean(anchorElNav)}\n onClose={handleCloseNavMenu}\n >\n {navLinks.map(link => (\n <MenuItem key={link.text} onClick={link.onClick}>\n <Typography>{link.text}</Typography>\n </MenuItem>\n ))}\n </Menu>\n </Box>\n\n {position === 'inline' && <>{navLinksContent}</>}\n\n <Box sx={{ flexGrow: 0 }}>\n <IconButton onClick={handleOpenUserMenu} size='large'>\n <Avatar>{operator.currentUserInitials}</Avatar>\n </IconButton>\n <Menu\n id='menu-appbar'\n anchorEl={anchorElUser}\n anchorOrigin={{\n vertical: 'top',\n horizontal: 'right'\n }}\n keepMounted\n transformOrigin={{\n vertical: 'top',\n horizontal: 'right'\n }}\n open={Boolean(anchorElUser)}\n onClose={handleCloseUserMenu}\n >\n <MenuItem onClick={logout}>\n <Typography>{localizedVal('Log off', localeCategory)}</Typography>\n </MenuItem>\n </Menu>\n </Box>\n </Toolbar>\n {position === 'below' && <>{navLinksContent}</>}\n </Container>\n </AppBar>\n </div>\n );\n}\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PConnProps } from '../../../types/PConnProps';
|
|
3
2
|
interface AppAnnouncementProps extends PConnProps {
|
|
4
3
|
header?: string;
|
|
@@ -6,6 +5,6 @@ interface AppAnnouncementProps extends PConnProps {
|
|
|
6
5
|
datasource?: any;
|
|
7
6
|
whatsnewlink?: string;
|
|
8
7
|
}
|
|
9
|
-
export default function AppAnnouncement(props: AppAnnouncementProps): JSX.Element;
|
|
8
|
+
export default function AppAnnouncement(props: AppAnnouncementProps): import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export {};
|
|
11
10
|
//# sourceMappingURL=AppAnnouncement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppAnnouncement.d.ts","sourceRoot":"","sources":["../../../../src/components/widget/AppAnnouncement/AppAnnouncement.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppAnnouncement.d.ts","sourceRoot":"","sources":["../../../../src/components/widget/AppAnnouncement/AppAnnouncement.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,UAAU,oBAAqB,SAAQ,UAAU;IAE/C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAWD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CAsClE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Card, CardContent, CardHeader, Typography, CardActions, Button } from '@material
|
|
3
|
-
import
|
|
2
|
+
import { Card, CardContent, CardHeader, Typography, CardActions, Button } from '@mui/material';
|
|
3
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
4
4
|
const useStyles = makeStyles(theme => ({
|
|
5
5
|
root: {
|
|
6
6
|
marginTop: theme.spacing(1),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppAnnouncement.js","sourceRoot":"","sources":["../../../../src/components/widget/AppAnnouncement/AppAnnouncement.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AppAnnouncement.js","sourceRoot":"","sources":["../../../../src/components/widget/AppAnnouncement/AppAnnouncement.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/F,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAWhD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AG,EAAE,CAAC;wBACpC,OAAO,CACL,MAAC,UAAU,IAAc,OAAO,EAAC,OAAO,mBACnC,GAAG,KADS,MAAM,CAEV,CACd,CAAC;oBACJ,CAAC,CAAC,IACU,EACd,KAAC,WAAW,cACV,KAAC,MAAM,IAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAC,OAAO,+BAEjD,GACG,IACT,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { Card, CardContent, CardHeader, Typography, CardActions, Button } from '@mui/material';\nimport makeStyles from '@mui/styles/makeStyles';\nimport { PConnProps } from '../../../types/PConnProps';\n\ninterface AppAnnouncementProps extends PConnProps {\n // If any, enter additional props that only exist on this component\n header?: string;\n description?: string;\n datasource?: any;\n whatsnewlink?: string;\n}\n\nconst useStyles = makeStyles(theme => ({\n root: {\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n borderLeft: '6px solid',\n borderLeftColor: theme.palette.primary.light\n }\n}));\n\nexport default function AppAnnouncement(props: AppAnnouncementProps) {\n const { header = '', description = '', datasource = [], whatsnewlink = '' } = props;\n let details = [];\n if (datasource && datasource.source) {\n details = datasource.source.map(item => {\n return item.name;\n });\n }\n\n const classes = useStyles();\n\n const handleClick = () => {\n window.open(whatsnewlink);\n };\n\n return (\n <Card title='AppAnnouncement' className={classes.root}>\n <CardHeader title={<Typography variant='h6'>{header}</Typography>} />\n <CardContent>\n <Typography variant='body1' gutterBottom>\n {description}\n </Typography>\n {details.map((itm, idx) => {\n const theKey = `AppAnn-item-${idx}`;\n return (\n <Typography key={theKey} variant='body2'>\n - {itm}\n </Typography>\n );\n })}\n </CardContent>\n <CardActions>\n <Button color='primary' onClick={handleClick} size='small'>\n See what's new\n </Button>\n </CardActions>\n </Card>\n );\n}\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PConnFieldProps } from '../../../types/PConnProps';
|
|
3
2
|
import './Attachment.css';
|
|
4
3
|
interface AttachmentProps extends Omit<PConnFieldProps, 'value'> {
|
|
@@ -6,6 +5,6 @@ interface AttachmentProps extends Omit<PConnFieldProps, 'value'> {
|
|
|
6
5
|
allowMultiple: string;
|
|
7
6
|
extensions: string;
|
|
8
7
|
}
|
|
9
|
-
export default function Attachment(props: AttachmentProps): JSX.Element;
|
|
8
|
+
export default function Attachment(props: AttachmentProps): import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export {};
|
|
11
10
|
//# sourceMappingURL=Attachment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Attachment.d.ts","sourceRoot":"","sources":["../../../../src/components/widget/Attachment/Attachment.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Attachment.d.ts","sourceRoot":"","sources":["../../../../src/components/widget/Attachment/Attachment.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,kBAAkB,CAAC;AAE1B,UAAU,eAAgB,SAAQ,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC;IAE9D,KAAK,EAAE,GAAG,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAeD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,eAAe,2CAibxD"}
|
|
@@ -3,12 +3,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
/* eslint-disable react/no-array-index-key */
|
|
4
4
|
/* eslint-disable no-nested-ternary */
|
|
5
5
|
import { useState, useEffect, useCallback } from 'react';
|
|
6
|
-
import { CircularProgress, IconButton, Menu, MenuItem, Button } from '@material
|
|
7
|
-
import MoreVertIcon from '@
|
|
6
|
+
import { CircularProgress, IconButton, Menu, MenuItem, Button } from '@mui/material';
|
|
7
|
+
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
|
8
8
|
import download from 'downloadjs';
|
|
9
9
|
import { buildFilePropsFromResponse, getIconFromFileType, validateMaxSize } from '../../helpers/attachmentHelpers';
|
|
10
10
|
import { Utils } from '../../helpers/utils';
|
|
11
|
-
import { isInfinity23OrHigher } from '../../helpers/common-utils';
|
|
12
11
|
import './Attachment.css';
|
|
13
12
|
const getAttachmentKey = (name = '') => (name ? `attachmentsList.${name}` : 'attachmentsList');
|
|
14
13
|
const getCurrentAttachmentsList = (key, context) => {
|
|
@@ -45,7 +44,7 @@ export default function Attachment(props) {
|
|
|
45
44
|
const [filesWithError, setFilesWithError] = useState([]);
|
|
46
45
|
const [toggleUploadBegin, setToggleUploadBegin] = useState(false);
|
|
47
46
|
const resetAttachmentStoredState = () => {
|
|
48
|
-
PCore.getStateUtils().updateState(pConn.getContextName(), getAttachmentKey(
|
|
47
|
+
PCore.getStateUtils().updateState(pConn.getContextName(), getAttachmentKey(valueRef), undefined, {
|
|
49
48
|
pageReference: 'context_data',
|
|
50
49
|
isArrayDeepMerge: false
|
|
51
50
|
});
|
|
@@ -131,6 +130,7 @@ export default function Attachment(props) {
|
|
|
131
130
|
messages: [
|
|
132
131
|
{
|
|
133
132
|
type: 'error',
|
|
133
|
+
// @ts-ignore - Type '{ type: string; message: string; }' is not assignable to type 'MessagesConfigObject'.
|
|
134
134
|
message: pConn.getLocalizedValue('Error with one or more files', '', '')
|
|
135
135
|
}
|
|
136
136
|
],
|
|
@@ -185,10 +185,12 @@ export default function Attachment(props) {
|
|
|
185
185
|
};
|
|
186
186
|
if (!validateMaxSize(f, maxAttachmentSize)) {
|
|
187
187
|
f.props.error = true;
|
|
188
|
+
f.inProgress = false;
|
|
188
189
|
f.props.meta = pConn.getLocalizedValue(`File is too big. Max allowed size is ${maxAttachmentSize}MB.`, '', '');
|
|
189
190
|
}
|
|
190
191
|
else if (!validateFileExtension(f, extensions)) {
|
|
191
192
|
f.props.error = true;
|
|
193
|
+
f.inProgress = false;
|
|
192
194
|
f.props.meta = `${pConn.getLocalizedValue('File has invalid extension. Allowed extensions are:', '', '')} ${extensions.replaceAll('.', '')}`;
|
|
193
195
|
}
|
|
194
196
|
if (f.props.error) {
|
|
@@ -199,6 +201,7 @@ export default function Attachment(props) {
|
|
|
199
201
|
messages: [
|
|
200
202
|
{
|
|
201
203
|
type: 'error',
|
|
204
|
+
// @ts-ignore - Type '{ type: string; message: string; }' is not assignable to type 'MessagesConfigObject'.
|
|
202
205
|
message: pConn.getLocalizedValue('Error with one or more files', '', '')
|
|
203
206
|
}
|
|
204
207
|
],
|
|
@@ -324,7 +327,7 @@ export default function Attachment(props) {
|
|
|
324
327
|
const fileDisplay = (_jsx("div", { children: files &&
|
|
325
328
|
files.length > 0 &&
|
|
326
329
|
files.map((item, index) => {
|
|
327
|
-
return (_jsxs("div", { className: 'psdk-utility-card', children: [_jsxs("div", { className: 'psdk-utility-card-icon', children: [!item.inProgress && _jsx("img", { className: 'psdk-utility-card-svg-icon', src: srcImg }), item.inProgress && (_jsx("div", { children: _jsx(CircularProgress, {}) }))] }), _jsxs("div", { className: 'psdk-utility-card-main', children: [_jsx("div", { className: 'psdk-utility-card-main-primary-label', children: item.props.name }), item.props.meta && _jsx("div", { style: { color: item.props.error ? 'red' : undefined }, children: item.props.meta })] }), _jsxs("div", { className: 'psdk-utility-action', children: [item.ID && (_jsx("button", { type: 'button', className: 'psdk-utility-button', "aria-label": 'Delete Attachment', onClick: () => deleteFile(item), children: _jsx("img", { className: 'psdk-utility-card-action-svg-icon', src: deleteIcon }) })), !item.ID && (_jsxs("div", { children: [_jsx(IconButton, { id: 'setting-button', "aria-controls": open ? 'file-menu' : undefined, "aria-expanded": open ? 'true' : undefined, "aria-haspopup": 'true', onClick: handleClick, children: _jsx(MoreVertIcon, {}) }), _jsxs(Menu, { style: { marginTop: '3rem' }, id: 'file-menu', anchorEl: anchorEl, keepMounted: true, open: Boolean(anchorEl), onClose: handleClose, children: [_jsx(MenuItem, { style: { fontSize: '14px' }, onClick: () => downloadFile(item.responseProps ? item.responseProps : {}), children: "Download" }, 'download'), _jsx(MenuItem, { style: { fontSize: '14px' }, onClick: () => deleteFile(item), children: "Delete" }, 'delete')] })] }))] })] }, index));
|
|
330
|
+
return (_jsxs("div", { className: 'psdk-utility-card', children: [_jsxs("div", { className: 'psdk-utility-card-icon', children: [!item.inProgress && _jsx("img", { className: 'psdk-utility-card-svg-icon', src: srcImg }), item.inProgress && (_jsx("div", { children: _jsx(CircularProgress, {}) }))] }), _jsxs("div", { className: 'psdk-utility-card-main', children: [_jsx("div", { className: 'psdk-utility-card-main-primary-label', children: item.props.name }), item.props.meta && _jsx("div", { style: { color: item.props.error ? 'red' : undefined }, children: item.props.meta })] }), _jsxs("div", { className: 'psdk-utility-action', children: [item.ID && (_jsx("button", { type: 'button', className: 'psdk-utility-button', "aria-label": 'Delete Attachment', onClick: () => deleteFile(item), children: _jsx("img", { className: 'psdk-utility-card-action-svg-icon', src: deleteIcon }) })), !item.ID && (_jsxs("div", { children: [_jsx(IconButton, { id: 'setting-button', "aria-controls": open ? 'file-menu' : undefined, "aria-expanded": open ? 'true' : undefined, "aria-haspopup": 'true', onClick: handleClick, size: 'large', children: _jsx(MoreVertIcon, {}) }), _jsxs(Menu, { style: { marginTop: '3rem' }, id: 'file-menu', anchorEl: anchorEl, keepMounted: true, open: Boolean(anchorEl), onClose: handleClose, children: [_jsx(MenuItem, { style: { fontSize: '14px' }, onClick: () => downloadFile(item.responseProps ? item.responseProps : {}), children: "Download" }, 'download'), _jsx(MenuItem, { style: { fontSize: '14px' }, onClick: () => deleteFile(item), children: "Delete" }, 'delete')] })] }))] })] }, index));
|
|
328
331
|
}) }));
|
|
329
332
|
return (_jsxs("div", { className: 'file-upload-container', children: [_jsx("span", { className: `label ${required ? 'file-label' : ''}`, children: label }), ((files.length === 0 && allowMultiple !== 'true') || allowMultiple === 'true') && _jsx("section", { children: content }), validatemessage !== '' ? _jsx("span", { className: 'file-error', children: validatemessage }) : '', files && files.length > 0 && _jsx("section", { children: fileDisplay })] }));
|
|
330
333
|
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AAC,CAAC,CAAC,eAAM,SAAS,EAAC,YAAY,YAAE,eAAe,GAAQ,CAAC,CAAC,CAAC,EAAE,EACnF,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,4BAAU,WAAW,GAAW,IAC1D,CACP,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable react/jsx-boolean-value */\n/* eslint-disable react/no-array-index-key */\n/* eslint-disable no-nested-ternary */\nimport { useState, useEffect, useCallback } from 'react';\nimport { CircularProgress, IconButton, Menu, MenuItem, Button } from '@material-ui/core';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\nimport download from 'downloadjs';\n\nimport { buildFilePropsFromResponse, getIconFromFileType, validateMaxSize } from '../../helpers/attachmentHelpers';\nimport { Utils } from '../../helpers/utils';\nimport { isInfinity23OrHigher } from '../../helpers/common-utils';\nimport { PConnFieldProps } from '../../../types/PConnProps';\n\nimport './Attachment.css';\n\ninterface AttachmentProps extends Omit<PConnFieldProps, 'value'> {\n // If any, enter additional props that only exist on this component\n value: any;\n allowMultiple: string;\n extensions: string;\n}\n\nconst getAttachmentKey = (name = '') => (name ? `attachmentsList.${name}` : 'attachmentsList');\n\nconst getCurrentAttachmentsList = (key, context) => {\n return PCore.getStoreValue(`.${key}`, 'context_data', context) || [];\n};\n\nconst updateAttachmentState = (pConn, key, attachments) => {\n PCore.getStateUtils().updateState(pConn.getContextName(), key, attachments, {\n pageReference: 'context_data',\n isArrayDeepMerge: false\n });\n};\n\nexport default function Attachment(props: AttachmentProps) {\n const { value, getPConnect, label, validatemessage, allowMultiple, extensions, displayMode } = props;\n /* this is a temporary fix because required is supposed to be passed as a boolean and NOT as a string */\n let { required, disabled } = props;\n [required, disabled] = [required, disabled].map(prop => prop === true || (typeof prop === 'string' && prop === 'true'));\n const pConn = getPConnect();\n const caseID = PCore.getStoreValue('.pyID', 'caseInfo.content', pConn.getContextName());\n const localizedVal = PCore.getLocaleUtils().getLocaleValue;\n const localeCategory = 'CosmosFields';\n const uploadMultipleFilesLabel = localizedVal('file_upload_text_multiple', localeCategory);\n const uploadSingleFileLabel = localizedVal('file_upload_text_one', localeCategory);\n let categoryName = '';\n if (value && value.pyCategoryName) {\n categoryName = value.pyCategoryName;\n }\n const deleteIcon = Utils.getImageSrc('trash', Utils.getSDKStaticConentUrl());\n const srcImg = Utils.getImageSrc('document-doc', Utils.getSDKStaticConentUrl());\n let valueRef = (pConn.getStateProps() as any).value;\n valueRef = valueRef.indexOf('.') === 0 ? valueRef.substring(1) : valueRef;\n const [anchorEl, setAnchorEl] = useState(null);\n const open = Boolean(anchorEl);\n const [files, setFiles] = useState<any[]>(() =>\n value?.pxResults && +value.pyCount > 0 ? value.pxResults.map(f => buildFilePropsFromResponse(f)) : []\n );\n const [filesWithError, setFilesWithError] = useState<any[]>([]);\n const [toggleUploadBegin, setToggleUploadBegin] = useState(false);\n\n const resetAttachmentStoredState = () => {\n PCore.getStateUtils().updateState(pConn.getContextName(), getAttachmentKey(isInfinity23OrHigher() ? valueRef : ''), undefined, {\n pageReference: 'context_data',\n isArrayDeepMerge: false\n });\n };\n\n const fileDownload = (data, fileName, ext) => {\n const fileData = ext ? `${fileName}.${ext}` : fileName;\n download(atob(data), fileData);\n };\n\n const downloadFile = (fileObj: any) => {\n setAnchorEl(null);\n PCore.getAttachmentUtils()\n // @ts-ignore - 3rd parameter \"responseEncoding\" should be optional\n .downloadAttachment(fileObj.pzInsKey, pConn.getContextName())\n .then((content: any) => {\n const extension = fileObj.pyAttachName.split('.').pop();\n fileDownload(content.data, fileObj.pyFileName, extension);\n })\n .catch(() => {});\n };\n\n const deleteFile = useCallback(\n file => {\n setAnchorEl(null);\n let attachmentsList: any[] = [];\n let currentAttachmentList = getCurrentAttachmentsList(getAttachmentKey(valueRef), pConn.getContextName());\n\n // If file to be deleted is the one added in previous stage i.e. for which a file instance is created in server\n // no need to filter currentAttachmentList as we will get another entry of file in redux with delete & label\n // eslint-disable-next-line no-unsafe-optional-chaining\n if (value && value?.pxResults && +value?.pyCount > 0 && file.responseProps && file?.responseProps?.pzInsKey !== 'temp') {\n const updatedAttachments = files.map(f => {\n if (f.responseProps && f.responseProps.pzInsKey === file.responseProps.pzInsKey) {\n return { ...f, delete: true, label: valueRef };\n }\n return f;\n });\n\n // updating the redux store to help form-handler in passing the data to delete the file from server\n updateAttachmentState(pConn, getAttachmentKey(valueRef), [...updatedAttachments]);\n setFiles(current => {\n const newlyAddedFiles = current.filter(f => !!f.ID);\n const filesPostDelete = current.filter(\n f => f.responseProps?.pzInsKey !== 'temp' && f.responseProps?.pzInsKey !== file.responseProps?.pzInsKey\n );\n attachmentsList = [...filesPostDelete, ...newlyAddedFiles];\n return attachmentsList;\n });\n } // if the file being deleted is the added in this stage i.e. whose data is not yet created in server\n else {\n // filter newly added files in this stage, later the updated current stage files will be added to redux once files state is updated in below setFiles()\n currentAttachmentList = currentAttachmentList.filter(f => f.label !== valueRef);\n setFiles(current => {\n attachmentsList = current.filter(f => f.ID !== file.ID);\n return attachmentsList;\n });\n updateAttachmentState(pConn, getAttachmentKey(valueRef), [...currentAttachmentList, ...attachmentsList]);\n if (file.inProgress) {\n // @ts-ignore - 3rd parameter \"responseEncoding\" should be optional\n PCore.getAttachmentUtils().cancelRequest(file.ID, pConn.getContextName());\n }\n }\n\n setToggleUploadBegin(false);\n setFilesWithError(prevFilesWithError => {\n return prevFilesWithError.filter(f => f.ID !== file.ID);\n });\n },\n [pConn, value, valueRef, filesWithError]\n );\n\n const onUploadProgress = () => {};\n\n const errorHandler = (isFetchCanceled, attachedFile) => {\n return error => {\n if (!isFetchCanceled(error)) {\n let uploadFailMsg = pConn.getLocalizedValue('Something went wrong', '', '');\n if (error.response && error.response.data && error.response.data.errorDetails) {\n uploadFailMsg = pConn.getLocalizedValue(error.response.data.errorDetails[0].localizedValue, '', '');\n }\n setFiles(current => {\n return current.map(f => {\n if (f.ID === attachedFile.ID) {\n f.props.meta = uploadFailMsg;\n f.props.error = true;\n f.props.onDelete = () => deleteFile(f);\n f.props.icon = getIconFromFileType(f.type);\n f.props.name = pConn.getLocalizedValue('Unable to upload file', '', '');\n f.inProgress = false;\n const fieldName = (pConn.getStateProps() as any).value;\n const context = pConn.getContextName();\n // set errors to property to block submit even on errors in file upload\n PCore.getMessageManager().addMessages({\n // @ts-ignore\n messages: [\n {\n type: 'error',\n message: pConn.getLocalizedValue('Error with one or more files', '', '')\n }\n ],\n property: fieldName,\n pageReference: pConn.getPageReference(),\n context\n });\n delete f.props.progress;\n }\n return f;\n });\n });\n }\n throw error;\n };\n };\n\n const validateFileExtension = (fileObj, allowedExtensions) => {\n if (!allowedExtensions) {\n return true;\n }\n const allowedExtensionList = allowedExtensions\n .toLowerCase()\n .split(',')\n .map(item => item.replaceAll('.', '').trim());\n const extension = fileObj.name.split('.').pop().toLowerCase();\n return allowedExtensionList.includes(extension);\n };\n\n const clearFieldErrorMessages = () => {\n const fieldName = (pConn.getStateProps() as any).value;\n const context = pConn.getContextName();\n // @ts-ignore\n PCore.getMessageManager().clearMessages({\n type: PCore.getConstants().MESSAGES.MESSAGES_TYPE_ERROR,\n property: fieldName,\n pageReference: pConn.getPageReference(),\n context\n });\n };\n\n const onFileAdded = event => {\n let addedFiles = Array.from(event.target.files);\n addedFiles = allowMultiple === 'true' ? addedFiles : [addedFiles[0]];\n const maxAttachmentSize = PCore.getEnvironmentInfo().getMaxAttachmentSize() || '5';\n const tempFilesToBeUploaded = [\n ...addedFiles.map((f: any, index) => {\n f.ID = `${new Date().getTime()}I${index}`;\n f.inProgress = true;\n f.props = {\n type: f.type,\n name: f.name,\n icon: getIconFromFileType(f.type),\n onDelete: () => deleteFile(f)\n };\n if (!validateMaxSize(f, maxAttachmentSize)) {\n f.props.error = true;\n f.props.meta = pConn.getLocalizedValue(`File is too big. Max allowed size is ${maxAttachmentSize}MB.`, '', '');\n } else if (!validateFileExtension(f, extensions)) {\n f.props.error = true;\n f.props.meta = `${pConn.getLocalizedValue('File has invalid extension. Allowed extensions are:', '', '')} ${extensions.replaceAll(\n '.',\n ''\n )}`;\n }\n if (f.props.error) {\n const fieldName = (pConn.getStateProps() as any).value;\n const context = pConn.getContextName();\n PCore.getMessageManager().addMessages({\n // @ts-ignore\n messages: [\n {\n type: 'error',\n message: pConn.getLocalizedValue('Error with one or more files', '', '')\n }\n ],\n property: fieldName,\n pageReference: pConn.getPageReference(),\n context\n });\n }\n return f;\n })\n ];\n const tempFilesWithError = tempFilesToBeUploaded.filter(f => f.props.error);\n if (tempFilesWithError.length > 0) {\n setFilesWithError(tempFilesWithError);\n }\n setFiles(current => (allowMultiple !== 'true' ? [...tempFilesToBeUploaded] : [...current, ...tempFilesToBeUploaded]));\n setToggleUploadBegin(true);\n };\n\n const uploadFiles = useCallback(() => {\n const filesToBeUploaded = files\n .filter(e => {\n const isFileUploaded = e.props && e.props.progress === 100;\n const fileHasError = e.props && e.props.error;\n const isFileUploadedinLastStep = e.responseProps && e.responseProps.pzInsKey;\n return !isFileUploaded && !fileHasError && !isFileUploadedinLastStep;\n })\n .map(f =>\n window.PCore.getAttachmentUtils().uploadAttachment(\n f,\n () => {\n onUploadProgress();\n },\n isFetchCanceled => {\n return errorHandler(isFetchCanceled, f);\n },\n pConn.getContextName()\n )\n );\n Promise.allSettled(filesToBeUploaded)\n .then((fileResponses: any) => {\n fileResponses = fileResponses.filter(fr => fr.status !== 'rejected'); // in case of deleting an in progress file, promise gets cancelled but still enters then block\n if (fileResponses.length > 0) {\n setFiles(current => {\n const tempFilesUploaded = [...current];\n tempFilesUploaded.forEach(f => {\n const index = fileResponses.findIndex((fr: any) => fr.value.clientFileID === f.ID);\n if (index >= 0) {\n f.props.meta = pConn.getLocalizedValue('Uploaded successfully', '', '');\n f.props.progress = 100;\n f.inProgress = false;\n f.handle = fileResponses[index].value.ID;\n f.label = valueRef;\n f.category = categoryName;\n f.responseProps = {\n pzInsKey: 'temp',\n pyAttachName: f.props.name\n };\n }\n });\n return tempFilesUploaded;\n });\n\n if (filesWithError.length === 0) {\n clearFieldErrorMessages();\n }\n }\n setToggleUploadBegin(false);\n })\n .catch(error => {\n // eslint-disable-next-line no-console\n console.log(error);\n setToggleUploadBegin(false);\n });\n }, [files, filesWithError]);\n\n useEffect(() => {\n if (toggleUploadBegin && files.length > 0) {\n uploadFiles();\n }\n }, [toggleUploadBegin]);\n\n useEffect(() => {\n if (files.length > 0 && displayMode !== 'DISPLAY_ONLY') {\n const currentAttachmentList = getCurrentAttachmentsList(getAttachmentKey(valueRef), pConn.getContextName());\n // block duplicate files to redux store when added 1 after another to prevent multiple duplicates being added to the case on submit\n const tempFiles = files.filter(f => currentAttachmentList.findIndex(fr => fr.ID === f.ID) === -1 && !f.inProgress && f.responseProps);\n\n const updatedAttList = [...currentAttachmentList, ...tempFiles];\n updateAttachmentState(pConn, getAttachmentKey(valueRef), updatedAttList);\n }\n }, [files]);\n\n useEffect(() => {\n if (filesWithError.length === 0) {\n clearFieldErrorMessages();\n }\n }, [filesWithError]);\n\n useEffect(() => {\n let tempUploadedFiles = getCurrentAttachmentsList(getAttachmentKey(valueRef), pConn.getContextName());\n tempUploadedFiles = tempUploadedFiles.filter(f => f.label === valueRef);\n setFiles(current => {\n return [\n ...current.map(f => {\n return f.responseProps.pzInsKey && !f.responseProps.pzInsKey.includes('temp')\n ? {\n ...f,\n props: {\n ...f.props,\n onDelete: () => deleteFile(f)\n }\n }\n : { ...f };\n }),\n ...tempUploadedFiles\n ];\n });\n PCore.getPubSubUtils().subscribe(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION, resetAttachmentStoredState, caseID);\n return () => {\n PCore.getPubSubUtils().unsubscribe(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION, caseID);\n };\n }, []);\n\n const handleClick = event => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n const content = (\n <div style={{ marginBottom: '8px' }}>\n <div className={`${disabled ? 'file-disabled' : ''} ${validatemessage === '' ? 'file-div' : 'file-div-error'}`}>\n <div hidden={true} id='attachment-ID'>\n {valueRef}\n </div>\n <label htmlFor={valueRef}>\n <input\n style={{ display: 'none' }}\n id={valueRef}\n name='upload-photo'\n type='file'\n multiple={allowMultiple === 'true'}\n required={required}\n disabled={disabled}\n onChange={onFileAdded}\n />\n <Button style={{ textTransform: 'none' }} variant='outlined' color='primary' component='span'>\n {allowMultiple === 'true'\n ? uploadMultipleFilesLabel === 'file_upload_text_multiple'\n ? 'Choose files'\n : uploadMultipleFilesLabel\n : uploadSingleFileLabel === 'file_upload_text_one'\n ? 'Choose a file'\n : uploadSingleFileLabel}\n </Button>\n </label>\n </div>\n </div>\n );\n\n const fileDisplay = (\n <div>\n {files &&\n files.length > 0 &&\n files.map((item, index) => {\n return (\n <div key={index} className='psdk-utility-card'>\n <div className='psdk-utility-card-icon'>\n {!item.inProgress && <img className='psdk-utility-card-svg-icon' src={srcImg} />}\n {item.inProgress && (\n <div>\n <CircularProgress />\n </div>\n )}\n </div>\n <div className='psdk-utility-card-main'>\n <div className='psdk-utility-card-main-primary-label'>{item.props.name}</div>\n {item.props.meta && <div style={{ color: item.props.error ? 'red' : undefined }}>{item.props.meta}</div>}\n </div>\n <div className='psdk-utility-action'>\n {item.ID && (\n <button type='button' className='psdk-utility-button' aria-label='Delete Attachment' onClick={() => deleteFile(item)}>\n <img className='psdk-utility-card-action-svg-icon' src={deleteIcon} />\n </button>\n )}\n {!item.ID && (\n <div>\n <IconButton\n id='setting-button'\n aria-controls={open ? 'file-menu' : undefined}\n aria-expanded={open ? 'true' : undefined}\n aria-haspopup='true'\n onClick={handleClick}\n >\n <MoreVertIcon />\n </IconButton>\n <Menu style={{ marginTop: '3rem' }} id='file-menu' anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={handleClose}>\n <MenuItem\n style={{ fontSize: '14px' }}\n key='download'\n onClick={() => downloadFile(item.responseProps ? item.responseProps : {})}\n >\n Download\n </MenuItem>\n <MenuItem style={{ fontSize: '14px' }} key='delete' onClick={() => deleteFile(item)}>\n Delete\n </MenuItem>\n </Menu>\n </div>\n )}\n </div>\n </div>\n );\n })}\n </div>\n );\n\n return (\n <div className='file-upload-container'>\n <span className={`label ${required ? 'file-label' : ''}`}>{label}</span>\n {((files.length === 0 && allowMultiple !== 'true') || allowMultiple === 'true') && <section>{content}</section>}\n {validatemessage !== '' ? <span className='file-error'>{validatemessage}</span> : ''}\n {files && files.length > 0 && <section>{fileDisplay}</section>}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Attachment.js","sourceRoot":"","sources":["../../../../src/components/widget/Attachment/Attachment.tsx"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,6CAA6C;AAC7C,sCAAsC;AACtC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,YAAY,MAAM,8BAA8B,CAAC;AACxD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACnH,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,OAAO,kBAAkB,CAAC;AAS1B,MAAM,gBAAgB,GAAG,CAAC,IAAI,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC;AAE/F,MAAM,yBAAyB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;IACjD,OAAO,KAAK,CAAC,aAAa,CAAC,IAAI,GAAG,EAAE,EAAE,cAAc,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;AACvE,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,C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ACP,CAAC;IAEF,OAAO,CACL,eAAK,SAAS,EAAC,uBAAuB,aACpC,eAAM,SAAS,EAAE,SAAS,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,YAAG,KAAK,GAAQ,EACvE,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,aAAa,KAAK,MAAM,CAAC,IAAI,aAAa,KAAK,MAAM,CAAC,IAAI,4BAAU,OAAO,GAAW,EAC9G,eAAe,KAAK,EAAE,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,YAAY,YAAE,eAAe,GAAQ,CAAC,CAAC,CAAC,EAAE,EACnF,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,4BAAU,WAAW,GAAW,IAC1D,CACP,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable react/jsx-boolean-value */\n/* eslint-disable react/no-array-index-key */\n/* eslint-disable no-nested-ternary */\nimport { useState, useEffect, useCallback } from 'react';\nimport { CircularProgress, IconButton, Menu, MenuItem, Button } from '@mui/material';\nimport MoreVertIcon from '@mui/icons-material/MoreVert';\nimport download from 'downloadjs';\n\nimport { buildFilePropsFromResponse, getIconFromFileType, validateMaxSize } from '../../helpers/attachmentHelpers';\nimport { Utils } from '../../helpers/utils';\nimport { PConnFieldProps } from '../../../types/PConnProps';\n\nimport './Attachment.css';\n\ninterface AttachmentProps extends Omit<PConnFieldProps, 'value'> {\n // If any, enter additional props that only exist on this component\n value: any;\n allowMultiple: string;\n extensions: string;\n}\n\nconst getAttachmentKey = (name = '') => (name ? `attachmentsList.${name}` : 'attachmentsList');\n\nconst getCurrentAttachmentsList = (key, context) => {\n return PCore.getStoreValue(`.${key}`, 'context_data', context) || [];\n};\n\nconst updateAttachmentState = (pConn, key, attachments) => {\n PCore.getStateUtils().updateState(pConn.getContextName(), key, attachments, {\n pageReference: 'context_data',\n isArrayDeepMerge: false\n });\n};\n\nexport default function Attachment(props: AttachmentProps) {\n const { value, getPConnect, label, validatemessage, allowMultiple, extensions, displayMode } = props;\n /* this is a temporary fix because required is supposed to be passed as a boolean and NOT as a string */\n let { required, disabled } = props;\n [required, disabled] = [required, disabled].map(prop => prop === true || (typeof prop === 'string' && prop === 'true'));\n const pConn = getPConnect();\n const caseID = PCore.getStoreValue('.pyID', 'caseInfo.content', pConn.getContextName());\n const localizedVal = PCore.getLocaleUtils().getLocaleValue;\n const localeCategory = 'CosmosFields';\n const uploadMultipleFilesLabel = localizedVal('file_upload_text_multiple', localeCategory);\n const uploadSingleFileLabel = localizedVal('file_upload_text_one', localeCategory);\n let categoryName = '';\n if (value && value.pyCategoryName) {\n categoryName = value.pyCategoryName;\n }\n const deleteIcon = Utils.getImageSrc('trash', Utils.getSDKStaticConentUrl());\n const srcImg = Utils.getImageSrc('document-doc', Utils.getSDKStaticConentUrl());\n let valueRef = (pConn.getStateProps() as any).value;\n valueRef = valueRef.indexOf('.') === 0 ? valueRef.substring(1) : valueRef;\n const [anchorEl, setAnchorEl] = useState(null);\n const open = Boolean(anchorEl);\n const [files, setFiles] = useState<any[]>(() =>\n value?.pxResults && +value.pyCount > 0 ? value.pxResults.map(f => buildFilePropsFromResponse(f)) : []\n );\n const [filesWithError, setFilesWithError] = useState<any[]>([]);\n const [toggleUploadBegin, setToggleUploadBegin] = useState(false);\n\n const resetAttachmentStoredState = () => {\n PCore.getStateUtils().updateState(pConn.getContextName(), getAttachmentKey(valueRef), undefined, {\n pageReference: 'context_data',\n isArrayDeepMerge: false\n });\n };\n\n const fileDownload = (data, fileName, ext) => {\n const fileData = ext ? `${fileName}.${ext}` : fileName;\n download(atob(data), fileData);\n };\n\n const downloadFile = (fileObj: any) => {\n setAnchorEl(null);\n PCore.getAttachmentUtils()\n // @ts-ignore - 3rd parameter \"responseEncoding\" should be optional\n .downloadAttachment(fileObj.pzInsKey, pConn.getContextName())\n .then((content: any) => {\n const extension = fileObj.pyAttachName.split('.').pop();\n fileDownload(content.data, fileObj.pyFileName, extension);\n })\n .catch(() => {});\n };\n\n const deleteFile = useCallback(\n file => {\n setAnchorEl(null);\n let attachmentsList: any[] = [];\n let currentAttachmentList = getCurrentAttachmentsList(getAttachmentKey(valueRef), pConn.getContextName());\n\n // If file to be deleted is the one added in previous stage i.e. for which a file instance is created in server\n // no need to filter currentAttachmentList as we will get another entry of file in redux with delete & label\n // eslint-disable-next-line no-unsafe-optional-chaining\n if (value && value?.pxResults && +value?.pyCount > 0 && file.responseProps && file?.responseProps?.pzInsKey !== 'temp') {\n const updatedAttachments = files.map(f => {\n if (f.responseProps && f.responseProps.pzInsKey === file.responseProps.pzInsKey) {\n return { ...f, delete: true, label: valueRef };\n }\n return f;\n });\n\n // updating the redux store to help form-handler in passing the data to delete the file from server\n updateAttachmentState(pConn, getAttachmentKey(valueRef), [...updatedAttachments]);\n setFiles(current => {\n const newlyAddedFiles = current.filter(f => !!f.ID);\n const filesPostDelete = current.filter(\n f => f.responseProps?.pzInsKey !== 'temp' && f.responseProps?.pzInsKey !== file.responseProps?.pzInsKey\n );\n attachmentsList = [...filesPostDelete, ...newlyAddedFiles];\n return attachmentsList;\n });\n } // if the file being deleted is the added in this stage i.e. whose data is not yet created in server\n else {\n // filter newly added files in this stage, later the updated current stage files will be added to redux once files state is updated in below setFiles()\n currentAttachmentList = currentAttachmentList.filter(f => f.label !== valueRef);\n setFiles(current => {\n attachmentsList = current.filter(f => f.ID !== file.ID);\n return attachmentsList;\n });\n updateAttachmentState(pConn, getAttachmentKey(valueRef), [...currentAttachmentList, ...attachmentsList]);\n if (file.inProgress) {\n // @ts-ignore - 3rd parameter \"responseEncoding\" should be optional\n PCore.getAttachmentUtils().cancelRequest(file.ID, pConn.getContextName());\n }\n }\n\n setToggleUploadBegin(false);\n setFilesWithError(prevFilesWithError => {\n return prevFilesWithError.filter(f => f.ID !== file.ID);\n });\n },\n [pConn, value, valueRef, filesWithError]\n );\n\n const onUploadProgress = () => {};\n\n const errorHandler = (isFetchCanceled, attachedFile) => {\n return error => {\n if (!isFetchCanceled(error)) {\n let uploadFailMsg = pConn.getLocalizedValue('Something went wrong', '', '');\n if (error.response && error.response.data && error.response.data.errorDetails) {\n uploadFailMsg = pConn.getLocalizedValue(error.response.data.errorDetails[0].localizedValue, '', '');\n }\n setFiles(current => {\n return current.map(f => {\n if (f.ID === attachedFile.ID) {\n f.props.meta = uploadFailMsg;\n f.props.error = true;\n f.props.onDelete = () => deleteFile(f);\n f.props.icon = getIconFromFileType(f.type);\n f.props.name = pConn.getLocalizedValue('Unable to upload file', '', '');\n f.inProgress = false;\n const fieldName = (pConn.getStateProps() as any).value;\n const context = pConn.getContextName();\n // set errors to property to block submit even on errors in file upload\n PCore.getMessageManager().addMessages({\n // @ts-ignore\n messages: [\n {\n type: 'error',\n // @ts-ignore - Type '{ type: string; message: string; }' is not assignable to type 'MessagesConfigObject'.\n message: pConn.getLocalizedValue('Error with one or more files', '', '')\n }\n ],\n property: fieldName,\n pageReference: pConn.getPageReference(),\n context\n });\n delete f.props.progress;\n }\n return f;\n });\n });\n }\n throw error;\n };\n };\n\n const validateFileExtension = (fileObj, allowedExtensions) => {\n if (!allowedExtensions) {\n return true;\n }\n const allowedExtensionList = allowedExtensions\n .toLowerCase()\n .split(',')\n .map(item => item.replaceAll('.', '').trim());\n const extension = fileObj.name.split('.').pop().toLowerCase();\n return allowedExtensionList.includes(extension);\n };\n\n const clearFieldErrorMessages = () => {\n const fieldName = (pConn.getStateProps() as any).value;\n const context = pConn.getContextName();\n // @ts-ignore\n PCore.getMessageManager().clearMessages({\n type: PCore.getConstants().MESSAGES.MESSAGES_TYPE_ERROR,\n property: fieldName,\n pageReference: pConn.getPageReference(),\n context\n });\n };\n\n const onFileAdded = event => {\n let addedFiles = Array.from(event.target.files);\n addedFiles = allowMultiple === 'true' ? addedFiles : [addedFiles[0]];\n const maxAttachmentSize = PCore.getEnvironmentInfo().getMaxAttachmentSize() || '5';\n const tempFilesToBeUploaded = [\n ...addedFiles.map((f: any, index) => {\n f.ID = `${new Date().getTime()}I${index}`;\n f.inProgress = true;\n f.props = {\n type: f.type,\n name: f.name,\n icon: getIconFromFileType(f.type),\n onDelete: () => deleteFile(f)\n };\n if (!validateMaxSize(f, maxAttachmentSize)) {\n f.props.error = true;\n f.inProgress = false;\n f.props.meta = pConn.getLocalizedValue(`File is too big. Max allowed size is ${maxAttachmentSize}MB.`, '', '');\n } else if (!validateFileExtension(f, extensions)) {\n f.props.error = true;\n f.inProgress = false;\n f.props.meta = `${pConn.getLocalizedValue('File has invalid extension. Allowed extensions are:', '', '')} ${extensions.replaceAll(\n '.',\n ''\n )}`;\n }\n if (f.props.error) {\n const fieldName = (pConn.getStateProps() as any).value;\n const context = pConn.getContextName();\n PCore.getMessageManager().addMessages({\n // @ts-ignore\n messages: [\n {\n type: 'error',\n // @ts-ignore - Type '{ type: string; message: string; }' is not assignable to type 'MessagesConfigObject'.\n message: pConn.getLocalizedValue('Error with one or more files', '', '')\n }\n ],\n property: fieldName,\n pageReference: pConn.getPageReference(),\n context\n });\n }\n return f;\n })\n ];\n const tempFilesWithError = tempFilesToBeUploaded.filter(f => f.props.error);\n if (tempFilesWithError.length > 0) {\n setFilesWithError(tempFilesWithError);\n }\n setFiles(current => (allowMultiple !== 'true' ? [...tempFilesToBeUploaded] : [...current, ...tempFilesToBeUploaded]));\n setToggleUploadBegin(true);\n };\n\n const uploadFiles = useCallback(() => {\n const filesToBeUploaded = files\n .filter(e => {\n const isFileUploaded = e.props && e.props.progress === 100;\n const fileHasError = e.props && e.props.error;\n const isFileUploadedinLastStep = e.responseProps && e.responseProps.pzInsKey;\n return !isFileUploaded && !fileHasError && !isFileUploadedinLastStep;\n })\n .map(f =>\n window.PCore.getAttachmentUtils().uploadAttachment(\n f,\n () => {\n onUploadProgress();\n },\n isFetchCanceled => {\n return errorHandler(isFetchCanceled, f);\n },\n pConn.getContextName()\n )\n );\n Promise.allSettled(filesToBeUploaded)\n .then((fileResponses: any) => {\n fileResponses = fileResponses.filter(fr => fr.status !== 'rejected'); // in case of deleting an in progress file, promise gets cancelled but still enters then block\n if (fileResponses.length > 0) {\n setFiles(current => {\n const tempFilesUploaded = [...current];\n tempFilesUploaded.forEach(f => {\n const index = fileResponses.findIndex((fr: any) => fr.value.clientFileID === f.ID);\n if (index >= 0) {\n f.props.meta = pConn.getLocalizedValue('Uploaded successfully', '', '');\n f.props.progress = 100;\n f.inProgress = false;\n f.handle = fileResponses[index].value.ID;\n f.label = valueRef;\n f.category = categoryName;\n f.responseProps = {\n pzInsKey: 'temp',\n pyAttachName: f.props.name\n };\n }\n });\n return tempFilesUploaded;\n });\n\n if (filesWithError.length === 0) {\n clearFieldErrorMessages();\n }\n }\n setToggleUploadBegin(false);\n })\n .catch(error => {\n // eslint-disable-next-line no-console\n console.log(error);\n setToggleUploadBegin(false);\n });\n }, [files, filesWithError]);\n\n useEffect(() => {\n if (toggleUploadBegin && files.length > 0) {\n uploadFiles();\n }\n }, [toggleUploadBegin]);\n\n useEffect(() => {\n if (files.length > 0 && displayMode !== 'DISPLAY_ONLY') {\n const currentAttachmentList = getCurrentAttachmentsList(getAttachmentKey(valueRef), pConn.getContextName());\n // block duplicate files to redux store when added 1 after another to prevent multiple duplicates being added to the case on submit\n const tempFiles = files.filter(f => currentAttachmentList.findIndex(fr => fr.ID === f.ID) === -1 && !f.inProgress && f.responseProps);\n\n const updatedAttList = [...currentAttachmentList, ...tempFiles];\n updateAttachmentState(pConn, getAttachmentKey(valueRef), updatedAttList);\n }\n }, [files]);\n\n useEffect(() => {\n if (filesWithError.length === 0) {\n clearFieldErrorMessages();\n }\n }, [filesWithError]);\n\n useEffect(() => {\n let tempUploadedFiles = getCurrentAttachmentsList(getAttachmentKey(valueRef), pConn.getContextName());\n tempUploadedFiles = tempUploadedFiles.filter(f => f.label === valueRef);\n setFiles(current => {\n return [\n ...current.map(f => {\n return f.responseProps.pzInsKey && !f.responseProps.pzInsKey.includes('temp')\n ? {\n ...f,\n props: {\n ...f.props,\n onDelete: () => deleteFile(f)\n }\n }\n : { ...f };\n }),\n ...tempUploadedFiles\n ];\n });\n PCore.getPubSubUtils().subscribe(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION, resetAttachmentStoredState, caseID);\n return () => {\n PCore.getPubSubUtils().unsubscribe(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION, caseID);\n };\n }, []);\n\n const handleClick = event => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n const content = (\n <div style={{ marginBottom: '8px' }}>\n <div className={`${disabled ? 'file-disabled' : ''} ${validatemessage === '' ? 'file-div' : 'file-div-error'}`}>\n <div hidden={true} id='attachment-ID'>\n {valueRef}\n </div>\n <label htmlFor={valueRef}>\n <input\n style={{ display: 'none' }}\n id={valueRef}\n name='upload-photo'\n type='file'\n multiple={allowMultiple === 'true'}\n required={required}\n disabled={disabled}\n onChange={onFileAdded}\n />\n <Button style={{ textTransform: 'none' }} variant='outlined' color='primary' component='span'>\n {allowMultiple === 'true'\n ? uploadMultipleFilesLabel === 'file_upload_text_multiple'\n ? 'Choose files'\n : uploadMultipleFilesLabel\n : uploadSingleFileLabel === 'file_upload_text_one'\n ? 'Choose a file'\n : uploadSingleFileLabel}\n </Button>\n </label>\n </div>\n </div>\n );\n\n const fileDisplay = (\n <div>\n {files &&\n files.length > 0 &&\n files.map((item, index) => {\n return (\n <div key={index} className='psdk-utility-card'>\n <div className='psdk-utility-card-icon'>\n {!item.inProgress && <img className='psdk-utility-card-svg-icon' src={srcImg} />}\n {item.inProgress && (\n <div>\n <CircularProgress />\n </div>\n )}\n </div>\n <div className='psdk-utility-card-main'>\n <div className='psdk-utility-card-main-primary-label'>{item.props.name}</div>\n {item.props.meta && <div style={{ color: item.props.error ? 'red' : undefined }}>{item.props.meta}</div>}\n </div>\n <div className='psdk-utility-action'>\n {item.ID && (\n <button type='button' className='psdk-utility-button' aria-label='Delete Attachment' onClick={() => deleteFile(item)}>\n <img className='psdk-utility-card-action-svg-icon' src={deleteIcon} />\n </button>\n )}\n {!item.ID && (\n <div>\n <IconButton\n id='setting-button'\n aria-controls={open ? 'file-menu' : undefined}\n aria-expanded={open ? 'true' : undefined}\n aria-haspopup='true'\n onClick={handleClick}\n size='large'\n >\n <MoreVertIcon />\n </IconButton>\n <Menu style={{ marginTop: '3rem' }} id='file-menu' anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={handleClose}>\n <MenuItem\n style={{ fontSize: '14px' }}\n key='download'\n onClick={() => downloadFile(item.responseProps ? item.responseProps : {})}\n >\n Download\n </MenuItem>\n <MenuItem style={{ fontSize: '14px' }} key='delete' onClick={() => deleteFile(item)}>\n Delete\n </MenuItem>\n </Menu>\n </div>\n )}\n </div>\n </div>\n );\n })}\n </div>\n );\n\n return (\n <div className='file-upload-container'>\n <span className={`label ${required ? 'file-label' : ''}`}>{label}</span>\n {((files.length === 0 && allowMultiple !== 'true') || allowMultiple === 'true') && <section>{content}</section>}\n {validatemessage !== '' ? <span className='file-error'>{validatemessage}</span> : ''}\n {files && files.length > 0 && <section>{fileDisplay}</section>}\n </div>\n );\n}\n"]}
|