@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,12 +4,20 @@ 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
|
|
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,22 +34,31 @@ 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
|
fieldMetadata,
|
|
33
40
|
helperText,
|
|
34
41
|
displayMode,
|
|
35
42
|
hideLabel,
|
|
36
|
-
placeholder
|
|
43
|
+
placeholder,
|
|
44
|
+
showFieldMessage,
|
|
45
|
+
messageConfig = {}
|
|
37
46
|
} = props;
|
|
38
|
-
const
|
|
47
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
48
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
39
49
|
|
|
40
50
|
const pConn = getPConnect();
|
|
41
51
|
const actions = pConn.getActionsApi();
|
|
42
52
|
const propName = (pConn.getStateProps() as any).value;
|
|
43
53
|
const maxLength = fieldMetadata?.maxLength;
|
|
44
54
|
|
|
55
|
+
const status = useStatus({
|
|
56
|
+
showFieldMessage,
|
|
57
|
+
messageVisibility: messageConfig.visibility,
|
|
58
|
+
validatemessage,
|
|
59
|
+
readOnly
|
|
60
|
+
});
|
|
61
|
+
|
|
45
62
|
const [inputValue, setInputValue] = useState('');
|
|
46
63
|
|
|
47
64
|
let readOnlyProp = {};
|
|
@@ -51,11 +68,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
51
68
|
}, [value]);
|
|
52
69
|
|
|
53
70
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
54
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
58
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
|
|
71
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} variant={props.variant} />;
|
|
59
72
|
}
|
|
60
73
|
|
|
61
74
|
if (readOnly) {
|
|
@@ -64,11 +77,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
64
77
|
readOnlyProp = { readOnly: true };
|
|
65
78
|
}
|
|
66
79
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
testProp = {
|
|
70
|
-
'data-test-id': testId
|
|
71
|
-
};
|
|
80
|
+
const testProps: any = { 'data-test-id': testId };
|
|
72
81
|
|
|
73
82
|
function handleChange(event) {
|
|
74
83
|
// update internal value
|
|
@@ -99,7 +108,10 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
99
108
|
value={inputValue}
|
|
100
109
|
{{! pick new delimiters for mustache }}
|
|
101
110
|
{{=<% %>=}}
|
|
102
|
-
|
|
111
|
+
slotProps={{
|
|
112
|
+
input: { ...readOnlyProp, inputProps: { maxLength, ...testProps } }
|
|
113
|
+
}}
|
|
114
|
+
sx={getFieldSx(status)}
|
|
103
115
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
104
116
|
/>
|
|
105
117
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -4,11 +4,19 @@ import { MuiTelInput } from 'mui-tel-input';
|
|
|
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
|
|
@@ -25,14 +33,15 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
25
33
|
disabled,
|
|
26
34
|
value = '',
|
|
27
35
|
validatemessage,
|
|
28
|
-
status,
|
|
29
36
|
onChange,
|
|
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();
|
|
@@ -42,16 +51,20 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
42
51
|
const [inputValue, setInputValue] = useState(value);
|
|
43
52
|
useEffect(() => setInputValue(value), [value]);
|
|
44
53
|
|
|
45
|
-
const
|
|
54
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
55
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
46
56
|
|
|
47
|
-
|
|
57
|
+
const status = useStatus({
|
|
58
|
+
showFieldMessage,
|
|
59
|
+
messageVisibility: messageConfig.visibility,
|
|
60
|
+
validatemessage,
|
|
61
|
+
readOnly
|
|
62
|
+
});
|
|
48
63
|
|
|
49
|
-
|
|
50
|
-
'data-test-id': testId
|
|
51
|
-
};
|
|
64
|
+
const testProps: any = { 'data-test-id': testId };
|
|
52
65
|
|
|
53
66
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
54
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
67
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} variant={props.variant} />;
|
|
55
68
|
}
|
|
56
69
|
|
|
57
70
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
@@ -80,11 +93,15 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
80
93
|
slotProps={{
|
|
81
94
|
input: {
|
|
82
95
|
readOnly: true,
|
|
83
|
-
...
|
|
96
|
+
...testProps,
|
|
84
97
|
},
|
|
85
98
|
}}
|
|
86
99
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
87
100
|
disableDropdown={disableDropdown}
|
|
101
|
+
{{! pick new delimiters for mustache }}
|
|
102
|
+
{{=<% %>=}}
|
|
103
|
+
sx={getFieldSx(status)}
|
|
104
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
88
105
|
/>
|
|
89
106
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
90
107
|
</div>
|
|
@@ -120,7 +137,8 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
120
137
|
value={inputValue}
|
|
121
138
|
{{! pick new delimiters for mustache }}
|
|
122
139
|
{{=<% %>=}}
|
|
123
|
-
slotProps={{ input: { ...
|
|
140
|
+
slotProps={{ input: { ...testProps } }}
|
|
141
|
+
sx={getFieldSx(status)}
|
|
124
142
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
125
143
|
/>
|
|
126
144
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -4,11 +4,19 @@ 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
|
|
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,15 +34,17 @@ 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
|
-
const
|
|
46
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
47
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
38
48
|
|
|
39
49
|
const [inputValue, setInputValue] = useState('');
|
|
40
50
|
|
|
@@ -42,27 +52,26 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
42
52
|
const actions = pConn.getActionsApi();
|
|
43
53
|
const propName = (pConn.getStateProps() as any).value;
|
|
44
54
|
|
|
55
|
+
const status = useStatus({
|
|
56
|
+
showFieldMessage,
|
|
57
|
+
messageVisibility: messageConfig.visibility,
|
|
58
|
+
validatemessage,
|
|
59
|
+
readOnly
|
|
60
|
+
});
|
|
61
|
+
|
|
45
62
|
useEffect(() => {
|
|
46
63
|
setInputValue(value);
|
|
47
64
|
}, [value]);
|
|
48
65
|
|
|
49
66
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
50
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
54
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
|
|
67
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} variant={props.variant} />;
|
|
55
68
|
}
|
|
56
69
|
|
|
57
70
|
if (readOnly) {
|
|
58
71
|
return <TextInput {...props} />;
|
|
59
72
|
}
|
|
60
73
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
testProp = {
|
|
64
|
-
'data-test-id': testId
|
|
65
|
-
};
|
|
74
|
+
const testProps: any = { 'data-test-id': testId };
|
|
66
75
|
|
|
67
76
|
const handleChange = event => {
|
|
68
77
|
setInputValue(event?.target?.value);
|
|
@@ -90,7 +99,10 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
90
99
|
value={inputValue}
|
|
91
100
|
{{! pick new delimiters for mustache }}
|
|
92
101
|
{{=<% %>=}}
|
|
93
|
-
|
|
102
|
+
slotProps={{
|
|
103
|
+
input: { inputProps: { ...testProps } }
|
|
104
|
+
}}
|
|
105
|
+
sx={getFieldSx(status)}
|
|
94
106
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
95
107
|
/>
|
|
96
108
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { LocalizationProvider } from '@mui/x-date-pickers';
|
|
4
|
+
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
5
|
+
|
|
2
6
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
7
|
|
|
4
8
|
import {{COMPONENT_CLASS_NAME}} from './index';
|
|
@@ -41,7 +45,11 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
41
45
|
}
|
|
42
46
|
};
|
|
43
47
|
|
|
44
|
-
|
|
48
|
+
return (
|
|
49
|
+
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
|
50
|
+
<{{COMPONENT_CLASS_NAME}} {...props} {...args} />
|
|
51
|
+
</LocalizationProvider>
|
|
52
|
+
);
|
|
45
53
|
};
|
|
46
54
|
|
|
47
55
|
Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { TimePicker } from '@mui/x-date-pickers/TimePicker';
|
|
2
2
|
// import AccessTimeIcon from '@mui/icons-material/AccessTime';
|
|
3
|
-
import { LocalizationProvider } from '@mui/x-date-pickers';
|
|
4
|
-
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
5
3
|
import dayjs from 'dayjs';
|
|
6
4
|
|
|
7
5
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
8
6
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
9
7
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
|
+
import useStatus from '@pega/react-sdk-components/lib/hooks/useStatus';
|
|
9
|
+
import { getFieldSx } from '@pega/react-sdk-components/lib/components/helpers/field-utils';
|
|
10
10
|
|
|
11
11
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
12
12
|
|
|
13
13
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
14
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;
|
|
15
21
|
}
|
|
16
22
|
|
|
17
23
|
// Duplicated runtime code from React SDK
|
|
@@ -22,29 +28,29 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
22
28
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
23
29
|
const TextInput = getComponentFromMap('TextInput');
|
|
24
30
|
|
|
25
|
-
const { getPConnect, label, required, disabled, value = '', validatemessage,
|
|
26
|
-
const
|
|
31
|
+
const { getPConnect, label, required, disabled, value = '', validatemessage, readOnly, helperText, displayMode, hideLabel, testId, showFieldMessage, messageConfig = {} } = props;
|
|
32
|
+
const eligibleForFieldWarning = showFieldMessage && messageConfig.visibility && !readOnly;
|
|
33
|
+
const helperTextToDisplay = validatemessage || (eligibleForFieldWarning ? messageConfig.content : helperText);
|
|
27
34
|
const pConn = getPConnect();
|
|
28
35
|
const actions = pConn.getActionsApi();
|
|
29
36
|
const propName = (pConn.getStateProps() as any).value;
|
|
30
37
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
const status = useStatus({
|
|
39
|
+
showFieldMessage,
|
|
40
|
+
messageVisibility: messageConfig.visibility,
|
|
41
|
+
validatemessage,
|
|
42
|
+
readOnly
|
|
43
|
+
});
|
|
34
44
|
|
|
35
|
-
if (displayMode === '
|
|
36
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} variant=
|
|
45
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
46
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} variant={props.variant} />;
|
|
37
47
|
}
|
|
38
48
|
|
|
39
49
|
if (readOnly) {
|
|
40
50
|
return <TextInput {...props} />;
|
|
41
51
|
}
|
|
42
52
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
testProp = {
|
|
46
|
-
'data-test-id': testId
|
|
47
|
-
};
|
|
53
|
+
const testProps: any = { 'data-test-id': testId };
|
|
48
54
|
|
|
49
55
|
const handleChange = date => {
|
|
50
56
|
const theValue = date && date.isValid() ? date.format('HH:mm:ss') : null;
|
|
@@ -64,7 +70,6 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
64
70
|
|
|
65
71
|
return (
|
|
66
72
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
67
|
-
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
|
68
73
|
<TimePicker
|
|
69
74
|
// keyboardIcon={<AccessTimeIcon />}
|
|
70
75
|
// fullWidth
|
|
@@ -87,12 +92,12 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
87
92
|
error: status === 'error',
|
|
88
93
|
helperText: helperTextToDisplay,
|
|
89
94
|
size: 'small',
|
|
90
|
-
InputProps: { ...
|
|
95
|
+
InputProps: { ...testProps },
|
|
96
|
+
sx: getFieldSx(status)
|
|
91
97
|
}
|
|
92
98
|
}}
|
|
93
99
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
94
100
|
/>
|
|
95
|
-
</LocalizationProvider>
|
|
96
101
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
97
102
|
);
|
|
98
103
|
}
|
|
@@ -16,10 +16,90 @@
|
|
|
16
16
|
gap: calc(1rem);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
.psdk-default-form-three-column .grid-column {
|
|
20
|
+
grid-column: 1 / span 3;
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
.psdk-default-form-two-column .grid-column {
|
|
20
24
|
grid-column: 1 / span 2;
|
|
21
25
|
}
|
|
22
26
|
|
|
23
|
-
.psdk-default-form-
|
|
24
|
-
grid-column: 1
|
|
27
|
+
.psdk-default-form-one-column .grid-column {
|
|
28
|
+
grid-column: 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.psdk-default-form-instruction-text {
|
|
32
|
+
padding-top: 0.625rem;
|
|
33
|
+
padding-bottom: 0.625rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.psdk-default-form-instruction-text ul {
|
|
37
|
+
padding-left: 30px;
|
|
38
|
+
list-style-type: disc;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.psdk-default-form-instruction-text ol {
|
|
42
|
+
padding-left: 30px;
|
|
43
|
+
list-style-type: decimal;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Banner styles */
|
|
47
|
+
.psdk-banner {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: flex-start;
|
|
50
|
+
padding: 0.75rem 1rem;
|
|
51
|
+
border-radius: 0.25rem;
|
|
52
|
+
margin-bottom: 1rem;
|
|
53
|
+
border: 1px solid;
|
|
54
|
+
gap: 0.75rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.psdk-banner-info {
|
|
58
|
+
background-color: color-mix(in srgb, var(--app-neutral-color) 12%, var(--app-form-bg-color));
|
|
59
|
+
border-color: var(--app-neutral-color);
|
|
60
|
+
color: var(--banner-text-color);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.psdk-banner-warning {
|
|
64
|
+
background-color: color-mix(in srgb, var(--app-warning-color-dark) 12%, var(--app-form-bg-color));
|
|
65
|
+
border-color: var(--app-warning-color-dark);
|
|
66
|
+
color: var(--app-warning-color-dark);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.psdk-banner-success {
|
|
70
|
+
background-color: color-mix(in srgb, var(--stepper-completed-bg-color) 12%, var(--app-form-bg-color));
|
|
71
|
+
border-color: var(--stepper-completed-bg-color);
|
|
72
|
+
color: var(--stepper-completed-bg-color);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.psdk-banner-icon {
|
|
76
|
+
flex-shrink: 0;
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
padding-top: 0.125rem;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.psdk-banner-content {
|
|
83
|
+
flex: 1;
|
|
84
|
+
line-height: 1.5;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.psdk-banner-content p {
|
|
88
|
+
margin: 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.psdk-banner-dismiss {
|
|
92
|
+
flex-shrink: 0;
|
|
93
|
+
background: none;
|
|
94
|
+
border: none;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
padding: 0.25rem;
|
|
97
|
+
color: inherit;
|
|
98
|
+
opacity: 0.7;
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.psdk-banner-dismiss:hover {
|
|
104
|
+
opacity: 1;
|
|
25
105
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { createElement, PropsWithChildren } from 'react';
|
|
1
|
+
import { createElement, PropsWithChildren, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
4
|
+
import WarningAmberIcon from '@mui/icons-material/WarningAmber';
|
|
5
|
+
import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline';
|
|
6
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
7
|
+
|
|
8
|
+
import { getInstructions, getInstructionsType, getDismissBanner, mapInstructionsTypeToBannerVariant } from '@pega/react-sdk-components/lib/components/helpers/template-utils';
|
|
4
9
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
10
|
import connectToState from '@pega/react-sdk-components/lib/components/helpers/state-utils';
|
|
6
11
|
|
|
@@ -22,12 +27,24 @@ const Child = connectToState(mapStateToProps)(props => {
|
|
|
22
27
|
return createElement(createPConnectComponent(), { ...rest, key, visibility });
|
|
23
28
|
});
|
|
24
29
|
|
|
30
|
+
const bannerIconMap = {
|
|
31
|
+
info: <InfoOutlinedIcon fontSize='small' />,
|
|
32
|
+
warning: <WarningAmberIcon fontSize='small' />,
|
|
33
|
+
success: <CheckCircleOutlineIcon fontSize='small' />
|
|
34
|
+
};
|
|
35
|
+
|
|
25
36
|
// Duplicated runtime code from React SDK
|
|
26
37
|
|
|
27
38
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
28
39
|
export default function {{COMPONENT_CLASS_NAME}}(props: PropsWithChildren<{{COMPONENT_CLASS_NAME}}Props>) {
|
|
29
40
|
const { getPConnect, NumCols = '1' } = props;
|
|
30
41
|
const instructions = getInstructions(getPConnect(), props.instructions);
|
|
42
|
+
const [bannerDismissed, setBannerDismissed] = useState(false);
|
|
43
|
+
|
|
44
|
+
const instructionsType = getInstructionsType(props.instructions);
|
|
45
|
+
const isBanner = typeof props.instructions === 'object' && (props.instructions as any)?.isBanner;
|
|
46
|
+
const dismissBanner = getDismissBanner(props.instructions);
|
|
47
|
+
const bannerVariant = mapInstructionsTypeToBannerVariant(instructionsType);
|
|
31
48
|
|
|
32
49
|
let divClass: string;
|
|
33
50
|
|
|
@@ -55,18 +72,41 @@ export default function {{COMPONENT_CLASS_NAME}}(props: PropsWithChildren<{{COMP
|
|
|
55
72
|
const arChildren = getPConnect().getChildren()[0].getPConnect().getChildren();
|
|
56
73
|
const dfChildren = arChildren?.map(kid => <Child key={getKeyForMappedField(kid)} {...kid} />);
|
|
57
74
|
|
|
75
|
+
const renderInstructions = () => {
|
|
76
|
+
if (!instructions || bannerDismissed) return null;
|
|
77
|
+
|
|
78
|
+
if (isBanner) {
|
|
79
|
+
return (
|
|
80
|
+
{{! pick new delimiters for mustache }}
|
|
81
|
+
{{=<% %>=}}
|
|
82
|
+
<div className={`psdk-banner psdk-banner-${bannerVariant}`}>
|
|
83
|
+
<div className='psdk-banner-icon'>{bannerIconMap[bannerVariant]}</div>
|
|
84
|
+
<div className='psdk-banner-content' dangerouslySetInnerHTML={{ __html: instructions }} />
|
|
85
|
+
{dismissBanner && (
|
|
86
|
+
<button type='button' className='psdk-banner-dismiss' aria-label='Dismiss banner' onClick={() => setBannerDismissed(true)}>
|
|
87
|
+
<CloseIcon fontSize='small' />
|
|
88
|
+
</button>
|
|
89
|
+
)}
|
|
90
|
+
</div>
|
|
91
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<div className='psdk-default-form-instruction-text'>
|
|
97
|
+
{/* server performs sanitization method for instructions html content */}
|
|
98
|
+
{{! pick new delimiters for mustache }}
|
|
99
|
+
{{=<% %>=}}
|
|
100
|
+
<div key='instructions' id='instruction-text' dangerouslySetInnerHTML={{ __html: instructions }} />
|
|
101
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
102
|
+
</div>
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
|
|
58
106
|
return (
|
|
59
107
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
60
108
|
<>
|
|
61
|
-
{
|
|
62
|
-
<div className='psdk-default-form-instruction-text'>
|
|
63
|
-
{/* server performs sanitization method for instructions html content */}
|
|
64
|
-
{{! pick new delimiters for mustache }}
|
|
65
|
-
{{=<% %>=}}
|
|
66
|
-
<div key='instructions' id='instruction-text' dangerouslySetInnerHTML={{ __html: instructions }} />
|
|
67
|
-
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
68
|
-
</div>
|
|
69
|
-
)}
|
|
109
|
+
{renderInstructions()}
|
|
70
110
|
<div className={divClass}>{dfChildren}</div>
|
|
71
111
|
</>
|
|
72
112
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -108,18 +108,22 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
108
108
|
context
|
|
109
109
|
) as Promise<any>;
|
|
110
110
|
|
|
111
|
-
historyData
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
111
|
+
historyData
|
|
112
|
+
.then((historyJSON: any) => {
|
|
113
|
+
const tableDataResults = historyJSON.data.data;
|
|
114
|
+
|
|
115
|
+
// compute the rowData using the tableDataResults
|
|
116
|
+
computeRowData(tableDataResults);
|
|
117
|
+
|
|
118
|
+
// At this point, if we have data ready to render and haven't been asked
|
|
119
|
+
// to NOT call setWaitingForData, we can stop progress indicator
|
|
120
|
+
if (bCallSetWaitingForData) {
|
|
121
|
+
setWaitingForData(false);
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
.catch(e => {
|
|
125
|
+
console.error(e);
|
|
126
|
+
});
|
|
123
127
|
|
|
124
128
|
return () => {
|
|
125
129
|
// Inspired by https://juliangaramendy.dev/blog/use-promise-subscription
|
|
@@ -154,9 +158,9 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
154
158
|
const theKey = `CaseHistory-${index}`;
|
|
155
159
|
theDataRows.push(
|
|
156
160
|
<TableRow key={theKey}>
|
|
157
|
-
<StyledTableCell>{dataRow[0] ?
|
|
158
|
-
<StyledTableCell>{dataRow[1] ?
|
|
159
|
-
<StyledTableCell>{dataRow[2] ?
|
|
161
|
+
<StyledTableCell>{dataRow[0] ? dataRow[0] : ('---' as any)}</StyledTableCell>
|
|
162
|
+
<StyledTableCell>{dataRow[1] ? dataRow[1] : ('---' as any)}</StyledTableCell>
|
|
163
|
+
<StyledTableCell>{dataRow[2] ? dataRow[2] : ('---' as any)}</StyledTableCell>
|
|
160
164
|
</TableRow>
|
|
161
165
|
);
|
|
162
166
|
});
|