@pega/react-sdk-components 24.2.10 → 25.1.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/Context/StoreContext.d.ts +0 -1
- package/lib/bridge/Context/StoreContext.d.ts.map +1 -1
- package/lib/bridge/Context/StoreContext.js.map +1 -1
- package/lib/bridge/helpers/sdk_component_map.d.ts.map +1 -1
- package/lib/bridge/helpers/sdk_component_map.js +0 -6
- package/lib/bridge/helpers/sdk_component_map.js.map +1 -1
- package/lib/bridge/react_pconnect.d.ts.map +1 -1
- package/lib/bridge/react_pconnect.js +11 -14
- package/lib/bridge/react_pconnect.js.map +1 -1
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js.map +1 -1
- package/lib/components/designSystemExtension/Banner/Banner.css +1 -1
- package/lib/components/designSystemExtension/Banner/Banner.d.ts.map +1 -1
- package/lib/components/designSystemExtension/Banner/Banner.js +2 -2
- 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.map +1 -1
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js +50 -35
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
- package/lib/components/designSystemExtension/DetailsFields/DetailsFields.d.ts.map +1 -1
- package/lib/components/designSystemExtension/DetailsFields/DetailsFields.js +6 -8
- 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 +3 -5
- package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js +2 -2
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js.map +1 -1
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js +4 -6
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/designSystemExtension/Operator/Operator.d.ts +1 -1
- package/lib/components/designSystemExtension/Operator/Operator.d.ts.map +1 -1
- package/lib/components/designSystemExtension/Operator/Operator.js +12 -9
- 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.map +1 -1
- package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.js +32 -4
- package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.js.map +1 -1
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.css +7 -14
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.d.ts.map +1 -1
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js +12 -2
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js.map +1 -1
- package/lib/components/field/AutoComplete/AutoComplete.d.ts +1 -1
- package/lib/components/field/AutoComplete/AutoComplete.d.ts.map +1 -1
- package/lib/components/field/AutoComplete/AutoComplete.js.map +1 -1
- package/lib/components/field/CancelAlert/CancelAlert.css +4 -4
- package/lib/components/field/CancelAlert/CancelAlert.d.ts +1 -1
- package/lib/components/field/CancelAlert/CancelAlert.d.ts.map +1 -1
- package/lib/components/field/CancelAlert/CancelAlert.js +4 -7
- package/lib/components/field/CancelAlert/CancelAlert.js.map +1 -1
- package/lib/components/field/Checkbox/Checkbox.d.ts +9 -1
- package/lib/components/field/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/field/Checkbox/Checkbox.js +52 -3
- package/lib/components/field/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/field/Currency/Currency.d.ts +1 -1
- package/lib/components/field/Currency/Currency.d.ts.map +1 -1
- package/lib/components/field/Currency/Currency.js +8 -7
- package/lib/components/field/Currency/Currency.js.map +1 -1
- package/lib/components/field/Currency/currency-utils.d.ts.map +1 -1
- package/lib/components/field/Currency/currency-utils.js +0 -2
- package/lib/components/field/Currency/currency-utils.js.map +1 -1
- package/lib/components/field/Date/Date.d.ts +1 -1
- package/lib/components/field/Date/Date.d.ts.map +1 -1
- package/lib/components/field/Date/Date.js +7 -7
- package/lib/components/field/Date/Date.js.map +1 -1
- package/lib/components/field/DateTime/DateTime.d.ts +1 -1
- package/lib/components/field/DateTime/DateTime.d.ts.map +1 -1
- package/lib/components/field/DateTime/DateTime.js +15 -11
- package/lib/components/field/DateTime/DateTime.js.map +1 -1
- package/lib/components/field/Decimal/Decimal.d.ts +1 -1
- package/lib/components/field/Decimal/Decimal.d.ts.map +1 -1
- package/lib/components/field/Decimal/Decimal.js +7 -6
- package/lib/components/field/Decimal/Decimal.js.map +1 -1
- package/lib/components/field/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/field/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/components/field/Dropdown/Dropdown.js +16 -13
- package/lib/components/field/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/field/Email/Email.d.ts +1 -1
- package/lib/components/field/Email/Email.d.ts.map +1 -1
- package/lib/components/field/Email/Email.js +6 -7
- package/lib/components/field/Email/Email.js.map +1 -1
- package/lib/components/field/Group/Group.d.ts +2 -2
- package/lib/components/field/Group/Group.d.ts.map +1 -1
- package/lib/components/field/Group/Group.js +4 -3
- package/lib/components/field/Group/Group.js.map +1 -1
- package/lib/components/field/Integer/Integer.d.ts +1 -1
- package/lib/components/field/Integer/Integer.d.ts.map +1 -1
- package/lib/components/field/Integer/Integer.js +4 -5
- package/lib/components/field/Integer/Integer.js.map +1 -1
- package/lib/components/field/Location/Location.css +4 -0
- package/lib/components/field/Location/Location.d.ts +11 -0
- package/lib/components/field/Location/Location.d.ts.map +1 -0
- package/lib/components/field/Location/Location.js +158 -0
- package/lib/components/field/Location/Location.js.map +1 -0
- package/lib/components/field/Location/index.d.ts +2 -0
- package/lib/components/field/Location/index.d.ts.map +1 -0
- package/lib/components/field/Location/index.js +2 -0
- package/lib/components/field/Location/index.js.map +1 -0
- package/lib/components/field/Multiselect/Multiselect.js.map +1 -1
- package/lib/components/field/Multiselect/utils.d.ts +2 -1
- package/lib/components/field/Multiselect/utils.d.ts.map +1 -1
- package/lib/components/field/Multiselect/utils.js +1 -1
- package/lib/components/field/Multiselect/utils.js.map +1 -1
- package/lib/components/field/ObjectReference/ObjectReference.d.ts +16 -0
- package/lib/components/field/ObjectReference/ObjectReference.d.ts.map +1 -0
- package/lib/components/field/ObjectReference/ObjectReference.js +165 -0
- package/lib/components/field/ObjectReference/ObjectReference.js.map +1 -0
- package/lib/components/field/ObjectReference/index.d.ts +2 -0
- package/lib/components/field/ObjectReference/index.d.ts.map +1 -0
- package/lib/components/field/ObjectReference/index.js +2 -0
- package/lib/components/field/ObjectReference/index.js.map +1 -0
- package/lib/components/field/ObjectReference/utils.d.ts +17 -0
- package/lib/components/field/ObjectReference/utils.d.ts.map +1 -0
- package/lib/components/field/ObjectReference/utils.js +99 -0
- package/lib/components/field/ObjectReference/utils.js.map +1 -0
- package/lib/components/field/Percentage/Percentage.d.ts +1 -1
- package/lib/components/field/Percentage/Percentage.d.ts.map +1 -1
- package/lib/components/field/Percentage/Percentage.js +7 -7
- package/lib/components/field/Percentage/Percentage.js.map +1 -1
- package/lib/components/field/Phone/Phone.d.ts +1 -1
- package/lib/components/field/Phone/Phone.d.ts.map +1 -1
- package/lib/components/field/Phone/Phone.js +6 -4
- package/lib/components/field/Phone/Phone.js.map +1 -1
- package/lib/components/field/RadioButtons/RadioButtons.d.ts +8 -1
- package/lib/components/field/RadioButtons/RadioButtons.d.ts.map +1 -1
- package/lib/components/field/RadioButtons/RadioButtons.js +15 -10
- package/lib/components/field/RadioButtons/RadioButtons.js.map +1 -1
- package/lib/components/field/RichText/RichText.css +79 -0
- package/lib/components/field/RichText/RichText.d.ts +2 -1
- package/lib/components/field/RichText/RichText.d.ts.map +1 -1
- package/lib/components/field/RichText/RichText.js +1 -0
- package/lib/components/field/RichText/RichText.js.map +1 -1
- package/lib/components/field/ScalarList/ScalarList.d.ts +1 -1
- package/lib/components/field/ScalarList/ScalarList.d.ts.map +1 -1
- package/lib/components/field/ScalarList/ScalarList.js +3 -4
- package/lib/components/field/ScalarList/ScalarList.js.map +1 -1
- package/lib/components/field/SelectableCard/SelectableCard.d.ts +2 -0
- package/lib/components/field/SelectableCard/SelectableCard.d.ts.map +1 -0
- package/lib/components/field/SelectableCard/SelectableCard.js +57 -0
- package/lib/components/field/SelectableCard/SelectableCard.js.map +1 -0
- package/lib/components/field/SelectableCard/index.d.ts +2 -0
- package/lib/components/field/SelectableCard/index.d.ts.map +1 -0
- package/lib/components/field/SelectableCard/index.js +2 -0
- package/lib/components/field/SelectableCard/index.js.map +1 -0
- package/lib/components/field/SelectableCard/utils.d.ts +13 -0
- package/lib/components/field/SelectableCard/utils.d.ts.map +1 -0
- package/lib/components/field/SelectableCard/utils.js +183 -0
- package/lib/components/field/SelectableCard/utils.js.map +1 -0
- package/lib/components/field/SemanticLink/SemanticLink.d.ts +10 -2
- package/lib/components/field/SemanticLink/SemanticLink.d.ts.map +1 -1
- package/lib/components/field/SemanticLink/SemanticLink.js +128 -15
- package/lib/components/field/SemanticLink/SemanticLink.js.map +1 -1
- package/lib/components/field/SemanticLink/utils.js +1 -1
- package/lib/components/field/SemanticLink/utils.js.map +1 -1
- package/lib/components/field/TextArea/TextArea.d.ts +1 -1
- package/lib/components/field/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/field/TextArea/TextArea.js +4 -5
- package/lib/components/field/TextArea/TextArea.js.map +1 -1
- package/lib/components/field/TextContent/TextContent.d.ts +1 -1
- package/lib/components/field/TextContent/TextContent.d.ts.map +1 -1
- package/lib/components/field/TextContent/TextContent.js +0 -1
- package/lib/components/field/TextContent/TextContent.js.map +1 -1
- package/lib/components/field/TextInput/TextInput.d.ts +1 -1
- package/lib/components/field/TextInput/TextInput.d.ts.map +1 -1
- package/lib/components/field/TextInput/TextInput.js +4 -5
- package/lib/components/field/TextInput/TextInput.js.map +1 -1
- package/lib/components/field/Time/Time.d.ts +1 -1
- package/lib/components/field/Time/Time.d.ts.map +1 -1
- package/lib/components/field/Time/Time.js +3 -6
- package/lib/components/field/Time/Time.js.map +1 -1
- package/lib/components/field/URL/URL.d.ts +1 -1
- package/lib/components/field/URL/URL.d.ts.map +1 -1
- package/lib/components/field/URL/URL.js +4 -5
- package/lib/components/field/URL/URL.js.map +1 -1
- package/lib/components/field/UserReference/UserReference.d.ts +1 -2
- package/lib/components/field/UserReference/UserReference.d.ts.map +1 -1
- package/lib/components/field/UserReference/UserReference.js +2 -5
- package/lib/components/field/UserReference/UserReference.js.map +1 -1
- package/lib/components/field/UserReference/UserReferenceUtils.d.ts.map +1 -1
- package/lib/components/field/UserReference/UserReferenceUtils.js.map +1 -1
- package/lib/components/helpers/attachmentShared.d.ts +2 -0
- package/lib/components/helpers/attachmentShared.d.ts.map +1 -0
- package/lib/components/helpers/attachmentShared.js +6 -0
- package/lib/components/helpers/attachmentShared.js.map +1 -0
- package/lib/components/helpers/case-utils.js.map +1 -1
- package/lib/components/helpers/common-utils.d.ts +8 -1
- package/lib/components/helpers/common-utils.d.ts.map +1 -1
- package/lib/components/helpers/common-utils.js +20 -1
- package/lib/components/helpers/common-utils.js.map +1 -1
- package/lib/components/helpers/data_page.d.ts.map +1 -1
- package/lib/components/helpers/data_page.js +0 -1
- package/lib/components/helpers/data_page.js.map +1 -1
- package/lib/components/helpers/date-format-utils.d.ts.map +1 -1
- package/lib/components/helpers/event-utils.d.ts.map +1 -1
- package/lib/components/helpers/event-utils.js.map +1 -1
- package/lib/components/helpers/field-group-utils.d.ts +1 -1
- package/lib/components/helpers/field-group-utils.d.ts.map +1 -1
- package/lib/components/helpers/field-group-utils.js.map +1 -1
- package/lib/components/helpers/formatters/Boolean.js.map +1 -1
- package/lib/components/helpers/formatters/Currency.d.ts +1 -0
- package/lib/components/helpers/formatters/Currency.d.ts.map +1 -1
- package/lib/components/helpers/formatters/Currency.js +20 -19
- package/lib/components/helpers/formatters/Currency.js.map +1 -1
- package/lib/components/helpers/formatters/CurrencyMap.d.ts.map +1 -1
- package/lib/components/helpers/formatters/CurrencyMap.js +0 -1
- package/lib/components/helpers/formatters/CurrencyMap.js.map +1 -1
- package/lib/components/helpers/formatters/Date.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/formatters/common.js +2 -1
- package/lib/components/helpers/formatters/common.js.map +1 -1
- package/lib/components/helpers/formatters/index.d.ts +1 -0
- package/lib/components/helpers/formatters/index.d.ts.map +1 -1
- package/lib/components/helpers/formatters/index.js +2 -3
- package/lib/components/helpers/formatters/index.js.map +1 -1
- package/lib/components/helpers/instructions-utils.d.ts.map +1 -1
- package/lib/components/helpers/object-utils.d.ts +9 -0
- package/lib/components/helpers/object-utils.d.ts.map +1 -0
- package/lib/components/helpers/object-utils.js +11 -0
- package/lib/components/helpers/object-utils.js.map +1 -0
- package/lib/components/helpers/reactContextHelpers.d.ts +0 -1
- package/lib/components/helpers/reactContextHelpers.d.ts.map +1 -1
- package/lib/components/helpers/simpleTableHelpers.d.ts +16 -2
- package/lib/components/helpers/simpleTableHelpers.d.ts.map +1 -1
- package/lib/components/helpers/simpleTableHelpers.js +111 -5
- package/lib/components/helpers/simpleTableHelpers.js.map +1 -1
- package/lib/components/helpers/state-utils.d.ts.map +1 -1
- package/lib/components/helpers/state-utils.js.map +1 -1
- package/lib/components/helpers/template-utils.js.map +1 -1
- package/lib/components/helpers/utils.d.ts +1 -0
- package/lib/components/helpers/utils.d.ts.map +1 -1
- package/lib/components/helpers/utils.js +7 -1
- package/lib/components/helpers/utils.js.map +1 -1
- package/lib/components/helpers/versionHelpers.d.ts.map +1 -1
- package/lib/components/helpers/versionHelpers.js +0 -1
- package/lib/components/helpers/versionHelpers.js.map +1 -1
- package/lib/components/infra/ActionButtons/ActionButtons.d.ts.map +1 -1
- package/lib/components/infra/ActionButtons/ActionButtons.js +12 -7
- package/lib/components/infra/ActionButtons/ActionButtons.js.map +1 -1
- package/lib/components/infra/Assignment/Assignment.d.ts +2 -2
- package/lib/components/infra/Assignment/Assignment.d.ts.map +1 -1
- package/lib/components/infra/Assignment/Assignment.js +35 -36
- package/lib/components/infra/Assignment/Assignment.js.map +1 -1
- package/lib/components/infra/AssignmentCard/AssignmentCard.d.ts +2 -2
- package/lib/components/infra/AssignmentCard/AssignmentCard.d.ts.map +1 -1
- package/lib/components/infra/AssignmentCard/AssignmentCard.js.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts +1 -2
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +18 -93
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/helpers.d.ts.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/helpers.js +1 -5
- package/lib/components/infra/Containers/FlowContainer/helpers.js.map +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.d.ts +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.d.ts.map +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.js +3 -2
- package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.js.map +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js +4 -5
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js.map +1 -1
- package/lib/components/infra/Containers/SimpleView/SimpleView.d.ts +0 -1
- package/lib/components/infra/Containers/SimpleView/SimpleView.d.ts.map +1 -1
- package/lib/components/infra/Containers/SimpleView/helper.d.ts +0 -1
- package/lib/components/infra/Containers/SimpleView/helper.d.ts.map +1 -1
- package/lib/components/infra/Containers/SimpleView/helper.js +1 -1
- package/lib/components/infra/Containers/SimpleView/helper.js.map +1 -1
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts +1 -1
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.js +3 -4
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.js.map +1 -1
- package/lib/components/infra/Containers/container-helpers.d.ts +3 -0
- package/lib/components/infra/Containers/container-helpers.d.ts.map +1 -0
- package/lib/components/infra/Containers/container-helpers.js +52 -0
- package/lib/components/infra/Containers/container-helpers.js.map +1 -0
- package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts +2 -2
- package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts.map +1 -1
- package/lib/components/infra/DashboardFilter/DashboardFilter.js +3 -7
- package/lib/components/infra/DashboardFilter/DashboardFilter.js.map +1 -1
- package/lib/components/infra/DashboardFilter/filterUtils.d.ts.map +1 -1
- package/lib/components/infra/DashboardFilter/filterUtils.js +2 -5
- package/lib/components/infra/DashboardFilter/filterUtils.js.map +1 -1
- package/lib/components/infra/DeferLoad/DeferLoad.d.ts +2 -1
- package/lib/components/infra/DeferLoad/DeferLoad.d.ts.map +1 -1
- package/lib/components/infra/DeferLoad/DeferLoad.js +6 -9
- package/lib/components/infra/DeferLoad/DeferLoad.js.map +1 -1
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts +1 -1
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.js +0 -2
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.js.map +1 -1
- package/lib/components/infra/MultiStep/MultiStep.css +48 -70
- 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 +19 -41
- package/lib/components/infra/MultiStep/MultiStep.js.map +1 -1
- package/lib/components/infra/NavBar/NavBar.css +1 -1
- package/lib/components/infra/NavBar/NavBar.d.ts +1 -1
- package/lib/components/infra/NavBar/NavBar.d.ts.map +1 -1
- package/lib/components/infra/NavBar/NavBar.js +13 -7
- package/lib/components/infra/NavBar/NavBar.js.map +1 -1
- package/lib/components/infra/Reference/Reference.d.ts +1 -1
- package/lib/components/infra/Reference/Reference.d.ts.map +1 -1
- package/lib/components/infra/Reference/Reference.js +2 -3
- package/lib/components/infra/Reference/Reference.js.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/Region/Region.js.map +1 -1
- package/lib/components/infra/RootContainer/RootContainer.d.ts +2 -2
- package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
- package/lib/components/infra/RootContainer/RootContainer.js +1 -2
- package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
- package/lib/components/infra/Stages/Stages.d.ts +1 -1
- package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
- package/lib/components/infra/Stages/Stages.js +2 -2
- package/lib/components/infra/Stages/Stages.js.map +1 -1
- package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.js +1 -1
- package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.js.map +1 -1
- package/lib/components/infra/View/View.d.ts +2 -2
- package/lib/components/infra/View/View.d.ts.map +1 -1
- package/lib/components/infra/View/View.js +2 -1
- package/lib/components/infra/View/View.js.map +1 -1
- package/lib/components/template/AdvancedSearch/AdvancedSearch.d.ts +2 -0
- package/lib/components/template/AdvancedSearch/AdvancedSearch.d.ts.map +1 -0
- package/lib/components/template/AdvancedSearch/AdvancedSearch.js +68 -0
- package/lib/components/template/AdvancedSearch/AdvancedSearch.js.map +1 -0
- package/lib/components/template/AdvancedSearch/SearchGroup/persistUtils.d.ts +23 -0
- package/lib/components/template/AdvancedSearch/SearchGroup/persistUtils.d.ts.map +1 -0
- package/lib/components/template/AdvancedSearch/SearchGroup/persistUtils.js +26 -0
- package/lib/components/template/AdvancedSearch/SearchGroup/persistUtils.js.map +1 -0
- package/lib/components/template/AdvancedSearch/SearchGroups/SearchGroups.d.ts +3 -0
- package/lib/components/template/AdvancedSearch/SearchGroups/SearchGroups.d.ts.map +1 -0
- package/lib/components/template/AdvancedSearch/SearchGroups/SearchGroups.js +179 -0
- package/lib/components/template/AdvancedSearch/SearchGroups/SearchGroups.js.map +1 -0
- package/lib/components/template/AdvancedSearch/SearchGroups/hooks.d.ts +10 -0
- package/lib/components/template/AdvancedSearch/SearchGroups/hooks.d.ts.map +1 -0
- package/lib/components/template/AdvancedSearch/SearchGroups/hooks.js +25 -0
- package/lib/components/template/AdvancedSearch/SearchGroups/hooks.js.map +1 -0
- package/lib/components/template/AdvancedSearch/SearchGroups/index.d.ts +2 -0
- package/lib/components/template/AdvancedSearch/SearchGroups/index.d.ts.map +1 -0
- package/lib/components/template/AdvancedSearch/SearchGroups/index.js +2 -0
- package/lib/components/template/AdvancedSearch/SearchGroups/index.js.map +1 -0
- package/lib/components/template/AdvancedSearch/SearchGroups/utils.d.ts +16 -0
- package/lib/components/template/AdvancedSearch/SearchGroups/utils.d.ts.map +1 -0
- package/lib/components/template/AdvancedSearch/SearchGroups/utils.js +22 -0
- package/lib/components/template/AdvancedSearch/SearchGroups/utils.js.map +1 -0
- package/lib/components/template/AdvancedSearch/TemplateContext.d.ts +10 -0
- package/lib/components/template/AdvancedSearch/TemplateContext.d.ts.map +1 -0
- package/lib/components/template/AdvancedSearch/TemplateContext.js +11 -0
- package/lib/components/template/AdvancedSearch/TemplateContext.js.map +1 -0
- package/lib/components/template/AdvancedSearch/index.d.ts +2 -0
- package/lib/components/template/AdvancedSearch/index.d.ts.map +1 -0
- package/lib/components/template/AdvancedSearch/index.js +2 -0
- package/lib/components/template/AdvancedSearch/index.js.map +1 -0
- package/lib/components/template/AppShell/AppShell.css +1 -1
- package/lib/components/template/AppShell/AppShell.d.ts +2 -2
- package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/template/AppShell/AppShell.js +14 -17
- package/lib/components/template/AppShell/AppShell.js.map +1 -1
- package/lib/components/template/BannerPage/BannerPage.d.ts +2 -2
- package/lib/components/template/BannerPage/BannerPage.d.ts.map +1 -1
- package/lib/components/template/BannerPage/BannerPage.js.map +1 -1
- package/lib/components/template/CaseSummary/CaseSummary.d.ts +4 -2
- package/lib/components/template/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/components/template/CaseSummary/CaseSummary.js +24 -37
- package/lib/components/template/CaseSummary/CaseSummary.js.map +1 -1
- package/lib/components/template/CaseView/CaseView.d.ts +3 -2
- package/lib/components/template/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/template/CaseView/CaseView.js +14 -16
- package/lib/components/template/CaseView/CaseView.js.map +1 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts +1 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts.map +1 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js +1 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js.map +1 -1
- package/lib/components/template/Confirmation/Confirmation.d.ts +2 -2
- package/lib/components/template/Confirmation/Confirmation.d.ts.map +1 -1
- package/lib/components/template/Confirmation/Confirmation.js +1 -2
- package/lib/components/template/Confirmation/Confirmation.js.map +1 -1
- package/lib/components/template/DataReference/DataReference.d.ts +9 -2
- package/lib/components/template/DataReference/DataReference.d.ts.map +1 -1
- package/lib/components/template/DataReference/DataReference.js +239 -80
- package/lib/components/template/DataReference/DataReference.js.map +1 -1
- package/lib/components/template/DataReference/DataReferenceAdvancedSearchContext.d.ts +8 -0
- package/lib/components/template/DataReference/DataReferenceAdvancedSearchContext.d.ts.map +1 -0
- package/lib/components/template/DataReference/DataReferenceAdvancedSearchContext.js +9 -0
- package/lib/components/template/DataReference/DataReferenceAdvancedSearchContext.js.map +1 -0
- package/lib/components/template/DataReference/SearchForm.d.ts +3 -0
- package/lib/components/template/DataReference/SearchForm.d.ts.map +1 -0
- package/lib/components/template/DataReference/SearchForm.js +87 -0
- package/lib/components/template/DataReference/SearchForm.js.map +1 -0
- package/lib/components/template/DataReference/utils.d.ts +15 -0
- package/lib/components/template/DataReference/utils.d.ts.map +1 -0
- package/lib/components/template/DataReference/utils.js +75 -0
- package/lib/components/template/DataReference/utils.js.map +1 -0
- package/lib/components/template/DefaultForm/DefaultForm.d.ts +2 -2
- package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.js.map +1 -1
- package/lib/components/template/DefaultForm/utils/index.d.ts.map +1 -1
- package/lib/components/template/DefaultForm/utils/index.js +1 -2
- package/lib/components/template/DefaultForm/utils/index.js.map +1 -1
- package/lib/components/template/DefaultPage/DefaultPage.d.ts +36 -0
- package/lib/components/template/DefaultPage/DefaultPage.d.ts.map +1 -0
- package/lib/components/template/DefaultPage/DefaultPage.js +28 -0
- package/lib/components/template/DefaultPage/DefaultPage.js.map +1 -0
- package/lib/components/template/DefaultPage/index.d.ts +2 -0
- package/lib/components/template/DefaultPage/index.d.ts.map +1 -0
- package/lib/components/template/DefaultPage/index.js +2 -0
- package/lib/components/template/DefaultPage/index.js.map +1 -0
- package/lib/components/template/Details/Details/Details.d.ts +1 -1
- package/lib/components/template/Details/Details/Details.d.ts.map +1 -1
- package/lib/components/template/Details/Details/Details.js +2 -3
- package/lib/components/template/Details/Details/Details.js.map +1 -1
- package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.d.ts +2 -2
- package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.d.ts.map +1 -1
- package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.js.map +1 -1
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts +1 -1
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts.map +1 -1
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js +2 -3
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js.map +1 -1
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts +1 -1
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts.map +1 -1
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js +2 -3
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js.map +1 -1
- package/lib/components/template/Details/DynamicTabs/DynamicTabs.d.ts +1 -1
- package/lib/components/template/Details/DynamicTabs/DynamicTabs.d.ts.map +1 -1
- package/lib/components/template/Details/DynamicTabs/DynamicTabs.js +0 -1
- package/lib/components/template/Details/DynamicTabs/DynamicTabs.js.map +1 -1
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts +1 -1
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts.map +1 -1
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js +1 -4
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js.map +1 -1
- package/lib/components/template/InlineDashboard/InlineDashboard.d.ts +2 -2
- 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 +2 -2
- package/lib/components/template/InlineDashboardPage/InlineDashboardPage.d.ts.map +1 -1
- package/lib/components/template/InlineDashboardPage/InlineDashboardPage.js.map +1 -1
- package/lib/components/template/ListPage/ListPage.d.ts +1 -1
- package/lib/components/template/ListPage/ListPage.d.ts.map +1 -1
- package/lib/components/template/ListPage/ListPage.js.map +1 -1
- package/lib/components/template/ListView/DefaultViewMeta.js.map +1 -1
- package/lib/components/template/ListView/ListView.d.ts +4 -1
- package/lib/components/template/ListView/ListView.d.ts.map +1 -1
- package/lib/components/template/ListView/ListView.js +134 -67
- package/lib/components/template/ListView/ListView.js.map +1 -1
- package/lib/components/template/ListView/hooks.d.ts.map +1 -1
- package/lib/components/template/ListView/hooks.js +2 -5
- package/lib/components/template/ListView/hooks.js.map +1 -1
- package/lib/components/template/ListView/utils.d.ts.map +1 -1
- package/lib/components/template/ListView/utils.js +28 -6
- package/lib/components/template/ListView/utils.js.map +1 -1
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts +1 -1
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts.map +1 -1
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.d.ts +2 -2
- package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.d.ts.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.js.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts +1 -1
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js +2 -3
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.d.ts +2 -2
- package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.d.ts.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.js.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.d.ts +2 -2
- package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.d.ts.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.js.map +1 -1
- package/lib/components/template/OneColumn/OneColumn/OneColumn.d.ts +2 -2
- 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 -1
- package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.d.ts.map +1 -1
- package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.js.map +1 -1
- package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.d.ts +2 -2
- package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.d.ts.map +1 -1
- package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.js.map +1 -1
- package/lib/components/template/PromotedFilters/PromotedFilters.d.ts +1 -1
- package/lib/components/template/PromotedFilters/PromotedFilters.d.ts.map +1 -1
- package/lib/components/template/PromotedFilters/PromotedFilters.js +0 -2
- package/lib/components/template/PromotedFilters/PromotedFilters.js.map +1 -1
- package/lib/components/template/SelfServiceCaseView/SelfServiceCaseView.d.ts +2 -0
- package/lib/components/template/SelfServiceCaseView/SelfServiceCaseView.d.ts.map +1 -0
- package/lib/components/template/SelfServiceCaseView/SelfServiceCaseView.js +73 -0
- package/lib/components/template/SelfServiceCaseView/SelfServiceCaseView.js.map +1 -0
- package/lib/components/template/SelfServiceCaseView/index.d.ts +2 -0
- package/lib/components/template/SelfServiceCaseView/index.d.ts.map +1 -0
- package/lib/components/template/SelfServiceCaseView/index.js +2 -0
- package/lib/components/template/SelfServiceCaseView/index.js.map +1 -0
- package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts +1 -1
- package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js +1 -4
- package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts +4 -2
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +64 -47
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts +1 -1
- package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js +2 -4
- package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js.map +1 -1
- package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.d.ts +1 -1
- package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.d.ts.map +1 -1
- package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.js +3 -2
- package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.js.map +1 -1
- package/lib/components/template/SubTabs/SubTabs.d.ts +2 -2
- package/lib/components/template/SubTabs/SubTabs.d.ts.map +1 -1
- package/lib/components/template/SubTabs/SubTabs.js.map +1 -1
- package/lib/components/template/SubTabs/tabUtils.d.ts +10 -0
- package/lib/components/template/SubTabs/tabUtils.d.ts.map +1 -1
- package/lib/components/template/SubTabs/tabUtils.js +102 -1
- package/lib/components/template/SubTabs/tabUtils.js.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.d.ts +2 -2
- package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.d.ts.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.js +2 -3
- package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.js.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.d.ts +1 -1
- package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.d.ts.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.js.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.d.ts +2 -2
- package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.d.ts.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.js +2 -3
- package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.js.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.d.ts +2 -2
- package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.d.ts.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.js.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts +1 -1
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js +2 -3
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.d.ts +2 -2
- package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.d.ts.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.js.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.d.ts +2 -2
- package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.d.ts.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.js.map +1 -1
- package/lib/components/template/WssNavBar/WssNavBar.css +1 -1
- package/lib/components/template/WssNavBar/WssNavBar.d.ts +1 -1
- package/lib/components/template/WssNavBar/WssNavBar.d.ts.map +1 -1
- package/lib/components/template/WssNavBar/WssNavBar.js +4 -4
- package/lib/components/template/WssNavBar/WssNavBar.js.map +1 -1
- package/lib/components/template/utils.d.ts +7 -0
- package/lib/components/template/utils.d.ts.map +1 -0
- package/lib/components/template/utils.js +52 -0
- package/lib/components/template/utils.js.map +1 -0
- package/lib/components/widget/AppAnnouncement/AppAnnouncement.d.ts +1 -1
- package/lib/components/widget/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
- package/lib/components/widget/AppAnnouncement/AppAnnouncement.js.map +1 -1
- package/lib/components/widget/Attachment/Attachment.css +7 -8
- package/lib/components/widget/Attachment/Attachment.d.ts +4 -2
- package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
- package/lib/components/widget/Attachment/Attachment.js +255 -207
- package/lib/components/widget/Attachment/Attachment.js.map +1 -1
- package/lib/components/widget/Attachment/Attachment.types.d.ts +90 -0
- package/lib/components/widget/Attachment/Attachment.types.d.ts.map +1 -0
- package/lib/components/widget/Attachment/Attachment.types.js +2 -0
- package/lib/components/widget/Attachment/Attachment.types.js.map +1 -0
- package/lib/components/widget/Attachment/AttachmentUtils.d.ts +25 -0
- package/lib/components/widget/Attachment/AttachmentUtils.d.ts.map +1 -0
- package/lib/components/widget/Attachment/AttachmentUtils.js +255 -0
- package/lib/components/widget/Attachment/AttachmentUtils.js.map +1 -0
- package/lib/components/widget/CaseHistory/CaseHistory.d.ts +1 -1
- package/lib/components/widget/CaseHistory/CaseHistory.d.ts.map +1 -1
- package/lib/components/widget/CaseHistory/CaseHistory.js +2 -2
- package/lib/components/widget/CaseHistory/CaseHistory.js.map +1 -1
- package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.css +0 -14
- package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.d.ts +1 -1
- 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.css +7 -6
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts +2 -1
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts.map +1 -1
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.js +29 -17
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.js.map +1 -1
- package/lib/components/widget/Followers/Followers.d.ts +2 -2
- package/lib/components/widget/Followers/Followers.d.ts.map +1 -1
- package/lib/components/widget/Followers/Followers.js +0 -2
- package/lib/components/widget/Followers/Followers.js.map +1 -1
- package/lib/components/widget/QuickCreate/QuickCreate.d.ts +1 -1
- package/lib/components/widget/QuickCreate/QuickCreate.d.ts.map +1 -1
- package/lib/components/widget/QuickCreate/QuickCreate.js +0 -2
- package/lib/components/widget/QuickCreate/QuickCreate.js.map +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.css +9 -11
- package/lib/components/widget/SummaryItem/SummaryItem.d.ts +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.js +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/widget/SummaryList/SummaryList.d.ts +1 -1
- package/lib/components/widget/SummaryList/SummaryList.d.ts.map +1 -1
- package/lib/components/widget/SummaryList/SummaryList.js.map +1 -1
- package/lib/components/widget/ToDo/ToDo.css +1 -13
- package/lib/components/widget/ToDo/ToDo.d.ts +1 -1
- package/lib/components/widget/ToDo/ToDo.d.ts.map +1 -1
- package/lib/components/widget/ToDo/ToDo.js +22 -17
- package/lib/components/widget/ToDo/ToDo.js.map +1 -1
- package/lib/hooks/useAfterInitialEffect.d.ts +1 -1
- package/lib/hooks/useAfterInitialEffect.d.ts.map +1 -1
- package/lib/hooks/useAfterInitialEffect.js.map +1 -1
- package/lib/hooks/useConsolidatedRef.d.ts +1 -1
- package/lib/hooks/useConsolidatedRef.d.ts.map +1 -1
- package/lib/hooks/useConsolidatedRef.js.map +1 -1
- package/lib/hooks/useFocusFirstField.d.ts.map +1 -1
- package/lib/hooks/useFocusFirstField.js.map +1 -1
- package/lib/hooks/useGetTabsCount.d.ts +10 -0
- package/lib/hooks/useGetTabsCount.d.ts.map +1 -0
- package/lib/hooks/useGetTabsCount.js +165 -0
- package/lib/hooks/useGetTabsCount.js.map +1 -0
- package/lib/hooks/useIsMount.d.ts +2 -0
- package/lib/hooks/useIsMount.d.ts.map +1 -0
- package/lib/hooks/useIsMount.js +9 -0
- package/lib/hooks/useIsMount.js.map +1 -0
- package/lib/hooks/useScrolltoTop.d.ts.map +1 -1
- package/lib/mediaco/ToDo/ToDo.css +81 -0
- package/lib/mediaco/ToDo/ToDo.d.ts +16 -0
- package/lib/mediaco/ToDo/ToDo.d.ts.map +1 -0
- package/lib/mediaco/ToDo/ToDo.js +187 -0
- package/lib/mediaco/ToDo/ToDo.js.map +1 -0
- package/lib/mediaco/ToDo/index.d.ts +2 -0
- package/lib/mediaco/ToDo/index.d.ts.map +1 -0
- package/lib/mediaco/ToDo/index.js +2 -0
- package/lib/mediaco/ToDo/index.js.map +1 -0
- package/lib/samples/Embedded/styles.css +26 -0
- package/lib/sdk-pega-component-map.d.ts +119 -103
- package/lib/sdk-pega-component-map.d.ts.map +1 -1
- package/lib/sdk-pega-component-map.js +20 -3
- package/lib/sdk-pega-component-map.js.map +1 -1
- package/lib/theme.d.ts +30 -1
- package/lib/theme.d.ts.map +1 -1
- package/lib/theme.js +209 -2
- package/lib/theme.js.map +1 -1
- package/lib/types/PConnProps.d.ts +1 -1
- package/package.json +32 -1
- package/lib/components/helpers/attachmentHelpers.d.ts +0 -13
- package/lib/components/helpers/attachmentHelpers.d.ts.map +0 -1
- package/lib/components/helpers/attachmentHelpers.js +0 -72
- package/lib/components/helpers/attachmentHelpers.js.map +0 -1
- package/lib/components/infra/Containers/helpers.d.ts +0 -2
- package/lib/components/infra/Containers/helpers.d.ts.map +0 -1
- package/lib/components/infra/Containers/helpers.js +0 -7
- package/lib/components/infra/Containers/helpers.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
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,CAAC,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,EAAE;IACxD,KAAK,CAAC,aAAa,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,cAAc,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,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"]}
|
|
1
|
+
{"version":3,"file":"Attachment.js","sourceRoot":"","sources":["../../../../src/components/widget/Attachment/Attachment.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,YAAY,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAIjE,OAAO,kBAAkB,CAAC;AAW1B,MAAM,CAA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ACvE,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,IAAI,4BAAU,OAAO,GAAW,EACzF,eAAe,KAAK,EAAE,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,YAAY,YAAE,eAAe,GAAQ,CAAC,CAAC,CAAC,eAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAG,UAAU,GAAQ,EACvI,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,4BAAU,WAAW,GAAW,IAC1D,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { useState, useEffect, useCallback, useMemo, useRef } from 'react';\nimport { CircularProgress, IconButton, Menu, MenuItem, Button } from '@mui/material';\nimport MoreVertIcon from '@mui/icons-material/MoreVert';\n\nimport { Utils } from '../../helpers/utils';\nimport {\n clearFieldErrorMessages,\n deleteAttachments,\n getIconFromFileType,\n getMappedValue,\n insertAttachments,\n useDeepMemo,\n useFileDownload,\n validateFileExtension\n} from './AttachmentUtils';\nimport { validateMaxSize } from '../../helpers/attachmentShared';\nimport type { PageInstructionOptions } from './Attachment.types';\nimport type { 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: boolean | string;\n extensions: string;\n editMode: string;\n isTableFormatter: boolean;\n}\n\nexport default function Attachment(props: AttachmentProps) {\n const { value, getPConnect, label, validatemessage, extensions, displayMode, helperText, editMode, isTableFormatter } = 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, allowMultiple } = props;\n [required, disabled, allowMultiple] = [required, disabled, allowMultiple].map(\n prop => prop === true || (typeof prop === 'string' && prop === 'true')\n );\n const pConn = getPConnect();\n const localizationService = pConn.getLocalizationService();\n\n const actionSequencer = useMemo(() => PCore.getActionsSequencer(), []);\n const rawValue = pConn.getComponentConfig().value;\n const isAttachmentAnnotationPresent = typeof rawValue === 'object' ? false : rawValue?.includes('@ATTACHMENT');\n const { attachments, isOldAttachment } = isAttachmentAnnotationPresent ? value : PCore.getAttachmentUtils().prepareAttachmentData(value);\n\n let valueRef = (pConn.getStateProps() as any).value;\n valueRef = valueRef.indexOf('.') === 0 ? valueRef.substring(1) : valueRef;\n\n pConn.setReferenceList(`.${valueRef}`);\n\n const isMultiAttachmentInInlineEditTable = isTableFormatter && allowMultiple && editMode === 'tableRows';\n\n const [files, setFiles] = useState<any[]>(attachments);\n const overrideLocalState = useRef(false);\n const attachmentCount = useRef(attachments.length);\n const filesWithError = useRef<any[]>([]);\n const multiAttachmentsInInlineEdit = useRef([]);\n const thumbnailURLs = useRef<any[]>([]);\n const contextName = pConn.getContextName();\n const onFileDownload = useFileDownload(contextName);\n\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 const deleteIcon = Utils.getImageSrc('trash', Utils.getSDKStaticConentUrl());\n const srcImg = Utils.getImageSrc('document-doc', Utils.getSDKStaticConentUrl());\n\n const [anchorEl, setAnchorEl] = useState(null);\n const open = Boolean(anchorEl);\n\n const fileInputRef = useRef<HTMLInputElement>(null);\n const [toggleUploadBegin, setToggleUploadBegin] = useState(false);\n\n const deleteFile = useCallback(\n (file, fileIndex) => {\n setAnchorEl(null);\n\n // reset the file input so that it will allow re-uploading the same file after deletion\n if (fileInputRef.current) {\n fileInputRef.current.value = ''; // Reset the input\n }\n\n if (filesWithError.current.length > 0) {\n filesWithError.current = filesWithError.current.filter(fileWithError => fileWithError.props.id !== file.props.id);\n if (filesWithError.current.length === 0) {\n clearFieldErrorMessages(pConn);\n }\n }\n\n if (file.inProgress) {\n // @ts-ignore - Expected 1 arguments, but got 2.ts(2554)\n PCore.getAttachmentUtils().cancelRequest(file.props.id, contextName);\n actionSequencer.deRegisterBlockingAction(contextName).catch(() => {});\n setFiles(localFiles => {\n return localFiles.filter(localFile => localFile.props.id !== file.props.id);\n });\n } else {\n deleteAttachments([file], pConn, multiAttachmentsInInlineEdit.current, {\n allowMultiple,\n isOldAttachment,\n isMultiAttachmentInInlineEditTable,\n attachmentCount: attachmentCount.current,\n deleteIndex: fileIndex\n } as any);\n // Filter out without deleted file and reset the file indexes\n setFiles(localFiles => {\n let tempLocalFiles = [...localFiles];\n tempLocalFiles = tempLocalFiles.filter(localFile => localFile.props.id !== file.props.id);\n tempLocalFiles.forEach(localFile => {\n if (!localFile.props.error && !file.props.error) {\n const updatedDeleteIndex =\n localFile.responseProps.deleteIndex > fileIndex ? localFile.responseProps.deleteIndex - 1 : localFile.responseProps.deleteIndex;\n\n localFile.props.onDelete = () => deleteFile(localFile, updatedDeleteIndex);\n\n localFile.responseProps.deleteIndex = updatedDeleteIndex;\n }\n });\n return tempLocalFiles;\n });\n if (!file.props.error) {\n attachmentCount.current -= 1;\n }\n }\n\n setToggleUploadBegin(false);\n },\n [pConn]\n );\n\n const onUploadProgress = (id, ev) => {\n const progress = Math.floor((ev.loaded / ev.total) * 100);\n setFiles(localFiles => [\n ...localFiles.map(localFile => {\n if (localFile.props?.id === id) {\n localFile.inProgress = true;\n localFile.props.progress = progress;\n }\n return localFile;\n })\n ]);\n };\n\n const populateErrorAndUpdateRedux = file => {\n const fieldName = (pConn.getStateProps() as any).value;\n // set errors to property to block submit even on errors in file upload\n PCore.getMessageManager().addMessages({\n messages: [\n {\n type: 'error',\n message: localizationService.getLocalizedText('Error with one or more files')\n }\n ],\n property: fieldName,\n pageReference: pConn.getPageReference(),\n context: contextName\n });\n insertAttachments([file], pConn, multiAttachmentsInInlineEdit.current, {\n allowMultiple,\n isOldAttachment,\n isMultiAttachmentInInlineEditTable,\n attachmentCount: attachmentCount.current\n } as any);\n };\n\n const errorHandler = (isFetchCanceled, file) => {\n return error => {\n if (!isFetchCanceled(error)) {\n let uploadFailMsg = localizationService.getLocalizedText('Something went wrong');\n if (error.response && error.response.data && error.response.data.errorDetails) {\n uploadFailMsg = localizationService.getLocalizedText(error.response.data.errorDetails[0].localizedValue);\n }\n\n setFiles(current => {\n return current.map((localFile, index) => {\n if (localFile.props.id === file.props.id) {\n localFile.props.meta = uploadFailMsg;\n localFile.props.error = true;\n localFile.props.onDelete = () => deleteFile(localFile, index);\n localFile.props.icon = getIconFromFileType(localFile.type);\n localFile.props.name = localizationService.getLocalizedText('Unable to upload file');\n localFile.inProgress = false;\n delete localFile.props.progress;\n filesWithError.current.push(localFile);\n\n populateErrorAndUpdateRedux(localFile);\n }\n return localFile;\n });\n });\n }\n throw error;\n };\n };\n\n const onFileAdded = event => {\n let addedFiles = Array.from(event.target.files);\n addedFiles = allowMultiple ? 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.props = {\n type: f.type,\n name: f.name,\n id: f.ID,\n format: f.name.split('.').pop(),\n icon: getIconFromFileType(f.type),\n onDelete: () => deleteFile(f, index),\n thumbnail: window.URL.createObjectURL(f)\n };\n if (!validateMaxSize(f, maxAttachmentSize)) {\n f.props.error = true;\n f.props.meta = localizationService.getLocalizedText(`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 = `${localizationService.getLocalizedText('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 PCore.getMessageManager().addMessages({\n messages: [\n {\n type: 'error',\n message: localizationService.getLocalizedText('Error with one or more files')\n }\n ],\n property: fieldName,\n pageReference: pConn.getPageReference(),\n context: contextName\n });\n }\n return f;\n })\n ];\n\n const tempFilesWithError = tempFilesToBeUploaded.filter(f => f.props.error);\n if (tempFilesWithError.length > 0) {\n filesWithError.current = [...filesWithError.current, ...tempFilesWithError];\n\n insertAttachments(tempFilesWithError, pConn, multiAttachmentsInInlineEdit.current, {\n allowMultiple,\n isOldAttachment,\n isMultiAttachmentInInlineEditTable,\n attachmentCount: attachmentCount.current\n } as PageInstructionOptions);\n }\n setFiles(current => (!allowMultiple ? [...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.ID !== 'temp';\n const isFileUploadInProgress = e.inProgress;\n return !isFileUploadInProgress && !isFileUploaded && !fileHasError && !isFileUploadedInLastStep;\n })\n .map(file =>\n PCore.getAttachmentUtils().uploadAttachment(\n file,\n ev => {\n onUploadProgress(file.props.id, ev);\n },\n isFetchCanceled => {\n return errorHandler(isFetchCanceled, file);\n },\n contextName\n )\n );\n\n // allow new files to be added when other files upload is still in progress\n setToggleUploadBegin(false);\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(localFiles => {\n const tempFilesUploaded = [...localFiles];\n tempFilesUploaded.forEach(localFile => {\n // if attach field has multiple files & in bw any error files are present\n // Example : files = [properFile1, errFile, errFile, properFile2]\n // indexes for delete & preview should be for files [properFile1, properFile2] which is [1,2]\n const index = fileResponses.findIndex(fileResponse => fileResponse.value.clientFileID === localFile.props.id);\n if (index >= 0) {\n fileResponses[index].value.thumbnail = localFile.props.thumbnail;\n localFile.inProgress = false;\n localFile.ID = fileResponses[index].value.ID;\n localFile.props.meta = localizationService.getLocalizedText('Uploaded successfully');\n localFile.props.progress = 100;\n localFile.handle = fileResponses[index].value.ID;\n localFile.label = valueRef;\n localFile.responseProps = {\n pzInsKey: 'temp'\n };\n }\n });\n return tempFilesUploaded;\n });\n\n insertAttachments(fileResponses, pConn, multiAttachmentsInInlineEdit.current, {\n allowMultiple,\n isOldAttachment,\n isMultiAttachmentInInlineEditTable,\n attachmentCount: attachmentCount.current,\n insert: true\n } as any);\n attachmentCount.current += fileResponses.length;\n\n if (filesWithError.current.length === 0) {\n clearFieldErrorMessages(pConn);\n }\n }\n actionSequencer.deRegisterBlockingAction(contextName).catch(() => {});\n })\n .catch(error => {\n console.log(error);\n setToggleUploadBegin(false);\n });\n }, [files]);\n\n useEffect(() => {\n if (toggleUploadBegin && files.length > 0) {\n actionSequencer.registerBlockingAction(contextName).then(() => {\n uploadFiles();\n });\n }\n }, [toggleUploadBegin]);\n\n useEffect(() => {\n if (filesWithError.current.length === 0) {\n clearFieldErrorMessages(pConn);\n }\n }, [filesWithError]);\n\n const memoizedAttachments = useDeepMemo(() => {\n return attachments;\n }, [attachments]);\n\n // Prepares new structure as per Cosmos component\n const transformAttachments = () => {\n const transformedFiles = [...attachments];\n let deleteIndex = -1;\n transformedFiles.forEach(attachment => {\n attachment.props.id = attachment.responseProps.ID;\n attachment.props.format = attachment.props.name.split('.').pop();\n if (attachment.props.error) {\n attachment.responseProps.deleteIndex = deleteIndex;\n } else {\n deleteIndex += 1;\n attachment.responseProps.deleteIndex = deleteIndex;\n }\n if (attachment.props.thumbnail) {\n thumbnailURLs.current.push(attachment.props.thumbnail);\n }\n });\n\n return transformedFiles;\n };\n\n useEffect(() => {\n const caseID = PCore.getStoreValue(`.${getMappedValue('pyID')}`, PCore.getResolvedConstantValue('caseInfo.content'), contextName);\n if (displayMode !== 'DISPLAY_ONLY') {\n PCore.getPubSubUtils().subscribe(\n PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION,\n () => {\n overrideLocalState.current = true;\n },\n caseID\n );\n }\n\n // When component mounts, only set local files state from redux.\n const serverFiles = transformAttachments();\n setFiles(serverFiles);\n filesWithError.current = serverFiles.filter(file => file.props.error);\n\n return () => {\n if (displayMode !== 'DISPLAY_ONLY') {\n PCore.getPubSubUtils().unsubscribe(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION, caseID);\n }\n };\n }, []);\n\n useEffect(() => {\n if (overrideLocalState.current) {\n const serverFiles = transformAttachments();\n overrideLocalState.current = false;\n attachmentCount.current = attachments.length;\n filesWithError.current = [];\n setFiles(serverFiles);\n } else {\n // Determine whether refresh call has overridden any error files in redux, push error files back to redux from local state to perform client side validation during assignment submit\n const errorFiles = attachments.filter(attachment => attachment.props.error);\n if (errorFiles.length === 0 && filesWithError.current.length > 0) {\n // Check if local file state contains error files and push those to redux\n const uniqueKey = getMappedValue('pzInsKey');\n const transformedErrorFiles = filesWithError.current.map(errorFile => {\n const filename = errorFile.props.name;\n return {\n [uniqueKey]: errorFile.props.id,\n FileName: filename,\n Category: '',\n FileExtension: filename.split('.').pop() ?? filename,\n error: errorFile.props.error || null\n };\n });\n let key = '';\n let updatedAttachments: any = [];\n if (allowMultiple || isOldAttachment) {\n key = isOldAttachment ? `${valueRef}.pxResults` : valueRef;\n const existingAttachments = PCore.getStoreValue(`.${key}`, pConn.getPageReference(), pConn.getContextName()) || [];\n updatedAttachments = [...existingAttachments, ...transformedErrorFiles];\n } else {\n key = valueRef;\n updatedAttachments = transformedErrorFiles[0];\n }\n PCore.getStateUtils().updateState(pConn.getContextName(), key, updatedAttachments, {\n pageReference: pConn.getPageReference(),\n isArrayDeepMerge: false,\n removePropertyFromChangedList: true\n });\n }\n }\n }, [memoizedAttachments]);\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}\n required={required}\n disabled={disabled}\n onChange={onFileAdded}\n />\n <Button style={{ textTransform: 'none' }} variant='outlined' color='primary' component='span'>\n {allowMultiple\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, index)}>\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={() => {\n setAnchorEl(null);\n onFileDownload(item.responseProps ? item.responseProps : {});\n }}\n >\n Download\n </MenuItem>\n <MenuItem style={{ fontSize: '14px' }} key='delete' onClick={() => deleteFile(item, index)}>\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) || allowMultiple) && <section>{content}</section>}\n {validatemessage !== '' ? <span className='file-error'>{validatemessage}</span> : <span style={{ fontSize: '14px' }}>{helperText}</span>}\n {files && files.length > 0 && <section>{fileDisplay}</section>}\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { ReactElement, Ref } from 'react';
|
|
2
|
+
export interface ResponseProps {
|
|
3
|
+
ID: string;
|
|
4
|
+
extension: string;
|
|
5
|
+
createDateTime?: Date | string | number;
|
|
6
|
+
createUser?: string;
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
export interface AttachmentActions {
|
|
10
|
+
rel: string;
|
|
11
|
+
href: string;
|
|
12
|
+
title: string;
|
|
13
|
+
type: string;
|
|
14
|
+
}
|
|
15
|
+
export interface AttachmentLinks {
|
|
16
|
+
delete: AttachmentActions;
|
|
17
|
+
download: AttachmentActions;
|
|
18
|
+
edit: AttachmentActions;
|
|
19
|
+
}
|
|
20
|
+
export interface FileObject extends File {
|
|
21
|
+
icon?: string;
|
|
22
|
+
ID: string;
|
|
23
|
+
fileName: string;
|
|
24
|
+
category: string;
|
|
25
|
+
responseType: string;
|
|
26
|
+
fileType: string;
|
|
27
|
+
mimeType: string;
|
|
28
|
+
extension: string;
|
|
29
|
+
thumbnail?: string;
|
|
30
|
+
nameWithExt: string;
|
|
31
|
+
inProgress?: boolean;
|
|
32
|
+
progress?: number;
|
|
33
|
+
handle: string;
|
|
34
|
+
label: string;
|
|
35
|
+
delete?: boolean;
|
|
36
|
+
error?: boolean;
|
|
37
|
+
description: string;
|
|
38
|
+
props: {
|
|
39
|
+
icon?: string;
|
|
40
|
+
ref?: Ref<HTMLDivElement>;
|
|
41
|
+
id: string;
|
|
42
|
+
error?: string;
|
|
43
|
+
format?: string;
|
|
44
|
+
name: string;
|
|
45
|
+
thumbnail?: string;
|
|
46
|
+
onPreview?: () => void;
|
|
47
|
+
onDelete?: () => void;
|
|
48
|
+
onOpen?: () => void;
|
|
49
|
+
onEdit?: () => void;
|
|
50
|
+
onCancel?: () => void;
|
|
51
|
+
};
|
|
52
|
+
responseProps: ResponseProps;
|
|
53
|
+
value?: {
|
|
54
|
+
filename: string;
|
|
55
|
+
ID: string;
|
|
56
|
+
thumbnail: string;
|
|
57
|
+
};
|
|
58
|
+
categoryName: string;
|
|
59
|
+
createTime: string;
|
|
60
|
+
createdBy: string;
|
|
61
|
+
createdByName: string;
|
|
62
|
+
links: AttachmentLinks;
|
|
63
|
+
name: string;
|
|
64
|
+
meta?: ReactElement;
|
|
65
|
+
}
|
|
66
|
+
export interface ReduxAttachments {
|
|
67
|
+
ID?: string;
|
|
68
|
+
pzInsKey?: string;
|
|
69
|
+
FileName: string;
|
|
70
|
+
Category: string;
|
|
71
|
+
MimeType?: string;
|
|
72
|
+
FileExtension: string;
|
|
73
|
+
error: string | null;
|
|
74
|
+
localAttachment: boolean;
|
|
75
|
+
thumbnail?: string;
|
|
76
|
+
fileIndex?: number;
|
|
77
|
+
instruction?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface PageInstructionOptions {
|
|
80
|
+
allowMultiple: boolean;
|
|
81
|
+
isMultiAttachmentInInlineEditTable: boolean;
|
|
82
|
+
attachmentCount: number;
|
|
83
|
+
insertPageInstruction: boolean;
|
|
84
|
+
deletePageInstruction: boolean;
|
|
85
|
+
deleteIndex: number;
|
|
86
|
+
insertRedux: boolean;
|
|
87
|
+
isOldAttachment: boolean;
|
|
88
|
+
deleteRedux: boolean;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=Attachment.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Attachment.types.d.ts","sourceRoot":"","sources":["../../../../src/components/widget/Attachment/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AED,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,OAAO,CAAC;IACvB,kCAAkC,EAAE,OAAO,CAAC;IAC5C,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Attachment.types.js","sourceRoot":"","sources":["../../../../src/components/widget/Attachment/Attachment.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactElement, Ref } from 'react';\n\nexport interface ResponseProps {\n ID: string;\n extension: string;\n createDateTime?: Date | string | number;\n createUser?: string;\n name: string;\n}\n\nexport interface AttachmentActions {\n rel: string;\n href: string;\n title: string;\n type: string;\n}\n\nexport interface AttachmentLinks {\n delete: AttachmentActions;\n download: AttachmentActions;\n edit: AttachmentActions;\n}\nexport interface FileObject extends File {\n icon?: string;\n ID: string;\n fileName: string;\n category: string;\n responseType: string;\n fileType: string;\n mimeType: string;\n extension: string;\n thumbnail?: string;\n nameWithExt: string;\n inProgress?: boolean;\n progress?: number;\n handle: string;\n label: string;\n delete?: boolean;\n error?: boolean;\n description: string;\n\n props: {\n icon?: string;\n\n ref?: Ref<HTMLDivElement>;\n id: string;\n error?: string;\n format?: string;\n name: string;\n thumbnail?: string;\n onPreview?: () => void;\n onDelete?: () => void;\n onOpen?: () => void;\n onEdit?: () => void;\n onCancel?: () => void;\n };\n responseProps: ResponseProps;\n value?: {\n filename: string;\n ID: string;\n thumbnail: string;\n };\n categoryName: string;\n createTime: string;\n createdBy: string;\n createdByName: string;\n links: AttachmentLinks;\n name: string;\n meta?: ReactElement;\n}\n\nexport interface ReduxAttachments {\n ID?: string;\n pzInsKey?: string;\n FileName: string;\n Category: string;\n MimeType?: string;\n FileExtension: string;\n error: string | null;\n localAttachment: boolean;\n thumbnail?: string;\n fileIndex?: number;\n instruction?: string;\n}\n\nexport interface PageInstructionOptions {\n allowMultiple: boolean;\n isMultiAttachmentInInlineEditTable: boolean;\n attachmentCount: number;\n insertPageInstruction: boolean;\n deletePageInstruction: boolean;\n deleteIndex: number;\n insertRedux: boolean;\n isOldAttachment: boolean;\n deleteRedux: boolean;\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { FileObject, PageInstructionOptions, ReduxAttachments } from './Attachment.types';
|
|
2
|
+
export declare const isContentBinary: (headers: Record<string, string>) => boolean;
|
|
3
|
+
export declare const isContentBase64: (headers: Record<string, string>) => boolean;
|
|
4
|
+
export declare const validateFileExtension: (fileObj: Record<string, string>, allowedExtensions: string) => boolean;
|
|
5
|
+
export declare const fileDownload: (data: string | Blob, fileName: string, ext: string | null, headers: Record<string, string>) => void;
|
|
6
|
+
export declare const getIconFromFileType: (fileType: string) => string;
|
|
7
|
+
export declare const fileDownloadVar: (content: {
|
|
8
|
+
data: string;
|
|
9
|
+
headers: Record<string, string>;
|
|
10
|
+
}, type: string, name: string, extension: string) => void;
|
|
11
|
+
export declare const getMappedValue: (value: string) => string;
|
|
12
|
+
export declare const updateReduxState: (transformedAttachments: ReduxAttachments[], pConn: typeof PConnect, valueRef: string, options: PageInstructionOptions) => void;
|
|
13
|
+
export declare const insertAttachments: (files: FileObject[], pConn: typeof PConnect, attachmentsInModal: ReduxAttachments[], options: PageInstructionOptions) => void;
|
|
14
|
+
export declare const deleteAttachments: (files: FileObject[], pConn: typeof PConnect, attachmentsInModal: Pick<ReduxAttachments, "instruction" | "fileIndex">[], options: PageInstructionOptions) => void;
|
|
15
|
+
export declare const clearFieldErrorMessages: (pConn: typeof PConnect) => void;
|
|
16
|
+
export declare const useFileDownload: (context: string) => ({ ID, name, extension, type, category, responseType }: {
|
|
17
|
+
ID: string;
|
|
18
|
+
name: string;
|
|
19
|
+
extension: string;
|
|
20
|
+
type: string;
|
|
21
|
+
category: string;
|
|
22
|
+
responseType: string;
|
|
23
|
+
}) => void;
|
|
24
|
+
export declare const useDeepMemo: (memoFn: any, key: any) => any;
|
|
25
|
+
//# sourceMappingURL=AttachmentUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentUtils.d.ts","sourceRoot":"","sources":["../../../../src/components/widget/Attachment/AttachmentUtils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE/F,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,YAE9D,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,YAE9D,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,mBAAmB,MAAM,YAU/F,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,GAAG,IAAI,EAAE,UAAU,MAAM,EAAE,KAAK,MAAM,GAAG,IAAI,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SAUtH,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,UAAU,MAAM,WAyBnD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,EAAE,MAAM,MAAM,EAAE,MAAM,MAAM,EAAE,WAAW,MAAM,SAaxI,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,MAE9C,CAAC;AA8DF,eAAO,MAAM,gBAAgB,GAC3B,wBAAwB,gBAAgB,EAAE,EAC1C,OAAO,OAAO,QAAQ,EACtB,UAAU,MAAM,EAChB,SAAS,sBAAsB,SA8DhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,OAAO,UAAU,EAAE,EACnB,OAAO,OAAO,QAAQ,EACtB,oBAAoB,gBAAgB,EAAE,EACtC,SAAS,sBAAsB,SAchC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,OAAO,UAAU,EAAE,EACnB,OAAO,OAAO,QAAQ,EACtB,oBAAoB,IAAI,CAAC,gBAAgB,EAAE,aAAa,GAAG,WAAW,CAAC,EAAE,EACzE,SAAS,sBAAsB,SAchC,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,OAAO,OAAO,QAAQ,SAQ7D,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,6DASxC;IACD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB,SA6BJ,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,WAAM,EAAE,QAAG,QAMtC,CAAC"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
import download from 'downloadjs';
|
|
3
|
+
import equal from 'fast-deep-equal';
|
|
4
|
+
export const isContentBinary = (headers) => {
|
|
5
|
+
return headers && headers['content-transfer-encoding'] === 'binary';
|
|
6
|
+
};
|
|
7
|
+
export const isContentBase64 = (headers) => {
|
|
8
|
+
return headers && headers['content-transfer-encoding'] === 'base64';
|
|
9
|
+
};
|
|
10
|
+
export const validateFileExtension = (fileObj, allowedExtensions) => {
|
|
11
|
+
if (!allowedExtensions) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
const allowedExtensionList = allowedExtensions
|
|
15
|
+
.toLowerCase()
|
|
16
|
+
.split(',')
|
|
17
|
+
.map(item => item.replaceAll('.', '').trim());
|
|
18
|
+
const extension = fileObj.name.split('.').pop()?.toLowerCase() || '';
|
|
19
|
+
return allowedExtensionList.includes(extension);
|
|
20
|
+
};
|
|
21
|
+
export const fileDownload = (data, fileName, ext, headers) => {
|
|
22
|
+
const name = ext ? `${fileName}.${ext}` : fileName;
|
|
23
|
+
// Temp fix: downloading EMAIl type attachment as html file
|
|
24
|
+
if (ext === 'html') {
|
|
25
|
+
download(isContentBase64(headers) ? atob(data) : data, name, 'text/html');
|
|
26
|
+
}
|
|
27
|
+
else if (isContentBinary(headers)) {
|
|
28
|
+
download(data, name);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
download(atob(data), name);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
export const getIconFromFileType = (fileType) => {
|
|
35
|
+
let icon = 'document-doc';
|
|
36
|
+
if (!fileType)
|
|
37
|
+
return icon;
|
|
38
|
+
if (fileType.startsWith('audio')) {
|
|
39
|
+
icon = 'audio';
|
|
40
|
+
}
|
|
41
|
+
else if (fileType.startsWith('video')) {
|
|
42
|
+
icon = 'video';
|
|
43
|
+
}
|
|
44
|
+
else if (fileType.startsWith('image')) {
|
|
45
|
+
icon = 'picture';
|
|
46
|
+
}
|
|
47
|
+
else if (fileType.includes('pdf')) {
|
|
48
|
+
icon = 'document-pdf';
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
const [, subtype] = fileType.split('/');
|
|
52
|
+
const foundMatch = (sources) => {
|
|
53
|
+
return sources.some(key => subtype.includes(key));
|
|
54
|
+
};
|
|
55
|
+
if (foundMatch(['excel', 'spreadsheet'])) {
|
|
56
|
+
icon = 'document-xls';
|
|
57
|
+
}
|
|
58
|
+
else if (foundMatch(['zip', 'compressed', 'gzip', 'rar', 'tar'])) {
|
|
59
|
+
icon = 'document-compress';
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return icon;
|
|
63
|
+
};
|
|
64
|
+
export const fileDownloadVar = (content, type, name, extension) => {
|
|
65
|
+
if (type === 'FILE' || type === undefined) {
|
|
66
|
+
fileDownload(content.data, name, extension, content.headers);
|
|
67
|
+
}
|
|
68
|
+
else if (type === 'URL') {
|
|
69
|
+
let { data } = content;
|
|
70
|
+
if (!/^(http|https):\/\//.test(data)) {
|
|
71
|
+
data = `//${data}`;
|
|
72
|
+
}
|
|
73
|
+
window.open(content.data, '_blank');
|
|
74
|
+
}
|
|
75
|
+
else if (type === 'EMAIL') {
|
|
76
|
+
// Temp Fix: for EMAIL type attachment
|
|
77
|
+
fileDownload(content.data, name, 'html', content.headers);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
export const getMappedValue = (value) => {
|
|
81
|
+
return PCore.getEnvironmentInfo().getKeyMapping(value) ?? value;
|
|
82
|
+
};
|
|
83
|
+
const generateInstructions = (files, pConn, attachmentsInModal, options) => {
|
|
84
|
+
const { allowMultiple, isMultiAttachmentInInlineEditTable, attachmentCount, insertPageInstruction, deletePageInstruction, deleteIndex } = options;
|
|
85
|
+
const transformedAttachments = [];
|
|
86
|
+
let valueRef = pConn.getStateProps().value;
|
|
87
|
+
valueRef = valueRef?.indexOf('.') === 0 ? valueRef.substring(1) : valueRef;
|
|
88
|
+
const uniqueKey = getMappedValue('pzInsKey');
|
|
89
|
+
files.forEach((file, index) => {
|
|
90
|
+
const filename = file.value?.filename || file.props?.name || '';
|
|
91
|
+
const payload = {
|
|
92
|
+
[uniqueKey]: file.value?.ID || file.props?.id,
|
|
93
|
+
FileName: filename,
|
|
94
|
+
Category: '',
|
|
95
|
+
// MimeType: getMimeTypeFromFile(filename),
|
|
96
|
+
FileExtension: filename.split('.').pop() ?? filename,
|
|
97
|
+
error: file.props?.error || null,
|
|
98
|
+
localAttachment: true,
|
|
99
|
+
thumbnail: file.value?.thumbnail
|
|
100
|
+
};
|
|
101
|
+
transformedAttachments.push(payload);
|
|
102
|
+
if (payload.error) {
|
|
103
|
+
return; // Don't process page instructions for error files, skip current iteration
|
|
104
|
+
}
|
|
105
|
+
if (allowMultiple) {
|
|
106
|
+
if (isMultiAttachmentInInlineEditTable) {
|
|
107
|
+
if (insertPageInstruction) {
|
|
108
|
+
attachmentsInModal.push({ ...payload, instruction: 'insert' });
|
|
109
|
+
}
|
|
110
|
+
else if (deletePageInstruction) {
|
|
111
|
+
attachmentsInModal.push({
|
|
112
|
+
instruction: 'delete',
|
|
113
|
+
fileIndex: deleteIndex
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else if (insertPageInstruction) {
|
|
118
|
+
pConn.getListActions().insert({ ID: payload[uniqueKey] }, attachmentCount + index, undefined, {
|
|
119
|
+
skipStateUpdate: true
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
else if (deletePageInstruction) {
|
|
123
|
+
pConn.getListActions().deleteEntry(deleteIndex, undefined, { skipStateUpdate: true });
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
else if (insertPageInstruction) {
|
|
127
|
+
pConn.getListActions().replacePage(`.${valueRef}`, { ID: payload[uniqueKey] }, { skipStateUpdate: true });
|
|
128
|
+
}
|
|
129
|
+
else if (deletePageInstruction) {
|
|
130
|
+
pConn.getListActions().deletePage(`.${valueRef}`, { skipStateUpdate: true });
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
return transformedAttachments;
|
|
134
|
+
};
|
|
135
|
+
export const updateReduxState = (transformedAttachments, pConn, valueRef, options) => {
|
|
136
|
+
const { allowMultiple, isOldAttachment, insertRedux, deleteRedux } = options;
|
|
137
|
+
let deleteIndex = -1;
|
|
138
|
+
if (allowMultiple || isOldAttachment) {
|
|
139
|
+
transformedAttachments.forEach(attachment => {
|
|
140
|
+
const key = isOldAttachment ? `${valueRef}.pxResults` : valueRef;
|
|
141
|
+
const existingAttachments = PCore.getStoreValue(`.${key}`, pConn.getPageReference(), pConn.getContextName()) || [];
|
|
142
|
+
if (insertRedux) {
|
|
143
|
+
const actionPayLoad = {
|
|
144
|
+
type: 'LIST_ACTION',
|
|
145
|
+
payload: {
|
|
146
|
+
instruction: 'INSERT',
|
|
147
|
+
context: pConn.getContextName(),
|
|
148
|
+
referenceList: `${pConn.getPageReference()}.${key}`,
|
|
149
|
+
listIndex: existingAttachments.length,
|
|
150
|
+
content: attachment
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
PCore.getStore()?.dispatch(actionPayLoad);
|
|
154
|
+
}
|
|
155
|
+
else if (deleteRedux) {
|
|
156
|
+
const uniqueKey = getMappedValue('pzInsKey');
|
|
157
|
+
deleteIndex = existingAttachments.findIndex(existingAttachment => existingAttachment[uniqueKey] === transformedAttachments[0][uniqueKey]);
|
|
158
|
+
const actionPayLoad = {
|
|
159
|
+
type: 'LIST_ACTION',
|
|
160
|
+
payload: {
|
|
161
|
+
instruction: 'DELETE',
|
|
162
|
+
context: pConn.getContextName(),
|
|
163
|
+
referenceList: `${pConn.getPageReference()}.${key}`,
|
|
164
|
+
listIndex: deleteIndex
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
PCore.getStore()?.dispatch(actionPayLoad);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
else if (insertRedux) {
|
|
172
|
+
const actionPayLoad = {
|
|
173
|
+
type: 'LIST_ACTION',
|
|
174
|
+
payload: {
|
|
175
|
+
instruction: 'REPLACE',
|
|
176
|
+
context: pConn.getContextName(),
|
|
177
|
+
referenceList: `${pConn.getPageReference()}.${valueRef}`,
|
|
178
|
+
content: transformedAttachments[0]
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
PCore.getStore()?.dispatch(actionPayLoad);
|
|
182
|
+
}
|
|
183
|
+
else if (deleteRedux) {
|
|
184
|
+
const actionPayLoad = {
|
|
185
|
+
type: 'LIST_ACTION',
|
|
186
|
+
payload: {
|
|
187
|
+
instruction: 'DELETEPAGE',
|
|
188
|
+
context: pConn.getContextName(),
|
|
189
|
+
referenceList: `${pConn.getPageReference()}.${valueRef}`
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
PCore.getStore()?.dispatch(actionPayLoad);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
export const insertAttachments = (files, pConn, attachmentsInModal, options) => {
|
|
196
|
+
const { isMultiAttachmentInInlineEditTable } = options;
|
|
197
|
+
let valueRef = pConn.getStateProps().value;
|
|
198
|
+
valueRef = valueRef?.indexOf('.') === 0 ? valueRef.substring(1) : valueRef;
|
|
199
|
+
const transformedAttachments = generateInstructions(files, pConn, attachmentsInModal, {
|
|
200
|
+
...options,
|
|
201
|
+
insertPageInstruction: true
|
|
202
|
+
});
|
|
203
|
+
if (isMultiAttachmentInInlineEditTable) {
|
|
204
|
+
return; // For attachments within modal, redux update is not necessary yet, as modal isn't submitted at this stage
|
|
205
|
+
}
|
|
206
|
+
updateReduxState(transformedAttachments, pConn, valueRef, { ...options, insertRedux: true });
|
|
207
|
+
};
|
|
208
|
+
export const deleteAttachments = (files, pConn, attachmentsInModal, options) => {
|
|
209
|
+
const { isMultiAttachmentInInlineEditTable } = options;
|
|
210
|
+
let valueRef = pConn.getStateProps().value;
|
|
211
|
+
valueRef = valueRef?.indexOf('.') === 0 ? valueRef.substring(1) : valueRef;
|
|
212
|
+
const transformedAttachments = generateInstructions(files, pConn, attachmentsInModal, {
|
|
213
|
+
...options,
|
|
214
|
+
deletePageInstruction: true
|
|
215
|
+
});
|
|
216
|
+
if (isMultiAttachmentInInlineEditTable) {
|
|
217
|
+
return; // For attachments within modal, redux update is not necessary yet, as modal isn't submitted at this stage
|
|
218
|
+
}
|
|
219
|
+
updateReduxState(transformedAttachments, pConn, valueRef, { ...options, deleteRedux: true });
|
|
220
|
+
};
|
|
221
|
+
export const clearFieldErrorMessages = (pConn) => {
|
|
222
|
+
const fieldName = pConn.getStateProps().value;
|
|
223
|
+
PCore.getMessageManager().clearMessages({
|
|
224
|
+
type: PCore.getConstants().MESSAGES.MESSAGES_TYPE_ERROR,
|
|
225
|
+
property: fieldName,
|
|
226
|
+
pageReference: pConn.getPageReference(),
|
|
227
|
+
context: pConn.getContextName()
|
|
228
|
+
});
|
|
229
|
+
};
|
|
230
|
+
export const useFileDownload = (context) => {
|
|
231
|
+
return useCallback(({ ID, name, extension, type, category, responseType }) => {
|
|
232
|
+
if (category !== 'pxDocument') {
|
|
233
|
+
PCore.getAttachmentUtils().downloadAttachment(ID, context, responseType)
|
|
234
|
+
.then(content => {
|
|
235
|
+
fileDownloadVar(content, type, name, extension);
|
|
236
|
+
})
|
|
237
|
+
.catch(console.error);
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
PCore.getAttachmentUtils().downloadDocument(ID, context)
|
|
241
|
+
.then(content => {
|
|
242
|
+
fileDownloadVar(content, type, name, extension);
|
|
243
|
+
})
|
|
244
|
+
.catch(console.error);
|
|
245
|
+
}
|
|
246
|
+
}, [context]);
|
|
247
|
+
};
|
|
248
|
+
export const useDeepMemo = (memoFn, key) => {
|
|
249
|
+
const ref = useRef();
|
|
250
|
+
if (!ref.current || !equal(key, ref.current.key)) {
|
|
251
|
+
ref.current = { key, value: memoFn() };
|
|
252
|
+
}
|
|
253
|
+
return ref.current.value;
|
|
254
|
+
};
|
|
255
|
+
//# sourceMappingURL=AttachmentUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachmentUtils.js","sourceRoot":"","sources":["../../../../src/components/widget/Attachment/AttachmentUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,KAAK,MAAM,iBAAiB,CAAC;AAIpC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAA+B,EAAE,EAAE;IACjE,OAAO,OAAO,IAAI,OAAO,CAAC,2BAA2B,CAAC,KAAK,QAAQ,CAAC;AACtE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAA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CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,OAAO,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC;IACzC,CAAC;IACD,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["import { useCallback, useRef } from 'react';\nimport download from 'downloadjs';\nimport equal from 'fast-deep-equal';\n\nimport type { FileObject, PageInstructionOptions, ReduxAttachments } from './Attachment.types';\n\nexport const isContentBinary = (headers: Record<string, string>) => {\n return headers && headers['content-transfer-encoding'] === 'binary';\n};\n\nexport const isContentBase64 = (headers: Record<string, string>) => {\n return headers && headers['content-transfer-encoding'] === 'base64';\n};\n\nexport const validateFileExtension = (fileObj: Record<string, string>, allowedExtensions: string) => {\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\nexport const fileDownload = (data: string | Blob, fileName: string, ext: string | null, headers: Record<string, string>) => {\n const name = ext ? `${fileName}.${ext}` : fileName;\n // Temp fix: downloading EMAIl type attachment as html file\n if (ext === 'html') {\n download(isContentBase64(headers) ? atob(data as string) : data, name, 'text/html');\n } else if (isContentBinary(headers)) {\n download(data, name);\n } else {\n download(atob(data as string), name);\n }\n};\n\nexport const getIconFromFileType = (fileType: string) => {\n let icon = 'document-doc';\n if (!fileType) return icon;\n if (fileType.startsWith('audio')) {\n icon = 'audio';\n } else if (fileType.startsWith('video')) {\n icon = 'video';\n } else if (fileType.startsWith('image')) {\n icon = 'picture';\n } else if (fileType.includes('pdf')) {\n icon = 'document-pdf';\n } else {\n const [, subtype] = fileType.split('/');\n const foundMatch = (sources: string[]) => {\n return sources.some(key => subtype.includes(key));\n };\n\n if (foundMatch(['excel', 'spreadsheet'])) {\n icon = 'document-xls';\n } else if (foundMatch(['zip', 'compressed', 'gzip', 'rar', 'tar'])) {\n icon = 'document-compress';\n }\n }\n\n return icon;\n};\n\nexport const fileDownloadVar = (content: { data: string; headers: Record<string, string> }, type: string, name: string, extension: string) => {\n if (type === 'FILE' || type === undefined) {\n fileDownload(content.data, name, extension, content.headers);\n } else if (type === 'URL') {\n let { data } = content;\n if (!/^(http|https):\\/\\//.test(data)) {\n data = `//${data}`;\n }\n window.open(content.data, '_blank');\n } else if (type === 'EMAIL') {\n // Temp Fix: for EMAIL type attachment\n fileDownload(content.data, name, 'html', content.headers);\n }\n};\n\nexport const getMappedValue = (value: string): string => {\n return PCore.getEnvironmentInfo().getKeyMapping(value) ?? value;\n};\n\nconst generateInstructions = (\n files: FileObject[],\n pConn: typeof PConnect,\n attachmentsInModal: ReduxAttachments[] | Pick<ReduxAttachments, 'instruction' | 'fileIndex'>[],\n options: {\n allowMultiple: boolean;\n isMultiAttachmentInInlineEditTable: boolean;\n attachmentCount: number;\n insertPageInstruction: boolean;\n deletePageInstruction: boolean;\n deleteIndex: number;\n }\n) => {\n const { allowMultiple, isMultiAttachmentInInlineEditTable, attachmentCount, insertPageInstruction, deletePageInstruction, deleteIndex } = options;\n const transformedAttachments: ReduxAttachments[] = [];\n let valueRef = pConn.getStateProps().value;\n valueRef = valueRef?.indexOf('.') === 0 ? valueRef.substring(1) : valueRef;\n const uniqueKey = getMappedValue('pzInsKey');\n files.forEach((file, index) => {\n const filename = file.value?.filename || file.props?.name || '';\n const payload = {\n [uniqueKey]: file.value?.ID || file.props?.id,\n FileName: filename,\n Category: '',\n // MimeType: getMimeTypeFromFile(filename),\n FileExtension: filename.split('.').pop() ?? filename,\n error: file.props?.error || null,\n localAttachment: true,\n thumbnail: file.value?.thumbnail\n };\n transformedAttachments.push(payload);\n if (payload.error) {\n return; // Don't process page instructions for error files, skip current iteration\n }\n if (allowMultiple) {\n if (isMultiAttachmentInInlineEditTable) {\n if (insertPageInstruction) {\n attachmentsInModal.push({ ...payload, instruction: 'insert' } as any);\n } else if (deletePageInstruction) {\n (attachmentsInModal as Pick<ReduxAttachments, 'instruction' | 'fileIndex'>[]).push({\n instruction: 'delete',\n fileIndex: deleteIndex\n });\n }\n } else if (insertPageInstruction) {\n pConn.getListActions().insert({ ID: payload[uniqueKey] }, attachmentCount + index, undefined, {\n skipStateUpdate: true\n });\n } else if (deletePageInstruction) {\n pConn.getListActions().deleteEntry(deleteIndex, undefined, { skipStateUpdate: true });\n }\n } else if (insertPageInstruction) {\n pConn.getListActions().replacePage(`.${valueRef}`, { ID: payload[uniqueKey] }, { skipStateUpdate: true });\n } else if (deletePageInstruction) {\n pConn.getListActions().deletePage(`.${valueRef}`, { skipStateUpdate: true });\n }\n });\n return transformedAttachments;\n};\n\nexport const updateReduxState = (\n transformedAttachments: ReduxAttachments[],\n pConn: typeof PConnect,\n valueRef: string,\n options: PageInstructionOptions\n) => {\n const { allowMultiple, isOldAttachment, insertRedux, deleteRedux } = options;\n let deleteIndex = -1;\n\n if (allowMultiple || isOldAttachment) {\n transformedAttachments.forEach(attachment => {\n const key = isOldAttachment ? `${valueRef}.pxResults` : valueRef;\n const existingAttachments: ReduxAttachments[] = PCore.getStoreValue(`.${key}`, pConn.getPageReference(), pConn.getContextName()) || [];\n\n if (insertRedux) {\n const actionPayLoad = {\n type: 'LIST_ACTION',\n payload: {\n instruction: 'INSERT',\n context: pConn.getContextName(),\n referenceList: `${pConn.getPageReference()}.${key}`,\n listIndex: existingAttachments.length,\n content: attachment\n }\n };\n PCore.getStore()?.dispatch(actionPayLoad);\n } else if (deleteRedux) {\n const uniqueKey = getMappedValue('pzInsKey');\n deleteIndex = existingAttachments.findIndex(\n existingAttachment =>\n existingAttachment[uniqueKey as keyof ReduxAttachments] === transformedAttachments[0][uniqueKey as keyof ReduxAttachments]\n );\n const actionPayLoad = {\n type: 'LIST_ACTION',\n payload: {\n instruction: 'DELETE',\n context: pConn.getContextName(),\n referenceList: `${pConn.getPageReference()}.${key}`,\n listIndex: deleteIndex\n }\n };\n PCore.getStore()?.dispatch(actionPayLoad);\n }\n });\n } else if (insertRedux) {\n const actionPayLoad = {\n type: 'LIST_ACTION',\n payload: {\n instruction: 'REPLACE',\n context: pConn.getContextName(),\n referenceList: `${pConn.getPageReference()}.${valueRef}`,\n content: transformedAttachments[0]\n }\n };\n PCore.getStore()?.dispatch(actionPayLoad);\n } else if (deleteRedux) {\n const actionPayLoad = {\n type: 'LIST_ACTION',\n payload: {\n instruction: 'DELETEPAGE',\n context: pConn.getContextName(),\n referenceList: `${pConn.getPageReference()}.${valueRef}`\n }\n };\n PCore.getStore()?.dispatch(actionPayLoad);\n }\n};\n\nexport const insertAttachments = (\n files: FileObject[],\n pConn: typeof PConnect,\n attachmentsInModal: ReduxAttachments[],\n options: PageInstructionOptions\n) => {\n const { isMultiAttachmentInInlineEditTable } = options;\n let valueRef = pConn.getStateProps().value;\n valueRef = valueRef?.indexOf('.') === 0 ? valueRef.substring(1) : valueRef;\n const transformedAttachments = generateInstructions(files, pConn, attachmentsInModal, {\n ...options,\n insertPageInstruction: true\n });\n\n if (isMultiAttachmentInInlineEditTable) {\n return; // For attachments within modal, redux update is not necessary yet, as modal isn't submitted at this stage\n }\n updateReduxState(transformedAttachments, pConn, valueRef, { ...options, insertRedux: true });\n};\n\nexport const deleteAttachments = (\n files: FileObject[],\n pConn: typeof PConnect,\n attachmentsInModal: Pick<ReduxAttachments, 'instruction' | 'fileIndex'>[],\n options: PageInstructionOptions\n) => {\n const { isMultiAttachmentInInlineEditTable } = options;\n let valueRef = pConn.getStateProps().value;\n valueRef = valueRef?.indexOf('.') === 0 ? valueRef.substring(1) : valueRef;\n const transformedAttachments = generateInstructions(files, pConn, attachmentsInModal, {\n ...options,\n deletePageInstruction: true\n });\n\n if (isMultiAttachmentInInlineEditTable) {\n return; // For attachments within modal, redux update is not necessary yet, as modal isn't submitted at this stage\n }\n updateReduxState(transformedAttachments, pConn, valueRef, { ...options, deleteRedux: true });\n};\n\nexport const clearFieldErrorMessages = (pConn: typeof PConnect) => {\n const fieldName = pConn.getStateProps().value;\n PCore.getMessageManager().clearMessages({\n type: PCore.getConstants().MESSAGES.MESSAGES_TYPE_ERROR,\n property: fieldName,\n pageReference: pConn.getPageReference(),\n context: pConn.getContextName()\n });\n};\n\nexport const useFileDownload = (context: string) => {\n return useCallback(\n ({\n ID,\n name,\n extension,\n type,\n category,\n responseType\n }: {\n ID: string;\n name: string;\n extension: string;\n type: string;\n category: string;\n responseType: string;\n }) => {\n if (category !== 'pxDocument') {\n (\n PCore.getAttachmentUtils().downloadAttachment(ID, context, responseType) as Promise<{\n data: string;\n headers: Record<string, string>;\n }>\n )\n .then(content => {\n fileDownloadVar(content, type, name, extension);\n })\n\n .catch(console.error);\n } else {\n (\n PCore.getAttachmentUtils().downloadDocument(ID, context) as Promise<{\n data: string;\n headers: Record<string, string>;\n }>\n )\n .then(content => {\n fileDownloadVar(content, type, name, extension);\n })\n\n .catch(console.error);\n }\n },\n [context]\n );\n};\n\nexport const useDeepMemo = (memoFn, key) => {\n const ref: any = useRef();\n if (!ref.current || !equal(key, ref.current.key)) {\n ref.current = { key, value: memoFn() };\n }\n return ref.current.value;\n};\n"]}
|