@pega/react-sdk-components 0.23.26 → 8.8.20
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 +3 -2
- package/lib/bridge/Context/StoreContext.d.ts.map +1 -1
- package/lib/bridge/Context/StoreContext.js +2 -3
- package/lib/bridge/Context/StoreContext.js.map +1 -1
- package/lib/bridge/helpers/sdk_component_map.d.ts +1 -0
- package/lib/bridge/helpers/sdk_component_map.d.ts.map +1 -1
- package/lib/bridge/helpers/sdk_component_map.js +22 -0
- 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 +2 -14
- package/lib/bridge/react_pconnect.js.map +1 -1
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts +10 -0
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts.map +1 -0
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js +19 -0
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js.map +1 -0
- package/lib/components/designSystemExtension/AlertBanner/index.d.ts +2 -0
- package/lib/components/designSystemExtension/AlertBanner/index.d.ts.map +1 -0
- package/lib/components/designSystemExtension/AlertBanner/index.js +2 -0
- package/lib/components/designSystemExtension/AlertBanner/index.js.map +1 -0
- package/lib/components/designSystemExtension/Banner/Banner.d.ts +15 -1
- package/lib/components/designSystemExtension/Banner/Banner.d.ts.map +1 -1
- package/lib/components/designSystemExtension/Banner/Banner.js.map +1 -1
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts +6 -9
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js +3 -7
- package/lib/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
- package/lib/components/designSystemExtension/DetailsFields/DetailsFields.d.ts +4 -10
- package/lib/components/designSystemExtension/DetailsFields/DetailsFields.d.ts.map +1 -1
- package/lib/components/designSystemExtension/DetailsFields/DetailsFields.js +1 -8
- package/lib/components/designSystemExtension/DetailsFields/DetailsFields.js.map +1 -1
- package/lib/components/designSystemExtension/FieldGroup/FieldGroup.d.ts +6 -2
- package/lib/components/designSystemExtension/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js +3 -3
- package/lib/components/designSystemExtension/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.d.ts +7 -2
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.d.ts.map +1 -1
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js +4 -4
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js.map +1 -1
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.d.ts +7 -2
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js +3 -3
- package/lib/components/designSystemExtension/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/designSystemExtension/Operator/Operator.d.ts +17 -7
- package/lib/components/designSystemExtension/Operator/Operator.d.ts.map +1 -1
- package/lib/components/designSystemExtension/Operator/Operator.js +13 -16
- package/lib/components/designSystemExtension/Operator/Operator.js.map +1 -1
- package/lib/components/designSystemExtension/Pulse/Pulse.d.ts +5 -1
- package/lib/components/designSystemExtension/Pulse/Pulse.d.ts.map +1 -1
- package/lib/components/designSystemExtension/Pulse/Pulse.js +3 -6
- package/lib/components/designSystemExtension/Pulse/Pulse.js.map +1 -1
- package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.d.ts +19 -0
- package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.d.ts.map +1 -0
- package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.js +77 -0
- package/lib/components/designSystemExtension/RichTextEditor/RichTextEditor.js.map +1 -0
- package/lib/components/designSystemExtension/RichTextEditor/index.d.ts +2 -0
- package/lib/components/designSystemExtension/RichTextEditor/index.d.ts.map +1 -0
- package/lib/components/designSystemExtension/RichTextEditor/index.js +2 -0
- package/lib/components/designSystemExtension/RichTextEditor/index.js.map +1 -0
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.d.ts +6 -1
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.d.ts.map +1 -1
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js +2 -2
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js.map +1 -1
- package/lib/components/field/AutoComplete/AutoComplete.d.ts +15 -1
- package/lib/components/field/AutoComplete/AutoComplete.d.ts.map +1 -1
- package/lib/components/field/AutoComplete/AutoComplete.js +17 -15
- package/lib/components/field/AutoComplete/AutoComplete.js.map +1 -1
- package/lib/components/field/CancelAlert/CancelAlert.d.ts +7 -2
- package/lib/components/field/CancelAlert/CancelAlert.d.ts.map +1 -1
- package/lib/components/field/CancelAlert/CancelAlert.js +12 -10
- package/lib/components/field/CancelAlert/CancelAlert.js.map +1 -1
- package/lib/components/field/Checkbox/Checkbox.d.ts +19 -1
- package/lib/components/field/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/field/Checkbox/Checkbox.js +12 -10
- package/lib/components/field/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/field/Currency/Currency.d.ts +6 -1
- package/lib/components/field/Currency/Currency.d.ts.map +1 -1
- package/lib/components/field/Currency/Currency.js +11 -11
- package/lib/components/field/Currency/Currency.js.map +1 -1
- package/lib/components/field/Currency/currency-utils.d.ts +1 -1
- package/lib/components/field/Currency/currency-utils.d.ts.map +1 -1
- package/lib/components/field/Currency/currency-utils.js +1 -1
- package/lib/components/field/Currency/currency-utils.js.map +1 -1
- package/lib/components/field/Date/Date.d.ts +5 -1
- package/lib/components/field/Date/Date.d.ts.map +1 -1
- package/lib/components/field/Date/Date.js +19 -11
- package/lib/components/field/Date/Date.js.map +1 -1
- package/lib/components/field/DateTime/DateTime.d.ts +5 -1
- package/lib/components/field/DateTime/DateTime.d.ts.map +1 -1
- package/lib/components/field/DateTime/DateTime.js +15 -9
- package/lib/components/field/DateTime/DateTime.js.map +1 -1
- package/lib/components/field/Decimal/Decimal.d.ts +8 -1
- package/lib/components/field/Decimal/Decimal.d.ts.map +1 -1
- package/lib/components/field/Decimal/Decimal.js +43 -9
- package/lib/components/field/Decimal/Decimal.js.map +1 -1
- package/lib/components/field/Dropdown/Dropdown.d.ts +10 -1
- package/lib/components/field/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/components/field/Dropdown/Dropdown.js +26 -9
- package/lib/components/field/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/field/Email/Email.d.ts +5 -1
- package/lib/components/field/Email/Email.d.ts.map +1 -1
- package/lib/components/field/Email/Email.js +7 -5
- package/lib/components/field/Email/Email.js.map +1 -1
- package/lib/components/field/Integer/Integer.d.ts +5 -1
- package/lib/components/field/Integer/Integer.d.ts.map +1 -1
- package/lib/components/field/Integer/Integer.js +6 -4
- package/lib/components/field/Integer/Integer.js.map +1 -1
- package/lib/components/field/Percentage/Percentage.d.ts +5 -1
- package/lib/components/field/Percentage/Percentage.d.ts.map +1 -1
- package/lib/components/field/Percentage/Percentage.js +6 -4
- package/lib/components/field/Percentage/Percentage.js.map +1 -1
- package/lib/components/field/Phone/Phone.d.ts +5 -1
- package/lib/components/field/Phone/Phone.d.ts.map +1 -1
- package/lib/components/field/Phone/Phone.js +10 -7
- package/lib/components/field/Phone/Phone.js.map +1 -1
- package/lib/components/field/RadioButtons/RadioButtons.d.ts +7 -1
- package/lib/components/field/RadioButtons/RadioButtons.d.ts.map +1 -1
- package/lib/components/field/RadioButtons/RadioButtons.js +24 -11
- package/lib/components/field/RadioButtons/RadioButtons.js.map +1 -1
- package/lib/components/field/RichText/RichText.d.ts +7 -0
- package/lib/components/field/RichText/RichText.d.ts.map +1 -0
- package/lib/components/field/RichText/RichText.js +51 -0
- package/lib/components/field/RichText/RichText.js.map +1 -0
- package/lib/components/field/RichText/index.d.ts +2 -0
- package/lib/components/field/RichText/index.d.ts.map +1 -0
- package/lib/components/field/RichText/index.js +2 -0
- package/lib/components/field/RichText/index.js.map +1 -0
- package/lib/components/field/ScalarList/ScalarList.d.ts +13 -0
- package/lib/components/field/ScalarList/ScalarList.d.ts.map +1 -0
- package/lib/components/field/ScalarList/ScalarList.js +34 -0
- package/lib/components/field/ScalarList/ScalarList.js.map +1 -0
- package/lib/components/field/ScalarList/index.d.ts +2 -0
- package/lib/components/field/ScalarList/index.d.ts.map +1 -0
- package/lib/components/field/ScalarList/index.js +2 -0
- package/lib/components/field/ScalarList/index.js.map +1 -0
- package/lib/components/field/SemanticLink/SemanticLink.d.ts +5 -9
- package/lib/components/field/SemanticLink/SemanticLink.d.ts.map +1 -1
- package/lib/components/field/SemanticLink/SemanticLink.js +10 -14
- package/lib/components/field/SemanticLink/SemanticLink.js.map +1 -1
- package/lib/components/field/SemanticLink/utils.d.ts.map +1 -1
- package/lib/components/field/SemanticLink/utils.js.map +1 -1
- package/lib/components/field/TextArea/TextArea.d.ts +6 -1
- package/lib/components/field/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/field/TextArea/TextArea.js +5 -3
- package/lib/components/field/TextArea/TextArea.js.map +1 -1
- package/lib/components/field/TextContent/TextContent.d.ts +7 -1
- package/lib/components/field/TextContent/TextContent.d.ts.map +1 -1
- package/lib/components/field/TextContent/TextContent.js.map +1 -1
- package/lib/components/field/TextInput/TextInput.d.ts +6 -1
- package/lib/components/field/TextInput/TextInput.d.ts.map +1 -1
- package/lib/components/field/TextInput/TextInput.js +24 -5
- package/lib/components/field/TextInput/TextInput.js.map +1 -1
- package/lib/components/field/Time/Time.d.ts +5 -1
- package/lib/components/field/Time/Time.d.ts.map +1 -1
- package/lib/components/field/Time/Time.js +14 -8
- package/lib/components/field/Time/Time.js.map +1 -1
- package/lib/components/field/URL/URL.d.ts +5 -1
- package/lib/components/field/URL/URL.d.ts.map +1 -1
- package/lib/components/field/URL/URL.js +11 -5
- package/lib/components/field/URL/URL.js.map +1 -1
- package/lib/components/field/UserReference/UserReference.d.ts +19 -40
- package/lib/components/field/UserReference/UserReference.d.ts.map +1 -1
- package/lib/components/field/UserReference/UserReference.js +16 -45
- package/lib/components/field/UserReference/UserReference.js.map +1 -1
- package/lib/components/helpers/attachmentHelpers.d.ts +6 -6
- package/lib/components/helpers/attachmentHelpers.d.ts.map +1 -1
- package/lib/components/helpers/attachmentHelpers.js +2 -2
- package/lib/components/helpers/attachmentHelpers.js.map +1 -1
- package/lib/components/helpers/auth.d.ts +8 -6
- package/lib/components/helpers/auth.d.ts.map +1 -1
- package/lib/components/helpers/auth.js +642 -327
- package/lib/components/helpers/auth.js.map +1 -1
- package/lib/components/helpers/authManager.d.ts +20 -17
- package/lib/components/helpers/authManager.d.ts.map +1 -1
- package/lib/components/helpers/authManager.js +713 -438
- package/lib/components/helpers/authManager.js.map +1 -1
- package/lib/components/helpers/case-utils.d.ts +20 -0
- package/lib/components/helpers/case-utils.d.ts.map +1 -0
- package/lib/components/helpers/case-utils.js +82 -0
- package/lib/components/helpers/case-utils.js.map +1 -0
- package/lib/components/helpers/common-utils.d.ts +2 -0
- package/lib/components/helpers/common-utils.d.ts.map +1 -0
- package/lib/components/helpers/common-utils.js +5 -0
- package/lib/components/helpers/common-utils.js.map +1 -0
- package/lib/components/helpers/config_access.d.ts.map +1 -1
- package/lib/components/helpers/config_access.js +28 -98
- package/lib/components/helpers/config_access.js.map +1 -1
- package/lib/components/helpers/data_page.d.ts.map +1 -1
- package/lib/components/helpers/data_page.js.map +1 -1
- package/lib/components/helpers/date-format-utils.d.ts +1 -6
- package/lib/components/helpers/date-format-utils.d.ts.map +1 -1
- package/lib/components/helpers/date-format-utils.js +23 -14
- package/lib/components/helpers/date-format-utils.js.map +1 -1
- package/lib/components/helpers/event-utils.d.ts +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 +15 -2
- package/lib/components/helpers/field-group-utils.d.ts.map +1 -1
- package/lib/components/helpers/field-group-utils.js +3 -3
- package/lib/components/helpers/field-group-utils.js.map +1 -1
- package/lib/components/helpers/formatters/Boolean.d.ts +3 -3
- package/lib/components/helpers/formatters/Boolean.d.ts.map +1 -1
- package/lib/components/helpers/formatters/Boolean.js.map +1 -1
- package/lib/components/helpers/formatters/Currency.d.ts +6 -6
- package/lib/components/helpers/formatters/Currency.d.ts.map +1 -1
- package/lib/components/helpers/formatters/Currency.js +6 -5
- package/lib/components/helpers/formatters/Currency.js.map +1 -1
- package/lib/components/helpers/formatters/CurrencyMap.d.ts +881 -1399
- package/lib/components/helpers/formatters/CurrencyMap.d.ts.map +1 -1
- package/lib/components/helpers/formatters/CurrencyMap.js.map +1 -1
- package/lib/components/helpers/formatters/Date.d.ts +4 -4
- package/lib/components/helpers/formatters/Date.d.ts.map +1 -1
- package/lib/components/helpers/formatters/Date.js +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 +4 -5
- package/lib/components/helpers/formatters/common.js.map +1 -1
- package/lib/components/helpers/formatters/index.d.ts +11 -11
- package/lib/components/helpers/formatters/index.d.ts.map +1 -1
- package/lib/components/helpers/formatters/index.js.map +1 -1
- package/lib/components/helpers/reactContextHelpers.d.ts +3 -2
- package/lib/components/helpers/reactContextHelpers.d.ts.map +1 -1
- package/lib/components/helpers/reactContextHelpers.js.map +1 -1
- package/lib/components/helpers/simpleTableHelpers.d.ts +5 -3
- package/lib/components/helpers/simpleTableHelpers.d.ts.map +1 -1
- package/lib/components/helpers/simpleTableHelpers.js +10 -5
- package/lib/components/helpers/simpleTableHelpers.js.map +1 -1
- package/lib/components/helpers/state-utils.d.ts +4 -0
- package/lib/components/helpers/state-utils.d.ts.map +1 -0
- package/lib/components/helpers/state-utils.js +36 -0
- package/lib/components/helpers/state-utils.js.map +1 -0
- package/lib/components/helpers/template-utils.d.ts +7 -3
- package/lib/components/helpers/template-utils.d.ts.map +1 -1
- package/lib/components/helpers/template-utils.js.map +1 -1
- package/lib/components/helpers/utils.d.ts +1 -1
- package/lib/components/helpers/utils.d.ts.map +1 -1
- package/lib/components/helpers/utils.js +9 -3
- 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.map +1 -1
- package/lib/components/infra/ActionButtons/ActionButtons.d.ts +6 -13
- package/lib/components/infra/ActionButtons/ActionButtons.d.ts.map +1 -1
- package/lib/components/infra/ActionButtons/ActionButtons.js +5 -15
- package/lib/components/infra/ActionButtons/ActionButtons.js.map +1 -1
- package/lib/components/infra/Assignment/Assignment.d.ts +9 -14
- package/lib/components/infra/Assignment/Assignment.d.ts.map +1 -1
- package/lib/components/infra/Assignment/Assignment.js +32 -33
- package/lib/components/infra/Assignment/Assignment.js.map +1 -1
- package/lib/components/infra/AssignmentCard/AssignmentCard.d.ts +8 -14
- package/lib/components/infra/AssignmentCard/AssignmentCard.d.ts.map +1 -1
- package/lib/components/infra/AssignmentCard/AssignmentCard.js +3 -16
- package/lib/components/infra/AssignmentCard/AssignmentCard.js.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts +1 -21
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +53 -52
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/helpers.d.ts +12 -12
- package/lib/components/infra/Containers/FlowContainer/helpers.d.ts.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/helpers.js +17 -16
- package/lib/components/infra/Containers/FlowContainer/helpers.js.map +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts +8 -17
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js +22 -24
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js.map +1 -1
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts +9 -22
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.js +7 -22
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.js.map +1 -1
- package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts +9 -19
- package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts.map +1 -1
- package/lib/components/infra/DashboardFilter/DashboardFilter.js +2 -16
- 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 +1 -1
- package/lib/components/infra/DashboardFilter/filterUtils.js.map +1 -1
- package/lib/components/infra/DeferLoad/DeferLoad.d.ts +1 -14
- package/lib/components/infra/DeferLoad/DeferLoad.d.ts.map +1 -1
- package/lib/components/infra/DeferLoad/DeferLoad.js +13 -15
- package/lib/components/infra/DeferLoad/DeferLoad.js.map +1 -1
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts +5 -12
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.js +9 -16
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.js.map +1 -1
- package/lib/components/infra/MultiStep/MultiStep.d.ts +11 -17
- package/lib/components/infra/MultiStep/MultiStep.d.ts.map +1 -1
- package/lib/components/infra/MultiStep/MultiStep.js +6 -20
- package/lib/components/infra/MultiStep/MultiStep.js.map +1 -1
- package/lib/components/infra/NavBar/NavBar.d.ts +8 -16
- package/lib/components/infra/NavBar/NavBar.d.ts.map +1 -1
- package/lib/components/infra/NavBar/NavBar.js +9 -20
- package/lib/components/infra/NavBar/NavBar.js.map +1 -1
- package/lib/components/infra/Reference/Reference.d.ts +8 -17
- package/lib/components/infra/Reference/Reference.d.ts.map +1 -1
- package/lib/components/infra/Reference/Reference.js +1 -15
- package/lib/components/infra/Reference/Reference.js.map +1 -1
- package/lib/components/infra/Region/Region.d.ts +4 -7
- package/lib/components/infra/Region/Region.d.ts.map +1 -1
- package/lib/components/infra/Region/Region.js +0 -4
- package/lib/components/infra/Region/Region.js.map +1 -1
- package/lib/components/infra/RootContainer/RootContainer.d.ts +1 -21
- package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
- package/lib/components/infra/RootContainer/RootContainer.js +16 -36
- package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
- package/lib/components/infra/Stages/Stages.d.ts +5 -8
- package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
- package/lib/components/infra/Stages/Stages.js +3 -7
- package/lib/components/infra/Stages/Stages.js.map +1 -1
- package/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.d.ts.map +1 -1
- package/lib/components/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.js.map +1 -1
- package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.d.ts +4 -10
- package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.d.ts.map +1 -1
- package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.js +4 -9
- package/lib/components/infra/VerticalTabs/VerticalTabs/VerticalTabs.js.map +1 -1
- package/lib/components/infra/View/View.d.ts +13 -16
- package/lib/components/infra/View/View.d.ts.map +1 -1
- package/lib/components/infra/View/View.js +8 -54
- package/lib/components/infra/View/View.js.map +1 -1
- package/lib/components/template/AppShell/AppShell.d.ts +20 -15
- package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/template/AppShell/AppShell.js +17 -29
- package/lib/components/template/AppShell/AppShell.js.map +1 -1
- package/lib/components/template/BannerPage/BannerPage.d.ts +11 -23
- package/lib/components/template/BannerPage/BannerPage.d.ts.map +1 -1
- package/lib/components/template/BannerPage/BannerPage.js +4 -22
- package/lib/components/template/BannerPage/BannerPage.js.map +1 -1
- package/lib/components/template/CaseSummary/CaseSummary.d.ts +5 -7
- package/lib/components/template/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/components/template/CaseSummary/CaseSummary.js +6 -6
- package/lib/components/template/CaseSummary/CaseSummary.js.map +1 -1
- package/lib/components/template/CaseView/CaseView.d.ts +10 -22
- package/lib/components/template/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/template/CaseView/CaseView.js +41 -45
- package/lib/components/template/CaseView/CaseView.js.map +1 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts +8 -13
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts.map +1 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js +9 -16
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js.map +1 -1
- package/lib/components/template/Confirmation/Confirmation.d.ts +10 -16
- package/lib/components/template/Confirmation/Confirmation.d.ts.map +1 -1
- package/lib/components/template/Confirmation/Confirmation.js +12 -23
- package/lib/components/template/Confirmation/Confirmation.js.map +1 -1
- package/lib/components/template/DataReference/DataReference.d.ts +1 -31
- package/lib/components/template/DataReference/DataReference.d.ts.map +1 -1
- package/lib/components/template/DataReference/DataReference.js +41 -48
- package/lib/components/template/DataReference/DataReference.js.map +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.d.ts +1 -11
- package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.js +18 -15
- package/lib/components/template/DefaultForm/DefaultForm.js.map +1 -1
- package/lib/components/template/DefaultForm/utils/index.d.ts +3 -0
- package/lib/components/template/DefaultForm/utils/index.d.ts.map +1 -0
- package/lib/components/template/DefaultForm/utils/index.js +27 -0
- package/lib/components/template/DefaultForm/utils/index.js.map +1 -0
- package/lib/components/template/Details/Details/Details.d.ts +1 -16
- package/lib/components/template/Details/Details/Details.d.ts.map +1 -1
- package/lib/components/template/Details/Details/Details.js +10 -15
- package/lib/components/template/Details/Details/Details.js.map +1 -1
- package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.d.ts +7 -15
- package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.d.ts.map +1 -1
- package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.js +1 -13
- package/lib/components/template/Details/DetailsSubTabs/DetailsSubTabs.js.map +1 -1
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts +1 -16
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.d.ts.map +1 -1
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js +14 -16
- package/lib/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.js.map +1 -1
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts +1 -16
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.d.ts.map +1 -1
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js +14 -16
- package/lib/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.js.map +1 -1
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts +12 -19
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts.map +1 -1
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js +7 -21
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js.map +1 -1
- package/lib/components/template/InlineDashboard/InlineDashboard.d.ts +7 -7
- package/lib/components/template/InlineDashboard/InlineDashboard.d.ts.map +1 -1
- package/lib/components/template/InlineDashboard/InlineDashboard.js +0 -5
- package/lib/components/template/InlineDashboard/InlineDashboard.js.map +1 -1
- package/lib/components/template/InlineDashboardPage/InlineDashboardPage.d.ts +8 -15
- package/lib/components/template/InlineDashboardPage/InlineDashboardPage.d.ts.map +1 -1
- package/lib/components/template/InlineDashboardPage/InlineDashboardPage.js +5 -14
- package/lib/components/template/InlineDashboardPage/InlineDashboardPage.js.map +1 -1
- package/lib/components/template/ListPage/ListPage.d.ts +5 -13
- package/lib/components/template/ListPage/ListPage.d.ts.map +1 -1
- package/lib/components/template/ListPage/ListPage.js +6 -10
- package/lib/components/template/ListPage/ListPage.js.map +1 -1
- package/lib/components/template/ListView/DefaultViewMeta.d.ts +1 -90
- package/lib/components/template/ListView/DefaultViewMeta.d.ts.map +1 -1
- package/lib/components/template/ListView/DefaultViewMeta.js.map +1 -1
- package/lib/components/template/ListView/ListView.d.ts +1 -9
- package/lib/components/template/ListView/ListView.d.ts.map +1 -1
- package/lib/components/template/ListView/ListView.js +96 -100
- 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 +0 -1
- package/lib/components/template/ListView/hooks.js.map +1 -1
- package/lib/components/template/ListView/utils.d.ts +72 -16
- package/lib/components/template/ListView/utils.d.ts.map +1 -1
- package/lib/components/template/ListView/utils.js +143 -3
- package/lib/components/template/ListView/utils.js.map +1 -1
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts +9 -13
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts.map +1 -1
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js +2 -13
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWide/NarrowWide.d.ts +10 -1
- 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 -16
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.d.ts.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js +14 -16
- package/lib/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.js.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.d.ts +5 -1
- 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 +7 -14
- package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.d.ts.map +1 -1
- package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.js +4 -13
- package/lib/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.js.map +1 -1
- package/lib/components/template/OneColumn/OneColumn/OneColumn.d.ts +4 -7
- package/lib/components/template/OneColumn/OneColumn/OneColumn.d.ts.map +1 -1
- package/lib/components/template/OneColumn/OneColumn/OneColumn.js +0 -5
- package/lib/components/template/OneColumn/OneColumn/OneColumn.js.map +1 -1
- package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.d.ts +4 -8
- package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.d.ts.map +1 -1
- package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.js +3 -6
- package/lib/components/template/OneColumn/OneColumnPage/OneColumnPage.js.map +1 -1
- package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.d.ts +4 -7
- package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.d.ts.map +1 -1
- package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.js +0 -5
- package/lib/components/template/OneColumn/OneColumnTab/OneColumnTab.js.map +1 -1
- package/lib/components/template/PromotedFilters/PromotedFilters.d.ts +1 -15
- package/lib/components/template/PromotedFilters/PromotedFilters.d.ts.map +1 -1
- package/lib/components/template/PromotedFilters/PromotedFilters.js +17 -13
- package/lib/components/template/PromotedFilters/PromotedFilters.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js +57 -5
- package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts +18 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +5 -5
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts +1 -29
- package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js +22 -28
- package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js.map +1 -1
- package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.d.ts +14 -26
- package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.d.ts.map +1 -1
- package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.js +5 -26
- package/lib/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.js.map +1 -1
- package/lib/components/template/SubTabs/SubTabs.d.ts +4 -10
- package/lib/components/template/SubTabs/SubTabs.d.ts.map +1 -1
- package/lib/components/template/SubTabs/SubTabs.js +1 -8
- package/lib/components/template/SubTabs/SubTabs.js.map +1 -1
- package/lib/components/template/SubTabs/tabUtils.d.ts.map +1 -1
- package/lib/components/template/SubTabs/tabUtils.js.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.d.ts +5 -11
- package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.d.ts.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.js +1 -12
- package/lib/components/template/TwoColumn/TwoColumn/TwoColumn.js.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.d.ts +4 -8
- package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.d.ts.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.js +3 -6
- package/lib/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.js.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.d.ts +5 -11
- package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.d.ts.map +1 -1
- package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.js +1 -9
- package/lib/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.js.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.d.ts +10 -1
- package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.d.ts.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.js +1 -1
- package/lib/components/template/WideNarrow/WideNarrow/WideNarrow.js.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts +1 -16
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.d.ts.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js +31 -23
- package/lib/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.js.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.d.ts +5 -1
- 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 +7 -14
- package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.d.ts.map +1 -1
- package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.js +4 -14
- package/lib/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.js.map +1 -1
- package/lib/components/template/WssNavBar/WssNavBar.d.ts +17 -1
- package/lib/components/template/WssNavBar/WssNavBar.d.ts.map +1 -1
- package/lib/components/template/WssNavBar/WssNavBar.js +2 -2
- package/lib/components/template/WssNavBar/WssNavBar.js.map +1 -1
- package/lib/components/widget/AppAnnouncement/AppAnnouncement.d.ts +8 -17
- package/lib/components/widget/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
- package/lib/components/widget/AppAnnouncement/AppAnnouncement.js +4 -19
- package/lib/components/widget/AppAnnouncement/AppAnnouncement.js.map +1 -1
- package/lib/components/widget/Attachment/Attachment.css +15 -3
- package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
- package/lib/components/widget/Attachment/Attachment.js +44 -32
- package/lib/components/widget/Attachment/Attachment.js.map +1 -1
- package/lib/components/widget/CaseHistory/CaseHistory.d.ts +4 -7
- package/lib/components/widget/CaseHistory/CaseHistory.d.ts.map +1 -1
- package/lib/components/widget/CaseHistory/CaseHistory.js +4 -8
- package/lib/components/widget/CaseHistory/CaseHistory.js.map +1 -1
- package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.d.ts +8 -1
- package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.d.ts.map +1 -1
- package/lib/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.js.map +1 -1
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts +5 -1
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts.map +1 -1
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.js +33 -23
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.js.map +1 -1
- package/lib/components/widget/Followers/Followers.d.ts +4 -5
- package/lib/components/widget/Followers/Followers.d.ts.map +1 -1
- package/lib/components/widget/Followers/Followers.js +3 -10
- package/lib/components/widget/Followers/Followers.js.map +1 -1
- package/lib/components/widget/QuickCreate/QuickCreate.d.ts.map +1 -1
- package/lib/components/widget/QuickCreate/QuickCreate.js +12 -4
- package/lib/components/widget/QuickCreate/QuickCreate.js.map +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.d.ts +7 -1
- package/lib/components/widget/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.js +2 -2
- package/lib/components/widget/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/widget/SummaryList/SummaryList.d.ts +7 -1
- package/lib/components/widget/SummaryList/SummaryList.d.ts.map +1 -1
- package/lib/components/widget/SummaryList/SummaryList.js +5 -2
- package/lib/components/widget/SummaryList/SummaryList.js.map +1 -1
- package/lib/components/widget/ToDo/ToDo.d.ts +13 -27
- package/lib/components/widget/ToDo/ToDo.d.ts.map +1 -1
- package/lib/components/widget/ToDo/ToDo.js +35 -67
- package/lib/components/widget/ToDo/ToDo.js.map +1 -1
- package/lib/components_map.d.ts +3 -3
- package/lib/components_map.d.ts.map +1 -1
- package/lib/components_map.js +819 -818
- package/lib/components_map.js.map +1 -1
- package/lib/doc/KeyReleaseUpdates.md +65 -9
- package/lib/hooks/index.d.ts +4 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/index.js +4 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/useAfterInitialEffect.d.ts +9 -0
- package/lib/hooks/useAfterInitialEffect.d.ts.map +1 -0
- package/lib/hooks/useAfterInitialEffect.js +16 -0
- package/lib/hooks/useAfterInitialEffect.js.map +1 -0
- package/lib/hooks/useConsolidatedRef.d.ts +9 -0
- package/lib/hooks/useConsolidatedRef.d.ts.map +1 -0
- package/lib/hooks/useConsolidatedRef.js +30 -0
- package/lib/hooks/useConsolidatedRef.js.map +1 -0
- package/lib/hooks/useUID.d.ts +8 -0
- package/lib/hooks/useUID.d.ts.map +1 -0
- package/lib/hooks/useUID.js +14 -0
- package/lib/hooks/useUID.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/sdk-pega-component-map.d.ts +15 -1
- package/lib/sdk-pega-component-map.js +15 -1
- package/lib/sdk-pega-component-map.js.map +1 -1
- package/lib/types/PConnProps.d.ts +42 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/designSystemExtension/RichTextEditor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export { default } from './RichTextEditor';\n"]}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './WssQuickCreate.css';
|
|
3
|
-
|
|
3
|
+
interface WssQuickCreateProps {
|
|
4
|
+
heading: string;
|
|
5
|
+
actions?: Array<any>;
|
|
6
|
+
}
|
|
7
|
+
export default function WssQuickCreate(props: WssQuickCreateProps): JSX.Element;
|
|
8
|
+
export {};
|
|
4
9
|
//# sourceMappingURL=WssQuickCreate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WssQuickCreate.d.ts","sourceRoot":"","sources":["../../../../src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx"],"names":[],"mappings":";AAEA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"WssQuickCreate.d.ts","sourceRoot":"","sources":["../../../../src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx"],"names":[],"mappings":";AAEA,OAAO,sBAAsB,CAAC;AAI9B,UAAU,mBAAmB;IAE3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;CACrB;AAGD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,eAuBhE"}
|
|
@@ -4,8 +4,8 @@ import './WssQuickCreate.css';
|
|
|
4
4
|
export default function WssQuickCreate(props) {
|
|
5
5
|
const { heading, actions } = props;
|
|
6
6
|
return (React.createElement("div", null,
|
|
7
|
-
React.createElement("h1", { className: 'quick-link-heading' }, heading),
|
|
8
|
-
React.createElement("ul", { className: 'quick-link-ul-list' }, actions &&
|
|
7
|
+
React.createElement("h1", { id: "quick-links-heading", className: 'quick-link-heading' }, heading),
|
|
8
|
+
React.createElement("ul", { id: "quick-links", className: 'quick-link-ul-list' }, actions &&
|
|
9
9
|
actions.map(element => {
|
|
10
10
|
return (React.createElement("li", { className: 'quick-link-list', key: element.label },
|
|
11
11
|
React.createElement(Button, { className: 'quick-link-button', onClick: element.onClick },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WssQuickCreate.js","sourceRoot":"","sources":["../../../../src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"WssQuickCreate.js","sourceRoot":"","sources":["../../../../src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,sBAAsB,CAAC;AAW9B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAA0B;IAC/D,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAEnC,OAAO,CACL;QACE,4BAAI,EAAE,EAAC,qBAAqB,EAAC,SAAS,EAAC,oBAAoB,IAAE,OAAO,CAAM;QAC1E,4BAAI,EAAE,EAAC,aAAa,EAAC,SAAS,EAAC,oBAAoB,IAChD,OAAO;YACN,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;gBACpB,OAAO,CACP,4BAAI,SAAS,EAAC,iBAAiB,EAAC,GAAG,EAAE,OAAO,CAAC,KAAK;oBAChD,oBAAC,MAAM,IAAC,SAAS,EAAC,mBAAmB,EAAC,OAAO,EAAE,OAAO,CAAC,OAAO;wBAC5D,8BAAM,SAAS,EAAC,wBAAwB;4BACrC,OAAO,CAAC,IAAI,IAAI,6BAAK,SAAS,EAAC,iBAAiB,EAAC,GAAG,EAAE,OAAO,CAAC,IAAI,GAAG;4BACtE,kCAAO,OAAO,CAAC,KAAK,CAAQ,CACvB,CACA,CACN,CACJ,CAAC;YACJ,CAAC,CAAC,CACD,CACD,CACP,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Button } from '@material-ui/core';\nimport './WssQuickCreate.css';\n\n// WssQuickCreate is one of the few components that does NOT have getPConnect.\n// So, no need to extend PConnProps\ninterface WssQuickCreateProps {\n // If any, enter additional props that only exist on this component\n heading: string,\n actions?: Array<any>\n}\n\n\nexport default function WssQuickCreate(props: WssQuickCreateProps) {\n const { heading, actions } = props;\n\n return (\n <div>\n <h1 id=\"quick-links-heading\" className='quick-link-heading'>{heading}</h1>\n <ul id=\"quick-links\" className='quick-link-ul-list'>\n {actions &&\n actions.map(element => {\n return (\n <li className='quick-link-list' key={element.label}>\n <Button className='quick-link-button' onClick={element.onClick}>\n <span className='quick-link-button-span'>\n {element.icon && <img className='quick-link-icon' src={element.icon}/>}\n <span>{element.label}</span>\n </span>\n </Button>\n </li>\n );\n })}\n </ul>\n </div>\n );\n}\n"]}
|
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import type { PConnFieldProps } from '../../../types/PConnProps';
|
|
3
|
+
interface AutoCompleteProps extends PConnFieldProps {
|
|
4
|
+
displayMode?: string;
|
|
5
|
+
deferDatasource?: boolean;
|
|
6
|
+
datasourceMetadata?: any;
|
|
7
|
+
status?: string;
|
|
8
|
+
onRecordChange?: any;
|
|
9
|
+
additionalProps?: object;
|
|
10
|
+
listType: string;
|
|
11
|
+
parameters?: any;
|
|
12
|
+
datasource: any;
|
|
13
|
+
columns: Array<any>;
|
|
14
|
+
}
|
|
15
|
+
export default function AutoComplete(props: AutoCompleteProps): JSX.Element;
|
|
16
|
+
export {};
|
|
3
17
|
//# sourceMappingURL=AutoComplete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoComplete.d.ts","sourceRoot":"","sources":["../../../../src/components/field/AutoComplete/AutoComplete.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AutoComplete.d.ts","sourceRoot":"","sources":["../../../../src/components/field/AutoComplete/AutoComplete.tsx"],"names":[],"mappings":";AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AA8BjE,UAAU,iBAAkB,SAAQ,eAAe;IAEjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,GAAG,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,UAAU,EAAE,GAAG,CAAC;IAChB,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,iBAAiB,eAuK5D"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { TextField } from '@material-ui/core';
|
|
3
3
|
import Autocomplete from '@material-ui/lab/Autocomplete';
|
|
4
|
-
import Utils from '../../helpers/utils';
|
|
5
|
-
import TextInput from '../TextInput';
|
|
6
4
|
import isDeepEqual from 'fast-deep-equal/react';
|
|
5
|
+
import Utils from '../../helpers/utils';
|
|
7
6
|
import { getDataPage } from '../../helpers/data_page';
|
|
8
7
|
import handleEvent from '../../helpers/event-utils';
|
|
9
|
-
import
|
|
10
|
-
const preProcessColumns = columnList => {
|
|
11
|
-
return columnList.map(col => {
|
|
8
|
+
import { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';
|
|
9
|
+
const preProcessColumns = (columnList) => {
|
|
10
|
+
return columnList.map((col) => {
|
|
12
11
|
const tempColObj = { ...col };
|
|
13
12
|
tempColObj.value = col.value && col.value.startsWith('.') ? col.value.substring(1) : col.value;
|
|
14
13
|
return tempColObj;
|
|
15
14
|
});
|
|
16
15
|
};
|
|
17
|
-
const getDisplayFieldsMetaData = columnList => {
|
|
18
|
-
const displayColumns = columnList.filter(col => col.display === 'true');
|
|
16
|
+
const getDisplayFieldsMetaData = (columnList) => {
|
|
17
|
+
const displayColumns = columnList.filter((col) => col.display === 'true');
|
|
19
18
|
const metaDataObj = { key: '', primary: '', secondary: [] };
|
|
20
|
-
const keyCol = columnList.filter(col => col.key === 'true');
|
|
19
|
+
const keyCol = columnList.filter((col) => col.key === 'true');
|
|
21
20
|
metaDataObj.key = keyCol.length > 0 ? keyCol[0].value : 'auto';
|
|
22
21
|
for (let index = 0; index < displayColumns.length; index += 1) {
|
|
23
22
|
if (displayColumns[index].primary === 'true') {
|
|
@@ -30,6 +29,9 @@ const getDisplayFieldsMetaData = columnList => {
|
|
|
30
29
|
return metaDataObj;
|
|
31
30
|
};
|
|
32
31
|
export default function AutoComplete(props) {
|
|
32
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
33
|
+
const TextInput = getComponentFromMap('TextInput');
|
|
34
|
+
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
33
35
|
const { getPConnect, label, required, placeholder, value = '', validatemessage, readOnly, testId, displayMode, deferDatasource, datasourceMetadata, status, helperText, hideLabel, onRecordChange } = props;
|
|
34
36
|
const context = getPConnect().getContextName();
|
|
35
37
|
let { listType, parameters, datasource = [], columns = [] } = props;
|
|
@@ -47,7 +49,7 @@ export default function AutoComplete(props) {
|
|
|
47
49
|
}
|
|
48
50
|
const flattenParameters = (params = {}) => {
|
|
49
51
|
const flatParams = {};
|
|
50
|
-
Object.keys(params).forEach(key => {
|
|
52
|
+
Object.keys(params).forEach((key) => {
|
|
51
53
|
const { name, value: theVal } = params[key];
|
|
52
54
|
flatParams[name] = theVal;
|
|
53
55
|
});
|
|
@@ -82,7 +84,7 @@ export default function AutoComplete(props) {
|
|
|
82
84
|
columns = preProcessColumns(columns);
|
|
83
85
|
useEffect(() => {
|
|
84
86
|
if (listType === 'associated') {
|
|
85
|
-
setOptions(Utils.getOptionList(props, getPConnect().getDataObject()));
|
|
87
|
+
setOptions(Utils.getOptionList(props, getPConnect().getDataObject(context)));
|
|
86
88
|
}
|
|
87
89
|
}, [theDatasource]);
|
|
88
90
|
useEffect(() => {
|
|
@@ -90,7 +92,7 @@ export default function AutoComplete(props) {
|
|
|
90
92
|
getDataPage(datasource, parameters, context).then((results) => {
|
|
91
93
|
const optionsData = [];
|
|
92
94
|
const displayColumn = getDisplayFieldsMetaData(columns);
|
|
93
|
-
results?.forEach(element => {
|
|
95
|
+
results?.forEach((element) => {
|
|
94
96
|
const val = element[displayColumn.primary]?.toString();
|
|
95
97
|
const obj = {
|
|
96
98
|
key: element[displayColumn.key] || element.pyGUID,
|
|
@@ -106,10 +108,10 @@ export default function AutoComplete(props) {
|
|
|
106
108
|
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value });
|
|
107
109
|
}
|
|
108
110
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
109
|
-
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value, variant:
|
|
111
|
+
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value, variant: "stacked" });
|
|
110
112
|
}
|
|
111
113
|
if (value) {
|
|
112
|
-
const index = options?.findIndex(element => element.key === value);
|
|
114
|
+
const index = options?.findIndex((element) => element.key === value);
|
|
113
115
|
if (index > -1) {
|
|
114
116
|
selectedValue = options[index].value;
|
|
115
117
|
}
|
|
@@ -128,7 +130,7 @@ export default function AutoComplete(props) {
|
|
|
128
130
|
setInputValue(newInputValue);
|
|
129
131
|
};
|
|
130
132
|
if (readOnly) {
|
|
131
|
-
const theValAsString = options?.find(opt => opt.key === value)?.value;
|
|
133
|
+
const theValAsString = options?.find((opt) => opt.key === value)?.value;
|
|
132
134
|
return React.createElement(TextInput, { ...props, value: theValAsString });
|
|
133
135
|
}
|
|
134
136
|
// Need to use both getOptionLabel and getOptionSelected to map our
|
|
@@ -137,6 +139,6 @@ export default function AutoComplete(props) {
|
|
|
137
139
|
return option.value ? option.value : '';
|
|
138
140
|
}, getOptionSelected: (option) => {
|
|
139
141
|
return option.value ? option.value : '';
|
|
140
|
-
}, fullWidth: true, onChange: handleChange, value: selectedValue, inputValue: inputValue || selectedValue, onInputChange: handleInputValue, renderInput: params => (React.createElement(TextField, { ...params, fullWidth: true, variant:
|
|
142
|
+
}, fullWidth: true, onChange: handleChange, value: selectedValue, inputValue: inputValue || selectedValue, onInputChange: handleInputValue, renderInput: (params) => (React.createElement(TextField, { ...params, fullWidth: true, variant: "outlined", helperText: helperTextToDisplay, placeholder: placeholder, size: "small", required: required, error: status === 'error', label: label, "data-test-id": testId })) }));
|
|
141
143
|
}
|
|
142
144
|
//# sourceMappingURL=AutoComplete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoComplete.js","sourceRoot":"","sources":["../../../../src/components/field/AutoComplete/AutoComplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,S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K,KAAK,CAAC,EAAE,KAAK,CAAC;QACtE,OAAO,oBAAC,SAAS,OAAK,KAAK,EAAE,KAAK,EAAE,cAAc,GAAI,CAAC;KACxD;IACD,mEAAmE;IACnE,oDAAoD;IACpD,OAAO,CACL,oBAAC,YAAY,IACX,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,MAAe,EAAE,EAAE;YAClC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,CAAC,EACD,iBAAiB,EAAE,CAAC,MAAW,EAAE,EAAE;YACjC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,CAAC,EACD,SAAS,QACT,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,aAAa,EACpB,UAAU,EAAE,UAAU,IAAI,aAAa,EACvC,aAAa,EAAE,gBAAgB,EAC/B,WAAW,EAAE,MAAM,CAAC,EAAE,CAAC,CACrB,oBAAC,SAAS,OACJ,MAAM,EACV,SAAS,QACT,OAAO,EAAC,UAAU,EAClB,UAAU,EAAE,mBAAmB,EAC/B,WAAW,EAAE,WAAW,EACxB,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,KAAK,OAAO,EACzB,KAAK,EAAE,KAAK,kBACE,MAAM,GACpB,CACH,GACD,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { TextField } from '@material-ui/core';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport Utils from '../../helpers/utils';\nimport TextInput from '../TextInput';\nimport isDeepEqual from 'fast-deep-equal/react';\nimport { getDataPage } from '../../helpers/data_page';\nimport handleEvent from '../../helpers/event-utils';\nimport FieldValueList from '../../designSystemExtension/FieldValueList';\n\ninterface IOption {\n key: string;\n value: string;\n}\n\nconst preProcessColumns = columnList => {\n return columnList.map(col => {\n const tempColObj = { ...col };\n tempColObj.value = col.value && col.value.startsWith('.') ? col.value.substring(1) : col.value;\n return tempColObj;\n });\n};\n\nconst getDisplayFieldsMetaData = columnList => {\n const displayColumns = columnList.filter(col => col.display === 'true');\n const metaDataObj: any = { key: '', primary: '', secondary: [] };\n const keyCol = columnList.filter(col => col.key === 'true');\n metaDataObj.key = keyCol.length > 0 ? keyCol[0].value : 'auto';\n for (let index = 0; index < displayColumns.length; index += 1) {\n if (displayColumns[index].primary === 'true') {\n metaDataObj.primary = displayColumns[index].value;\n } else {\n metaDataObj.secondary.push(displayColumns[index].value);\n }\n }\n return metaDataObj;\n};\n\nexport default function AutoComplete(props) {\n const {\n getPConnect,\n label,\n required,\n placeholder,\n value = '',\n validatemessage,\n readOnly,\n testId,\n displayMode,\n deferDatasource,\n datasourceMetadata,\n status,\n helperText,\n hideLabel,\n onRecordChange\n } = props;\n const context = getPConnect().getContextName();\n let { listType, parameters, datasource = [], columns = [] } = props;\n const [inputValue, setInputValue] = useState('');\n const [options, setOptions] = useState<Array<IOption>>([]);\n const [theDatasource, setDatasource] = useState(null);\n let selectedValue: any = '';\n const helperTextToDisplay = validatemessage || helperText;\n\n const thePConn = getPConnect();\n const actionsApi = thePConn.getActionsApi();\n const propName = thePConn.getStateProps().value;\n\n if (!isDeepEqual(datasource, theDatasource)) {\n // inbound datasource is different, so update theDatasource (to trigger useEffect)\n setDatasource(datasource);\n }\n\n const flattenParameters = (params = {}) => {\n const flatParams = {};\n Object.keys(params).forEach(key => {\n const { name, value: theVal } = params[key];\n flatParams[name] = theVal;\n });\n\n return flatParams;\n };\n\n // convert associated to datapage listtype and transform props\n // Process deferDatasource when datapage name is present. WHhen tableType is promptList / localList\n if (deferDatasource && datasourceMetadata?.datasource?.name) {\n listType = 'datapage';\n datasource = datasourceMetadata.datasource.name;\n parameters = flattenParameters(datasourceMetadata?.datasource?.parameters);\n const displayProp = datasourceMetadata.datasource.propertyForDisplayText.startsWith('@P')\n ? datasourceMetadata.datasource.propertyForDisplayText.substring(3)\n : datasourceMetadata.datasource.propertyForDisplayText;\n const valueProp = datasourceMetadata.datasource.propertyForValue.startsWith('@P')\n ? datasourceMetadata.datasource.propertyForValue.substring(3)\n : datasourceMetadata.datasource.propertyForValue;\n columns = [\n {\n key: 'true',\n setProperty: 'Associated property',\n value: valueProp\n },\n {\n display: 'true',\n primary: 'true',\n useForSearch: true,\n value: displayProp\n }\n ];\n }\n columns = preProcessColumns(columns);\n\n useEffect(() => {\n if (listType === 'associated') {\n setOptions(Utils.getOptionList(props, getPConnect().getDataObject()));\n }\n }, [theDatasource]);\n\n useEffect(() => {\n if (!displayMode && listType !== 'associated') {\n getDataPage(datasource, parameters, context).then((results: any) => {\n const optionsData: Array<any> = [];\n const displayColumn = getDisplayFieldsMetaData(columns);\n results?.forEach(element => {\n const val = element[displayColumn.primary]?.toString();\n const obj = {\n key: element[displayColumn.key] || element.pyGUID,\n value: val\n };\n optionsData.push(obj);\n });\n setOptions(optionsData);\n });\n }\n }, []);\n\n if (displayMode === 'LABELS_LEFT') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;\n }\n\n if (value) {\n const index = options?.findIndex(element => element.key === value);\n if (index > -1) {\n selectedValue = options[index].value;\n } else {\n selectedValue = value;\n }\n }\n\n const handleChange = (event: object, newValue) => {\n const val = newValue ? newValue.key : '';\n handleEvent(actionsApi, 'changeNblur', propName, val);\n if (onRecordChange) {\n onRecordChange(event);\n }\n };\n\n const handleInputValue = (event, newInputValue) => {\n setInputValue(newInputValue);\n };\n\n if (readOnly) {\n const theValAsString = options?.find(opt => opt.key === value)?.value;\n return <TextInput {...props} value={theValAsString} />;\n }\n // Need to use both getOptionLabel and getOptionSelected to map our\n // key/value structure to what Autocomplete expects\n return (\n <Autocomplete\n options={options}\n getOptionLabel={(option: IOption) => {\n return option.value ? option.value : '';\n }}\n getOptionSelected={(option: any) => {\n return option.value ? option.value : '';\n }}\n fullWidth\n onChange={handleChange}\n value={selectedValue}\n inputValue={inputValue || selectedValue}\n onInputChange={handleInputValue}\n renderInput={params => (\n <TextField\n {...params}\n fullWidth\n variant='outlined'\n helperText={helperTextToDisplay}\n placeholder={placeholder}\n size='small'\n required={required}\n error={status === 'error'}\n label={label}\n data-test-id={testId}\n />\n )}\n />\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AutoComplete.js","sourceRoot":"","sources":["../../../../src/components/field/AutoComplete/AutoComplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAQhF,MAAM,iBAAiB,GAAG,CAAC,UAAU,EAAE,EAAE;IACvC,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAC5B,MAAM,UAAU,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;QAC9B,UAAU,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;QAC/F,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,wBAA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AC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,CAAC,EACD,SAAS,QACT,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,aAAa,EACpB,UAAU,EAAE,UAAU,IAAI,aAAa,EACvC,aAAa,EAAE,gBAAgB,EAC/B,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,oBAAC,SAAS,OACJ,MAAM,EACV,SAAS,QACT,OAAO,EAAC,UAAU,EAClB,UAAU,EAAE,mBAAmB,EAC/B,WAAW,EAAE,WAAW,EACxB,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,KAAK,OAAO,EACzB,KAAK,EAAE,KAAK,kBACE,MAAM,GACpB,CACH,GACD,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { TextField } from '@material-ui/core';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport isDeepEqual from 'fast-deep-equal/react';\nimport Utils from '../../helpers/utils';\nimport { getDataPage } from '../../helpers/data_page';\nimport handleEvent from '../../helpers/event-utils';\nimport { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';\nimport type { PConnFieldProps } from '../../../types/PConnProps';\n\ninterface IOption {\n key: string;\n value: string;\n}\n\nconst preProcessColumns = (columnList) => {\n return columnList.map((col) => {\n const tempColObj = { ...col };\n tempColObj.value = col.value && col.value.startsWith('.') ? col.value.substring(1) : col.value;\n return tempColObj;\n });\n};\n\nconst getDisplayFieldsMetaData = (columnList) => {\n const displayColumns = columnList.filter((col) => col.display === 'true');\n const metaDataObj: any = { key: '', primary: '', secondary: [] };\n const keyCol = columnList.filter((col) => col.key === 'true');\n metaDataObj.key = keyCol.length > 0 ? keyCol[0].value : 'auto';\n for (let index = 0; index < displayColumns.length; index += 1) {\n if (displayColumns[index].primary === 'true') {\n metaDataObj.primary = displayColumns[index].value;\n } else {\n metaDataObj.secondary.push(displayColumns[index].value);\n }\n }\n return metaDataObj;\n};\n\ninterface AutoCompleteProps extends PConnFieldProps {\n // If any, enter additional props that only exist on AutoComplete here'\n displayMode?: string;\n deferDatasource?: boolean;\n datasourceMetadata?: any;\n status?: string;\n onRecordChange?: any;\n additionalProps?: object;\n listType: string;\n parameters?: any;\n datasource: any;\n columns: Array<any>;\n}\n\nexport default function AutoComplete(props: AutoCompleteProps) {\n // Get emitted components from map (so we can get any override that may exist)\n const TextInput = getComponentFromMap('TextInput');\n const FieldValueList = getComponentFromMap('FieldValueList');\n\n const {\n getPConnect,\n label,\n required,\n placeholder,\n value = '',\n validatemessage,\n readOnly,\n testId,\n displayMode,\n deferDatasource,\n datasourceMetadata,\n status,\n helperText,\n hideLabel,\n onRecordChange\n } = props;\n\n const context = getPConnect().getContextName();\n let { listType, parameters, datasource = [], columns = [] } = props;\n const [inputValue, setInputValue] = useState('');\n const [options, setOptions] = useState<Array<IOption>>([]);\n const [theDatasource, setDatasource] = useState(null);\n let selectedValue: any = '';\n const helperTextToDisplay = validatemessage || helperText;\n\n const thePConn = getPConnect();\n const actionsApi = thePConn.getActionsApi();\n const propName = thePConn.getStateProps().value;\n\n if (!isDeepEqual(datasource, theDatasource)) {\n // inbound datasource is different, so update theDatasource (to trigger useEffect)\n setDatasource(datasource);\n }\n\n const flattenParameters = (params = {}) => {\n const flatParams = {};\n Object.keys(params).forEach((key) => {\n const { name, value: theVal } = params[key];\n flatParams[name] = theVal;\n });\n\n return flatParams;\n };\n\n // convert associated to datapage listtype and transform props\n // Process deferDatasource when datapage name is present. WHhen tableType is promptList / localList\n if (deferDatasource && datasourceMetadata?.datasource?.name) {\n listType = 'datapage';\n datasource = datasourceMetadata.datasource.name;\n parameters = flattenParameters(datasourceMetadata?.datasource?.parameters);\n const displayProp = datasourceMetadata.datasource.propertyForDisplayText.startsWith('@P')\n ? datasourceMetadata.datasource.propertyForDisplayText.substring(3)\n : datasourceMetadata.datasource.propertyForDisplayText;\n const valueProp = datasourceMetadata.datasource.propertyForValue.startsWith('@P')\n ? datasourceMetadata.datasource.propertyForValue.substring(3)\n : datasourceMetadata.datasource.propertyForValue;\n columns = [\n {\n key: 'true',\n setProperty: 'Associated property',\n value: valueProp\n },\n {\n display: 'true',\n primary: 'true',\n useForSearch: true,\n value: displayProp\n }\n ];\n }\n columns = preProcessColumns(columns);\n\n useEffect(() => {\n if (listType === 'associated') {\n setOptions(Utils.getOptionList(props, getPConnect().getDataObject(context)));\n }\n }, [theDatasource]);\n\n useEffect(() => {\n if (!displayMode && listType !== 'associated') {\n getDataPage(datasource, parameters, context).then((results: any) => {\n const optionsData: Array<any> = [];\n const displayColumn = getDisplayFieldsMetaData(columns);\n results?.forEach((element) => {\n const val = element[displayColumn.primary]?.toString();\n const obj = {\n key: element[displayColumn.key] || element.pyGUID,\n value: val\n };\n optionsData.push(obj);\n });\n setOptions(optionsData);\n });\n }\n }, []);\n\n if (displayMode === 'LABELS_LEFT') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} variant=\"stacked\" />;\n }\n\n if (value) {\n const index = options?.findIndex((element) => element.key === value);\n if (index > -1) {\n selectedValue = options[index].value;\n } else {\n selectedValue = value;\n }\n }\n\n const handleChange = (event: object, newValue) => {\n const val = newValue ? newValue.key : '';\n handleEvent(actionsApi, 'changeNblur', propName, val);\n if (onRecordChange) {\n onRecordChange(event);\n }\n };\n\n const handleInputValue = (event, newInputValue) => {\n setInputValue(newInputValue);\n };\n\n if (readOnly) {\n const theValAsString = options?.find((opt) => opt.key === value)?.value;\n return <TextInput {...props} value={theValAsString} />;\n }\n // Need to use both getOptionLabel and getOptionSelected to map our\n // key/value structure to what Autocomplete expects\n return (\n <Autocomplete\n options={options}\n getOptionLabel={(option: IOption) => {\n return option.value ? option.value : '';\n }}\n getOptionSelected={(option: any) => {\n return option.value ? option.value : '';\n }}\n fullWidth\n onChange={handleChange}\n value={selectedValue}\n inputValue={inputValue || selectedValue}\n onInputChange={handleInputValue}\n renderInput={(params) => (\n <TextField\n {...params}\n fullWidth\n variant=\"outlined\"\n helperText={helperTextToDisplay}\n placeholder={placeholder}\n size=\"small\"\n required={required}\n error={status === 'error'}\n label={label}\n data-test-id={testId}\n />\n )}\n />\n );\n}\n"]}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { PConnFieldProps } from '../../../types/PConnProps';
|
|
2
3
|
import './CancelAlert.css';
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
interface CancelAlertProps extends PConnFieldProps {
|
|
5
|
+
pConn: any;
|
|
6
|
+
updateAlertState: any;
|
|
7
|
+
}
|
|
8
|
+
export default function CancelAlert(props: CancelAlertProps): JSX.Element;
|
|
9
|
+
export {};
|
|
5
10
|
//# sourceMappingURL=CancelAlert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CancelAlert.d.ts","sourceRoot":"","sources":["../../../../src/components/field/CancelAlert/CancelAlert.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CancelAlert.d.ts","sourceRoot":"","sources":["../../../../src/components/field/CancelAlert/CancelAlert.tsx"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,mBAAmB,CAAC;AAM3B,UAAU,gBAAiB,SAAQ,eAAe;IAEhD,KAAK,EAAE,GAAG,CAAC;IACX,gBAAgB,EAAE,GAAG,CAAA;CACtB;AAGD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,gBAAgB,eAqH1D"}
|
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { Button, Grid, IconButton, Snackbar } from '@material-ui/core';
|
|
3
3
|
import CloseIcon from '@material-ui/icons/Close';
|
|
4
4
|
import './CancelAlert.css';
|
|
5
|
-
|
|
5
|
+
export default function CancelAlert(props) {
|
|
6
6
|
const { pConn, updateAlertState } = props;
|
|
7
7
|
const [showSnackbar, setShowSnackbar] = useState(false);
|
|
8
8
|
const [snackbarMessage, setSnackbarMessage] = useState('');
|
|
@@ -10,6 +10,8 @@ const CancelAlert = props => {
|
|
|
10
10
|
const caseInfo = pConn.getCaseInfo();
|
|
11
11
|
const caseName = caseInfo.getName();
|
|
12
12
|
const ID = caseInfo.getID();
|
|
13
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
14
|
+
const localeCategory = 'ModalContainer';
|
|
13
15
|
function showToast(message) {
|
|
14
16
|
setSnackbarMessage(message);
|
|
15
17
|
setShowSnackbar(true);
|
|
@@ -38,7 +40,7 @@ const CancelAlert = props => {
|
|
|
38
40
|
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CASE_CREATED);
|
|
39
41
|
})
|
|
40
42
|
.catch(() => {
|
|
41
|
-
showToast('Save failed');
|
|
43
|
+
showToast(localizedVal('Save failed', localeCategory));
|
|
42
44
|
});
|
|
43
45
|
break;
|
|
44
46
|
case 'continue':
|
|
@@ -53,7 +55,7 @@ const CancelAlert = props => {
|
|
|
53
55
|
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);
|
|
54
56
|
})
|
|
55
57
|
.catch(() => {
|
|
56
|
-
showToast('Delete failed.');
|
|
58
|
+
showToast(localizedVal('Delete failed.', localeCategory));
|
|
57
59
|
});
|
|
58
60
|
break;
|
|
59
61
|
default:
|
|
@@ -65,17 +67,17 @@ const CancelAlert = props => {
|
|
|
65
67
|
React.createElement("div", { className: 'cancel-alert-top' },
|
|
66
68
|
React.createElement("h3", null, `Delete ${caseName}(${ID})`),
|
|
67
69
|
React.createElement("div", null,
|
|
68
|
-
React.createElement("p", null,
|
|
69
|
-
React.createElement("p", null,
|
|
70
|
+
React.createElement("p", null, `${localizedVal('Are you sure you want to delete', localeCategory)} ${caseName} (${ID})?`),
|
|
71
|
+
React.createElement("p", null, localizedVal('Alternatively, you can continue working or save your work for later.', localeCategory))),
|
|
70
72
|
React.createElement("div", { className: 'action-controls' },
|
|
71
73
|
React.createElement(Grid, { container: true, spacing: 4, justifyContent: 'space-between' },
|
|
72
74
|
React.createElement(Grid, { item: true },
|
|
73
|
-
React.createElement(Button, { variant: 'outlined', color: 'primary', onClick: () => buttonClick('save') },
|
|
75
|
+
React.createElement(Button, { variant: 'outlined', color: 'primary', onClick: () => buttonClick('save') }, localizedVal('Save for later', localeCategory))),
|
|
74
76
|
React.createElement(Grid, { item: true },
|
|
75
|
-
React.createElement(Button, { variant: 'outlined', color: 'primary', onClick: () => buttonClick('continue') },
|
|
76
|
-
React.createElement(Button, { variant: 'contained', color: 'primary', onClick: () => buttonClick('delete') },
|
|
77
|
+
React.createElement(Button, { variant: 'outlined', color: 'primary', onClick: () => buttonClick('continue') }, localizedVal('Continue Working', localeCategory)),
|
|
78
|
+
React.createElement(Button, { variant: 'contained', color: 'primary', onClick: () => buttonClick('delete') }, localizedVal('Delete', localeCategory))))))),
|
|
77
79
|
React.createElement(Snackbar, { open: showSnackbar, autoHideDuration: 3000, onClose: handleSnackbarClose, message: snackbarMessage, action: React.createElement(IconButton, { size: 'small', "aria-label": 'close', color: 'inherit', onClick: handleSnackbarClose },
|
|
78
80
|
React.createElement(CloseIcon, { fontSize: 'small' })) })));
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
+
}
|
|
82
|
+
;
|
|
81
83
|
//# sourceMappingURL=CancelAlert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CancelAlert.js","sourceRoot":"","sources":["../../../../src/components/field/CancelAlert/CancelAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,SAAS,MAAM,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EACJ,oBAAC,UAAU,IAAC,IAAI,EAAC,OAAO,gBAAY,OAAO,EAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,mBAAmB;gBACtF,oBAAC,SAAS,IAAC,QAAQ,EAAC,OAAO,GAAG,CACnB,GAEf,CACD,CACJ,CAAC;AACJ,CAAC;AAAA,CAAC","sourcesContent":["import React, { useState } from 'react';\nimport { Button, Grid, IconButton, Snackbar } from '@material-ui/core';\nimport CloseIcon from '@material-ui/icons/Close';\nimport type { PConnFieldProps } from '../../../types/PConnProps';\nimport './CancelAlert.css';\n\n// Remove this and use \"real\" PCore type once .d.ts is fixed (currently shows 2 errors)\ndeclare const PCore: any;\n\n\ninterface CancelAlertProps extends PConnFieldProps {\n // If any, enter additional props that only exist on CancelAlert here\n pConn: any,\n updateAlertState: any\n}\n\n\nexport default function CancelAlert(props: CancelAlertProps) {\n const { pConn, updateAlertState } = props;\n const [showSnackbar, setShowSnackbar] = useState(false);\n const [snackbarMessage, setSnackbarMessage] = useState('');\n\n const itemKey = pConn.getContextName();\n const caseInfo = pConn.getCaseInfo();\n const caseName = caseInfo.getName();\n const ID = caseInfo.getID();\n const localizedVal = PCore.getLocaleUtils().getLocaleValue;\n const localeCategory = 'ModalContainer';\n\n function showToast(message: string) {\n setSnackbarMessage(message);\n setShowSnackbar(true);\n }\n\n const dismissCancelAlertOnly = () => {\n updateAlertState(true);\n };\n\n const dismissModal = () => {\n updateAlertState(false);\n };\n\n function handleSnackbarClose(event: React.SyntheticEvent | React.MouseEvent, reason?: string) {\n if (reason === 'clickaway') {\n return;\n }\n setShowSnackbar(false);\n }\n\n const buttonClick = action => {\n const actionsAPI = pConn.getActionsApi();\n\n switch (action) {\n case 'save':\n // eslint-disable-next-line no-case-declarations\n const savePromise = actionsAPI.saveAndClose(itemKey);\n\n savePromise\n .then(() => {\n dismissModal();\n\n PCore.getPubSubUtils().publish(\n PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CASE_CREATED\n );\n })\n .catch(() => {\n showToast(localizedVal('Save failed', localeCategory));\n });\n break;\n\n case 'continue':\n dismissCancelAlertOnly();\n break;\n\n case 'delete':\n // eslint-disable-next-line no-case-declarations\n const deletePromise = actionsAPI.deleteCaseInCreateStage(itemKey);\n\n deletePromise\n .then(() => {\n dismissModal();\n PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);\n })\n .catch(() => {\n showToast(localizedVal('Delete failed.', localeCategory));\n });\n break;\n\n default:\n break;\n }\n };\n\n return (\n <>\n <div className='cancel-alert-background'>\n <div className='cancel-alert-top'>\n <h3>{`Delete ${caseName}(${ID})`}</h3>\n <div>\n <p>{`${localizedVal('Are you sure you want to delete', localeCategory)} ${caseName} (${ID})?`}</p>\n <p>{localizedVal('Alternatively, you can continue working or save your work for later.', localeCategory)}</p>\n </div>\n <div className='action-controls'>\n <Grid container spacing={4} justifyContent='space-between'>\n <Grid item>\n <Button variant='outlined' color='primary' onClick={() => buttonClick('save')}>\n {localizedVal('Save for later', localeCategory)}\n </Button>\n </Grid>\n <Grid item>\n <Button variant='outlined' color='primary' onClick={() => buttonClick('continue')}>\n {localizedVal('Continue Working', localeCategory)}\n </Button>\n <Button variant='contained' color='primary' onClick={() => buttonClick('delete')}>\n {localizedVal('Delete', localeCategory)}\n </Button>\n </Grid>\n </Grid>\n </div>\n </div>\n </div>\n <Snackbar\n open={showSnackbar}\n autoHideDuration={3000}\n onClose={handleSnackbarClose}\n message={snackbarMessage}\n action={\n <IconButton size='small' aria-label='close' color='inherit' onClick={handleSnackbarClose}>\n <CloseIcon fontSize='small' />\n </IconButton>\n }\n />\n </>\n );\n};\n"]}
|
|
@@ -1,3 +1,21 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import type { PConnProps } from '../../../types/PConnProps';
|
|
3
|
+
interface CheckboxProps extends PConnProps {
|
|
4
|
+
value?: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
required: boolean;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
validatemessage: string;
|
|
9
|
+
status?: string;
|
|
10
|
+
onChange: any;
|
|
11
|
+
onBlur?: any;
|
|
12
|
+
readOnly: boolean;
|
|
13
|
+
testId: string;
|
|
14
|
+
helperText: string;
|
|
15
|
+
displayMode?: string;
|
|
16
|
+
hideLabel: boolean;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
}
|
|
19
|
+
export default function CheckboxComponent(props: CheckboxProps): JSX.Element;
|
|
20
|
+
export {};
|
|
3
21
|
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Checkbox/Checkbox.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Checkbox/Checkbox.tsx"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAK5D,UAAU,aAAc,SAAQ,UAAU;IAIxC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,QAAQ,EAAE,GAAG,CAAC;IAEd,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IAEnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,aAAa,eAwE7D"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText } from '@material-ui/core';
|
|
3
3
|
import handleEvent from '../../helpers/event-utils';
|
|
4
|
-
import
|
|
4
|
+
import { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';
|
|
5
5
|
export default function CheckboxComponent(props) {
|
|
6
|
-
|
|
6
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
7
|
+
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
8
|
+
const { getPConnect, label, value = false, readOnly, testId, required, disabled, status, helperText, validatemessage, displayMode, hideLabel } = props;
|
|
7
9
|
const helperTextToDisplay = validatemessage || helperText;
|
|
8
10
|
const thePConn = getPConnect();
|
|
9
11
|
const theConfigProps = thePConn.getConfigProps();
|
|
@@ -16,26 +18,26 @@ export default function CheckboxComponent(props) {
|
|
|
16
18
|
setChecked(value);
|
|
17
19
|
}, [value]);
|
|
18
20
|
if (displayMode === 'LABELS_LEFT') {
|
|
19
|
-
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value });
|
|
21
|
+
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value.toString() });
|
|
20
22
|
}
|
|
21
23
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
22
|
-
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value, variant:
|
|
24
|
+
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value.toString(), variant: "stacked" });
|
|
23
25
|
}
|
|
24
|
-
const handleChange = event => {
|
|
26
|
+
const handleChange = (event) => {
|
|
25
27
|
handleEvent(actionsApi, 'changeNblur', propName, event.target.checked);
|
|
26
28
|
};
|
|
27
|
-
const handleBlur = event => {
|
|
28
|
-
thePConn.getValidationApi().validate(event.target.checked);
|
|
29
|
+
const handleBlur = (event) => {
|
|
30
|
+
thePConn.getValidationApi().validate(event.target.checked, ''); // 2nd arg empty string until typedef marked correctly as optional
|
|
29
31
|
};
|
|
30
|
-
let theCheckbox = React.createElement(Checkbox, { color:
|
|
32
|
+
let theCheckbox = React.createElement(Checkbox, { color: "primary", disabled: disabled });
|
|
31
33
|
if (readOnly) {
|
|
32
34
|
// Workaround for lack of InputProps readOnly from https://github.com/mui-org/material-ui/issues/17043
|
|
33
35
|
// Also note that we need to turn off the onChange call in the FormControlLabel wrapper, too. See below!
|
|
34
|
-
theCheckbox = React.createElement(Checkbox, { value: value || false,
|
|
36
|
+
theCheckbox = React.createElement(Checkbox, { value: value || false, readOnly: readOnly });
|
|
35
37
|
}
|
|
36
38
|
return (React.createElement(FormControl, { required: required, error: status === 'error' },
|
|
37
39
|
React.createElement(FormGroup, null,
|
|
38
|
-
React.createElement(FormControlLabel, { control: theCheckbox, checked: checked, onChange: !readOnly ? handleChange : undefined, onBlur: !readOnly ? handleBlur : undefined, label: caption, labelPlacement:
|
|
40
|
+
React.createElement(FormControlLabel, { control: theCheckbox, checked: checked, onChange: !readOnly ? handleChange : undefined, onBlur: !readOnly ? handleBlur : undefined, label: caption, labelPlacement: "end", "data-test-id": testId })),
|
|
39
41
|
React.createElement(FormHelperText, null, helperTextToDisplay)));
|
|
40
42
|
}
|
|
41
43
|
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../../src/components/field/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../../src/components/field/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CA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sourcesContent":["import React, { useState, useEffect } from 'react';\nimport { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText } from '@material-ui/core';\nimport handleEvent from '../../helpers/event-utils';\nimport type { PConnProps } from '../../../types/PConnProps';\nimport { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';\n\n// Checkbox passes in 'value' as a boolean. So can't use the default\n// PConnFieldProps since it expects value to be a string.\ninterface CheckboxProps extends PConnProps {\n // If any, enter additional props that only exist on Checkbox here\n // Everything from PConnFieldProps except value and change type of value to boolean\n\n value?: boolean;\n label: string;\n required: boolean;\n disabled: boolean;\n validatemessage: string;\n status?: string;\n // eslint-disable-next-line react/no-unused-prop-types\n onChange: any;\n // eslint-disable-next-line react/no-unused-prop-types\n onBlur?: any;\n readOnly: boolean;\n testId: string;\n helperText: string;\n displayMode?: string;\n hideLabel: boolean;\n // eslint-disable-next-line react/no-unused-prop-types\n placeholder?: string;\n}\n\nexport default function CheckboxComponent(props: CheckboxProps) {\n // Get emitted components from map (so we can get any override that may exist)\n const FieldValueList = getComponentFromMap('FieldValueList');\n\n const {\n getPConnect,\n label,\n value = false,\n readOnly,\n testId,\n required,\n disabled,\n status,\n helperText,\n validatemessage,\n displayMode,\n hideLabel\n } = props;\n const helperTextToDisplay = validatemessage || helperText;\n\n const thePConn = getPConnect();\n const theConfigProps = thePConn.getConfigProps();\n const { caption } = theConfigProps;\n const actionsApi = thePConn.getActionsApi();\n const propName = thePConn.getStateProps().value;\n\n const [checked, setChecked] = useState(false);\n useEffect(() => {\n // This update theSelectedButton which will update the UI to show the selected button correctly\n setChecked(value);\n }, [value]);\n\n if (displayMode === 'LABELS_LEFT') {\n return <FieldValueList name={hideLabel ? '' : label} value={value.toString()} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : label} value={value.toString()} variant=\"stacked\" />;\n }\n\n const handleChange = (event) => {\n handleEvent(actionsApi, 'changeNblur', propName, event.target.checked);\n };\n\n const handleBlur = (event) => {\n thePConn.getValidationApi().validate(event.target.checked, ''); // 2nd arg empty string until typedef marked correctly as optional\n };\n\n let theCheckbox = <Checkbox color=\"primary\" disabled={disabled} />;\n\n if (readOnly) {\n // Workaround for lack of InputProps readOnly from https://github.com/mui-org/material-ui/issues/17043\n // Also note that we need to turn off the onChange call in the FormControlLabel wrapper, too. See below!\n theCheckbox = <Checkbox value={value || false} readOnly={readOnly} />;\n }\n\n return (\n <FormControl required={required} error={status === 'error'}>\n <FormGroup>\n <FormControlLabel\n control={theCheckbox}\n checked={checked}\n onChange={!readOnly ? handleChange : undefined}\n onBlur={!readOnly ? handleBlur : undefined}\n label={caption}\n labelPlacement=\"end\"\n data-test-id={testId}\n />\n </FormGroup>\n <FormHelperText>{helperTextToDisplay}</FormHelperText>\n </FormControl>\n );\n}\n"]}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import type { PConnFieldProps } from '../../../types/PConnProps';
|
|
3
|
+
interface CurrrencyProps extends PConnFieldProps {
|
|
4
|
+
currencyISOCode?: string;
|
|
5
|
+
}
|
|
6
|
+
export default function Currency(props: CurrrencyProps): JSX.Element;
|
|
7
|
+
export {};
|
|
3
8
|
//# sourceMappingURL=Currency.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Currency/Currency.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Currency/Currency.tsx"],"names":[],"mappings":";AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAIjE,UAAU,cAAe,SAAQ,eAAe;IAE9C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,cAAc,eA2GrD"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
// import { TextField } from "@material-ui/core";
|
|
3
2
|
import CurrencyTextField from '@unicef/material-ui-currency-textfield';
|
|
4
3
|
import handleEvent from '../../helpers/event-utils';
|
|
5
|
-
import
|
|
6
|
-
import { format } from "../../helpers/formatters";
|
|
4
|
+
import { format } from '../../helpers/formatters';
|
|
7
5
|
import { getCurrencyCharacters, getCurrencyOptions } from './currency-utils';
|
|
8
|
-
|
|
6
|
+
import { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';
|
|
9
7
|
export default function Currency(props) {
|
|
8
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
9
|
+
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
10
10
|
const { getPConnect, label, required, disabled, value = '', validatemessage, status,
|
|
11
11
|
/* onChange, onBlur, */
|
|
12
|
-
readOnly, testId, helperText, displayMode, hideLabel, currencyISOCode =
|
|
12
|
+
readOnly, testId, helperText, displayMode, hideLabel, currencyISOCode = 'USD' } = props;
|
|
13
13
|
const pConn = getPConnect();
|
|
14
14
|
const actions = pConn.getActionsApi();
|
|
15
15
|
const propName = pConn.getStateProps().value;
|
|
@@ -23,10 +23,10 @@ export default function Currency(props) {
|
|
|
23
23
|
testProp = {
|
|
24
24
|
'data-test-id': testId
|
|
25
25
|
};
|
|
26
|
-
const [currValue, setCurrValue] = useState();
|
|
27
|
-
const [theCurrSym, setCurrSym] = useState(
|
|
28
|
-
const [theCurrDec, setCurrDec] = useState(
|
|
29
|
-
const [theCurrSep, setCurrSep] = useState(
|
|
26
|
+
const [currValue, setCurrValue] = useState('');
|
|
27
|
+
const [theCurrSym, setCurrSym] = useState('$');
|
|
28
|
+
const [theCurrDec, setCurrDec] = useState('.');
|
|
29
|
+
const [theCurrSep, setCurrSep] = useState(',');
|
|
30
30
|
useEffect(() => {
|
|
31
31
|
// currencySymbols looks like this: { theCurrencySymbol: '$', theDecimalIndicator: '.', theSeparator: ',' }
|
|
32
32
|
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
@@ -44,7 +44,7 @@ export default function Currency(props) {
|
|
|
44
44
|
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: formattedValue });
|
|
45
45
|
}
|
|
46
46
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
47
|
-
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: formattedValue, variant:
|
|
47
|
+
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: formattedValue, variant: "stacked" });
|
|
48
48
|
}
|
|
49
49
|
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
50
50
|
function currOnChange(event, inValue) {
|
|
@@ -57,6 +57,6 @@ export default function Currency(props) {
|
|
|
57
57
|
handleEvent(actions, 'changeNblur', propName, inValue !== '' ? Number(inValue) : inValue);
|
|
58
58
|
}
|
|
59
59
|
// console.log(`theCurrSym: ${theCurrSym} | theCurrDec: ${theCurrDec} | theCurrSep: ${theCurrSep}`);
|
|
60
|
-
return (React.createElement(CurrencyTextField, { fullWidth: true, variant: readOnly ? 'standard' : 'outlined', helperText: helperTextToDisplay, placeholder:
|
|
60
|
+
return (React.createElement(CurrencyTextField, { fullWidth: true, variant: readOnly ? 'standard' : 'outlined', helperText: helperTextToDisplay, placeholder: "", size: "small", required: required, disabled: disabled, onChange: currOnChange, onBlur: !readOnly ? currOnBlur : undefined, error: status === 'error', label: label, value: currValue, type: "text", outputFormat: "number", textAlign: "left", InputProps: { ...readOnlyProp, inputProps: { ...testProp, value: currValue } }, currencySymbol: theCurrSym, decimalCharacter: theCurrDec, digitGroupSeparator: theCurrSep }));
|
|
61
61
|
}
|
|
62
62
|
//# sourceMappingURL=Currency.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Currency.js","sourceRoot":"","sources":["../../../../src/components/field/Currency/Currency.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAA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Content":["import React, { useState, useEffect } from 'react';\nimport CurrencyTextField from '@unicef/material-ui-currency-textfield';\nimport handleEvent from '../../helpers/event-utils';\nimport { format } from '../../helpers/formatters';\nimport { getCurrencyCharacters, getCurrencyOptions } from './currency-utils';\nimport { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';\nimport type { PConnFieldProps } from '../../../types/PConnProps';\n\n// Using control from: https://github.com/unicef/material-ui-currency-textfield\n\ninterface CurrrencyProps extends PConnFieldProps {\n // If any, enter additional props that only exist on Currency here\n currencyISOCode?: string;\n}\n\nexport default function Currency(props: CurrrencyProps) {\n // Get emitted components from map (so we can get any override that may exist)\n const FieldValueList = getComponentFromMap('FieldValueList');\n\n const {\n getPConnect,\n label,\n required,\n disabled,\n value = '',\n validatemessage,\n status,\n /* onChange, onBlur, */\n readOnly,\n testId,\n helperText,\n displayMode,\n hideLabel,\n currencyISOCode = 'USD'\n } = props;\n\n const pConn = getPConnect();\n const actions = pConn.getActionsApi();\n const propName = pConn.getStateProps().value;\n const helperTextToDisplay = validatemessage || helperText;\n\n // console.log(`Currency: label: ${label} value: ${value}`);\n\n let readOnlyProp = {}; // Note: empty if NOT ReadOnly\n\n if (readOnly) {\n readOnlyProp = { readOnly: true };\n }\n\n let testProp = {};\n\n testProp = {\n 'data-test-id': testId\n };\n\n const [currValue, setCurrValue] = useState('');\n const [theCurrSym, setCurrSym] = useState('$');\n const [theCurrDec, setCurrDec] = useState('.');\n const [theCurrSep, setCurrSep] = useState(',');\n\n useEffect(() => {\n // currencySymbols looks like this: { theCurrencySymbol: '$', theDecimalIndicator: '.', theSeparator: ',' }\n const theSymbols = getCurrencyCharacters(currencyISOCode);\n setCurrSym(theSymbols.theCurrencySymbol);\n setCurrDec(theSymbols.theDecimalIndicator);\n setCurrSep(theSymbols.theDigitGroupSeparator);\n }, [currencyISOCode]);\n\n useEffect(() => {\n // const testVal = value;\n setCurrValue(value.toString());\n }, [value]);\n\n const theCurrencyOptions = getCurrencyOptions(currencyISOCode);\n const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);\n\n if (displayMode === 'LABELS_LEFT') {\n return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant=\"stacked\" />;\n }\n\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n function currOnChange(event, inValue) {\n // console.log(`Currency currOnChange inValue: ${inValue}`);\n\n // update internal value\n setCurrValue(event?.target?.value);\n }\n\n function currOnBlur(event, inValue) {\n // console.log(`Currency currOnBlur inValue: ${inValue}`);\n handleEvent(actions, 'changeNblur', propName, inValue !== '' ? Number(inValue) : inValue);\n }\n\n // console.log(`theCurrSym: ${theCurrSym} | theCurrDec: ${theCurrDec} | theCurrSep: ${theCurrSep}`);\n\n return (\n <CurrencyTextField\n fullWidth\n variant={readOnly ? 'standard' : 'outlined'}\n helperText={helperTextToDisplay}\n placeholder=\"\"\n size=\"small\"\n required={required}\n disabled={disabled}\n onChange={currOnChange}\n onBlur={!readOnly ? currOnBlur : undefined}\n error={status === 'error'}\n label={label}\n value={currValue}\n type=\"text\"\n outputFormat=\"number\"\n textAlign=\"left\"\n InputProps={{ ...readOnlyProp, inputProps: { ...testProp, value: currValue } }}\n currencySymbol={theCurrSym}\n decimalCharacter={theCurrDec}\n digitGroupSeparator={theCurrSep}\n />\n );\n}\n"]}
|