@pega/dx-component-builder-sdk 0.24.1 → 0.24.3
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/src/tasks/create/templates/Constellation/field/Icon-Button-URL/demo.stories.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/field/Picklist/index.tsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/date.ts.mustache +15 -37
- package/src/tasks/create/templates/Constellation/template/DETAILS/HighlightRender.tsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/HighlightRender.tsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.html.mustache +19 -18
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.ts.mustache +127 -44
- package/src/tasks/create/templates/SDK-Angular/field/Icon-Button-URL/demo.stories.tsx.mustache +36 -15
- package/src/tasks/create/templates/SDK-Angular/field/Icon-Button-URL/icon-button-url.component.html.mustache +40 -0
- package/src/tasks/create/templates/SDK-Angular/field/Icon-Button-URL/{text-url.component.scss.mustache → icon-button-url.component.scss.mustache} +4 -0
- package/src/tasks/create/templates/SDK-Angular/field/Icon-Button-URL/icon-button-url.component.ts.mustache +195 -0
- package/src/tasks/create/templates/SDK-Angular/field/Icon-Button-URL/mock.ts.mustache +32 -12
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.html.mustache +1 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.ts.mustache +2 -0
- package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.html.mustache +1 -0
- package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.ts.mustache +2 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.scss.mustache +1 -1
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.ts.mustache +2 -2
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.html.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Boolean/demo.stories.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Boolean/mock.ts.mustache +8 -8
- package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Date/mock.ts.mustache +7 -7
- package/src/tasks/create/templates/SDK-React/field/DateTime/demo.stories.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +2 -3
- package/src/tasks/create/templates/SDK-React/field/DateTime/mock.ts.mustache +6 -6
- package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +51 -35
- package/src/tasks/create/templates/SDK-React/field/Decimal/mock.ts.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/config.json.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/demo.stories.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +47 -37
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/mock.ts.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/config.json.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +36 -21
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/mock.ts.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Icon-Button-URL/demo.stories.tsx.mustache +58 -25
- package/src/tasks/create/templates/SDK-React/field/Icon-Button-URL/index.tsx.mustache +134 -53
- package/src/tasks/create/templates/SDK-React/field/Icon-Button-URL/mock.ts.mustache +2 -14
- package/src/tasks/create/templates/SDK-React/field/Integer/config.json.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Integer/index.tsx.mustache +19 -20
- package/src/tasks/create/templates/SDK-React/field/Integer/mock.ts.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +26 -26
- package/src/tasks/create/templates/SDK-React/field/Picklist-RadioButtons/mock.ts.mustache +0 -1
- package/src/tasks/create/templates/SDK-React/field/Text/config.json.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Text/index.tsx.mustache +0 -1
- package/src/tasks/create/templates/SDK-React/field/Text/mock.ts.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Text-Email/config.json.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Text-Email/mock.ts.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Text-Input/config.json.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Text-Input/index.tsx.mustache +0 -1
- package/src/tasks/create/templates/SDK-React/field/Text-Input/mock.ts.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/index.tsx.mustache +1 -3
- package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/mock.ts.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Text-Phone/index.tsx.mustache +1 -2
- package/src/tasks/create/templates/SDK-React/field/Text-URL/index.tsx.mustache +1 -2
- package/src/tasks/create/templates/SDK-React/field/Text-URL/mock.ts.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/TimeOfDay/demo.stories.tsx.mustache +4 -4
- package/src/tasks/create/templates/SDK-React/field/TimeOfDay/index.tsx.mustache +0 -2
- package/src/tasks/create/templates/SDK-React/field/TimeOfDay/mock.ts.mustache +6 -6
- package/src/tasks/create/templates/SDK-React/template/DETAILS/demo.stories.tsx.mustache +1 -4
- package/src/tasks/create/templates/SDK-React/template/DETAILS/index.tsx.mustache +3 -8
- package/src/tasks/create/templates/SDK-React/template/DETAILS/mock.ts.mustache +181 -165
- package/src/tasks/create/templates/SDK-React/template/DETAILS-region/demo.stories.tsx.mustache +1 -3
- package/src/tasks/create/templates/SDK-React/template/DETAILS-region/index.tsx.mustache +3 -8
- package/src/tasks/create/templates/SDK-React/template/DETAILS-region/mock.ts.mustache +207 -163
- package/src/tasks/create/templates/SDK-React/template/FORM/config.json.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/template/FORM/demo.stories.tsx.mustache +0 -1
- package/src/tasks/create/templates/SDK-React/template/FORM/index.tsx.mustache +14 -16
- package/src/tasks/create/templates/SDK-React/template/FORM/utils.ts.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.tsx.mustache +0 -2
- package/src/tasks/create/templates/SDK-React/template/FORM-region/mock.ts.mustache +121 -122
- package/src/tasks/create/templates/SDK-React/template/PAGE/OneColumn.tsx.mustache +12 -13
- package/src/tasks/create/templates/SDK-React/template/PAGE/demo.stories.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/template/PAGE/index.tsx.mustache +3 -5
- package/src/tasks/create/templates/SDK-React/template/PAGE/mock.ts.mustache +8 -9
- package/src/tasks/create/templates/SDK-React/widget/CASE/config.json.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/widget/CASE/demo.stories.tsx.mustache +0 -1
- package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +3 -3
- package/src/tasks/create/templates/SDK-React/widget/PAGE/config.json.mustache +43 -43
- package/src/tasks/create/templates/SDK-React/widget/PAGE/mock.ts.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/demo.stories.tsx.mustache +1 -2
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +0 -1
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/mock.ts.mustache +0 -1
- package/tests/assets/sdk-r/components/create/custom-constellation/field/Pega_DXIL_MyTestText/index.tsx +94 -4
- package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/config.json +1 -1
- package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +0 -1
- package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/mock.ts +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +2 -2
- package/tests/assets/sdk-r/components/create/override-sdk/field/CancelAlert/CancelAlert.tsx +2 -0
- package/tests/assets/sdk-r/components/create/override-sdk/field/Currency/Currency.tsx +36 -26
- package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/Decimal.tsx +33 -19
- package/tests/assets/sdk-r/components/create/override-sdk/field/Multiselect/Multiselect.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/Percentage.tsx +33 -18
- package/tests/assets/sdk-r/components/create/override-sdk/field/ScalarList/ScalarList.tsx +2 -0
- package/tests/assets/sdk-r/components/create/override-sdk/field/UserReference/UserReference.tsx +11 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/Assignment.tsx +2 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/DashboardFilter/DashboardFilter.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/DeferLoad/DeferLoad.tsx +5 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/MultiStep/MultiStep.tsx +3 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.tsx +2 -2
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/CaseView.tsx +2 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/DataReference.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/utils/index.ts +2 -7
- package/tests/assets/sdk-r/components/create/override-sdk/template/Details/Details.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +2 -0
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +4 -2
- package/tests/assets/sdk-r/components/create/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/PromotedFilters/PromotedFilters.tsx +1 -0
- package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +4 -0
- package/tests/assets/sdk-r/components/create/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.tsx +3 -2
- package/tests/assets/sdk-r/components/create/override-sdk/widget/FileUtility/FileUtility.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/widget/QuickCreate/QuickCreate.tsx +1 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyBoolean/index.tsx +3 -2
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/PConnProps.d.ts +46 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +99 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/index.tsx +201 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/mock.ts +5 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/styles.ts +8 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPicklist/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/date.ts +15 -37
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/index.tsx +11 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/utils.ts +3 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyText/index.tsx +94 -4
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/Avatar.tsx +78 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/DetailsRender.tsx +52 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/HighlightRender.tsx +46 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/Operator.tsx +215 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/demo.stories.tsx +77 -23
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/index.tsx +48 -37
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/mock.ts +78 -20
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/styles.ts +16 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/DetailsRender.tsx +59 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/index.tsx +28 -5
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/localizations.json +4 -2
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +78 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +52 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +46 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/Operator.tsx +215 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +95 -26
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/index.tsx +39 -36
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/mock.ts +68 -10
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/styles.ts +15 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +59 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/index.tsx +23 -4
- package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageWidget/demo.stories.tsx +87 -6
- package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageWidget/index.tsx +67 -5
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/demo.stories.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/mock.ts +8 -8
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/demo.stories.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +44 -34
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/index.tsx +2 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/mock.ts +7 -7
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/index.tsx +2 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/mock.ts +6 -6
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +48 -32
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/config.json +64 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +91 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/index.tsx +157 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/mock.ts +4 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/styles.js +7 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/index.tsx +16 -17
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/index.tsx +1 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +34 -19
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +1 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/index.tsx +23 -23
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyRadiobuttons/mock.ts +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +4 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/index.tsx +0 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/mock.ts +6 -6
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/index.tsx +1 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/demo.stories.tsx +1 -7
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/index.tsx +4 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/mock.ts +181 -165
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/demo.stories.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/index.tsx +11 -13
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/utils.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/OneColumn.tsx +12 -13
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/demo.stories.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/index.tsx +3 -5
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/mock.ts +8 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +1 -6
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/index.tsx +4 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/mock.ts +207 -163
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +0 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/mock.ts +121 -122
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/config.json +2 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/demo.stories.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +3 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +1 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/mock.ts +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/config.json +43 -43
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +2 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/CancelAlert/CancelAlert.tsx +2 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Currency/Currency.tsx +36 -26
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/Decimal.tsx +33 -19
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Multiselect/Multiselect.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx +33 -18
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/ScalarList/ScalarList.tsx +2 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/UserReference/UserReference.tsx +11 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/Assignment.tsx +2 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DashboardFilter/DashboardFilter.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DeferLoad/DeferLoad.tsx +5 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/MultiStep/MultiStep.tsx +3 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.tsx +2 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/CaseView.tsx +2 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/DataReference.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/utils/index.ts +2 -7
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/Details/Details.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +2 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +4 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/PromotedFilters/PromotedFilters.tsx +1 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +4 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.tsx +3 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/FileUtility/FileUtility.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/QuickCreate/QuickCreate.tsx +1 -0
- package/src/tasks/create/templates/SDK-Angular/field/Icon-Button-URL/text-url.component.html.mustache +0 -29
- package/src/tasks/create/templates/SDK-Angular/field/Icon-Button-URL/text-url.component.ts.mustache +0 -179
- /package/src/tasks/create/templates/SDK-Angular/field/Icon-Button-URL/{text-url.component.spec.ts.mustache → icon-button-url.component.spec.ts.mustache} +0 -0
|
@@ -95,7 +95,7 @@ export default function CaseViewActionsMenu(props: CaseViewActionsMenuProps) {
|
|
|
95
95
|
|
|
96
96
|
return (
|
|
97
97
|
<>
|
|
98
|
-
<Button aria-controls='simple-menu' aria-haspopup='true' onClick={handleClick}>
|
|
98
|
+
<Button id='actions-menu' aria-controls='simple-menu' aria-haspopup='true' onClick={handleClick}>
|
|
99
99
|
{localizedVal('Actions...', localeCategory)}
|
|
100
100
|
</Button>
|
|
101
101
|
<Menu id='simple-menu' anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={handleClose}>
|
package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/DataReference.tsx
CHANGED
|
@@ -128,7 +128,7 @@ export default function DataReference(props: PropsWithChildren<DataReferenceProp
|
|
|
128
128
|
const refreshOptions = { autoDetectRefresh: true };
|
|
129
129
|
if (canBeChangedInReviewMode && pConn.getValue('__currentPageTabViewName', '')) {
|
|
130
130
|
// 2nd arg empty string until typedef marked correctly
|
|
131
|
-
getPConnect().getActionsApi().refreshCaseView(caseKey, pConn.getValue('__currentPageTabViewName', ''),
|
|
131
|
+
getPConnect().getActionsApi().refreshCaseView(caseKey, pConn.getValue('__currentPageTabViewName', ''), '', refreshOptions); // 2nd arg empty string until typedef marked correctly
|
|
132
132
|
PCore.getDeferLoadManager().refreshActiveComponents(pConn.getContextName());
|
|
133
133
|
} else {
|
|
134
134
|
const pgRef = pConn.getPageReference().replace('caseInfo.content', '');
|
package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/utils/index.ts
CHANGED
|
@@ -20,13 +20,8 @@ export const getKeyForMappedField = field => {
|
|
|
20
20
|
|
|
21
21
|
const pConnect = field?.getPConnect?.();
|
|
22
22
|
|
|
23
|
-
if (pConnect?.meta
|
|
24
|
-
return
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Using label as a fallback if name is not defined.
|
|
28
|
-
if (pConnect?.meta?.type && pConnect?.meta?.config?.label) {
|
|
29
|
-
return `${pConnect.meta.type}_${pConnect.meta.config.label}`;
|
|
23
|
+
if (pConnect?.meta) {
|
|
24
|
+
return JSON.stringify(pConnect.meta);
|
|
30
25
|
}
|
|
31
26
|
|
|
32
27
|
return uuidv4();
|
|
@@ -46,7 +46,7 @@ export default function Details(props: DetailsProps) {
|
|
|
46
46
|
field.config.displayAsStatus = true;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
return getPConnect().createComponent(field, '',
|
|
49
|
+
return getPConnect().createComponent(field, '', 0, {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -46,7 +46,7 @@ export default function DetailsThreeColumn(props: DetailsThreeColumnProps) {
|
|
|
46
46
|
field.config.displayAsStatus = true;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
return getPConnect().createComponent(field, '',
|
|
49
|
+
return getPConnect().createComponent(field, '', 0, {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional);
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -46,7 +46,7 @@ export default function DetailsTwoColumn(props: DetailsTwoColumnProps) {
|
|
|
46
46
|
field.config.displayAsStatus = true;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
return getPConnect().createComponent(field, '',
|
|
49
|
+
return getPConnect().createComponent(field, '', 0, {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -51,6 +51,7 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
51
51
|
if (PCore.getPCoreVersion()?.includes('8.7')) {
|
|
52
52
|
pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference);
|
|
53
53
|
} else {
|
|
54
|
+
// @ts-ignore - An argument for 'pageRef' was not provided.
|
|
54
55
|
pConn.getListActions().insert({}, referenceList.length);
|
|
55
56
|
}
|
|
56
57
|
};
|
|
@@ -63,6 +64,7 @@ export default function FieldGroupTemplate(props: FieldGroupTemplateProps) {
|
|
|
63
64
|
if (PCore.getPCoreVersion()?.includes('8.7')) {
|
|
64
65
|
pConn.getListActions().deleteEntry(index, pageReference);
|
|
65
66
|
} else {
|
|
67
|
+
// @ts-ignore - An argument for 'pageRef' was not provided.
|
|
66
68
|
pConn.getListActions().deleteEntry(index);
|
|
67
69
|
}
|
|
68
70
|
};
|
|
@@ -653,6 +653,7 @@ export default function ListView(props: ListViewProps) {
|
|
|
653
653
|
|
|
654
654
|
thePConn
|
|
655
655
|
.getActionsApi()
|
|
656
|
+
// @ts-ignore
|
|
656
657
|
.openAssignment(pzInsKey, pxRefObjectClass, options)
|
|
657
658
|
.then(() => {
|
|
658
659
|
// console.log("openAssignment successful");
|
|
@@ -885,6 +886,7 @@ export default function ListView(props: ListViewProps) {
|
|
|
885
886
|
pzInsKey = row[`${associationCategory}:pzInsKey`];
|
|
886
887
|
}
|
|
887
888
|
if (column.isAssignmentLink) {
|
|
889
|
+
// @ts-ignore
|
|
888
890
|
thePConn.getActionsApi().openAssignment(pzInsKey, pxObjClass, {
|
|
889
891
|
containerName: 'primary',
|
|
890
892
|
channelName: ''
|
|
@@ -1047,7 +1049,7 @@ export default function ListView(props: ListViewProps) {
|
|
|
1047
1049
|
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
|
|
1048
1050
|
.map(row => {
|
|
1049
1051
|
return (
|
|
1050
|
-
<TableRow key={row.pxRefObjectInsName || row.pyID
|
|
1052
|
+
<TableRow key={row.pxRefObjectInsName || row.pyID}>
|
|
1051
1053
|
{arColumns.map(column => {
|
|
1052
1054
|
const value = row[column.id];
|
|
1053
1055
|
return (
|
|
@@ -1104,7 +1106,7 @@ export default function ListView(props: ListViewProps) {
|
|
|
1104
1106
|
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
|
|
1105
1107
|
.map(row => {
|
|
1106
1108
|
return (
|
|
1107
|
-
<TableRow key={row
|
|
1109
|
+
<TableRow key={row[rowID]}>
|
|
1108
1110
|
{selectionMode === SELECTION_MODE.SINGLE && (
|
|
1109
1111
|
<TableCell>
|
|
1110
1112
|
<Radio
|
|
@@ -49,7 +49,7 @@ export default function NarrowWideDetails(props: NarrowWideDetailsProps) {
|
|
|
49
49
|
field.config.displayAsStatus = true;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
return getPConnect().createComponent(field, '',
|
|
52
|
+
return getPConnect().createComponent(field, '', 0, {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -87,6 +87,7 @@ export default function PromotedFilters(props: PromotedFilterProps) {
|
|
|
87
87
|
};
|
|
88
88
|
return getPConnect().getContainerManager().addTransientItem({
|
|
89
89
|
id: viewName,
|
|
90
|
+
// @ts-ignore - Property 'coreHeaders' is missing in type '{ classID: string; }' but required in type '{ coreHeaders: any; }'.
|
|
90
91
|
data: filtersWithClassID
|
|
91
92
|
});
|
|
92
93
|
}, []);
|
|
@@ -201,6 +201,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
201
201
|
if (allowEditingInModal) {
|
|
202
202
|
getPConnect()
|
|
203
203
|
.getListActions()
|
|
204
|
+
// @ts-ignore - An argument for 'uniqueField' was not provided.
|
|
204
205
|
.initDefaultPageInstructions(
|
|
205
206
|
getPConnect().getReferenceList(),
|
|
206
207
|
fieldDefs.filter(item => item.name).map(item => item.name)
|
|
@@ -302,6 +303,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
302
303
|
.getActionsApi()
|
|
303
304
|
.openEmbeddedDataModal(defaultView, pConn, referenceListStr, referenceList.length, PCore.getConstants().RESOURCE_STATUS.CREATE);
|
|
304
305
|
} else {
|
|
306
|
+
// @ts-ignore - An argument for 'pageRef' was not provided.
|
|
305
307
|
pConn.getListActions().insert({ classID: contextClass }, referenceList.length);
|
|
306
308
|
}
|
|
307
309
|
|
|
@@ -327,10 +329,12 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
327
329
|
|
|
328
330
|
const deleteRecord = () => {
|
|
329
331
|
setEditAnchorEl(null);
|
|
332
|
+
// @ts-ignore - An argument for 'pageRef' was not provided.
|
|
330
333
|
pConn.getListActions().deleteEntry(selectedRowIndex.current);
|
|
331
334
|
};
|
|
332
335
|
|
|
333
336
|
const deleteRecordFromInlineEditable = (index: number) => {
|
|
337
|
+
// @ts-ignore - An argument for 'pageRef' was not provided.
|
|
334
338
|
pConn.getListActions().deleteEntry(index);
|
|
335
339
|
};
|
|
336
340
|
|
|
@@ -54,7 +54,7 @@ export default function WideNarrowDetails(props: WideNarrowDetailsProps) {
|
|
|
54
54
|
field.config.displayAsStatus = true;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
return getPConnect().createComponent(field, '',
|
|
57
|
+
return getPConnect().createComponent(field, '', 0, {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -8,7 +8,6 @@ import download from 'downloadjs';
|
|
|
8
8
|
|
|
9
9
|
import { buildFilePropsFromResponse, getIconFromFileType, validateMaxSize } from '@pega/react-sdk-components/lib/components/helpers/attachmentHelpers';
|
|
10
10
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
11
|
-
import { isInfinity23OrHigher } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
|
|
12
11
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
13
12
|
|
|
14
13
|
import './Attachment.css';
|
|
@@ -61,7 +60,7 @@ export default function Attachment(props: AttachmentProps) {
|
|
|
61
60
|
const [toggleUploadBegin, setToggleUploadBegin] = useState(false);
|
|
62
61
|
|
|
63
62
|
const resetAttachmentStoredState = () => {
|
|
64
|
-
PCore.getStateUtils().updateState(pConn.getContextName(), getAttachmentKey(
|
|
63
|
+
PCore.getStateUtils().updateState(pConn.getContextName(), getAttachmentKey(valueRef), undefined, {
|
|
65
64
|
pageReference: 'context_data',
|
|
66
65
|
isArrayDeepMerge: false
|
|
67
66
|
});
|
|
@@ -160,6 +159,7 @@ export default function Attachment(props: AttachmentProps) {
|
|
|
160
159
|
messages: [
|
|
161
160
|
{
|
|
162
161
|
type: 'error',
|
|
162
|
+
// @ts-ignore - Type '{ type: string; message: string; }' is not assignable to type 'MessagesConfigObject'.
|
|
163
163
|
message: pConn.getLocalizedValue('Error with one or more files', '', '')
|
|
164
164
|
}
|
|
165
165
|
],
|
|
@@ -233,6 +233,7 @@ export default function Attachment(props: AttachmentProps) {
|
|
|
233
233
|
messages: [
|
|
234
234
|
{
|
|
235
235
|
type: 'error',
|
|
236
|
+
// @ts-ignore - Type '{ type: string; message: string; }' is not assignable to type 'MessagesConfigObject'.
|
|
236
237
|
message: pConn.getLocalizedValue('Error with one or more files', '', '')
|
|
237
238
|
}
|
|
238
239
|
],
|
package/tests/assets/sdk-r/components/create/override-sdk/widget/FileUtility/FileUtility.tsx
CHANGED
|
@@ -488,7 +488,7 @@ export default function FileUtility(props: FileUtilityProps) {
|
|
|
488
488
|
}
|
|
489
489
|
|
|
490
490
|
return (
|
|
491
|
-
<div className='psdk-utility'>
|
|
491
|
+
<div className='psdk-utility' id='file-utility'>
|
|
492
492
|
{inProgress && (
|
|
493
493
|
<div className='progress-div'>
|
|
494
494
|
<CircularProgress />
|
package/tests/assets/sdk-r/components/create/override-sdk/widget/QuickCreate/QuickCreate.tsx
CHANGED
|
@@ -35,6 +35,7 @@ export default function QuickCreate(props: QuickCreateProps) {
|
|
|
35
35
|
const defaultCases: any = [];
|
|
36
36
|
const envInfo = PCore.getEnvironmentInfo();
|
|
37
37
|
if (envInfo?.environmentInfoObject?.pyCaseTypeList) {
|
|
38
|
+
// @ts-ignore - Property 'forEach' does not exist on type 'string'
|
|
38
39
|
envInfo.environmentInfoObject.pyCaseTypeList.forEach(casetype => {
|
|
39
40
|
if (casetype.pyWorkTypeName && casetype.pyWorkTypeImplementationClassName) {
|
|
40
41
|
defaultCases.push({
|
|
@@ -3,7 +3,8 @@ import {
|
|
|
3
3
|
CheckboxGroup,
|
|
4
4
|
FieldValueList,
|
|
5
5
|
Text,
|
|
6
|
-
withConfiguration
|
|
6
|
+
withConfiguration,
|
|
7
|
+
BooleanDisplay
|
|
7
8
|
} from "@pega/cosmos-react-core";
|
|
8
9
|
|
|
9
10
|
import type { PConnFieldProps } from './PConnProps';
|
|
@@ -99,7 +100,7 @@ function PegaDxilMyBoolean(props: PegaDxilMyBooleanProps) {
|
|
|
99
100
|
// @ts-ignore
|
|
100
101
|
displayComponent = (
|
|
101
102
|
// @ts-ignore
|
|
102
|
-
<
|
|
103
|
+
<BooleanDisplay value={value} trueLabel={trueLabel} falseLabel={falseLabel} />
|
|
103
104
|
);
|
|
104
105
|
}
|
|
105
106
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {PConnect } from '@pega/pcore-pconnect-typedefs';
|
|
2
|
+
|
|
3
|
+
// PConnProps.d.ts
|
|
4
|
+
// This gives us a place to have each component (which is most DX Components) that is
|
|
5
|
+
// expected to have a getPConnect extend its props (from BaseProps)
|
|
6
|
+
// such that every component will be expected to have a getPConnect() function
|
|
7
|
+
// that returns a PConnect object. (new/better way of doing .propTypes).
|
|
8
|
+
// This PConnProps can be extended to include other props that we know are in every component
|
|
9
|
+
export interface PConnProps {
|
|
10
|
+
// getPConnect should exist for every C11n component. (add @ts-ignore in special cases where it isn't)
|
|
11
|
+
getPConnect: () => typeof PConnect;
|
|
12
|
+
|
|
13
|
+
// Allow any/all other key/value pairs in the BaseProps for now
|
|
14
|
+
// TODO: refine which other props are always expected for various component
|
|
15
|
+
// types and consider further interface "subclassing". For example, we may
|
|
16
|
+
// want to create a "BasePropsForm" that gives guidance on required, readonly, etc.
|
|
17
|
+
// and any other props that every Form component expects.
|
|
18
|
+
// For example, see the PConnFieldProps below.
|
|
19
|
+
// NOTE: if you uncomment the line below, the PConnProps type will allow
|
|
20
|
+
// otherwise undefined types to appear. This can be helpful for debugging
|
|
21
|
+
// or when adding new components whose types aren't yet known.
|
|
22
|
+
// [key: string]: any;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
// PConnFieldProps extends PConnProps to bring in the common properties that are
|
|
27
|
+
// associated with most field components (ex: Dropdown, TextInput, etc.) in the
|
|
28
|
+
// components/field directory
|
|
29
|
+
export interface PConnFieldProps extends PConnProps {
|
|
30
|
+
label: string,
|
|
31
|
+
required: boolean,
|
|
32
|
+
disabled: boolean,
|
|
33
|
+
value: any,
|
|
34
|
+
validatemessage: string,
|
|
35
|
+
status?: string,
|
|
36
|
+
onChange?: any,
|
|
37
|
+
onBlur?: any,
|
|
38
|
+
readOnly: boolean,
|
|
39
|
+
testId: string,
|
|
40
|
+
helperText: string,
|
|
41
|
+
displayMode?: string,
|
|
42
|
+
hideLabel: boolean,
|
|
43
|
+
placeholder?: string,
|
|
44
|
+
fieldMetadata?: any,
|
|
45
|
+
additionalProps?: any
|
|
46
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
|
|
2
|
+
/* eslint-disable react/jsx-no-useless-fragment */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
import PegaDxilMyIconButtonUrl from './index';
|
|
7
|
+
import { configProps } from './mock';
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof PegaDxilMyIconButtonUrl> = {
|
|
10
|
+
title: 'PegaDxilMyIconButtonUrl',
|
|
11
|
+
component: PegaDxilMyIconButtonUrl,
|
|
12
|
+
excludeStories: /.*Data$/
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof PegaDxilMyIconButtonUrl>;
|
|
17
|
+
|
|
18
|
+
if (!window.PCore) {
|
|
19
|
+
window.PCore = {};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const statelistData = {
|
|
23
|
+
data: [
|
|
24
|
+
{
|
|
25
|
+
pyLabel: 'Massachusetts',
|
|
26
|
+
pyStateCode: 'MA'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
pyLabel: 'Rhode Island',
|
|
30
|
+
pyStateCode: 'RI'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
pyLabel: 'Connecticut',
|
|
34
|
+
pyStateCode: 'CT'
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
window.PCore.getDataPageUtils = () => {
|
|
40
|
+
return {
|
|
41
|
+
getDataAsync: () => {
|
|
42
|
+
return new Promise(resolve => {
|
|
43
|
+
resolve(statelistData);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const BasePegaDxilMyIconButtonUrl: Story = args => {
|
|
50
|
+
|
|
51
|
+
const props = {
|
|
52
|
+
countryCode: configProps.countryCode,
|
|
53
|
+
getPConnect: () => {
|
|
54
|
+
return {
|
|
55
|
+
getValue: value => {
|
|
56
|
+
return value;
|
|
57
|
+
},
|
|
58
|
+
getContextName: () => {
|
|
59
|
+
return 'app/primary_1';
|
|
60
|
+
},
|
|
61
|
+
getLocalizedValue: value => {
|
|
62
|
+
return value;
|
|
63
|
+
},
|
|
64
|
+
getActionsApi: () => {
|
|
65
|
+
return {
|
|
66
|
+
updateFieldValue: () => {
|
|
67
|
+
/* nothing */
|
|
68
|
+
},
|
|
69
|
+
triggerFieldChange: () => {
|
|
70
|
+
/* nothing */
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
ignoreSuggestion: () => {
|
|
75
|
+
/* nothing */
|
|
76
|
+
},
|
|
77
|
+
acceptSuggestion: () => {
|
|
78
|
+
/* nothing */
|
|
79
|
+
},
|
|
80
|
+
setInheritedProps: () => {
|
|
81
|
+
/* nothing */
|
|
82
|
+
},
|
|
83
|
+
resolveConfigProps: () => {
|
|
84
|
+
/* nothing */
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<>
|
|
92
|
+
<PegaDxilMyIconButtonUrl {...props} {...args} />
|
|
93
|
+
</>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
BasePegaDxilMyIconButtonUrl.args = {
|
|
98
|
+
countryCode: configProps.countryCode
|
|
99
|
+
};
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Icon,
|
|
4
|
+
Button,
|
|
5
|
+
withConfiguration,
|
|
6
|
+
registerIcon,
|
|
7
|
+
Table,
|
|
8
|
+
Label,
|
|
9
|
+
Link,
|
|
10
|
+
URLDisplay
|
|
11
|
+
} from '@pega/cosmos-react-core';
|
|
12
|
+
import type { PConnFieldProps } from './PConnProps';
|
|
13
|
+
|
|
14
|
+
// IMPORTANT
|
|
15
|
+
// To use Icons, need to individually import the icon file form @pega/cosmos-react-core (see path below)
|
|
16
|
+
// Icons filename is kabab case (file-name), where as the icon you import is camel case (fileName)
|
|
17
|
+
// Icons need to be registered (camel case), and then used (kabab case)
|
|
18
|
+
import * as listNumber from '@pega/cosmos-react-core/lib/components/Icon/icons/list-number.icon';
|
|
19
|
+
import * as arrowRight from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-right.icon';
|
|
20
|
+
import * as globe from '@pega/cosmos-react-core/lib/components/Icon/icons/globe.icon';
|
|
21
|
+
|
|
22
|
+
import StyledPegaDxilMyIconButtonUrlWrapper from './styles';
|
|
23
|
+
|
|
24
|
+
// interface for props
|
|
25
|
+
interface PegaDxilMyIconButtonUrlProps extends PConnFieldProps {
|
|
26
|
+
// If any, enter additional props that only exist on TextInput here
|
|
27
|
+
countryCode: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const textFormatter = (value: string) => {
|
|
31
|
+
return <URLDisplay target='_blank' value={value} displayText={value} variant='link' />;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
// *************
|
|
36
|
+
// This component is meant to be an example of usage (Icon, Button, Link, etc.) and NOT meant to be
|
|
37
|
+
// used "as is"
|
|
38
|
+
//
|
|
39
|
+
// In this example, Icon is shown on its own and inside a Button
|
|
40
|
+
// Though an Icon can have an "onClick" event is it recommended if you want to click on it,
|
|
41
|
+
// to put it in a Button (shown below), so you can have a tooltip and hover style or put it
|
|
42
|
+
// in a Link (shown below) as a URL.
|
|
43
|
+
//
|
|
44
|
+
// For the button, the click will get a list of states for a given country and display in a
|
|
45
|
+
// table below. The table display will toggle with the click of the button icon. Example shows
|
|
46
|
+
// how to handle click, retrieve data from PCore and display it.
|
|
47
|
+
//
|
|
48
|
+
// Globe icon is an icon placed in a Link element. The Link element to use an icon internally. (NOTE: In general
|
|
49
|
+
// the Link element shows the open icon to the left of the link text, but here we are using
|
|
50
|
+
// another icon, so with "icon" specified in the Link element, the open icon doesn't show)
|
|
51
|
+
// Link elements do not handle bad urls well, so we have a simple validator to prevent the Link element
|
|
52
|
+
// from getting most bad urls.
|
|
53
|
+
//
|
|
54
|
+
// NOTE: because icons have to be imported and registered, you can NOT put the icon name
|
|
55
|
+
// inside the config.json and let the user pick it, if it is not already part of your
|
|
56
|
+
// import and registration (can't be done on the fly)
|
|
57
|
+
// **************
|
|
58
|
+
|
|
59
|
+
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
60
|
+
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
61
|
+
function PegaDxilMyIconButtonUrl(props: PegaDxilMyIconButtonUrlProps) {
|
|
62
|
+
const { value, displayMode, countryCode = 'USA', getPConnect, testId } = props;
|
|
63
|
+
const [statelist, setStatelist] = useState([]);
|
|
64
|
+
const [showTable, setShowTable] = useState(false);
|
|
65
|
+
const [validUrl, setValidUrl] = useState('about:blank');
|
|
66
|
+
const PConnect = getPConnect();
|
|
67
|
+
|
|
68
|
+
// IMPORTANT: need to register icons used in camel case
|
|
69
|
+
registerIcon(listNumber, arrowRight, globe);
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
// setting up columns for the work list table
|
|
73
|
+
const columns = [
|
|
74
|
+
{ renderer: 'stateName', label: PConnect.getLocalizedValue('State name', '', '') },
|
|
75
|
+
{ renderer: 'stateCode', label: PConnect.getLocalizedValue('State code', '', '') }
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
// toggle showing table and getting table data
|
|
79
|
+
function showHideTable() {
|
|
80
|
+
setShowTable(prevShowTable => !prevShowTable);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// check if url is valid (simple)
|
|
84
|
+
function validateUrl(href: string) {
|
|
85
|
+
return /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(
|
|
86
|
+
href
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Testing to see if value entered is valid url, if not can't use it.
|
|
91
|
+
// Reason for this code is that you can NOT pass to Link component
|
|
92
|
+
// a bad url, or it will error out.
|
|
93
|
+
// For example: Since the value is the property field,
|
|
94
|
+
// it could be entered from another component and thus as it is
|
|
95
|
+
// entered (typed in), it won't be valid until it is all entered.
|
|
96
|
+
// NOTE: can't have a blank value for the url as the Link element will error out
|
|
97
|
+
// in App studio preview
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
if (validateUrl(value)) {
|
|
100
|
+
setValidUrl(value);
|
|
101
|
+
} else {
|
|
102
|
+
setValidUrl('about:blank');
|
|
103
|
+
}
|
|
104
|
+
}, [value]);
|
|
105
|
+
|
|
106
|
+
// going to get data for worklist to put into a table
|
|
107
|
+
// data comes from calling a PCore function to get
|
|
108
|
+
// get data from a data page and a PConnect function
|
|
109
|
+
// to get getContextName
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
const dataViewName = 'D_pyStateList';
|
|
112
|
+
const context = PConnect.getContextName();
|
|
113
|
+
const params = { pyCountry: countryCode };
|
|
114
|
+
|
|
115
|
+
// only retrieve table data if table is shown
|
|
116
|
+
if (showTable) {
|
|
117
|
+
PCore.getDataPageUtils()
|
|
118
|
+
.getDataAsync(dataViewName, context, params, null, null)
|
|
119
|
+
// @ts-ignore
|
|
120
|
+
.then((response: any) => {
|
|
121
|
+
// table requires an index or will get setExtraStackFrame error
|
|
122
|
+
setStatelist(
|
|
123
|
+
response.data.map((entry: any, index: number) => {
|
|
124
|
+
// mapping the data into the column names
|
|
125
|
+
// MUST have an id/index or will get a setExtraStackFrame error
|
|
126
|
+
// put a key in the table
|
|
127
|
+
return {
|
|
128
|
+
stateName: entry.pyLabel,
|
|
129
|
+
stateCode: entry.pyStateCode,
|
|
130
|
+
id: index
|
|
131
|
+
};
|
|
132
|
+
})
|
|
133
|
+
);
|
|
134
|
+
})
|
|
135
|
+
.catch((error: any) => {
|
|
136
|
+
console.log(error);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}, [PConnect, countryCode, showTable]);
|
|
140
|
+
|
|
141
|
+
// when DISPLAY_ONLY, in this example we will just show the URL.
|
|
142
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
143
|
+
const displayComp = textFormatter(validUrl);
|
|
144
|
+
return (
|
|
145
|
+
<StyledPegaDxilMyIconButtonUrlWrapper> {displayComp} </StyledPegaDxilMyIconButtonUrlWrapper>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return (
|
|
150
|
+
<StyledPegaDxilMyIconButtonUrlWrapper>
|
|
151
|
+
<div style={{ display: 'flex' }} data-testid={testId}>
|
|
152
|
+
<Icon
|
|
153
|
+
style={{ height: '1.5rem', width: '1.5rem' }}
|
|
154
|
+
// icon name is kabab case
|
|
155
|
+
name='arrow-right'
|
|
156
|
+
role='img'
|
|
157
|
+
aria-label='arrow right'
|
|
158
|
+
/>
|
|
159
|
+
<Label style={{ margin: '0.1rem' }}>
|
|
160
|
+
{' '}
|
|
161
|
+
{PConnect.getLocalizedValue('State list for', '', '')}{' '}
|
|
162
|
+
{PConnect.getLocalizedValue(`${countryCode}`, '', '')}{' '}
|
|
163
|
+
</Label>
|
|
164
|
+
<Button
|
|
165
|
+
icon
|
|
166
|
+
label={PConnect.getLocalizedValue('Click to show/hide state list', '', '')}
|
|
167
|
+
variant='link'
|
|
168
|
+
compact={false}
|
|
169
|
+
onClick={showHideTable}
|
|
170
|
+
>
|
|
171
|
+
<Icon
|
|
172
|
+
style={{ height: '1.5rem', width: '1.5rem' }}
|
|
173
|
+
// icon name is kabab case
|
|
174
|
+
name='list-number'
|
|
175
|
+
role='img'
|
|
176
|
+
aria-label='numbered list'
|
|
177
|
+
/>
|
|
178
|
+
</Button>
|
|
179
|
+
<Link href={validUrl} variant='link' label={validUrl} icon>
|
|
180
|
+
<Icon
|
|
181
|
+
style={{ height: '1.5rem', width: '1.5rem' }}
|
|
182
|
+
// icon name is kabab case
|
|
183
|
+
name='globe'
|
|
184
|
+
role='img'
|
|
185
|
+
aria-label='open link'
|
|
186
|
+
/>
|
|
187
|
+
</Link>
|
|
188
|
+
</div>
|
|
189
|
+
{showTable && (
|
|
190
|
+
<Table
|
|
191
|
+
title={PConnect.getLocalizedValue('State list', '', '')}
|
|
192
|
+
columns={columns}
|
|
193
|
+
data={statelist}
|
|
194
|
+
/>
|
|
195
|
+
)}
|
|
196
|
+
</StyledPegaDxilMyIconButtonUrlWrapper>
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
export default withConfiguration(PegaDxilMyIconButtonUrl);
|