@pega/dx-component-builder-sdk 25.1.16 → 26.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/pega-dx-component-builder-sdk-26.1.10.tgz +0 -0
- package/src/constants.js +4 -0
- package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/utils.ts.mustache +1 -1
- package/src/tasks/create/templates/Constellation/template/DETAILS/DetailsRender.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/DetailsRender.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/template/FORM/DetailsRender.tsx +1 -1
- package/src/tasks/create/templates/Constellation/template/FORM-region/DetailsRender.tsx +1 -1
- package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +22 -6
- package/src/tasks/create/templates/SDK-React/field/Date/demo.stories.tsx.mustache +8 -1
- package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +22 -13
- package/src/tasks/create/templates/SDK-React/field/DateTime/demo.stories.tsx.mustache +9 -1
- package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +23 -14
- package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +24 -8
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +24 -8
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +24 -10
- package/src/tasks/create/templates/SDK-React/field/Integer/index.tsx.mustache +26 -14
- package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +34 -8
- package/src/tasks/create/templates/SDK-React/field/Picklist-Autocomplete/index.tsx.mustache +25 -9
- package/src/tasks/create/templates/SDK-React/field/Picklist-RadioButtons/index.tsx.mustache +21 -5
- package/src/tasks/create/templates/SDK-React/field/Text/index.tsx.mustache +25 -14
- package/src/tasks/create/templates/SDK-React/field/Text-Email/index.tsx.mustache +32 -21
- package/src/tasks/create/templates/SDK-React/field/Text-Input/index.tsx.mustache +25 -10
- package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/index.tsx.mustache +26 -14
- package/src/tasks/create/templates/SDK-React/field/Text-Phone/index.tsx.mustache +28 -10
- package/src/tasks/create/templates/SDK-React/field/Text-URL/index.tsx.mustache +26 -14
- package/src/tasks/create/templates/SDK-React/field/TimeOfDay/demo.stories.tsx.mustache +9 -1
- package/src/tasks/create/templates/SDK-React/field/TimeOfDay/index.tsx.mustache +22 -17
- package/src/tasks/create/templates/SDK-React/template/FORM/DefaultForm.css +82 -2
- package/src/tasks/create/templates/SDK-React/template/FORM/index.tsx.mustache +51 -11
- package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +19 -15
- package/src/tasks/create/templates/SDK-React/widget/PAGE/index.tsx.mustache +2 -167
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +72 -15
- package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +25 -14
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/AlertBanner/AlertBanner.tsx +37 -20
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +14 -0
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +57 -5
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldGroup/FieldGroup.tsx +18 -11
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldGroupList/FieldGroupList.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +19 -4
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/Operator/Operator.tsx +125 -74
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/RichTextEditor/RichTextEditor.tsx +184 -90
- package/tests/assets/sdk-r/components/create/override-sdk/field/AutoComplete/AutoComplete.tsx +372 -26
- package/tests/assets/sdk-r/components/create/override-sdk/field/Checkbox/Checkbox.tsx +22 -6
- package/tests/assets/sdk-r/components/create/override-sdk/field/Currency/Currency.tsx +22 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Date/Date.tsx +35 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/DateTime/DateTime.tsx +35 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/Decimal.tsx +22 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Dropdown/Dropdown.tsx +48 -16
- package/tests/assets/sdk-r/components/create/override-sdk/field/Email/Email.tsx +21 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Group/Group.tsx +28 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Integer/Integer.tsx +21 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Multiselect/Multiselect.tsx +42 -20
- package/tests/assets/sdk-r/components/create/override-sdk/field/Multiselect/utils.ts +5 -3
- package/tests/assets/sdk-r/components/create/override-sdk/field/ObjectReference/ObjectReference.tsx +554 -66
- package/tests/assets/sdk-r/components/create/override-sdk/field/ObjectReference/utils.ts +108 -20
- package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/Percentage.tsx +22 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Phone/Phone.tsx +23 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/RadioButtons/RadioButtons.tsx +20 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/RichText/RichText.css +0 -79
- package/tests/assets/sdk-r/components/create/override-sdk/field/RichText/RichText.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/field/SelectableCard/SelectableCard.tsx +25 -10
- package/tests/assets/sdk-r/components/create/override-sdk/field/TextArea/TextArea.tsx +22 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/TextInput/TextInput.tsx +21 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Time/Time.tsx +35 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/URL/URL.tsx +22 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/UserReference/UserReference.tsx +10 -6
- package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/Assignment.tsx +36 -14
- package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/useValidationBanner.ts +29 -0
- package/tests/assets/sdk-r/components/create/override-sdk/infra/DeferLoad/DeferLoad.tsx +31 -10
- package/tests/assets/sdk-r/components/create/override-sdk/infra/FlowContainer/FlowContainer.tsx +5 -6
- package/tests/assets/sdk-r/components/create/override-sdk/infra/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/ModalViewContainer/DataViewActionButtons/DataViewActionButtons.tsx +138 -0
- package/tests/assets/sdk-r/components/create/override-sdk/infra/ModalViewContainer/ModalViewContainer.tsx +110 -64
- package/tests/assets/sdk-r/components/create/override-sdk/infra/MultiStep/MultiStep.css +63 -0
- package/tests/assets/sdk-r/components/create/override-sdk/infra/MultiStep/MultiStep.tsx +23 -52
- package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.tsx +8 -3
- package/tests/assets/sdk-r/components/create/override-sdk/infra/Reference/Reference.tsx +5 -0
- package/tests/assets/sdk-r/components/create/override-sdk/infra/RootContainer/RootContainer.tsx +4 -5
- package/tests/assets/sdk-r/components/create/override-sdk/infra/View/View.css +1 -0
- package/tests/assets/sdk-r/components/create/override-sdk/infra/View/View.tsx +10 -17
- package/tests/assets/sdk-r/components/create/override-sdk/infra/ViewContainer/ViewContainer.tsx +8 -10
- package/tests/assets/sdk-r/components/create/override-sdk/template/AppShell/AppShell.css +0 -4
- package/tests/assets/sdk-r/components/create/override-sdk/template/AppShell/AppShell.tsx +7 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseSummary/CaseSummary.tsx +9 -42
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/CaseView.tsx +8 -2
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +58 -3
- package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/DataReference.tsx +56 -33
- package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/SearchForm.tsx +3 -4
- package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/DefaultForm.css +71 -0
- package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/DefaultForm.tsx +45 -9
- package/tests/assets/sdk-r/components/create/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +10 -3
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +139 -59
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/hooks.ts +80 -13
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/utils.ts +13 -3
- package/tests/assets/sdk-r/components/create/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +16 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +167 -93
- package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableSelect/SimpleTableSelect.tsx +71 -56
- package/tests/assets/sdk-r/components/create/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +12 -7
- package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.tsx +119 -26
- package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/AttachmentUtils.ts +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/widget/CaseHistory/CaseHistory.tsx +16 -12
- package/tests/assets/sdk-r/components/create/override-sdk/widget/FileUtility/FileUtility.tsx +40 -28
- package/tests/assets/sdk-r/components/create/override-sdk/widget/ToDo/ToDo.tsx +14 -6
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/utils.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/DetailsRender.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/DetailsRender.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/index.tsx +22 -6
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +24 -8
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/demo.stories.tsx +8 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/index.tsx +22 -13
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +9 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/index.tsx +23 -14
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +24 -8
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/index.tsx +32 -21
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/index.tsx +2 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/index.tsx +26 -14
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/index.tsx +26 -14
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +24 -10
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +25 -10
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/index.tsx +34 -8
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyRadiobuttons/index.tsx +21 -5
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MySearchbox/index.tsx +22 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/index.tsx +25 -14
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/index.tsx +25 -10
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +9 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/index.tsx +22 -17
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/index.tsx +26 -14
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/DefaultForm.css +82 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/index.tsx +45 -8
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +19 -15
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +66 -15
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/index.tsx +2 -167
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/AlertBanner/AlertBanner.tsx +37 -20
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +14 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +57 -5
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldGroup/FieldGroup.tsx +18 -11
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldGroupList/FieldGroupList.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +19 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/Operator/Operator.tsx +125 -74
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/RichTextEditor/RichTextEditor.tsx +184 -90
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/AutoComplete/AutoComplete.tsx +372 -26
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Checkbox/Checkbox.tsx +22 -6
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Currency/Currency.tsx +22 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Date/Date.tsx +35 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/DateTime/DateTime.tsx +35 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/Decimal.tsx +22 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Dropdown/Dropdown.tsx +48 -16
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Email/Email.tsx +21 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/Group.tsx +28 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Integer/Integer.tsx +21 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Multiselect/Multiselect.tsx +42 -20
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Multiselect/utils.ts +5 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/ObjectReference/ObjectReference.tsx +554 -66
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/ObjectReference/utils.ts +108 -20
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx +22 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Phone/Phone.tsx +23 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/RadioButtons/RadioButtons.tsx +20 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/RichText/RichText.css +0 -79
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/RichText/RichText.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/SelectableCard/SelectableCard.tsx +25 -10
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextArea/TextArea.tsx +22 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextInput/TextInput.tsx +21 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Time/Time.tsx +35 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/URL/URL.tsx +22 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/UserReference/UserReference.tsx +10 -6
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/Assignment.tsx +36 -14
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/useValidationBanner.ts +29 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DeferLoad/DeferLoad.tsx +31 -10
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/FlowContainer/FlowContainer.tsx +5 -6
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ModalViewContainer/DataViewActionButtons/DataViewActionButtons.tsx +138 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ModalViewContainer/ModalViewContainer.tsx +110 -64
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/MultiStep/MultiStep.css +63 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/MultiStep/MultiStep.tsx +23 -52
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.tsx +8 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Reference/Reference.tsx +5 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/RootContainer/RootContainer.tsx +4 -5
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/View/View.css +1 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/View/View.tsx +10 -17
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/ViewContainer/ViewContainer.tsx +8 -10
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/AppShell/AppShell.css +0 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/AppShell/AppShell.tsx +7 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseSummary/CaseSummary.tsx +9 -42
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/CaseView.tsx +8 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +58 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/DataReference.tsx +56 -33
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/SearchForm.tsx +3 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/DefaultForm.css +71 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/DefaultForm.tsx +45 -9
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +10 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +139 -59
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/hooks.ts +80 -13
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/utils.ts +13 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +16 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +167 -93
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableSelect/SimpleTableSelect.tsx +71 -56
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +12 -7
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.tsx +119 -26
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/AttachmentUtils.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/CaseHistory/CaseHistory.tsx +16 -12
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/FileUtility/FileUtility.tsx +40 -28
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/ToDo/ToDo.tsx +14 -6
- package/SECURITY.md +0 -10
package/tests/assets/sdk-r/components/createAll/override-sdk/field/AutoComplete/AutoComplete.tsx
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { useEffect, useState, useCallback } from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import { TextField, Paper, Button, Divider } from '@mui/material';
|
|
4
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
5
|
+
import Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';
|
|
4
6
|
import isDeepEqual from 'fast-deep-equal/react';
|
|
5
7
|
|
|
6
8
|
import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
7
9
|
import { getDataPage } from '@pega/react-sdk-components/lib/components/helpers/data_page';
|
|
8
|
-
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
9
10
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
10
11
|
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
12
|
+
import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
|
|
13
|
+
import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
|
|
14
|
+
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
11
15
|
|
|
12
16
|
interface IOption {
|
|
13
17
|
key: string;
|
|
14
18
|
value: string;
|
|
19
|
+
secondary?: ReactNode[];
|
|
20
|
+
secondaryRaw?: string[];
|
|
21
|
+
group?: string;
|
|
15
22
|
}
|
|
16
23
|
|
|
17
24
|
const preProcessColumns = columnList => {
|
|
@@ -22,6 +29,18 @@ const preProcessColumns = columnList => {
|
|
|
22
29
|
});
|
|
23
30
|
};
|
|
24
31
|
|
|
32
|
+
const getPropertyName = (rawValue: string): string => {
|
|
33
|
+
let propName;
|
|
34
|
+
if (rawValue.startsWith('@USER ')) {
|
|
35
|
+
propName = rawValue.substring(6).trim();
|
|
36
|
+
} else if (rawValue.startsWith('@P ')) {
|
|
37
|
+
propName = rawValue.substring(3).trim();
|
|
38
|
+
} else {
|
|
39
|
+
propName = rawValue.trim();
|
|
40
|
+
}
|
|
41
|
+
return propName.startsWith('.') ? propName.substring(1) : propName;
|
|
42
|
+
};
|
|
43
|
+
|
|
25
44
|
const getDisplayFieldsMetaData = columnList => {
|
|
26
45
|
const displayColumns = columnList.filter(col => col.display === 'true');
|
|
27
46
|
const metaDataObj: any = { key: '', primary: '', secondary: [] };
|
|
@@ -49,6 +68,19 @@ interface AutoCompleteProps extends PConnFieldProps {
|
|
|
49
68
|
parameters?: any;
|
|
50
69
|
datasource: any;
|
|
51
70
|
columns: any[];
|
|
71
|
+
showFieldMessage?: boolean;
|
|
72
|
+
messageConfig?: {
|
|
73
|
+
content?: string;
|
|
74
|
+
visibility?: boolean;
|
|
75
|
+
};
|
|
76
|
+
variant?: string;
|
|
77
|
+
showCreateNew?: boolean;
|
|
78
|
+
onCreateNew?: () => void;
|
|
79
|
+
createNewLabel?: string;
|
|
80
|
+
createNewRecord?: () => Promise<unknown>;
|
|
81
|
+
contextClass?: string;
|
|
82
|
+
referenceType?: string;
|
|
83
|
+
allowCreatingRecords?: boolean;
|
|
52
84
|
}
|
|
53
85
|
|
|
54
86
|
export default function AutoComplete(props: AutoCompleteProps) {
|
|
@@ -68,10 +100,16 @@ export default function AutoComplete(props: AutoCompleteProps) {
|
|
|
68
100
|
displayMode,
|
|
69
101
|
deferDatasource,
|
|
70
102
|
datasourceMetadata,
|
|
71
|
-
status,
|
|
72
103
|
helperText,
|
|
73
104
|
hideLabel,
|
|
74
|
-
onRecordChange
|
|
105
|
+
onRecordChange,
|
|
106
|
+
showFieldMessage,
|
|
107
|
+
messageConfig = {},
|
|
108
|
+
onCreateNew,
|
|
109
|
+
createNewLabel = 'Create new',
|
|
110
|
+
createNewRecord,
|
|
111
|
+
contextClass,
|
|
112
|
+
referenceType
|
|
75
113
|
} = props;
|
|
76
114
|
|
|
77
115
|
const context = getPConnect().getContextName();
|
|
@@ -79,13 +117,21 @@ export default function AutoComplete(props: AutoCompleteProps) {
|
|
|
79
117
|
const [inputValue, setInputValue] = useState('');
|
|
80
118
|
const [options, setOptions] = useState<IOption[]>([]);
|
|
81
119
|
const [theDatasource, setDatasource] = useState(null);
|
|
82
|
-
let selectedValue: any =
|
|
83
|
-
const
|
|
120
|
+
let selectedValue: any = null;
|
|
121
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
122
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
84
123
|
|
|
85
124
|
const thePConn = getPConnect();
|
|
86
125
|
const actionsApi = thePConn.getActionsApi();
|
|
87
126
|
const propName = (thePConn.getStateProps() as any).value;
|
|
88
127
|
|
|
128
|
+
const status = useStatus({
|
|
129
|
+
showFieldMessage,
|
|
130
|
+
messageVisibility: messageConfig.visibility,
|
|
131
|
+
validatemessage,
|
|
132
|
+
readOnly
|
|
133
|
+
});
|
|
134
|
+
|
|
89
135
|
if (!isDeepEqual(datasource, theDatasource)) {
|
|
90
136
|
// inbound datasource is different, so update theDatasource (to trigger useEffect)
|
|
91
137
|
setDatasource(datasource);
|
|
@@ -124,6 +170,36 @@ export default function AutoComplete(props: AutoCompleteProps) {
|
|
|
124
170
|
}
|
|
125
171
|
];
|
|
126
172
|
}
|
|
173
|
+
|
|
174
|
+
// Add secondary columns from columnsFormatter metadata
|
|
175
|
+
const columnsFormatter = (thePConn.getRawMetadata?.()?.config as any)?.columnsFormatter;
|
|
176
|
+
if (Array.isArray(columnsFormatter) && columnsFormatter.length > 0) {
|
|
177
|
+
columnsFormatter.forEach(formatter => {
|
|
178
|
+
if (formatter.config?.value) {
|
|
179
|
+
columns.push({
|
|
180
|
+
value: getPropertyName(formatter.config.value),
|
|
181
|
+
display: 'true',
|
|
182
|
+
useForSearch: true,
|
|
183
|
+
secondary: 'true'
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Read groupsFields from raw metadata for grouping support
|
|
190
|
+
const groupsFields = (thePConn.getRawMetadata?.()?.config as any)?.groupsFields;
|
|
191
|
+
const groupKeyFields: string[] = Array.isArray(groupsFields)
|
|
192
|
+
? groupsFields.map((entry: any) => getPropertyName(entry?.config?.value || '')).filter(Boolean)
|
|
193
|
+
: [];
|
|
194
|
+
const isGrouped = groupKeyFields.length > 0;
|
|
195
|
+
|
|
196
|
+
// Ensure group fields are included in columns so they appear in the data page response
|
|
197
|
+
groupKeyFields.forEach(field => {
|
|
198
|
+
if (!columns.find(col => col.value === field || col.value === `.${field}`)) {
|
|
199
|
+
columns.push({ value: field, display: 'false', useForSearch: false });
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
|
|
127
203
|
columns = preProcessColumns(columns);
|
|
128
204
|
|
|
129
205
|
useEffect(() => {
|
|
@@ -132,26 +208,83 @@ export default function AutoComplete(props: AutoCompleteProps) {
|
|
|
132
208
|
}
|
|
133
209
|
}, [theDatasource]);
|
|
134
210
|
|
|
211
|
+
// Builds options with primary + secondary data from datapage results
|
|
212
|
+
const buildOptionsFromResults = (results: any[]): IOption[] => {
|
|
213
|
+
const optionsData: IOption[] = [];
|
|
214
|
+
const displayColumn = getDisplayFieldsMetaData(columns);
|
|
215
|
+
results?.forEach(element => {
|
|
216
|
+
const val = element[displayColumn.primary]?.toString() || '';
|
|
217
|
+
let secondaryNodes: ReactNode[] = [];
|
|
218
|
+
let secondaryRaw: string[] = [];
|
|
219
|
+
|
|
220
|
+
if (Array.isArray(columnsFormatter) && columnsFormatter.length > 0) {
|
|
221
|
+
columnsFormatter.forEach((formatter, idx) => {
|
|
222
|
+
if (formatter.config?.value) {
|
|
223
|
+
const fmtPropName = getPropertyName(formatter.config.value);
|
|
224
|
+
secondaryRaw.push(element[fmtPropName]?.toString() || '');
|
|
225
|
+
|
|
226
|
+
try {
|
|
227
|
+
const fieldMeta = {
|
|
228
|
+
meta: {
|
|
229
|
+
...formatter,
|
|
230
|
+
config: {
|
|
231
|
+
...formatter.config,
|
|
232
|
+
displayMode: 'DISPLAY_ONLY',
|
|
233
|
+
contextName: context,
|
|
234
|
+
variant: 'inline-compact'
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
useCustomContext: element
|
|
238
|
+
};
|
|
239
|
+
const configObj = PCore.createPConnect(fieldMeta);
|
|
240
|
+
const resolvedPConn = configObj.getPConnect();
|
|
241
|
+
const resolvedProps = resolvedPConn.resolveConfigProps(resolvedPConn.getConfigProps());
|
|
242
|
+
const Component = getComponentFromMap(formatter.type);
|
|
243
|
+
if (Component) {
|
|
244
|
+
secondaryNodes.push(<Component key={idx} {...resolvedProps} getPConnect={() => resolvedPConn} displayMode='DISPLAY_ONLY' />);
|
|
245
|
+
} else {
|
|
246
|
+
secondaryNodes.push(element[fmtPropName]?.toString() || '');
|
|
247
|
+
}
|
|
248
|
+
} catch {
|
|
249
|
+
secondaryNodes.push(element[fmtPropName]?.toString() || '');
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
} else {
|
|
254
|
+
secondaryRaw = displayColumn.secondary.map(col => element[col]?.toString()).filter(Boolean);
|
|
255
|
+
secondaryNodes = [...secondaryRaw];
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const obj: IOption = {
|
|
259
|
+
key: String(element[displayColumn.key] ?? element.pyGUID ?? ''),
|
|
260
|
+
value: val,
|
|
261
|
+
...(secondaryNodes.length > 0 && { secondary: secondaryNodes }),
|
|
262
|
+
...(secondaryRaw.length > 0 && { secondaryRaw }),
|
|
263
|
+
...(isGrouped && { group: element[groupKeyFields[0]]?.toString() || '' })
|
|
264
|
+
};
|
|
265
|
+
optionsData.push(obj);
|
|
266
|
+
});
|
|
267
|
+
// Sort options by group value so MUI renders groups contiguously
|
|
268
|
+
if (isGrouped) {
|
|
269
|
+
optionsData.sort((a, b) => (a.group || '').localeCompare(b.group || ''));
|
|
270
|
+
}
|
|
271
|
+
return optionsData;
|
|
272
|
+
};
|
|
273
|
+
|
|
135
274
|
useEffect(() => {
|
|
136
275
|
if (!displayMode && listType !== 'associated') {
|
|
137
|
-
getDataPage(datasource, parameters, context)
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
key: element[displayColumn.key] || element.pyGUID,
|
|
144
|
-
value: val
|
|
145
|
-
};
|
|
146
|
-
optionsData.push(obj);
|
|
276
|
+
getDataPage(datasource, parameters, context)
|
|
277
|
+
.then((results: any) => {
|
|
278
|
+
setOptions(buildOptionsFromResults(results));
|
|
279
|
+
})
|
|
280
|
+
.catch(e => {
|
|
281
|
+
console.error(e);
|
|
147
282
|
});
|
|
148
|
-
setOptions(optionsData);
|
|
149
|
-
});
|
|
150
283
|
}
|
|
151
284
|
}, []);
|
|
152
285
|
|
|
153
286
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
154
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
287
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} variant={props.variant} />;
|
|
155
288
|
}
|
|
156
289
|
|
|
157
290
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
@@ -167,18 +300,202 @@ export default function AutoComplete(props: AutoCompleteProps) {
|
|
|
167
300
|
}
|
|
168
301
|
}
|
|
169
302
|
|
|
303
|
+
useEffect(() => {
|
|
304
|
+
setInputValue(selectedValue || '');
|
|
305
|
+
}, [selectedValue]);
|
|
306
|
+
|
|
170
307
|
const handleChange = (event: object, newValue) => {
|
|
171
308
|
const val = newValue ? newValue.key : '';
|
|
172
|
-
|
|
309
|
+
if (!newValue) {
|
|
310
|
+
setInputValue('');
|
|
311
|
+
}
|
|
312
|
+
actionsApi.updateFieldValue(propName, val);
|
|
313
|
+
const changePromise = (actionsApi as any).triggerFieldChange(propName, val);
|
|
173
314
|
if (onRecordChange) {
|
|
174
|
-
|
|
315
|
+
if (changePromise && changePromise.then) {
|
|
316
|
+
changePromise
|
|
317
|
+
.then(() => {
|
|
318
|
+
onRecordChange({ ...event, id: val });
|
|
319
|
+
})
|
|
320
|
+
.catch(e => {
|
|
321
|
+
console.error(e);
|
|
322
|
+
});
|
|
323
|
+
} else {
|
|
324
|
+
onRecordChange({ ...event, id: val });
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
const handleInputValue = (event, newInputValue, reason) => {
|
|
330
|
+
if (reason === 'selectOption') {
|
|
331
|
+
setInputValue(newInputValue);
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
// Sets values for all columns that have setProperty defined (mirrors setValuesToOtherAdditionalFields in constellation-frontend)
|
|
336
|
+
const setValuesToAdditionalFields = (record: Record<string, unknown>) => {
|
|
337
|
+
const setPropertyList = columns
|
|
338
|
+
.filter(col => col.setProperty)
|
|
339
|
+
.map(col => ({
|
|
340
|
+
source: col.value,
|
|
341
|
+
target: col.setProperty,
|
|
342
|
+
key: col.key,
|
|
343
|
+
primary: col.primary
|
|
344
|
+
}));
|
|
345
|
+
|
|
346
|
+
if (setPropertyList.length > 0) {
|
|
347
|
+
setPropertyList.forEach(prop => {
|
|
348
|
+
let valueToSet: string;
|
|
349
|
+
if (prop.key === 'true') {
|
|
350
|
+
valueToSet = record[prop.source]?.toString() || (record as any).pyGUID || '';
|
|
351
|
+
} else {
|
|
352
|
+
valueToSet = record[prop.source]?.toString() || '';
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
if (prop.target === 'Associated property') {
|
|
356
|
+
handleEvent(actionsApi, 'changeNblur', propName, valueToSet);
|
|
357
|
+
} else {
|
|
358
|
+
const target = typeof prop.target === 'string' ? prop.target : '';
|
|
359
|
+
const targetProp = target.startsWith('.') ? target : `.${target}`;
|
|
360
|
+
actionsApi.updateFieldValue(targetProp, valueToSet, { associatedProperty: propName });
|
|
361
|
+
actionsApi.triggerFieldChange(targetProp, valueToSet);
|
|
362
|
+
}
|
|
363
|
+
});
|
|
175
364
|
}
|
|
176
365
|
};
|
|
177
366
|
|
|
178
|
-
|
|
179
|
-
|
|
367
|
+
// Re-fetches the options list (equivalent to initializeList in constellation-frontend)
|
|
368
|
+
const refreshOptionsList = () => {
|
|
369
|
+
if (!displayMode && listType !== 'associated') {
|
|
370
|
+
getDataPage(datasource, parameters, context)
|
|
371
|
+
.then((results: any) => {
|
|
372
|
+
setOptions(buildOptionsFromResults(results));
|
|
373
|
+
})
|
|
374
|
+
.catch(e => {
|
|
375
|
+
console.error(e);
|
|
376
|
+
});
|
|
377
|
+
}
|
|
180
378
|
};
|
|
181
379
|
|
|
380
|
+
const createNewButtonHandler = () => {
|
|
381
|
+
if (onCreateNew) {
|
|
382
|
+
onCreateNew();
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
if (!contextClass) return;
|
|
387
|
+
|
|
388
|
+
const normalizedReferenceType = typeof referenceType === 'string' ? referenceType.toLowerCase() : '';
|
|
389
|
+
const isDataReference = normalizedReferenceType === 'data';
|
|
390
|
+
const { CREATE_STAGE_DONE } = PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS;
|
|
391
|
+
const DATA_OBJECT_CREATED = (PCore.getConstants().PUB_SUB_EVENTS as any).DATA_EVENTS?.DATA_OBJECT_CREATED;
|
|
392
|
+
const eventType = isDataReference && DATA_OBJECT_CREATED ? DATA_OBJECT_CREATED : CREATE_STAGE_DONE;
|
|
393
|
+
|
|
394
|
+
const createNewCallback = isDataReference
|
|
395
|
+
? (data: { classId?: string; data?: { responseData?: Record<string, unknown> } }) => {
|
|
396
|
+
// Clear contexted cache before re-fetching
|
|
397
|
+
PCore.getDataApi().clearContextedCache(context);
|
|
398
|
+
|
|
399
|
+
const responseData = data?.data?.responseData;
|
|
400
|
+
if (responseData) {
|
|
401
|
+
// Set all mapped property values from the newly created record
|
|
402
|
+
setValuesToAdditionalFields(responseData);
|
|
403
|
+
const displayColumn = getDisplayFieldsMetaData(columns);
|
|
404
|
+
if (onRecordChange) {
|
|
405
|
+
const newKey = responseData[displayColumn.key]?.toString() || (responseData as any).pyGUID;
|
|
406
|
+
onRecordChange({ id: newKey });
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// Refresh the options list
|
|
411
|
+
refreshOptionsList();
|
|
412
|
+
PCore.getPubSubUtils().unsubscribe(eventType, contextClass);
|
|
413
|
+
}
|
|
414
|
+
: (data: { caseId?: string; caseType?: string; ID?: string }) => {
|
|
415
|
+
// Clear contexted cache before re-fetching
|
|
416
|
+
PCore.getDataApi().clearContextedCache(context);
|
|
417
|
+
|
|
418
|
+
const newCaseId = data.caseId?.split(' ').pop();
|
|
419
|
+
if (data.caseType === contextClass) {
|
|
420
|
+
const selectKey = data.ID || newCaseId;
|
|
421
|
+
|
|
422
|
+
if (selectKey && listType !== 'associated' && datasource) {
|
|
423
|
+
// Re-fetch data to find the newly created record and set all mapped properties
|
|
424
|
+
getDataPage(datasource, parameters, context)
|
|
425
|
+
.then((results: any) => {
|
|
426
|
+
setOptions(buildOptionsFromResults(results));
|
|
427
|
+
|
|
428
|
+
// Find the newly created record by ID or caseId and set all properties
|
|
429
|
+
const displayColumn = getDisplayFieldsMetaData(columns);
|
|
430
|
+
const newRecord = results?.find((el: any) => el.ID === data.ID || (el[displayColumn.key] || el.pyGUID) === selectKey);
|
|
431
|
+
if (newRecord) {
|
|
432
|
+
setValuesToAdditionalFields(newRecord);
|
|
433
|
+
} else {
|
|
434
|
+
// Fallback: just set the key value
|
|
435
|
+
handleEvent(actionsApi, 'changeNblur', propName, selectKey);
|
|
436
|
+
}
|
|
437
|
+
if (onRecordChange) {
|
|
438
|
+
onRecordChange({ id: selectKey });
|
|
439
|
+
}
|
|
440
|
+
})
|
|
441
|
+
.catch(e => {
|
|
442
|
+
console.error(e);
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
PCore.getPubSubUtils().unsubscribe(eventType, contextClass);
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
// Build the create action if createNewRecord prop is not provided
|
|
450
|
+
const triggerCreate = createNewRecord
|
|
451
|
+
? createNewRecord()
|
|
452
|
+
: isDataReference
|
|
453
|
+
? getPConnect().getActionsApi().showDataObjectCreateView(contextClass)
|
|
454
|
+
: thePConn.getActionsApi().createWork(contextClass, {
|
|
455
|
+
openCaseViewAfterCreate: false,
|
|
456
|
+
startingFields: {}
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
Promise.resolve(triggerCreate)
|
|
460
|
+
.then(() => {
|
|
461
|
+
PCore.getPubSubUtils().subscribe(eventType, createNewCallback, contextClass);
|
|
462
|
+
// Re-initialize the list (equivalent to initializeList() in constellation-frontend)
|
|
463
|
+
refreshOptionsList();
|
|
464
|
+
})
|
|
465
|
+
.catch(e => {
|
|
466
|
+
console.error(e);
|
|
467
|
+
});
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
const showCreateButton = props.allowCreatingRecords === true;
|
|
471
|
+
|
|
472
|
+
const CustomPaper = useCallback(
|
|
473
|
+
(paperProps: React.HTMLAttributes<HTMLElement>) => {
|
|
474
|
+
return (
|
|
475
|
+
<Paper {...paperProps}>
|
|
476
|
+
{paperProps.children}
|
|
477
|
+
{showCreateButton && (
|
|
478
|
+
<>
|
|
479
|
+
<Divider />
|
|
480
|
+
<Button
|
|
481
|
+
fullWidth
|
|
482
|
+
startIcon={<AddIcon />}
|
|
483
|
+
onMouseDown={event => {
|
|
484
|
+
event.preventDefault();
|
|
485
|
+
}}
|
|
486
|
+
onClick={createNewButtonHandler}
|
|
487
|
+
sx={{ justifyContent: 'flex-start', textTransform: 'none', py: 1, px: 2 }}
|
|
488
|
+
>
|
|
489
|
+
{createNewLabel}
|
|
490
|
+
</Button>
|
|
491
|
+
</>
|
|
492
|
+
)}
|
|
493
|
+
</Paper>
|
|
494
|
+
);
|
|
495
|
+
},
|
|
496
|
+
[showCreateButton, createNewButtonHandler, createNewLabel]
|
|
497
|
+
);
|
|
498
|
+
|
|
182
499
|
if (readOnly) {
|
|
183
500
|
const theValAsString = options?.find(opt => opt.key === value)?.value;
|
|
184
501
|
return <TextInput {...props} value={theValAsString} />;
|
|
@@ -187,18 +504,46 @@ export default function AutoComplete(props: AutoCompleteProps) {
|
|
|
187
504
|
// key/value structure to what Autocomplete expects
|
|
188
505
|
return (
|
|
189
506
|
<Autocomplete
|
|
507
|
+
slots={{ paper: CustomPaper }}
|
|
190
508
|
options={options}
|
|
191
509
|
getOptionLabel={(option: IOption) => {
|
|
192
510
|
return option.value ? option.value : '';
|
|
193
511
|
}}
|
|
512
|
+
{...(isGrouped && { groupBy: (option: IOption) => option.group || '' })}
|
|
194
513
|
isOptionEqualToValue={(option: any) => {
|
|
195
514
|
return option.value ? option.value : '';
|
|
196
515
|
}}
|
|
197
516
|
fullWidth
|
|
198
517
|
onChange={handleChange}
|
|
199
518
|
value={selectedValue}
|
|
200
|
-
inputValue={inputValue
|
|
519
|
+
inputValue={inputValue}
|
|
201
520
|
onInputChange={handleInputValue}
|
|
521
|
+
filterOptions={createFilterOptions<IOption>({
|
|
522
|
+
stringify: option => {
|
|
523
|
+
const parts = [option.value || ''];
|
|
524
|
+
if (option.secondaryRaw) {
|
|
525
|
+
parts.push(...option.secondaryRaw);
|
|
526
|
+
}
|
|
527
|
+
return parts.join(' ');
|
|
528
|
+
}
|
|
529
|
+
})}
|
|
530
|
+
renderOption={(renderProps, option: IOption) => (
|
|
531
|
+
<li {...renderProps} key={option.key}>
|
|
532
|
+
<div>
|
|
533
|
+
<span>{option.value}</span>
|
|
534
|
+
{option.secondary && option.secondary.length > 0 && (
|
|
535
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', alignItems: 'center' }}>
|
|
536
|
+
{option.secondary.map((sec, i) => (
|
|
537
|
+
<span key={i} style={{ display: 'inline-flex', alignItems: 'center' }}>
|
|
538
|
+
{sec}
|
|
539
|
+
{i < option.secondary!.length - 1 && <span style={{ margin: '0 4px' }}>{'\u00B7'}</span>}
|
|
540
|
+
</span>
|
|
541
|
+
))}
|
|
542
|
+
</div>
|
|
543
|
+
)}
|
|
544
|
+
</div>
|
|
545
|
+
</li>
|
|
546
|
+
)}
|
|
202
547
|
renderInput={params => (
|
|
203
548
|
<TextField
|
|
204
549
|
{...params}
|
|
@@ -211,6 +556,7 @@ export default function AutoComplete(props: AutoCompleteProps) {
|
|
|
211
556
|
error={status === 'error'}
|
|
212
557
|
label={label}
|
|
213
558
|
data-test-id={testId}
|
|
559
|
+
sx={getFieldSx(status)}
|
|
214
560
|
/>
|
|
215
561
|
)}
|
|
216
562
|
/>
|
|
@@ -6,6 +6,8 @@ import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event
|
|
|
6
6
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
7
|
import { insertInstruction, deleteInstruction, updateNewInstuctions } from '@pega/react-sdk-components/lib/components/helpers/instructions-utils';
|
|
8
8
|
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
9
|
+
import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
|
|
10
|
+
import { getFormControlSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
|
|
9
11
|
|
|
10
12
|
interface CheckboxProps extends Omit<PConnFieldProps, 'value'> {
|
|
11
13
|
// If any, enter additional props that only exist on Checkbox here
|
|
@@ -28,6 +30,11 @@ interface CheckboxProps extends Omit<PConnFieldProps, 'value'> {
|
|
|
28
30
|
showImageDescription: string;
|
|
29
31
|
renderMode: string;
|
|
30
32
|
image: string;
|
|
33
|
+
showFieldMessage?: boolean;
|
|
34
|
+
messageConfig?: {
|
|
35
|
+
content?: string;
|
|
36
|
+
visibility?: boolean;
|
|
37
|
+
};
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
const useStyles = makeStyles(() => ({
|
|
@@ -57,7 +64,6 @@ export default function CheckboxComponent(props: CheckboxProps) {
|
|
|
57
64
|
testId,
|
|
58
65
|
required,
|
|
59
66
|
disabled,
|
|
60
|
-
status,
|
|
61
67
|
helperText,
|
|
62
68
|
validatemessage,
|
|
63
69
|
displayMode,
|
|
@@ -78,18 +84,28 @@ export default function CheckboxComponent(props: CheckboxProps) {
|
|
|
78
84
|
imageSize,
|
|
79
85
|
showImageDescription,
|
|
80
86
|
renderMode,
|
|
81
|
-
image
|
|
87
|
+
image,
|
|
88
|
+
showFieldMessage,
|
|
89
|
+
messageConfig = {}
|
|
82
90
|
} = props;
|
|
83
91
|
const readOnlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY' || readOnly;
|
|
84
92
|
|
|
85
93
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
86
94
|
const [theSelectedButton, setSelectedButton] = useState(value);
|
|
87
95
|
const classes = useStyles();
|
|
88
|
-
const
|
|
96
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
97
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
89
98
|
const thePConn = getPConnect();
|
|
90
99
|
const actionsApi = thePConn.getActionsApi();
|
|
91
100
|
const propName = (thePConn.getStateProps() as any).value;
|
|
92
101
|
|
|
102
|
+
const status = useStatus({
|
|
103
|
+
showFieldMessage,
|
|
104
|
+
messageVisibility: messageConfig.visibility,
|
|
105
|
+
validatemessage,
|
|
106
|
+
readOnly
|
|
107
|
+
});
|
|
108
|
+
|
|
93
109
|
const [checked, setChecked] = useState<any>(false);
|
|
94
110
|
useEffect(() => {
|
|
95
111
|
// This update theSelectedButton which will update the UI to show the selected button correctly
|
|
@@ -109,11 +125,11 @@ export default function CheckboxComponent(props: CheckboxProps) {
|
|
|
109
125
|
}, [value]);
|
|
110
126
|
|
|
111
127
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
112
|
-
return <FieldValueList name={
|
|
128
|
+
return <FieldValueList name={caption} value={value ? trueLabel : falseLabel} variant={props.variant} />;
|
|
113
129
|
}
|
|
114
130
|
|
|
115
131
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
116
|
-
return <FieldValueList name={
|
|
132
|
+
return <FieldValueList name={caption} value={value ? trueLabel : falseLabel} variant='stacked' />;
|
|
117
133
|
}
|
|
118
134
|
|
|
119
135
|
const handleChange = event => {
|
|
@@ -254,7 +270,7 @@ export default function CheckboxComponent(props: CheckboxProps) {
|
|
|
254
270
|
}
|
|
255
271
|
|
|
256
272
|
return (
|
|
257
|
-
<FormControl variant='standard' required={required} error={status === 'error'}>
|
|
273
|
+
<FormControl variant='standard' required={required} error={status === 'error'} sx={getFormControlSx(status)}>
|
|
258
274
|
{!hideLabel && <FormLabel component='legend'>{label}</FormLabel>}
|
|
259
275
|
<FormGroup>{theCheckbox}</FormGroup>
|
|
260
276
|
<FormHelperText>{helperTextToDisplay}</FormHelperText>
|
|
@@ -6,6 +6,8 @@ import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConn
|
|
|
6
6
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
7
7
|
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
8
8
|
import { getCurrencyCharacters, getCurrencyOptions } from './currency-utils';
|
|
9
|
+
import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
|
|
10
|
+
import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
|
|
9
11
|
|
|
10
12
|
/* Using react-number-format component here, since it allows formatting decimal values,
|
|
11
13
|
as per the locale.
|
|
@@ -14,6 +16,12 @@ interface CurrrencyProps extends PConnFieldProps {
|
|
|
14
16
|
// If any, enter additional props that only exist on Currency here
|
|
15
17
|
currencyISOCode?: string;
|
|
16
18
|
allowDecimals: boolean;
|
|
19
|
+
showFieldMessage?: boolean;
|
|
20
|
+
messageConfig?: {
|
|
21
|
+
content?: string;
|
|
22
|
+
visibility?: boolean;
|
|
23
|
+
};
|
|
24
|
+
variant?: string;
|
|
17
25
|
}
|
|
18
26
|
|
|
19
27
|
export default function Currency(props: CurrrencyProps) {
|
|
@@ -27,7 +35,6 @@ export default function Currency(props: CurrrencyProps) {
|
|
|
27
35
|
disabled,
|
|
28
36
|
value = '',
|
|
29
37
|
validatemessage,
|
|
30
|
-
status,
|
|
31
38
|
/* onChange, onBlur, */
|
|
32
39
|
readOnly,
|
|
33
40
|
testId,
|
|
@@ -36,15 +43,25 @@ export default function Currency(props: CurrrencyProps) {
|
|
|
36
43
|
hideLabel,
|
|
37
44
|
currencyISOCode = 'USD',
|
|
38
45
|
placeholder,
|
|
39
|
-
allowDecimals
|
|
46
|
+
allowDecimals,
|
|
47
|
+
showFieldMessage,
|
|
48
|
+
messageConfig = {}
|
|
40
49
|
} = props;
|
|
41
50
|
|
|
42
51
|
const pConn = getPConnect();
|
|
43
52
|
const actions = pConn.getActionsApi();
|
|
44
53
|
const propName = (pConn.getStateProps() as any).value;
|
|
45
|
-
const
|
|
54
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
55
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
46
56
|
const [values, setValues] = useState(value.toString());
|
|
47
57
|
|
|
58
|
+
const status = useStatus({
|
|
59
|
+
showFieldMessage,
|
|
60
|
+
messageVisibility: messageConfig.visibility,
|
|
61
|
+
validatemessage,
|
|
62
|
+
readOnly
|
|
63
|
+
});
|
|
64
|
+
|
|
48
65
|
const testProps: any = { 'data-test-id': testId };
|
|
49
66
|
|
|
50
67
|
useEffect(() => {
|
|
@@ -70,7 +87,7 @@ export default function Currency(props: CurrrencyProps) {
|
|
|
70
87
|
currencyProp = { prefix: theCurrSym, decimalSeparator: theCurrDec, thousandSeparator: theCurrSep };
|
|
71
88
|
|
|
72
89
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
73
|
-
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;
|
|
90
|
+
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant={props.variant} />;
|
|
74
91
|
}
|
|
75
92
|
|
|
76
93
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
@@ -106,6 +123,7 @@ export default function Currency(props: CurrrencyProps) {
|
|
|
106
123
|
fixedDecimalScale={allowDecimals}
|
|
107
124
|
slotProps={{ input: { ...readOnlyProp, inputProps: { ...testProps } } }}
|
|
108
125
|
customInput={TextField}
|
|
126
|
+
sx={getFieldSx(status)}
|
|
109
127
|
/>
|
|
110
128
|
);
|
|
111
129
|
}
|