@pega/react-sdk-components 23.1.11 → 24.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/react_pconnect.d.ts.map +1 -1
- package/lib/bridge/react_pconnect.js +136 -140
- package/lib/bridge/react_pconnect.js.map +1 -1
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts +1 -2
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts.map +1 -1
- package/lib/components/designSystemExtension/Banner/Banner.d.ts +1 -2
- package/lib/components/designSystemExtension/Banner/Banner.d.ts.map +1 -1
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts +1 -2
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
- package/lib/components/designSystemExtension/DetailsFields/DetailsFields.d.ts +1 -2
- package/lib/components/designSystemExtension/DetailsFields/DetailsFields.d.ts.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/FieldGroupList/FieldGroupList.d.ts +1 -2
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.d.ts.map +1 -1
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.d.ts +2 -2
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js +4 -2
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/designSystemExtension/Operator/Operator.d.ts +1 -2
- package/lib/components/designSystemExtension/Operator/Operator.d.ts.map +1 -1
- package/lib/components/designSystemExtension/Pulse/Pulse.d.ts +1 -1
- package/lib/components/designSystemExtension/Pulse/Pulse.d.ts.map +1 -1
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.d.ts +1 -2
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.d.ts.map +1 -1
- package/lib/components/field/AutoComplete/AutoComplete.d.ts +1 -2
- package/lib/components/field/AutoComplete/AutoComplete.d.ts.map +1 -1
- package/lib/components/field/CancelAlert/CancelAlert.d.ts +1 -2
- package/lib/components/field/CancelAlert/CancelAlert.d.ts.map +1 -1
- package/lib/components/field/CancelAlert/CancelAlert.js +2 -0
- package/lib/components/field/CancelAlert/CancelAlert.js.map +1 -1
- package/lib/components/field/Checkbox/Checkbox.d.ts +8 -2
- package/lib/components/field/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/field/Checkbox/Checkbox.js +51 -9
- package/lib/components/field/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/field/Currency/Currency.d.ts +2 -2
- package/lib/components/field/Currency/Currency.d.ts.map +1 -1
- package/lib/components/field/Currency/Currency.js +19 -8
- package/lib/components/field/Currency/Currency.js.map +1 -1
- package/lib/components/field/Date/Date.d.ts +1 -2
- package/lib/components/field/Date/Date.d.ts.map +1 -1
- package/lib/components/field/DateTime/DateTime.d.ts +1 -2
- package/lib/components/field/DateTime/DateTime.d.ts.map +1 -1
- package/lib/components/field/Decimal/Decimal.d.ts +3 -3
- package/lib/components/field/Decimal/Decimal.d.ts.map +1 -1
- package/lib/components/field/Decimal/Decimal.js +25 -6
- package/lib/components/field/Decimal/Decimal.js.map +1 -1
- package/lib/components/field/Dropdown/Dropdown.d.ts +1 -2
- package/lib/components/field/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/components/field/Email/Email.d.ts +1 -2
- package/lib/components/field/Email/Email.d.ts.map +1 -1
- package/lib/components/field/Group/Group.d.ts +1 -1
- package/lib/components/field/Group/Group.d.ts.map +1 -1
- package/lib/components/field/Integer/Integer.d.ts +1 -2
- package/lib/components/field/Integer/Integer.d.ts.map +1 -1
- package/lib/components/field/Multiselect/Multiselect.d.ts +2 -0
- package/lib/components/field/Multiselect/Multiselect.d.ts.map +1 -0
- package/lib/components/field/Multiselect/Multiselect.js +175 -0
- package/lib/components/field/Multiselect/Multiselect.js.map +1 -0
- package/lib/components/field/Multiselect/index.d.ts +2 -0
- package/lib/components/field/Multiselect/index.d.ts.map +1 -0
- package/lib/components/field/Multiselect/index.js +2 -0
- package/lib/components/field/Multiselect/index.js.map +1 -0
- package/lib/components/field/Multiselect/utils.d.ts +10 -0
- package/lib/components/field/Multiselect/utils.d.ts.map +1 -0
- package/lib/components/field/Multiselect/utils.js +197 -0
- package/lib/components/field/Multiselect/utils.js.map +1 -0
- package/lib/components/field/Percentage/Percentage.d.ts +3 -2
- package/lib/components/field/Percentage/Percentage.d.ts.map +1 -1
- package/lib/components/field/Percentage/Percentage.js +17 -8
- package/lib/components/field/Percentage/Percentage.js.map +1 -1
- package/lib/components/field/Phone/Phone.d.ts +1 -2
- package/lib/components/field/Phone/Phone.d.ts.map +1 -1
- package/lib/components/field/Phone/Phone.js +13 -7
- package/lib/components/field/Phone/Phone.js.map +1 -1
- package/lib/components/field/RadioButtons/RadioButtons.d.ts +1 -2
- package/lib/components/field/RadioButtons/RadioButtons.d.ts.map +1 -1
- package/lib/components/field/RichText/RichText.js +2 -2
- package/lib/components/field/RichText/RichText.js.map +1 -1
- package/lib/components/field/ScalarList/ScalarList.d.ts +1 -2
- package/lib/components/field/ScalarList/ScalarList.d.ts.map +1 -1
- package/lib/components/field/ScalarList/ScalarList.js +2 -0
- package/lib/components/field/ScalarList/ScalarList.js.map +1 -1
- package/lib/components/field/SemanticLink/SemanticLink.d.ts +1 -2
- package/lib/components/field/SemanticLink/SemanticLink.d.ts.map +1 -1
- package/lib/components/field/TextArea/TextArea.d.ts +1 -2
- package/lib/components/field/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/field/TextContent/TextContent.d.ts +1 -2
- package/lib/components/field/TextContent/TextContent.d.ts.map +1 -1
- package/lib/components/field/TextInput/TextInput.d.ts +1 -2
- package/lib/components/field/TextInput/TextInput.d.ts.map +1 -1
- package/lib/components/field/Time/Time.d.ts +1 -2
- package/lib/components/field/Time/Time.d.ts.map +1 -1
- package/lib/components/field/URL/URL.d.ts +1 -2
- package/lib/components/field/URL/URL.d.ts.map +1 -1
- package/lib/components/field/UserReference/UserReference.d.ts +1 -0
- package/lib/components/field/UserReference/UserReference.d.ts.map +1 -1
- package/lib/components/field/UserReference/UserReference.js +8 -1
- package/lib/components/field/UserReference/UserReference.js.map +1 -1
- package/lib/components/helpers/common-utils.d.ts +0 -1
- package/lib/components/helpers/common-utils.d.ts.map +1 -1
- package/lib/components/helpers/common-utils.js +1 -4
- package/lib/components/helpers/common-utils.js.map +1 -1
- package/lib/components/helpers/formatters/common.d.ts +2 -2
- package/lib/components/helpers/formatters/common.d.ts.map +1 -1
- package/lib/components/helpers/instructions-utils.d.ts +5 -0
- package/lib/components/helpers/instructions-utils.d.ts.map +1 -0
- package/lib/components/helpers/instructions-utils.js +36 -0
- package/lib/components/helpers/instructions-utils.js.map +1 -0
- package/lib/components/helpers/state-utils.d.ts +1 -2
- package/lib/components/helpers/state-utils.d.ts.map +1 -1
- package/lib/components/infra/ActionButtons/ActionButtons.d.ts +1 -2
- package/lib/components/infra/ActionButtons/ActionButtons.d.ts.map +1 -1
- package/lib/components/infra/Assignment/Assignment.d.ts +1 -1
- package/lib/components/infra/Assignment/Assignment.d.ts.map +1 -1
- package/lib/components/infra/Assignment/Assignment.js +22 -1
- package/lib/components/infra/Assignment/Assignment.js.map +1 -1
- package/lib/components/infra/AssignmentCard/AssignmentCard.d.ts +1 -1
- package/lib/components/infra/AssignmentCard/AssignmentCard.d.ts.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts +2 -2
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +2 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.d.ts +1 -2
- package/lib/components/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.d.ts.map +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts +1 -2
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/SimpleView/SimpleView.d.ts +3 -3
- package/lib/components/infra/Containers/SimpleView/SimpleView.d.ts.map +1 -1
- package/lib/components/infra/Containers/SimpleView/helper.d.ts +3 -3
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts +1 -2
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/helpers.d.ts +1 -1
- package/lib/components/infra/Containers/helpers.d.ts.map +1 -1
- package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts +1 -1
- package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts.map +1 -1
- package/lib/components/infra/DashboardFilter/DashboardFilter.js +1 -1
- package/lib/components/infra/DashboardFilter/DashboardFilter.js.map +1 -1
- package/lib/components/infra/DashboardFilter/filterUtils.d.ts +1 -2
- package/lib/components/infra/DashboardFilter/filterUtils.d.ts.map +1 -1
- package/lib/components/infra/DeferLoad/DeferLoad.d.ts.map +1 -1
- package/lib/components/infra/DeferLoad/DeferLoad.js +5 -1
- package/lib/components/infra/DeferLoad/DeferLoad.js.map +1 -1
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts +1 -2
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/lib/components/infra/MultiStep/MultiStep.d.ts +1 -1
- package/lib/components/infra/MultiStep/MultiStep.d.ts.map +1 -1
- package/lib/components/infra/MultiStep/MultiStep.js +1 -1
- package/lib/components/infra/MultiStep/MultiStep.js.map +1 -1
- package/lib/components/infra/NavBar/NavBar.d.ts +1 -2
- package/lib/components/infra/NavBar/NavBar.d.ts.map +1 -1
- package/lib/components/infra/NavBar/NavBar.js +1 -1
- package/lib/components/infra/NavBar/NavBar.js.map +1 -1
- package/lib/components/infra/Reference/Reference.d.ts +1 -2
- package/lib/components/infra/Reference/Reference.d.ts.map +1 -1
- package/lib/components/infra/Reference/Reference.js +1 -1
- 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/Stages/Stages.d.ts +1 -2
- package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
- package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.d.ts +1 -2
- package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.d.ts.map +1 -1
- package/lib/components/infra/View/View.d.ts +1 -1
- package/lib/components/infra/View/View.d.ts.map +1 -1
- package/lib/components/template/AppShell/AppShell.d.ts +1 -1
- package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/template/BannerPage/BannerPage.d.ts +1 -1
- package/lib/components/template/BannerPage/BannerPage.d.ts.map +1 -1
- package/lib/components/template/CaseSummary/CaseSummary.d.ts +1 -1
- package/lib/components/template/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/components/template/CaseView/CaseView.d.ts +1 -1
- package/lib/components/template/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/template/CaseView/CaseView.js +2 -2
- package/lib/components/template/CaseView/CaseView.js.map +1 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts +1 -2
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts.map +1 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js +1 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js.map +1 -1
- package/lib/components/template/Confirmation/Confirmation.d.ts +1 -1
- package/lib/components/template/Confirmation/Confirmation.d.ts.map +1 -1
- package/lib/components/template/DataReference/DataReference.d.ts +1 -1
- package/lib/components/template/DataReference/DataReference.d.ts.map +1 -1
- package/lib/components/template/DataReference/DataReference.js +1 -1
- package/lib/components/template/DataReference/DataReference.js.map +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.d.ts +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
- package/lib/components/template/DefaultForm/utils/index.d.ts.map +1 -1
- package/lib/components/template/DefaultForm/utils/index.js +2 -6
- package/lib/components/template/DefaultForm/utils/index.js.map +1 -1
- package/lib/components/template/Details/Details/Details.d.ts +1 -2
- package/lib/components/template/Details/Details/Details.d.ts.map +1 -1
- package/lib/components/template/Details/Details/Details.js +1 -1
- package/lib/components/template/Details/Details/Details.js.map +1 -1
- package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.d.ts +1 -1
- package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.d.ts.map +1 -1
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts +1 -2
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts.map +1 -1
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js +1 -1
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js.map +1 -1
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts +1 -2
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts.map +1 -1
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js +1 -1
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js.map +1 -1
- package/lib/components/template/Details/DynamicTabs/DynamicTabs.d.ts +1 -2
- package/lib/components/template/Details/DynamicTabs/DynamicTabs.d.ts.map +1 -1
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts +1 -2
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts.map +1 -1
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js +2 -0
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js.map +1 -1
- package/lib/components/template/InlineDashboard/InlineDashboard.d.ts +1 -1
- package/lib/components/template/InlineDashboard/InlineDashboard.d.ts.map +1 -1
- package/lib/components/template/InlineDashboardPage/InlineDashboardPage.d.ts +1 -1
- package/lib/components/template/InlineDashboardPage/InlineDashboardPage.d.ts.map +1 -1
- package/lib/components/template/ListPage/ListPage.d.ts +1 -2
- package/lib/components/template/ListPage/ListPage.d.ts.map +1 -1
- package/lib/components/template/ListView/ListView.d.ts +1 -2
- package/lib/components/template/ListView/ListView.d.ts.map +1 -1
- package/lib/components/template/ListView/ListView.js +21 -28
- package/lib/components/template/ListView/ListView.js.map +1 -1
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts +1 -2
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts.map +1 -1
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js +1 -1
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.d.ts +1 -1
- package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.d.ts.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts +1 -2
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js +1 -1
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.d.ts +1 -1
- package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.d.ts.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.d.ts +1 -1
- package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.d.ts.map +1 -1
- package/lib/components/template/OneColumn/OneColumn/OneColumn.d.ts +1 -1
- package/lib/components/template/OneColumn/OneColumn/OneColumn.d.ts.map +1 -1
- package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.d.ts +1 -2
- package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.d.ts.map +1 -1
- package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.d.ts +1 -1
- package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.d.ts.map +1 -1
- package/lib/components/template/PromotedFilters/PromotedFilters.d.ts +1 -2
- package/lib/components/template/PromotedFilters/PromotedFilters.d.ts.map +1 -1
- package/lib/components/template/PromotedFilters/PromotedFilters.js +1 -0
- package/lib/components/template/PromotedFilters/PromotedFilters.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts +1 -2
- package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +8 -4
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts +1 -2
- package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts.map +1 -1
- package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.d.ts +1 -2
- package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.d.ts.map +1 -1
- package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.js +1 -1
- package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.js.map +1 -1
- package/lib/components/template/SubTabs/SubTabs.d.ts +1 -1
- package/lib/components/template/SubTabs/SubTabs.d.ts.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.d.ts +1 -1
- package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.d.ts.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.d.ts +1 -2
- package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.d.ts.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.d.ts +1 -1
- package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.d.ts.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.d.ts +1 -1
- package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.d.ts.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts +1 -2
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js +1 -1
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.d.ts +1 -1
- package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.d.ts.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.d.ts +1 -1
- package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.d.ts.map +1 -1
- package/lib/components/template/WssNavBar/WssNavBar.d.ts +1 -2
- package/lib/components/template/WssNavBar/WssNavBar.d.ts.map +1 -1
- package/lib/components/widget/AppAnnouncement/AppAnnouncement.d.ts +1 -2
- package/lib/components/widget/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
- package/lib/components/widget/Attachment/Attachment.d.ts +1 -2
- package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
- package/lib/components/widget/Attachment/Attachment.js +3 -2
- package/lib/components/widget/Attachment/Attachment.js.map +1 -1
- package/lib/components/widget/CaseHistory/CaseHistory.d.ts +1 -2
- package/lib/components/widget/CaseHistory/CaseHistory.d.ts.map +1 -1
- package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.d.ts +1 -2
- package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.d.ts.map +1 -1
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts +1 -2
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts.map +1 -1
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.js +1 -1
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.js.map +1 -1
- package/lib/components/widget/Followers/Followers.d.ts +1 -1
- package/lib/components/widget/Followers/Followers.d.ts.map +1 -1
- package/lib/components/widget/QuickCreate/QuickCreate.d.ts +1 -2
- package/lib/components/widget/QuickCreate/QuickCreate.d.ts.map +1 -1
- package/lib/components/widget/QuickCreate/QuickCreate.js +1 -0
- package/lib/components/widget/QuickCreate/QuickCreate.js.map +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.d.ts +1 -2
- package/lib/components/widget/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/widget/SummaryList/SummaryList.d.ts +1 -2
- package/lib/components/widget/SummaryList/SummaryList.d.ts.map +1 -1
- package/lib/components/widget/ToDo/ToDo.d.ts +1 -2
- package/lib/components/widget/ToDo/ToDo.d.ts.map +1 -1
- package/lib/doc/KeyReleaseUpdates.md +19 -7
- package/lib/sdk-pega-component-map.d.ts +2 -0
- package/lib/sdk-pega-component-map.js +2 -0
- package/lib/sdk-pega-component-map.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Dropdown/Dropdown.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAwC5D,UAAU,aAAc,SAAQ,eAAe;IAE7C,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC;IACnB,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,GAAG,CAAC;IACzB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,OAAO,EAAE,GAAG,EAAE,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,aAAa,kDA4KpD"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PConnFieldProps } from '../../../types/PConnProps';
|
|
3
2
|
interface EmailProps extends PConnFieldProps {
|
|
4
3
|
}
|
|
5
|
-
export default function Email(props: EmailProps): JSX.Element;
|
|
4
|
+
export default function Email(props: EmailProps): import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export {};
|
|
7
6
|
//# sourceMappingURL=Email.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Email/Email.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Email/Email.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,UAAU,UAAW,SAAQ,eAAe;CAE3C;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAK,EAAE,UAAU,2CAkE9C"}
|
|
@@ -8,6 +8,6 @@ interface GroupProps extends PConnFieldProps {
|
|
|
8
8
|
collapsible: boolean;
|
|
9
9
|
type: string;
|
|
10
10
|
}
|
|
11
|
-
export default function Group(props: GroupProps): JSX.Element | null;
|
|
11
|
+
export default function Group(props: GroupProps): import("react/jsx-runtime").JSX.Element | null;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=Group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Group/Group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAG9C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,UAAU,UAAW,SAAQ,eAAe;IAC1C,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAK,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Group/Group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAG9C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,UAAU,UAAW,SAAQ,eAAe;IAC1C,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAK,EAAE,UAAU,kDAwB9C"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PConnFieldProps } from '../../../types/PConnProps';
|
|
3
2
|
interface IntegerProps extends PConnFieldProps {
|
|
4
3
|
}
|
|
5
|
-
export default function Integer(props: IntegerProps): JSX.Element;
|
|
4
|
+
export default function Integer(props: IntegerProps): import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export {};
|
|
7
6
|
//# sourceMappingURL=Integer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Integer.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Integer/Integer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Integer.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Integer/Integer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,UAAU,YAAa,SAAQ,eAAe;CAE7C;AAED,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,YAAY,2CA8ElD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Multiselect.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Multiselect/Multiselect.tsx"],"names":[],"mappings":"AAYA,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,KAAA,2CAuOxC"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox, TextField } from '@material-ui/core';
|
|
3
|
+
import Autocomplete from '@material-ui/lab/Autocomplete';
|
|
4
|
+
import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';
|
|
5
|
+
import CheckBoxIcon from '@material-ui/icons/CheckBox';
|
|
6
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
7
|
+
import { doSearch, getDisplayFieldsMetaData, useDeepMemo, preProcessColumns, getGroupDataForItemsTree } from './utils';
|
|
8
|
+
import { insertInstruction, deleteInstruction } from '../../helpers/instructions-utils';
|
|
9
|
+
import { debounce } from 'throttle-debounce';
|
|
10
|
+
const icon = _jsx(CheckBoxOutlineBlankIcon, { fontSize: 'small' });
|
|
11
|
+
const checkedIcon = _jsx(CheckBoxIcon, { fontSize: 'small' });
|
|
12
|
+
export default function Multiselect(props) {
|
|
13
|
+
const { getPConnect, label, placeholder, referenceList, selectionKey, primaryField, initialCaseClass, showSecondaryInSearchOnly = false, listType = '', isGroupData = false, referenceType, secondaryFields, groupDataSource = [], parameters = {}, matchPosition = 'contains', maxResultsDisplay, groupColumnsConfig = [{}], selectionList, value } = props;
|
|
14
|
+
let { datasource = [], columns = [{}] } = props;
|
|
15
|
+
if (referenceList.length > 0) {
|
|
16
|
+
datasource = referenceList;
|
|
17
|
+
columns = [
|
|
18
|
+
{
|
|
19
|
+
value: primaryField,
|
|
20
|
+
display: 'true',
|
|
21
|
+
useForSearch: true,
|
|
22
|
+
primary: 'true'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: selectionKey,
|
|
26
|
+
setProperty: selectionKey,
|
|
27
|
+
key: 'true'
|
|
28
|
+
}
|
|
29
|
+
];
|
|
30
|
+
let secondaryColumns = [];
|
|
31
|
+
if (secondaryFields) {
|
|
32
|
+
secondaryColumns = secondaryFields.map(secondaryField => ({
|
|
33
|
+
value: secondaryField,
|
|
34
|
+
display: 'true',
|
|
35
|
+
secondary: 'true',
|
|
36
|
+
useForSearch: 'true'
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
secondaryColumns = [
|
|
41
|
+
{
|
|
42
|
+
value: selectionKey,
|
|
43
|
+
display: 'true',
|
|
44
|
+
secondary: 'true',
|
|
45
|
+
useForSearch: 'true'
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
if (referenceType === 'Case') {
|
|
50
|
+
columns = [...columns, ...secondaryColumns];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const [inputValue, setInputValue] = useState(value);
|
|
54
|
+
const [selectedItems, setSelectedItems] = useState([]);
|
|
55
|
+
const dataConfig = useDeepMemo(() => {
|
|
56
|
+
return {
|
|
57
|
+
dataSource: datasource,
|
|
58
|
+
groupDataSource,
|
|
59
|
+
isGroupData,
|
|
60
|
+
showSecondaryInSearchOnly,
|
|
61
|
+
parameters,
|
|
62
|
+
matchPosition,
|
|
63
|
+
listType,
|
|
64
|
+
maxResultsDisplay: maxResultsDisplay || '100',
|
|
65
|
+
columns: preProcessColumns(columns),
|
|
66
|
+
groupColumnsConfig: preProcessColumns(groupColumnsConfig)
|
|
67
|
+
};
|
|
68
|
+
}, [
|
|
69
|
+
datasource,
|
|
70
|
+
groupDataSource,
|
|
71
|
+
isGroupData,
|
|
72
|
+
showSecondaryInSearchOnly,
|
|
73
|
+
parameters,
|
|
74
|
+
matchPosition,
|
|
75
|
+
listType,
|
|
76
|
+
maxResultsDisplay,
|
|
77
|
+
columns,
|
|
78
|
+
groupColumnsConfig
|
|
79
|
+
]);
|
|
80
|
+
const groupsDisplayFieldMeta = useMemo(() => (listType !== 'associated' ? getDisplayFieldsMetaData(dataConfig.groupColumnsConfig) : null), [dataConfig.groupColumnsConfig]);
|
|
81
|
+
const itemsTreeBaseData = getGroupDataForItemsTree(groupDataSource, groupsDisplayFieldMeta, showSecondaryInSearchOnly) || [];
|
|
82
|
+
const [itemsTree, setItemsTree] = useState(isGroupData ? getGroupDataForItemsTree(groupDataSource, groupsDisplayFieldMeta, showSecondaryInSearchOnly) : []);
|
|
83
|
+
const displayFieldMeta = listType !== 'associated' ? getDisplayFieldsMetaData(dataConfig.columns) : null;
|
|
84
|
+
const getCaseListBasedOnParamsDebounced = useRef();
|
|
85
|
+
const pConn = getPConnect();
|
|
86
|
+
const contextName = pConn.getContextName();
|
|
87
|
+
const listActions = pConn.getListActions();
|
|
88
|
+
const dataApiObj = useRef();
|
|
89
|
+
// main search function trigger
|
|
90
|
+
const getCaseListBasedOnParams = async (searchText, group, selectedRows, currentItemsTree, isTriggeredFromSearch = false) => {
|
|
91
|
+
if (referenceList && referenceList.length > 0) {
|
|
92
|
+
selectedRows = await listActions.getSelectedRows(true);
|
|
93
|
+
selectedRows =
|
|
94
|
+
selectedRows &&
|
|
95
|
+
selectedRows.map(item => {
|
|
96
|
+
return {
|
|
97
|
+
id: item[selectionKey.startsWith('.') ? selectionKey.substring(1) : selectionKey],
|
|
98
|
+
primary: item[primaryField.startsWith('.') ? primaryField.substring(1) : primaryField]
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
setSelectedItems(selectedRows);
|
|
102
|
+
}
|
|
103
|
+
// if items tree is null or text search is triggered then always should use fresh data object, we use the original object
|
|
104
|
+
const initalItemsTree = isTriggeredFromSearch || !currentItemsTree ? [...itemsTreeBaseData] : [...currentItemsTree];
|
|
105
|
+
const res = await doSearch(searchText, group, initialCaseClass, displayFieldMeta, dataApiObj.current, initalItemsTree, isGroupData, showSecondaryInSearchOnly, selectedRows || []);
|
|
106
|
+
setItemsTree(res);
|
|
107
|
+
};
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
if (referenceList && referenceList.length > 0) {
|
|
110
|
+
pConn.setReferenceList(selectionList);
|
|
111
|
+
}
|
|
112
|
+
}, [pConn]);
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
getCaseListBasedOnParamsDebounced.current = debounce(500, getCaseListBasedOnParams);
|
|
115
|
+
}, []);
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
if (listType !== 'associated') {
|
|
118
|
+
PCore.getDataApi()
|
|
119
|
+
?.init(dataConfig, contextName)
|
|
120
|
+
.then(dataObj => {
|
|
121
|
+
dataApiObj.current = dataObj;
|
|
122
|
+
if (!isGroupData) {
|
|
123
|
+
getCaseListBasedOnParamsDebounced.current(inputValue ?? '', '', [...selectedItems], [...itemsTree]);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}, [dataConfig, listType, dataConfig.columns, inputValue, dataConfig.groupColumnsConfig, showSecondaryInSearchOnly]);
|
|
128
|
+
const onSearchHandler = ev => {
|
|
129
|
+
const searchText = ev.target.value;
|
|
130
|
+
setInputValue(searchText);
|
|
131
|
+
getCaseListBasedOnParamsDebounced.current(searchText, '', [...selectedItems], [...itemsTree], true);
|
|
132
|
+
};
|
|
133
|
+
const setSelectedItemsForReferenceList = item => {
|
|
134
|
+
// Clear error messages if any
|
|
135
|
+
const propName = pConn.getStateProps().selectionList;
|
|
136
|
+
pConn.clearErrorMessages({
|
|
137
|
+
property: propName
|
|
138
|
+
});
|
|
139
|
+
const { selected } = item;
|
|
140
|
+
if (selected) {
|
|
141
|
+
insertInstruction(pConn, selectionList, selectionKey, primaryField, item);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
deleteInstruction(pConn, selectionList, selectionKey, item);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
const handleChange = (event, newSelectedValues) => {
|
|
148
|
+
let clickedItem;
|
|
149
|
+
let updatedItems = [];
|
|
150
|
+
if (newSelectedValues && newSelectedValues.length > 0) {
|
|
151
|
+
updatedItems = newSelectedValues.map(ele => {
|
|
152
|
+
ele.selected = true;
|
|
153
|
+
return ele;
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
if (newSelectedValues.length > selectedItems.length) {
|
|
157
|
+
clickedItem = newSelectedValues.filter(item => !selectedItems.some((ele) => ele.id === item.id));
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
clickedItem = selectedItems.filter((item) => !newSelectedValues.some((ele) => ele.id === item.id));
|
|
161
|
+
clickedItem[0].selected = false;
|
|
162
|
+
}
|
|
163
|
+
itemsTree.forEach(ele => {
|
|
164
|
+
ele.selected = !!updatedItems.find(item => item.id === ele.id);
|
|
165
|
+
});
|
|
166
|
+
setSelectedItems(updatedItems);
|
|
167
|
+
setItemsTree(itemsTree);
|
|
168
|
+
setInputValue('');
|
|
169
|
+
// if this is a referenceList case
|
|
170
|
+
if (referenceList)
|
|
171
|
+
setSelectedItemsForReferenceList(clickedItem[0]);
|
|
172
|
+
};
|
|
173
|
+
return (_jsx(Autocomplete, { multiple: true, fullWidth: true, options: itemsTree, disableCloseOnSelect: true, getOptionSelected: (option, val) => option?.primary === val?.primary, getOptionLabel: (option) => option?.primary, onChange: handleChange, value: selectedItems, renderOption: (option, { selected }) => (_jsxs(_Fragment, { children: [_jsx(Checkbox, { icon: icon, checkedIcon: checkedIcon, style: { marginRight: 8 }, checked: selected }), option.primary] })), renderInput: params => (_jsx(TextField, { ...params, variant: 'outlined', fullWidth: true, label: label, placeholder: placeholder, size: 'small', onChange: onSearchHandler })) }));
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=Multiselect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Multiselect.js","sourceRoot":"","sources":["../../../../src/components/field/Multiselect/Multiselect.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,wBAAwB,MAAM,yCAAyC,CAAC;AAC/E,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,WAAW,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACvH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,IAAI,GAAG,KAAC,wBAAwB,IAAC,QAAQ,EAAC,OAAO,GAAG,CAAC;AAC3D,MAAM,WAAW,GAAG,KAAC,YAAY,IAAC,QAAQ,EAAC,OAAO,GAAG,CAAC;AAEtD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK;IACvC,MAAM,EACJ,WAAW,EACX,KAAK,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,yBAAyB,GAAG,KAAK,EACjC,QAAQ,GAAG,EAAE,EACb,WAAW,GAAG,K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AK,MAAM,EAAE,OAAO,EAAC,UAAU,EAAC,SAAS,QAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,EAAC,OAAO,EAAC,QAAQ,EAAE,eAAe,GAAI,CACvI,GACD,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { Checkbox, TextField } from '@material-ui/core';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { doSearch, getDisplayFieldsMetaData, useDeepMemo, preProcessColumns, getGroupDataForItemsTree } from './utils';\nimport { insertInstruction, deleteInstruction } from '../../helpers/instructions-utils';\nimport { debounce } from 'throttle-debounce';\n\nconst icon = <CheckBoxOutlineBlankIcon fontSize='small' />;\nconst checkedIcon = <CheckBoxIcon fontSize='small' />;\n\nexport default function Multiselect(props) {\n const {\n getPConnect,\n label,\n placeholder,\n referenceList,\n selectionKey,\n primaryField,\n initialCaseClass,\n showSecondaryInSearchOnly = false,\n listType = '',\n isGroupData = false,\n referenceType,\n secondaryFields,\n groupDataSource = [],\n parameters = {},\n matchPosition = 'contains',\n maxResultsDisplay,\n groupColumnsConfig = [{}],\n selectionList,\n value\n } = props;\n let { datasource = [], columns = [{}] } = props;\n\n if (referenceList.length > 0) {\n datasource = referenceList;\n columns = [\n {\n value: primaryField,\n display: 'true',\n useForSearch: true,\n primary: 'true'\n },\n {\n value: selectionKey,\n setProperty: selectionKey,\n key: 'true'\n }\n ];\n let secondaryColumns: any = [];\n if (secondaryFields) {\n secondaryColumns = secondaryFields.map(secondaryField => ({\n value: secondaryField,\n display: 'true',\n secondary: 'true',\n useForSearch: 'true'\n }));\n } else {\n secondaryColumns = [\n {\n value: selectionKey,\n display: 'true',\n secondary: 'true',\n useForSearch: 'true'\n }\n ];\n }\n if (referenceType === 'Case') {\n columns = [...columns, ...secondaryColumns];\n }\n }\n const [inputValue, setInputValue] = useState(value);\n const [selectedItems, setSelectedItems] = useState([]);\n\n const dataConfig = useDeepMemo(() => {\n return {\n dataSource: datasource,\n groupDataSource,\n isGroupData,\n showSecondaryInSearchOnly,\n parameters,\n matchPosition,\n listType,\n maxResultsDisplay: maxResultsDisplay || '100',\n columns: preProcessColumns(columns),\n groupColumnsConfig: preProcessColumns(groupColumnsConfig)\n };\n }, [\n datasource,\n groupDataSource,\n isGroupData,\n showSecondaryInSearchOnly,\n parameters,\n matchPosition,\n listType,\n maxResultsDisplay,\n columns,\n groupColumnsConfig\n ]);\n const groupsDisplayFieldMeta = useMemo(\n () => (listType !== 'associated' ? getDisplayFieldsMetaData(dataConfig.groupColumnsConfig) : null),\n [dataConfig.groupColumnsConfig]\n );\n\n const itemsTreeBaseData = getGroupDataForItemsTree(groupDataSource, groupsDisplayFieldMeta, showSecondaryInSearchOnly) || [];\n\n const [itemsTree, setItemsTree] = useState(\n isGroupData ? getGroupDataForItemsTree(groupDataSource, groupsDisplayFieldMeta, showSecondaryInSearchOnly) : []\n );\n\n const displayFieldMeta = listType !== 'associated' ? getDisplayFieldsMetaData(dataConfig.columns) : null;\n const getCaseListBasedOnParamsDebounced: any = useRef();\n const pConn = getPConnect();\n const contextName = pConn.getContextName();\n const listActions = pConn.getListActions();\n const dataApiObj: any = useRef();\n\n // main search function trigger\n const getCaseListBasedOnParams = async (searchText, group, selectedRows, currentItemsTree, isTriggeredFromSearch = false) => {\n if (referenceList && referenceList.length > 0) {\n selectedRows = await listActions.getSelectedRows(true);\n\n selectedRows =\n selectedRows &&\n selectedRows.map(item => {\n return {\n id: item[selectionKey.startsWith('.') ? selectionKey.substring(1) : selectionKey],\n primary: item[primaryField.startsWith('.') ? primaryField.substring(1) : primaryField]\n };\n });\n setSelectedItems(selectedRows);\n }\n\n // if items tree is null or text search is triggered then always should use fresh data object, we use the original object\n const initalItemsTree = isTriggeredFromSearch || !currentItemsTree ? [...itemsTreeBaseData] : [...currentItemsTree];\n const res = await doSearch(\n searchText,\n group,\n initialCaseClass,\n displayFieldMeta,\n dataApiObj.current,\n initalItemsTree,\n isGroupData,\n showSecondaryInSearchOnly,\n selectedRows || []\n );\n setItemsTree(res);\n };\n\n useEffect(() => {\n if (referenceList && referenceList.length > 0) {\n pConn.setReferenceList(selectionList);\n }\n }, [pConn]);\n\n useEffect(() => {\n getCaseListBasedOnParamsDebounced.current = debounce(500, getCaseListBasedOnParams);\n }, []);\n\n useEffect(() => {\n if (listType !== 'associated') {\n PCore.getDataApi()\n ?.init(dataConfig, contextName)\n .then(dataObj => {\n dataApiObj.current = dataObj;\n if (!isGroupData) {\n getCaseListBasedOnParamsDebounced.current(inputValue ?? '', '', [...selectedItems], [...itemsTree]);\n }\n });\n }\n }, [dataConfig, listType, dataConfig.columns, inputValue, dataConfig.groupColumnsConfig, showSecondaryInSearchOnly]);\n\n const onSearchHandler = ev => {\n const searchText = ev.target.value;\n setInputValue(searchText);\n getCaseListBasedOnParamsDebounced.current(searchText, '', [...selectedItems], [...itemsTree], true);\n };\n\n const setSelectedItemsForReferenceList = item => {\n // Clear error messages if any\n const propName = pConn.getStateProps().selectionList;\n pConn.clearErrorMessages({\n property: propName\n });\n const { selected } = item;\n if (selected) {\n insertInstruction(pConn, selectionList, selectionKey, primaryField, item);\n } else {\n deleteInstruction(pConn, selectionList, selectionKey, item);\n }\n };\n\n const handleChange = (event, newSelectedValues) => {\n let clickedItem;\n let updatedItems: any = [];\n if (newSelectedValues && newSelectedValues.length > 0) {\n updatedItems = newSelectedValues.map(ele => {\n ele.selected = true;\n return ele;\n });\n }\n if (newSelectedValues.length > selectedItems.length) {\n clickedItem = newSelectedValues.filter(item => !selectedItems.some((ele: any) => ele.id === item.id));\n } else {\n clickedItem = selectedItems.filter((item: any) => !newSelectedValues.some((ele: any) => ele.id === item.id));\n clickedItem[0].selected = false;\n }\n itemsTree.forEach(ele => {\n ele.selected = !!updatedItems.find(item => item.id === ele.id);\n });\n\n setSelectedItems(updatedItems);\n setItemsTree(itemsTree);\n\n setInputValue('');\n\n // if this is a referenceList case\n if (referenceList) setSelectedItemsForReferenceList(clickedItem[0]);\n };\n\n return (\n <Autocomplete\n multiple\n fullWidth\n options={itemsTree}\n disableCloseOnSelect\n getOptionSelected={(option: any, val: any) => option?.primary === val?.primary}\n getOptionLabel={(option: any) => option?.primary}\n onChange={handleChange}\n value={selectedItems}\n renderOption={(option: any, { selected }) => (\n <>\n <Checkbox icon={icon} checkedIcon={checkedIcon} style={{ marginRight: 8 }} checked={selected} />\n {option.primary}\n </>\n )}\n renderInput={params => (\n <TextField {...params} variant='outlined' fullWidth label={label} placeholder={placeholder} size='small' onChange={onSearchHandler} />\n )}\n />\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Multiselect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/field/Multiselect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { default } from './Multiselect';\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { updateNewInstuctions, insertInstruction, deleteInstruction } from '../../helpers/instructions-utils';
|
|
2
|
+
export declare const setVisibilityForList: (c11nEnv: any, visibility: any) => void;
|
|
3
|
+
declare const useDeepMemo: (memoFn: any, key: any) => any;
|
|
4
|
+
declare const preProcessColumns: (columns: any) => any;
|
|
5
|
+
declare const getDisplayFieldsMetaData: (columns: any) => any;
|
|
6
|
+
declare const doSearch: (searchText: any, clickedGroup: any, initialCaseClass: any, displayFieldMeta: any, dataApiObj: any, itemsTree: any, isGroupData: any, showSecondaryInSearchOnly: any, selected: any) => Promise<any>;
|
|
7
|
+
declare const setValuesToPropertyList: (searchText: any, assocProp: any, items: any, columns: any, actions: any, updatePropertyInRedux?: boolean) => any;
|
|
8
|
+
declare const getGroupDataForItemsTree: (groupDataSource: any, groupsDisplayFieldMeta: any, showSecondaryInSearchOnly: any) => any;
|
|
9
|
+
export { useDeepMemo, preProcessColumns, getDisplayFieldsMetaData, doSearch, setValuesToPropertyList, getGroupDataForItemsTree, updateNewInstuctions, insertInstruction, deleteInstruction };
|
|
10
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Multiselect/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE9G,eAAO,MAAM,oBAAoB,yCAMhC,CAAC;AAEF,QAAA,MAAM,WAAW,gCAMhB,CAAC;AAEF,QAAA,MAAM,iBAAiB,uBAStB,CAAC;AAEF,QAAA,MAAM,wBAAwB,uBAyB7B,CAAC;AAyCF,QAAA,MAAM,QAAQ,sMAkEb,CAAC;AAEF,QAAA,MAAM,uBAAuB,mHAoC5B,CAAC;AAEF,QAAA,MAAM,wBAAwB,4FAa7B,CAAC;AAEF,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,wBAAwB,EACxB,QAAQ,EACR,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EAClB,CAAC"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
import equal from 'fast-deep-equal';
|
|
3
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
4
|
+
import { updateNewInstuctions, insertInstruction, deleteInstruction } from '../../helpers/instructions-utils';
|
|
5
|
+
export const setVisibilityForList = (c11nEnv, visibility) => {
|
|
6
|
+
const { selectionMode, selectionList, renderMode, referenceList } = c11nEnv.getComponentConfig();
|
|
7
|
+
// usecase:multiselect, fieldgroup, editable table
|
|
8
|
+
if ((selectionMode === PCore.getConstants().LIST_SELECTION_MODE.MULTI && selectionList) || (renderMode === 'Editable' && referenceList)) {
|
|
9
|
+
c11nEnv.getListActions().setVisibility(visibility);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const useDeepMemo = (memoFn, key) => {
|
|
13
|
+
const ref = useRef();
|
|
14
|
+
if (!ref.current || !equal(key, ref.current.key)) {
|
|
15
|
+
ref.current = { key, value: memoFn() };
|
|
16
|
+
}
|
|
17
|
+
return ref.current.value;
|
|
18
|
+
};
|
|
19
|
+
const preProcessColumns = columns => {
|
|
20
|
+
return columns?.map(col => {
|
|
21
|
+
const tempColObj = { ...col };
|
|
22
|
+
tempColObj.value = col.value && col.value.startsWith('.') ? col.value.substring(1) : col.value;
|
|
23
|
+
if (tempColObj.setProperty) {
|
|
24
|
+
tempColObj.setProperty = col.setProperty && col.setProperty.startsWith('.') ? col.setProperty.substring(1) : col.setProperty;
|
|
25
|
+
}
|
|
26
|
+
return tempColObj;
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const getDisplayFieldsMetaData = columns => {
|
|
30
|
+
const displayColumns = columns?.filter(col => col.display === 'true');
|
|
31
|
+
const metaDataObj = {
|
|
32
|
+
key: '',
|
|
33
|
+
primary: '',
|
|
34
|
+
secondary: []
|
|
35
|
+
};
|
|
36
|
+
const keyCol = columns?.filter(col => col.key === 'true');
|
|
37
|
+
metaDataObj.key = keyCol?.length > 0 ? keyCol[0].value : 'auto';
|
|
38
|
+
const itemsRecordsColumn = columns?.filter(col => col.itemsRecordsColumn === 'true');
|
|
39
|
+
if (itemsRecordsColumn?.length > 0) {
|
|
40
|
+
metaDataObj.itemsRecordsColumn = itemsRecordsColumn[0].value;
|
|
41
|
+
}
|
|
42
|
+
const itemsGroupKeyColumn = columns?.filter(col => col.itemsGroupKeyColumn === 'true');
|
|
43
|
+
if (itemsGroupKeyColumn?.length > 0) {
|
|
44
|
+
metaDataObj.itemsGroupKeyColumn = itemsGroupKeyColumn[0].value;
|
|
45
|
+
}
|
|
46
|
+
for (let index = 0; index < displayColumns?.length; index += 1) {
|
|
47
|
+
if (displayColumns[index].secondary === 'true') {
|
|
48
|
+
metaDataObj.secondary.push(displayColumns[index].value);
|
|
49
|
+
}
|
|
50
|
+
else if (displayColumns[index].primary === 'true') {
|
|
51
|
+
metaDataObj.primary = displayColumns[index].value;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return metaDataObj;
|
|
55
|
+
};
|
|
56
|
+
const createSingleTreeObejct = (entry, displayFieldMeta, showSecondaryData, selected) => {
|
|
57
|
+
const secondaryArr = [];
|
|
58
|
+
displayFieldMeta.secondary.forEach(col => {
|
|
59
|
+
secondaryArr.push(entry[col]);
|
|
60
|
+
});
|
|
61
|
+
const isSelected = selected.some(item => item.id === entry[displayFieldMeta.key]);
|
|
62
|
+
return {
|
|
63
|
+
id: entry[displayFieldMeta.key],
|
|
64
|
+
primary: entry[displayFieldMeta.primary],
|
|
65
|
+
secondary: showSecondaryData ? secondaryArr : [],
|
|
66
|
+
selected: isSelected
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
const putItemsDataInItemsTree = (listObjData, displayFieldMeta, itemsTree, showSecondaryInSearchOnly, selected) => {
|
|
70
|
+
let newTreeItems = itemsTree.slice();
|
|
71
|
+
const showSecondaryData = !showSecondaryInSearchOnly;
|
|
72
|
+
for (const obj of listObjData) {
|
|
73
|
+
const items = obj[displayFieldMeta.itemsRecordsColumn].map(entry => createSingleTreeObejct(entry, displayFieldMeta, showSecondaryData, selected));
|
|
74
|
+
newTreeItems = newTreeItems.map(caseObject => {
|
|
75
|
+
if (caseObject.id === obj[displayFieldMeta.itemsGroupKeyColumn]) {
|
|
76
|
+
caseObject.items = [...items];
|
|
77
|
+
}
|
|
78
|
+
return caseObject;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return newTreeItems;
|
|
82
|
+
};
|
|
83
|
+
const prepareSearchResults = (listObjData, displayFieldMeta) => {
|
|
84
|
+
const searchResults = [];
|
|
85
|
+
for (const obj of listObjData) {
|
|
86
|
+
searchResults.push(...obj[displayFieldMeta.itemsRecordsColumn]);
|
|
87
|
+
}
|
|
88
|
+
return searchResults;
|
|
89
|
+
};
|
|
90
|
+
const doSearch = async (searchText, clickedGroup, initialCaseClass, displayFieldMeta, dataApiObj, // deep clone of the dataApiObj
|
|
91
|
+
itemsTree, isGroupData, showSecondaryInSearchOnly, selected) => {
|
|
92
|
+
let searchTextForUngroupedData = '';
|
|
93
|
+
if (dataApiObj) {
|
|
94
|
+
// creating dataApiObject in grouped data cases
|
|
95
|
+
if (isGroupData) {
|
|
96
|
+
dataApiObj = cloneDeep(dataApiObj);
|
|
97
|
+
dataApiObj.fetchedNQData = false;
|
|
98
|
+
dataApiObj.cache = {};
|
|
99
|
+
// if we have no search text and no group selected, return the original tree
|
|
100
|
+
if (searchText === '' && clickedGroup === '') {
|
|
101
|
+
return itemsTree;
|
|
102
|
+
}
|
|
103
|
+
// setting the inital search text & search classes in ApiObject
|
|
104
|
+
dataApiObj.parameters[Object.keys(dataApiObj.parameters)[1]] = searchText;
|
|
105
|
+
dataApiObj.parameters[Object.keys(dataApiObj.parameters)[0]] = initialCaseClass;
|
|
106
|
+
// if we have a selected group
|
|
107
|
+
if (clickedGroup) {
|
|
108
|
+
// check if the data for this group is already present and no search text
|
|
109
|
+
if (searchText === '') {
|
|
110
|
+
const containsData = itemsTree.find(item => item.id === clickedGroup);
|
|
111
|
+
// do not make API call when items of respective group are already fetched
|
|
112
|
+
if (containsData?.items?.length)
|
|
113
|
+
return itemsTree;
|
|
114
|
+
}
|
|
115
|
+
dataApiObj.parameters[Object.keys(dataApiObj.parameters)[0]] = JSON.stringify([clickedGroup]);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
searchTextForUngroupedData = searchText;
|
|
120
|
+
}
|
|
121
|
+
// search API call
|
|
122
|
+
const response = await dataApiObj.fetchData(searchTextForUngroupedData).catch(() => {
|
|
123
|
+
return itemsTree;
|
|
124
|
+
});
|
|
125
|
+
let listObjData = response.data;
|
|
126
|
+
let newItemsTree = [];
|
|
127
|
+
if (isGroupData) {
|
|
128
|
+
if (searchText) {
|
|
129
|
+
listObjData = prepareSearchResults(listObjData, displayFieldMeta);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
newItemsTree = putItemsDataInItemsTree(listObjData, displayFieldMeta, itemsTree, showSecondaryInSearchOnly, selected);
|
|
133
|
+
return newItemsTree;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const showSecondaryData = showSecondaryInSearchOnly ? !!searchText : true;
|
|
137
|
+
if (listObjData !== undefined && listObjData.length > 0) {
|
|
138
|
+
newItemsTree = listObjData.map(entry => createSingleTreeObejct(entry, displayFieldMeta, showSecondaryData, selected));
|
|
139
|
+
}
|
|
140
|
+
return newItemsTree;
|
|
141
|
+
}
|
|
142
|
+
return itemsTree;
|
|
143
|
+
};
|
|
144
|
+
const setValuesToPropertyList = (searchText, assocProp, items, columns, actions, updatePropertyInRedux = true) => {
|
|
145
|
+
const setPropertyList = columns
|
|
146
|
+
?.filter(col => col.setProperty)
|
|
147
|
+
.map(col => {
|
|
148
|
+
return {
|
|
149
|
+
source: col.value,
|
|
150
|
+
target: col.setProperty,
|
|
151
|
+
key: col.key,
|
|
152
|
+
primary: col.primary
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
const valueToSet = [];
|
|
156
|
+
if (setPropertyList.length > 0) {
|
|
157
|
+
setPropertyList.forEach(prop => {
|
|
158
|
+
items.forEach(item => {
|
|
159
|
+
if (prop.key === 'true' && item) {
|
|
160
|
+
valueToSet.push(item.id);
|
|
161
|
+
}
|
|
162
|
+
else if (prop.primary === 'true' || !item) {
|
|
163
|
+
valueToSet.push(searchText);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
if (updatePropertyInRedux) {
|
|
167
|
+
// BUG-666851 setting options so that the store values are replaced and not merged
|
|
168
|
+
const options = {
|
|
169
|
+
isArrayDeepMerge: false
|
|
170
|
+
};
|
|
171
|
+
if (prop.target === 'Associated property') {
|
|
172
|
+
actions.updateFieldValue(assocProp, valueToSet, options);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
actions.updateFieldValue(`.${prop.target}`, valueToSet, options);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
return valueToSet;
|
|
181
|
+
};
|
|
182
|
+
const getGroupDataForItemsTree = (groupDataSource, groupsDisplayFieldMeta, showSecondaryInSearchOnly) => {
|
|
183
|
+
return groupDataSource?.map(group => {
|
|
184
|
+
const secondaryArr = [];
|
|
185
|
+
groupsDisplayFieldMeta.secondary.forEach(col => {
|
|
186
|
+
secondaryArr.push(group[col]);
|
|
187
|
+
});
|
|
188
|
+
return {
|
|
189
|
+
id: group[groupsDisplayFieldMeta.key],
|
|
190
|
+
primary: group[groupsDisplayFieldMeta.primary],
|
|
191
|
+
secondary: showSecondaryInSearchOnly ? [] : secondaryArr,
|
|
192
|
+
items: []
|
|
193
|
+
};
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
export { useDeepMemo, preProcessColumns, getDisplayFieldsMetaData, doSearch, setValuesToPropertyList, getGroupDataForItemsTree, updateNewInstuctions, insertInstruction, deleteInstruction };
|
|
197
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/components/field/Multiselect/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CA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B,CAAC,GAAG,CAAC;YACrC,OAAO,EAAE,KAAK,CAAC,sBAAsB,CAAC,OAAO,CAAC;YAC9C,SAAS,EAAE,yBAAyB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;YACxD,KAAK,EAAE,EAAE;SACV,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,wBAAwB,EACxB,QAAQ,EACR,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EAClB,CAAC","sourcesContent":["import { useRef } from 'react';\nimport equal from 'fast-deep-equal';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { updateNewInstuctions, insertInstruction, deleteInstruction } from '../../helpers/instructions-utils';\n\nexport const setVisibilityForList = (c11nEnv, visibility) => {\n const { selectionMode, selectionList, renderMode, referenceList } = c11nEnv.getComponentConfig();\n // usecase:multiselect, fieldgroup, editable table\n if ((selectionMode === PCore.getConstants().LIST_SELECTION_MODE.MULTI && selectionList) || (renderMode === 'Editable' && referenceList)) {\n c11nEnv.getListActions().setVisibility(visibility);\n }\n};\n\nconst 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\nconst preProcessColumns = columns => {\n return columns?.map(col => {\n const tempColObj = { ...col };\n tempColObj.value = col.value && col.value.startsWith('.') ? col.value.substring(1) : col.value;\n if (tempColObj.setProperty) {\n tempColObj.setProperty = col.setProperty && col.setProperty.startsWith('.') ? col.setProperty.substring(1) : col.setProperty;\n }\n return tempColObj;\n });\n};\n\nconst getDisplayFieldsMetaData = columns => {\n const displayColumns = columns?.filter(col => col.display === 'true');\n const metaDataObj: any = {\n key: '',\n primary: '',\n secondary: []\n };\n const keyCol = columns?.filter(col => col.key === 'true');\n metaDataObj.key = keyCol?.length > 0 ? keyCol[0].value : 'auto';\n const itemsRecordsColumn = columns?.filter(col => col.itemsRecordsColumn === 'true');\n if (itemsRecordsColumn?.length > 0) {\n metaDataObj.itemsRecordsColumn = itemsRecordsColumn[0].value;\n }\n const itemsGroupKeyColumn = columns?.filter(col => col.itemsGroupKeyColumn === 'true');\n if (itemsGroupKeyColumn?.length > 0) {\n metaDataObj.itemsGroupKeyColumn = itemsGroupKeyColumn[0].value;\n }\n for (let index = 0; index < displayColumns?.length; index += 1) {\n if (displayColumns[index].secondary === 'true') {\n metaDataObj.secondary.push(displayColumns[index].value);\n } else if (displayColumns[index].primary === 'true') {\n metaDataObj.primary = displayColumns[index].value;\n }\n }\n return metaDataObj;\n};\n\nconst createSingleTreeObejct = (entry, displayFieldMeta, showSecondaryData, selected) => {\n const secondaryArr: any = [];\n displayFieldMeta.secondary.forEach(col => {\n secondaryArr.push(entry[col]);\n });\n const isSelected = selected.some(item => item.id === entry[displayFieldMeta.key]);\n\n return {\n id: entry[displayFieldMeta.key],\n primary: entry[displayFieldMeta.primary],\n secondary: showSecondaryData ? secondaryArr : [],\n selected: isSelected\n };\n};\n\nconst putItemsDataInItemsTree = (listObjData, displayFieldMeta, itemsTree, showSecondaryInSearchOnly, selected) => {\n let newTreeItems = itemsTree.slice();\n const showSecondaryData = !showSecondaryInSearchOnly;\n for (const obj of listObjData) {\n const items = obj[displayFieldMeta.itemsRecordsColumn].map(entry => createSingleTreeObejct(entry, displayFieldMeta, showSecondaryData, selected));\n\n newTreeItems = newTreeItems.map(caseObject => {\n if (caseObject.id === obj[displayFieldMeta.itemsGroupKeyColumn]) {\n caseObject.items = [...items];\n }\n return caseObject;\n });\n }\n return newTreeItems;\n};\n\nconst prepareSearchResults = (listObjData, displayFieldMeta) => {\n const searchResults: any = [];\n for (const obj of listObjData) {\n searchResults.push(...obj[displayFieldMeta.itemsRecordsColumn]);\n }\n return searchResults;\n};\n\nconst doSearch = async (\n searchText,\n clickedGroup,\n initialCaseClass,\n displayFieldMeta,\n dataApiObj, // deep clone of the dataApiObj\n itemsTree,\n isGroupData,\n showSecondaryInSearchOnly,\n selected\n) => {\n let searchTextForUngroupedData = '';\n if (dataApiObj) {\n // creating dataApiObject in grouped data cases\n if (isGroupData) {\n dataApiObj = cloneDeep(dataApiObj);\n dataApiObj.fetchedNQData = false;\n dataApiObj.cache = {};\n\n // if we have no search text and no group selected, return the original tree\n if (searchText === '' && clickedGroup === '') {\n return itemsTree;\n }\n\n // setting the inital search text & search classes in ApiObject\n dataApiObj.parameters[Object.keys(dataApiObj.parameters)[1]] = searchText;\n dataApiObj.parameters[Object.keys(dataApiObj.parameters)[0]] = initialCaseClass;\n\n // if we have a selected group\n if (clickedGroup) {\n // check if the data for this group is already present and no search text\n if (searchText === '') {\n const containsData = itemsTree.find(item => item.id === clickedGroup);\n // do not make API call when items of respective group are already fetched\n if (containsData?.items?.length) return itemsTree;\n }\n\n dataApiObj.parameters[Object.keys(dataApiObj.parameters)[0]] = JSON.stringify([clickedGroup]);\n }\n } else {\n searchTextForUngroupedData = searchText;\n }\n\n // search API call\n const response = await dataApiObj.fetchData(searchTextForUngroupedData).catch(() => {\n return itemsTree;\n });\n\n let listObjData = response.data;\n let newItemsTree = [];\n if (isGroupData) {\n if (searchText) {\n listObjData = prepareSearchResults(listObjData, displayFieldMeta);\n } else {\n newItemsTree = putItemsDataInItemsTree(listObjData, displayFieldMeta, itemsTree, showSecondaryInSearchOnly, selected);\n return newItemsTree;\n }\n }\n const showSecondaryData = showSecondaryInSearchOnly ? !!searchText : true;\n if (listObjData !== undefined && listObjData.length > 0) {\n newItemsTree = listObjData.map(entry => createSingleTreeObejct(entry, displayFieldMeta, showSecondaryData, selected));\n }\n return newItemsTree;\n }\n\n return itemsTree;\n};\n\nconst setValuesToPropertyList = (searchText, assocProp, items, columns, actions, updatePropertyInRedux = true) => {\n const setPropertyList = columns\n ?.filter(col => col.setProperty)\n .map(col => {\n return {\n source: col.value,\n target: col.setProperty,\n key: col.key,\n primary: col.primary\n };\n });\n const valueToSet: any = [];\n if (setPropertyList.length > 0) {\n setPropertyList.forEach(prop => {\n items.forEach(item => {\n if (prop.key === 'true' && item) {\n valueToSet.push(item.id);\n } else if (prop.primary === 'true' || !item) {\n valueToSet.push(searchText);\n }\n });\n\n if (updatePropertyInRedux) {\n // BUG-666851 setting options so that the store values are replaced and not merged\n const options = {\n isArrayDeepMerge: false\n };\n if (prop.target === 'Associated property') {\n actions.updateFieldValue(assocProp, valueToSet, options);\n } else {\n actions.updateFieldValue(`.${prop.target}`, valueToSet, options);\n }\n }\n });\n }\n return valueToSet;\n};\n\nconst getGroupDataForItemsTree = (groupDataSource, groupsDisplayFieldMeta, showSecondaryInSearchOnly) => {\n return groupDataSource?.map(group => {\n const secondaryArr: any = [];\n groupsDisplayFieldMeta.secondary.forEach(col => {\n secondaryArr.push(group[col]);\n });\n return {\n id: group[groupsDisplayFieldMeta.key],\n primary: group[groupsDisplayFieldMeta.primary],\n secondary: showSecondaryInSearchOnly ? [] : secondaryArr,\n items: []\n };\n });\n};\n\nexport {\n useDeepMemo,\n preProcessColumns,\n getDisplayFieldsMetaData,\n doSearch,\n setValuesToPropertyList,\n getGroupDataForItemsTree,\n updateNewInstuctions,\n insertInstruction,\n deleteInstruction\n};\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PConnFieldProps } from '../../../types/PConnProps';
|
|
3
2
|
interface PercentageProps extends PConnFieldProps {
|
|
4
3
|
currencyISOCode?: string;
|
|
4
|
+
showGroupSeparators?: string;
|
|
5
|
+
decimalPrecision?: number;
|
|
5
6
|
}
|
|
6
|
-
export default function Percentage(props: PercentageProps): JSX.Element;
|
|
7
|
+
export default function Percentage(props: PercentageProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
8
9
|
//# sourceMappingURL=Percentage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Percentage.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Percentage/Percentage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Percentage.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Percentage/Percentage.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAQ5D,UAAU,eAAgB,SAAQ,eAAe;IAE/C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,eAAe,2CA4FxD"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { TextField } from '@material-ui/core';
|
|
3
|
+
import { NumericFormat } from 'react-number-format';
|
|
4
|
+
import { useState } from 'react';
|
|
3
5
|
import { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';
|
|
4
6
|
import { getCurrencyCharacters, getCurrencyOptions } from '../Currency/currency-utils';
|
|
5
7
|
import handleEvent from '../../helpers/event-utils';
|
|
@@ -10,14 +12,18 @@ export default function Percentage(props) {
|
|
|
10
12
|
const { getPConnect, label, required, disabled, value = '', validatemessage, status,
|
|
11
13
|
// onChange,
|
|
12
14
|
// onBlur,
|
|
13
|
-
readOnly, currencyISOCode = 'USD', testId, helperText, displayMode, hideLabel, placeholder } = props;
|
|
15
|
+
readOnly, currencyISOCode = 'USD', testId, helperText, displayMode, hideLabel, placeholder, showGroupSeparators, decimalPrecision } = props;
|
|
16
|
+
const [values, setValues] = useState(value.toString());
|
|
14
17
|
const pConn = getPConnect();
|
|
15
18
|
const actions = pConn.getActionsApi();
|
|
16
19
|
const propName = pConn.getStateProps().value;
|
|
17
20
|
const helperTextToDisplay = validatemessage || helperText;
|
|
18
21
|
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
19
22
|
const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
|
|
20
|
-
|
|
23
|
+
let readOnlyProp = {}; // Note: empty if NOT ReadOnly
|
|
24
|
+
if (readOnly) {
|
|
25
|
+
readOnlyProp = { readOnly: true };
|
|
26
|
+
}
|
|
21
27
|
if (displayMode === 'LABELS_LEFT') {
|
|
22
28
|
return _jsx(FieldValueList, { name: hideLabel ? '' : label, value: formattedValue });
|
|
23
29
|
}
|
|
@@ -31,11 +37,14 @@ export default function Percentage(props) {
|
|
|
31
37
|
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
32
38
|
const theCurrDec = theSymbols.theDecimalIndicator;
|
|
33
39
|
const theCurrSep = theSymbols.theDigitGroupSeparator;
|
|
34
|
-
function PercentageOnBlur(
|
|
35
|
-
handleEvent(actions, 'changeNblur', propName,
|
|
40
|
+
function PercentageOnBlur() {
|
|
41
|
+
handleEvent(actions, 'changeNblur', propName, values);
|
|
36
42
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
const handleChange = val => {
|
|
44
|
+
setValues(val.value);
|
|
45
|
+
};
|
|
46
|
+
return (_jsx(NumericFormat, { valueIsNumericString: true, fullWidth: true, variant: readOnly ? 'standard' : 'outlined', helperText: helperTextToDisplay, placeholder: placeholder ?? '', size: 'small', required: required, disabled: disabled, error: status === 'error', label: label, value: values, onValueChange: val => {
|
|
47
|
+
handleChange(val);
|
|
48
|
+
}, onBlur: !readOnly ? PercentageOnBlur : undefined, decimalSeparator: theCurrDec, thousandSeparator: showGroupSeparators ? theCurrSep : '', decimalScale: decimalPrecision, suffix: '%', InputProps: { ...readOnlyProp, inputProps: { ...testProp } }, customInput: TextField }));
|
|
40
49
|
}
|
|
41
50
|
//# sourceMappingURL=Percentage.js.map
|