@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
|
@@ -4,11 +4,19 @@ import { TextField } from '@mui/material';
|
|
|
4
4
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
5
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
6
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
7
|
+
import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
|
|
8
|
+
import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
|
|
7
9
|
|
|
8
10
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
9
11
|
|
|
10
12
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
11
13
|
// If any, enter additional props that only exist on this componentName
|
|
14
|
+
showFieldMessage?: boolean;
|
|
15
|
+
messageConfig?: {
|
|
16
|
+
content?: string;
|
|
17
|
+
visibility?: boolean;
|
|
18
|
+
};
|
|
19
|
+
variant?: string;
|
|
12
20
|
}
|
|
13
21
|
|
|
14
22
|
// Duplicated runtime code from React SDK
|
|
@@ -26,20 +34,29 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
26
34
|
disabled,
|
|
27
35
|
value = '',
|
|
28
36
|
validatemessage,
|
|
29
|
-
status,
|
|
30
37
|
readOnly,
|
|
31
38
|
testId,
|
|
32
39
|
helperText,
|
|
33
40
|
displayMode,
|
|
34
41
|
hideLabel,
|
|
35
|
-
placeholder
|
|
42
|
+
placeholder,
|
|
43
|
+
showFieldMessage,
|
|
44
|
+
messageConfig = {}
|
|
36
45
|
} = props;
|
|
37
46
|
|
|
38
47
|
const pConn = getPConnect();
|
|
39
48
|
const actions = pConn.getActionsApi();
|
|
40
49
|
const propName = (pConn.getStateProps() as any).value;
|
|
41
50
|
|
|
42
|
-
const
|
|
51
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
52
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
53
|
+
|
|
54
|
+
const status = useStatus({
|
|
55
|
+
showFieldMessage,
|
|
56
|
+
messageVisibility: messageConfig.visibility,
|
|
57
|
+
validatemessage,
|
|
58
|
+
readOnly
|
|
59
|
+
});
|
|
43
60
|
|
|
44
61
|
const [inputValue, setInputValue] = useState('');
|
|
45
62
|
|
|
@@ -48,22 +65,14 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
48
65
|
}, [value]);
|
|
49
66
|
|
|
50
67
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
51
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
55
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
|
|
68
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} variant={props.variant} />;
|
|
56
69
|
}
|
|
57
70
|
|
|
58
71
|
if (readOnly) {
|
|
59
72
|
return <TextInput {...props} />;
|
|
60
73
|
}
|
|
61
74
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
testProp = {
|
|
65
|
-
'data-test-id': testId
|
|
66
|
-
};
|
|
75
|
+
const testProps: any = { 'data-test-id': testId };
|
|
67
76
|
|
|
68
77
|
function intOnChange(event) {
|
|
69
78
|
// console.log(`Integer intOnChange inValue: ${event.target.value}`);
|
|
@@ -104,7 +113,10 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
104
113
|
type='text'
|
|
105
114
|
{{! pick new delimiters for mustache }}
|
|
106
115
|
{{=<% %>=}}
|
|
107
|
-
|
|
116
|
+
slotProps={{
|
|
117
|
+
htmlInput: { inputMode: 'numeric', pattern: '[0-9]*', ...testProps }
|
|
118
|
+
}}
|
|
119
|
+
sx={getFieldSx(status)}
|
|
108
120
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
109
121
|
/>
|
|
110
122
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -7,6 +7,8 @@ import { getDataPage } from '@pega/react-sdk-components/lib/components/helpers/d
|
|
|
7
7
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
8
8
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
9
9
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
10
|
+
import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
|
|
11
|
+
import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
|
|
10
12
|
|
|
11
13
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
12
14
|
|
|
@@ -58,6 +60,12 @@ interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
|
58
60
|
datasourceMetadata?: any;
|
|
59
61
|
parameters?: any;
|
|
60
62
|
columns: any[];
|
|
63
|
+
showFieldMessage?: boolean;
|
|
64
|
+
messageConfig?: {
|
|
65
|
+
content?: string;
|
|
66
|
+
visibility?: boolean;
|
|
67
|
+
};
|
|
68
|
+
variant?: string;
|
|
61
69
|
}
|
|
62
70
|
|
|
63
71
|
// Duplicated runtime code from React SDK
|
|
@@ -74,7 +82,6 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
74
82
|
disabled,
|
|
75
83
|
value = '',
|
|
76
84
|
validatemessage,
|
|
77
|
-
status,
|
|
78
85
|
readOnly,
|
|
79
86
|
testId,
|
|
80
87
|
helperText,
|
|
@@ -83,7 +90,9 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
83
90
|
datasourceMetadata,
|
|
84
91
|
hideLabel,
|
|
85
92
|
onRecordChange,
|
|
86
|
-
fieldMetadata
|
|
93
|
+
fieldMetadata,
|
|
94
|
+
showFieldMessage,
|
|
95
|
+
messageConfig = {}
|
|
87
96
|
} = props;
|
|
88
97
|
let { placeholder = '' } = props;
|
|
89
98
|
const context = getPConnect().getContextName();
|
|
@@ -91,7 +100,8 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
91
100
|
placeholder = placeholder || 'Select...';
|
|
92
101
|
const [options, setOptions] = useState<IOption[]>([]);
|
|
93
102
|
const [theDatasource, setDatasource] = useState<any[] | null>(null);
|
|
94
|
-
const
|
|
103
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
104
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
95
105
|
|
|
96
106
|
const thePConn = getPConnect();
|
|
97
107
|
const actionsApi = thePConn.getActionsApi();
|
|
@@ -99,6 +109,13 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
99
109
|
const className = thePConn.getCaseInfo().getClassName();
|
|
100
110
|
const refName = propName?.slice(propName.lastIndexOf('.') + 1);
|
|
101
111
|
|
|
112
|
+
const status = useStatus({
|
|
113
|
+
showFieldMessage,
|
|
114
|
+
messageVisibility: messageConfig.visibility,
|
|
115
|
+
validatemessage,
|
|
116
|
+
readOnly
|
|
117
|
+
});
|
|
118
|
+
|
|
102
119
|
if (!isDeepEqual(datasource, theDatasource)) {
|
|
103
120
|
// inbound datasource is different, so update theDatasource (to trigger useEffect)
|
|
104
121
|
setDatasource(datasource);
|
|
@@ -135,7 +152,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
135
152
|
const optionsList = [...list];
|
|
136
153
|
optionsList.unshift({
|
|
137
154
|
key: placeholder,
|
|
138
|
-
value: thePConn.getLocalizedValue(placeholder)
|
|
155
|
+
value: thePConn.getLocalizedValue(placeholder, '', '')
|
|
139
156
|
}); // 2nd and 3rd args empty string until typedef marked correctly
|
|
140
157
|
setOptions(optionsList);
|
|
141
158
|
}
|
|
@@ -154,7 +171,14 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
154
171
|
};
|
|
155
172
|
optionsData.push(obj);
|
|
156
173
|
});
|
|
174
|
+
optionsData.unshift({
|
|
175
|
+
key: placeholder,
|
|
176
|
+
value: thePConn.getLocalizedValue(placeholder, '', '')
|
|
177
|
+
});
|
|
157
178
|
setOptions(optionsData);
|
|
179
|
+
})
|
|
180
|
+
.catch(e => {
|
|
181
|
+
console.error(e);
|
|
158
182
|
});
|
|
159
183
|
}
|
|
160
184
|
}, []);
|
|
@@ -176,6 +200,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
176
200
|
<FieldValueList
|
|
177
201
|
name={hideLabel ? '' : label}
|
|
178
202
|
value={thePConn.getLocalizedValue(val, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
|
|
203
|
+
variant={props.variant}
|
|
179
204
|
/>
|
|
180
205
|
);
|
|
181
206
|
}
|
|
@@ -201,9 +226,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
201
226
|
readOnlyProp = { readOnly: true };
|
|
202
227
|
}
|
|
203
228
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
testProp = {
|
|
229
|
+
const testProps: any = {
|
|
207
230
|
'data-test-id': testId
|
|
208
231
|
};
|
|
209
232
|
|
|
@@ -234,7 +257,10 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
234
257
|
select
|
|
235
258
|
{{! pick new delimiters for mustache }}
|
|
236
259
|
{{=<% %>=}}
|
|
237
|
-
|
|
260
|
+
slotProps={{
|
|
261
|
+
input: { ...readOnlyProp, ...testProps }
|
|
262
|
+
}}
|
|
263
|
+
sx={getFieldSx(status)}
|
|
238
264
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
239
265
|
>
|
|
240
266
|
{options.map((option: any) => (
|
|
@@ -8,6 +8,8 @@ import { getDataPage } from '@pega/react-sdk-components/lib/components/helpers/d
|
|
|
8
8
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
9
9
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
10
10
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
11
|
+
import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
|
|
12
|
+
import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
|
|
11
13
|
|
|
12
14
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
13
15
|
|
|
@@ -44,13 +46,18 @@ interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
|
44
46
|
displayMode?: string;
|
|
45
47
|
deferDatasource?: boolean;
|
|
46
48
|
datasourceMetadata?: any;
|
|
47
|
-
status?: string;
|
|
48
49
|
onRecordChange?: any;
|
|
49
50
|
additionalProps?: object;
|
|
50
51
|
listType: string;
|
|
51
52
|
parameters?: any;
|
|
52
53
|
datasource: any;
|
|
53
54
|
columns: any[];
|
|
55
|
+
showFieldMessage?: boolean;
|
|
56
|
+
messageConfig?: {
|
|
57
|
+
content?: string;
|
|
58
|
+
visibility?: boolean;
|
|
59
|
+
};
|
|
60
|
+
variant?: string;
|
|
54
61
|
}
|
|
55
62
|
|
|
56
63
|
// Duplicated runtime code from React SDK
|
|
@@ -73,10 +80,11 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
73
80
|
displayMode,
|
|
74
81
|
deferDatasource,
|
|
75
82
|
datasourceMetadata,
|
|
76
|
-
status,
|
|
77
83
|
helperText,
|
|
78
84
|
hideLabel,
|
|
79
|
-
onRecordChange
|
|
85
|
+
onRecordChange,
|
|
86
|
+
showFieldMessage,
|
|
87
|
+
messageConfig = {}
|
|
80
88
|
} = props;
|
|
81
89
|
|
|
82
90
|
const context = getPConnect().getContextName();
|
|
@@ -85,12 +93,20 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
85
93
|
const [options, setOptions] = useState<IOption[]>([]);
|
|
86
94
|
const [theDatasource, setDatasource] = useState(null);
|
|
87
95
|
let selectedValue: any = '';
|
|
88
|
-
const
|
|
96
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
97
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
89
98
|
|
|
90
99
|
const thePConn = getPConnect();
|
|
91
100
|
const actionsApi = thePConn.getActionsApi();
|
|
92
101
|
const propName = (thePConn.getStateProps() as any).value;
|
|
93
102
|
|
|
103
|
+
const status = useStatus({
|
|
104
|
+
showFieldMessage,
|
|
105
|
+
messageVisibility: messageConfig.visibility,
|
|
106
|
+
validatemessage,
|
|
107
|
+
readOnly
|
|
108
|
+
});
|
|
109
|
+
|
|
94
110
|
if (!isDeepEqual(datasource, theDatasource)) {
|
|
95
111
|
// inbound datasource is different, so update theDatasource (to trigger useEffect)
|
|
96
112
|
setDatasource(datasource);
|
|
@@ -156,11 +172,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
156
172
|
}, []);
|
|
157
173
|
|
|
158
174
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
159
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
163
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
|
|
175
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} variant={props.variant} />;
|
|
164
176
|
}
|
|
165
177
|
|
|
166
178
|
if (value) {
|
|
@@ -220,6 +232,10 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
220
232
|
error={status === 'error'}
|
|
221
233
|
label={label}
|
|
222
234
|
data-test-id={testId}
|
|
235
|
+
{{! pick new delimiters for mustache }}
|
|
236
|
+
{{=<% %>=}}
|
|
237
|
+
sx={getFieldSx(status)}
|
|
238
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
223
239
|
/>
|
|
224
240
|
)}
|
|
225
241
|
/>
|
|
@@ -5,6 +5,8 @@ import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
|
5
5
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
6
6
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
7
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
|
+
import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
|
|
9
|
+
import { getFormControlSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
|
|
8
10
|
|
|
9
11
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
10
12
|
|
|
@@ -20,6 +22,11 @@ interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
|
20
22
|
imageSize?: string;
|
|
21
23
|
showImageDescription?: boolean;
|
|
22
24
|
datasource?: any;
|
|
25
|
+
showFieldMessage?: boolean;
|
|
26
|
+
messageConfig?: {
|
|
27
|
+
content?: string;
|
|
28
|
+
visibility?: boolean;
|
|
29
|
+
};
|
|
23
30
|
}
|
|
24
31
|
|
|
25
32
|
// Duplicated runtime code from React SDK
|
|
@@ -37,7 +44,6 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
37
44
|
readOnly,
|
|
38
45
|
validatemessage,
|
|
39
46
|
helperText,
|
|
40
|
-
status,
|
|
41
47
|
required,
|
|
42
48
|
inline,
|
|
43
49
|
displayMode,
|
|
@@ -49,7 +55,9 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
49
55
|
datasource,
|
|
50
56
|
imagePosition,
|
|
51
57
|
imageSize,
|
|
52
|
-
showImageDescription
|
|
58
|
+
showImageDescription,
|
|
59
|
+
showFieldMessage,
|
|
60
|
+
messageConfig = {}
|
|
53
61
|
} = props;
|
|
54
62
|
const [theSelectedButton, setSelectedButton] = useState(value);
|
|
55
63
|
|
|
@@ -57,9 +65,17 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
57
65
|
const theConfigProps = thePConn.getConfigProps();
|
|
58
66
|
const actionsApi = thePConn.getActionsApi();
|
|
59
67
|
const propName = (thePConn.getStateProps() as any).value;
|
|
60
|
-
const
|
|
68
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
69
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
61
70
|
const className = thePConn.getCaseInfo().getClassName();
|
|
62
71
|
|
|
72
|
+
const status = useStatus({
|
|
73
|
+
showFieldMessage,
|
|
74
|
+
messageVisibility: messageConfig.visibility,
|
|
75
|
+
validatemessage,
|
|
76
|
+
readOnly
|
|
77
|
+
});
|
|
78
|
+
|
|
63
79
|
let configProperty = (thePConn.getRawMetadata() as any)?.config?.value || '';
|
|
64
80
|
configProperty = configProperty.startsWith('@P') ? configProperty.substring(3) : configProperty;
|
|
65
81
|
configProperty = configProperty.startsWith('.') ? configProperty.substring(1) : configProperty;
|
|
@@ -115,7 +131,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
115
131
|
{{! pick new delimiters for mustache }}
|
|
116
132
|
{{=<% %>=}}
|
|
117
133
|
<h4 style={{ marginTop: 0, marginBottom: 0 }}>{label}</h4>
|
|
118
|
-
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(min(200px, 100%), 1fr))', gap: '1rem' }}>
|
|
134
|
+
<div id='selectable-card' style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(min(200px, 100%), 1fr))', gap: '1rem' }}>
|
|
119
135
|
<SelectableCard
|
|
120
136
|
hideFieldLabels={hideFieldLabels}
|
|
121
137
|
additionalProps={additionalProps}
|
|
@@ -142,7 +158,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
142
158
|
}
|
|
143
159
|
return (
|
|
144
160
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
145
|
-
<FormControl variant='standard' error={status === 'error'} required={required}>
|
|
161
|
+
<FormControl variant='standard' error={status === 'error'} required={required} sx={getFormControlSx(status)}>
|
|
146
162
|
<FormLabel component='legend'>{label}</FormLabel>
|
|
147
163
|
<RadioGroup value={theSelectedButton} onChange={handleChange} onBlur={!readOnly ? handleBlur : undefined} row={inline}>
|
|
148
164
|
{theOptions.map(theOption => {
|
|
@@ -4,12 +4,20 @@ import { TextField } from '@mui/material';
|
|
|
4
4
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
6
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
|
|
8
|
+
import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
|
|
7
9
|
|
|
8
10
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
9
11
|
|
|
10
12
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
11
13
|
// If any, enter additional props that only exist on this componentName
|
|
12
14
|
fieldMetadata?: any;
|
|
15
|
+
showFieldMessage?: boolean;
|
|
16
|
+
messageConfig?: {
|
|
17
|
+
content?: string;
|
|
18
|
+
visibility?: boolean;
|
|
19
|
+
};
|
|
20
|
+
variant?: string;
|
|
13
21
|
}
|
|
14
22
|
|
|
15
23
|
// Duplicated runtime code from React SDK
|
|
@@ -26,7 +34,6 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
26
34
|
disabled,
|
|
27
35
|
value = '',
|
|
28
36
|
validatemessage,
|
|
29
|
-
status,
|
|
30
37
|
/* onChange, onBlur */
|
|
31
38
|
readOnly,
|
|
32
39
|
testId,
|
|
@@ -34,14 +41,23 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
34
41
|
helperText,
|
|
35
42
|
displayMode,
|
|
36
43
|
hideLabel,
|
|
37
|
-
placeholder
|
|
44
|
+
placeholder,
|
|
45
|
+
showFieldMessage,
|
|
46
|
+
messageConfig = {}
|
|
38
47
|
} = props;
|
|
39
48
|
|
|
40
49
|
const pConn = getPConnect();
|
|
41
50
|
const actions = pConn.getActionsApi();
|
|
42
51
|
const propName = (pConn.getStateProps() as any).value;
|
|
52
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
53
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
43
54
|
|
|
44
|
-
const
|
|
55
|
+
const status = useStatus({
|
|
56
|
+
showFieldMessage,
|
|
57
|
+
messageVisibility: messageConfig.visibility,
|
|
58
|
+
validatemessage,
|
|
59
|
+
readOnly
|
|
60
|
+
});
|
|
45
61
|
|
|
46
62
|
const [inputValue, setInputValue] = useState('');
|
|
47
63
|
const maxLength = fieldMetadata?.maxLength;
|
|
@@ -53,22 +69,14 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
53
69
|
}, [value]);
|
|
54
70
|
|
|
55
71
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
56
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
60
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
|
|
72
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} variant={props.variant} />;
|
|
61
73
|
}
|
|
62
74
|
|
|
63
75
|
if (readOnly) {
|
|
64
76
|
readOnlyProp = { readOnly: true };
|
|
65
77
|
}
|
|
66
78
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
testProp = {
|
|
70
|
-
'data-test-id': testId
|
|
71
|
-
};
|
|
79
|
+
const testProps: any = { 'data-test-id': testId };
|
|
72
80
|
|
|
73
81
|
function handleChange(event) {
|
|
74
82
|
// update internal value
|
|
@@ -96,7 +104,10 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
96
104
|
value={inputValue}
|
|
97
105
|
{{! pick new delimiters for mustache }}
|
|
98
106
|
{{=<% %>=}}
|
|
99
|
-
|
|
107
|
+
slotProps={{
|
|
108
|
+
input: { ...readOnlyProp, inputProps: { maxLength, ...testProps } }
|
|
109
|
+
}}
|
|
110
|
+
sx={getFieldSx(status)}
|
|
100
111
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
101
112
|
/>
|
|
102
113
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -5,11 +5,19 @@ import MailOutlineIcon from '@mui/icons-material/MailOutline';
|
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
6
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
7
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
8
|
+
import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
|
|
9
|
+
import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
|
|
8
10
|
|
|
9
11
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
10
12
|
|
|
11
13
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
12
14
|
// If any, enter additional props that only exist on this componentName
|
|
15
|
+
showFieldMessage?: boolean;
|
|
16
|
+
messageConfig?: {
|
|
17
|
+
content?: string;
|
|
18
|
+
visibility?: boolean;
|
|
19
|
+
};
|
|
20
|
+
variant?: string;
|
|
13
21
|
}
|
|
14
22
|
|
|
15
23
|
// Duplicated runtime code from React SDK
|
|
@@ -27,20 +35,28 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
27
35
|
disabled,
|
|
28
36
|
value = '',
|
|
29
37
|
validatemessage,
|
|
30
|
-
status,
|
|
31
38
|
readOnly,
|
|
32
39
|
testId,
|
|
33
40
|
helperText,
|
|
34
41
|
displayMode,
|
|
35
42
|
hideLabel,
|
|
36
|
-
placeholder
|
|
43
|
+
placeholder,
|
|
44
|
+
showFieldMessage,
|
|
45
|
+
messageConfig = {}
|
|
37
46
|
} = props;
|
|
38
47
|
|
|
39
48
|
const pConn = getPConnect();
|
|
40
49
|
const actions = pConn.getActionsApi();
|
|
41
50
|
const propName = (pConn.getStateProps() as any).value;
|
|
42
|
-
|
|
43
|
-
const helperTextToDisplay = validatemessage || helperText;
|
|
51
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
52
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
53
|
+
|
|
54
|
+
const status = useStatus({
|
|
55
|
+
showFieldMessage,
|
|
56
|
+
messageVisibility: messageConfig.visibility,
|
|
57
|
+
validatemessage,
|
|
58
|
+
readOnly
|
|
59
|
+
});
|
|
44
60
|
|
|
45
61
|
const [inputValue, setInputValue] = useState('');
|
|
46
62
|
|
|
@@ -49,22 +65,14 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
49
65
|
}, [value]);
|
|
50
66
|
|
|
51
67
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
52
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
56
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
|
|
68
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} variant={props.variant} />;
|
|
57
69
|
}
|
|
58
70
|
|
|
59
71
|
if (readOnly) {
|
|
60
72
|
return <TextInput {...props} />;
|
|
61
73
|
}
|
|
62
74
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
testProp = {
|
|
66
|
-
'data-test-id': testId
|
|
67
|
-
};
|
|
75
|
+
const testProps: any = { 'data-test-id': testId };
|
|
68
76
|
|
|
69
77
|
function handleChange(event) {
|
|
70
78
|
// update internal value
|
|
@@ -93,14 +101,17 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
93
101
|
type='email'
|
|
94
102
|
{{! pick new delimiters for mustache }}
|
|
95
103
|
{{=<% %>=}}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
slotProps={{
|
|
105
|
+
input: {
|
|
106
|
+
startAdornment: (
|
|
107
|
+
<InputAdornment position='start'>
|
|
108
|
+
<MailOutlineIcon />
|
|
109
|
+
</InputAdornment>
|
|
110
|
+
),
|
|
111
|
+
inputProps: { ...testProps }
|
|
112
|
+
}
|
|
103
113
|
}}
|
|
114
|
+
sx={getFieldSx(status)}
|
|
104
115
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
105
116
|
/>
|
|
106
117
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -4,12 +4,20 @@ import { TextField } from '@mui/material';
|
|
|
4
4
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
6
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
|
|
8
|
+
import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
|
|
7
9
|
|
|
8
10
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
9
11
|
|
|
10
12
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
11
13
|
// If any, enter additional props that only exist on this componentName
|
|
12
14
|
fieldMetadata?: any;
|
|
15
|
+
showFieldMessage?: boolean;
|
|
16
|
+
messageConfig?: {
|
|
17
|
+
content?: string;
|
|
18
|
+
visibility?: boolean;
|
|
19
|
+
};
|
|
20
|
+
variant?: string;
|
|
13
21
|
}
|
|
14
22
|
|
|
15
23
|
// Duplicated runtime code from React SDK
|
|
@@ -26,7 +34,6 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
26
34
|
disabled,
|
|
27
35
|
value = '',
|
|
28
36
|
validatemessage,
|
|
29
|
-
status,
|
|
30
37
|
/* onChange, onBlur */
|
|
31
38
|
readOnly,
|
|
32
39
|
testId,
|
|
@@ -34,14 +41,23 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
34
41
|
helperText,
|
|
35
42
|
displayMode,
|
|
36
43
|
hideLabel,
|
|
37
|
-
placeholder
|
|
44
|
+
placeholder,
|
|
45
|
+
showFieldMessage,
|
|
46
|
+
messageConfig = {}
|
|
38
47
|
} = props;
|
|
39
48
|
|
|
40
49
|
const pConn = getPConnect();
|
|
41
50
|
const actions = pConn.getActionsApi();
|
|
42
51
|
const propName = (pConn.getStateProps() as any).value;
|
|
52
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
53
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
43
54
|
|
|
44
|
-
const
|
|
55
|
+
const status = useStatus({
|
|
56
|
+
showFieldMessage,
|
|
57
|
+
messageVisibility: messageConfig.visibility,
|
|
58
|
+
validatemessage,
|
|
59
|
+
readOnly
|
|
60
|
+
});
|
|
45
61
|
|
|
46
62
|
const [inputValue, setInputValue] = useState('');
|
|
47
63
|
const maxLength = fieldMetadata?.maxLength;
|
|
@@ -53,7 +69,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
53
69
|
}, [value]);
|
|
54
70
|
|
|
55
71
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
56
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
72
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} variant={props.variant} />;
|
|
57
73
|
}
|
|
58
74
|
|
|
59
75
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
@@ -64,11 +80,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
64
80
|
readOnlyProp = { readOnly: true };
|
|
65
81
|
}
|
|
66
82
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
testProp = {
|
|
70
|
-
'data-test-id': testId
|
|
71
|
-
};
|
|
83
|
+
const testProps: any = { 'data-test-id': testId };
|
|
72
84
|
|
|
73
85
|
function handleChange(event) {
|
|
74
86
|
// update internal value
|
|
@@ -96,7 +108,10 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
96
108
|
value={inputValue}
|
|
97
109
|
{{! pick new delimiters for mustache }}
|
|
98
110
|
{{=<% %>=}}
|
|
99
|
-
|
|
111
|
+
slotProps={{
|
|
112
|
+
input: { ...readOnlyProp, inputProps: { maxLength, ...testProps } }
|
|
113
|
+
}}
|
|
114
|
+
sx={getFieldSx(status)}
|
|
100
115
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
101
116
|
/>
|
|
102
117
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|