@pega/custom-dx-components 0.23.35 → 0.23.37
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/SECURITY.md +10 -0
- package/package.json +1 -1
- package/src/constants.js +1 -0
- package/src/tasks/build-all/index.js +10 -25
- package/src/tasks/build-comp/index.js +1 -0
- package/src/tasks/bundle/builder/index.js +6 -3
- package/src/tasks/create/templates/Constellation/Field/Boolean/Boolean.ts.mustache +35 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +10 -47
- package/src/tasks/create/templates/Constellation/Field/Boolean/styles.ts.mustache +7 -14
- package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/DateFormatter.js → src/tasks/create/templates/Constellation/Field/Date/DateFormatter.ts.mustache} +6 -6
- package/src/tasks/create/templates/Constellation/Field/Date/FormattedText.tsx.mustache +20 -0
- package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/date.js → src/tasks/create/templates/Constellation/Field/Date/date.ts.mustache} +2 -2
- package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +29 -70
- package/src/tasks/create/templates/Constellation/Field/Date/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Field/DateTime/{date-time.js.mustache → date-time.ts.mustache} +12 -12
- package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/date-utils.js → src/tasks/create/templates/Constellation/Field/DateTime/date-utils.ts.mustache} +27 -26
- package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/date.js → src/tasks/create/templates/Constellation/Field/DateTime/date.ts.mustache} +1 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.tsx.mustache +9 -6
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.tsx.mustache +12 -59
- package/src/tasks/create/templates/Constellation/Field/DateTime/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +14 -67
- package/src/tasks/create/templates/Constellation/Field/Decimal/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +21 -75
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +13 -54
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +23 -87
- package/src/tasks/create/templates/Constellation/Field/Integer/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +12 -60
- package/src/tasks/create/templates/Constellation/Field/Picklist/styles.ts.mustache +7 -14
- package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/date.js → src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/date.ts.mustache} +2 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/demo.stories.tsx.mustache +8 -5
- package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/embed-utils.js → src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/embed-utils.ts.mustache} +2 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +15 -76
- package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/picklist-utils.js → src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/picklist-utils.ts.mustache} +1 -0
- package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/repeat-constants.js → src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/repeat-constants.ts.mustache} +1 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/{repeat-utils.js.mustache → repeat-utils.ts.mustache} +6 -12
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/styles.ts.mustache +7 -14
- package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/textformat-utils.jsx → src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/textformat-utils.tsx.mustache} +30 -10
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/utils.ts.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +11 -55
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Field/Text/index.tsx.mustache +4 -22
- package/src/tasks/create/templates/Constellation/Field/Text/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +9 -46
- package/src/tasks/create/templates/Constellation/Field/Text-Email/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.tsx.mustache +7 -4
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.tsx.mustache +10 -50
- package/src/tasks/create/templates/Constellation/Field/Text-Input/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +12 -48
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +13 -52
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.tsx.mustache +15 -71
- package/src/tasks/create/templates/Constellation/Field/Text-URL/styles.ts.mustache +7 -14
- package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/text-url.jsx → src/tasks/create/templates/Constellation/Field/Text-URL/text-url.tsx.mustache} +4 -3
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.tsx.mustache +8 -6
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.tsx.mustache +16 -52
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Field/{DateTime/date-utils.js.mustache → TimeofDay/time-of-day.ts.mustache} +24 -23
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +14 -5
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +4 -17
- package/src/tasks/create/templates/Constellation/Template/DETAILS/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +10 -3
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +4 -18
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/styles.ts.mustache +7 -14
- package/{tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/utils.js → src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.ts.mustache} +15 -13
- package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +11 -5
- package/src/tasks/create/templates/Constellation/Template/FORM/index.tsx.mustache +5 -13
- package/src/tasks/create/templates/Constellation/Template/FORM/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.tsx.mustache +11 -5
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.tsx.mustache +4 -10
- package/src/tasks/create/templates/Constellation/Template/FORM-region/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Template/PAGE/index.tsx.mustache +5 -16
- package/src/tasks/create/templates/Constellation/Template/PAGE/styles.ts.mustache +7 -14
- package/{tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/utils.js → src/tasks/create/templates/Constellation/Template/PAGE/utils.ts.mustache} +28 -14
- package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Widget/CASE/index.tsx.mustache +3 -10
- package/src/tasks/create/templates/Constellation/Widget/CASE/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +4 -18
- package/src/tasks/create/templates/Constellation/Widget/PAGE/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.tsx.mustache +3 -13
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.tsx.mustache +4 -19
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.tsx.mustache +24 -39
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Launchpad/Widget/CASE/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Launchpad/Widget/CASE/index.tsx.mustache +3 -9
- package/src/tasks/create/templates/Launchpad/Widget/CASE/styles.ts.mustache +7 -14
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Avatar.tsx.mustache +1 -11
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Operator.tsx.mustache +33 -51
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/index.tsx.mustache +22 -21
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/styles.ts.mustache +7 -14
- package/src/tasks/delete-all/helper.js +37 -5
- package/src/tasks/init/template/package.json.mustache +6 -6
- package/src/tasks/init/template/tasks.config.json +2 -1
- package/src/tasks/linter/index.js +7 -4
- package/src/tasks/list/helper.js +10 -0
- package/src/tasks/list/index.js +20 -3
- package/src/tasks/promote-webpack/index.js +3 -26
- package/src/tasks/publish/helper.js +1 -1
- package/src/tasks/publish/index.js +6 -4
- package/src/tasks/publish-all/helper.js +52 -40
- package/src/tasks/publish-all/index.js +16 -17
- package/src/tasks/revert-webpack/index.js +3 -23
- package/src/util.js +152 -61
- package/tests/assets/components/create/Pega_DXIL_MyTestText/demo.stories.tsx +8 -5
- package/tests/assets/components/create/Pega_DXIL_MyTestText/index.tsx +4 -22
- package/tests/assets/components/create/Pega_DXIL_MyTestText/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/Boolean.ts +35 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.tsx +10 -47
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/index.tsx +3 -10
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.tsx +21 -75
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/styles.ts +7 -14
- package/{src/tasks/create/templates/Constellation/Field/Date/DateFormatter.js.mustache → tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/DateFormatter.ts} +6 -6
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/FormattedText.tsx +20 -0
- package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MyDate/date.js → Constellation/Pega_DXIL_MyDate/date.ts} +2 -2
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/index.tsx +18 -59
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/styles.ts +7 -14
- package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MyDateTime/date-time.js → Constellation/Pega_DXIL_MyDateTime/date-time.ts} +12 -12
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/date-utils.ts +288 -0
- package/{src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache → tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/date.ts} +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.stories.tsx +9 -6
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.tsx +12 -59
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.tsx +14 -67
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +12 -3
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/index.tsx +4 -17
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/index.tsx +9 -46
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/demo.stories.tsx +11 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/index.tsx +5 -13
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/index.tsx +23 -87
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/index.tsx +5 -16
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/{utils.js → utils.ts} +28 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +3 -13
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Operator.tsx +4 -19
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/index.tsx +24 -39
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +4 -18
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.tsx +12 -48
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.tsx +13 -54
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/index.tsx +13 -52
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +12 -60
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/index.tsx +11 -55
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/{date.js → date.ts} +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/{embed-utils.js → embed-utils.ts} +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +15 -76
- package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MySearchbox/picklist-utils.js → Constellation/Pega_DXIL_MySearchbox/picklist-utils.ts} +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/{repeat-constants.js → repeat-constants.ts} +1 -1
- package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MySearchbox/repeat-utils.js → Constellation/Pega_DXIL_MySearchbox/repeat-utils.ts} +6 -12
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/styles.ts +7 -14
- package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MySearchbox/textformat-utils.jsx → Constellation/Pega_DXIL_MySearchbox/textformat-utils.tsx} +30 -10
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/utils.ts +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/index.tsx +4 -22
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/demo.stories.tsx +7 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.tsx +10 -50
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +8 -6
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.tsx +16 -52
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/{time-of-day.js → time-of-day.ts} +24 -23
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +10 -3
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/index.tsx +4 -18
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/styles.ts +7 -14
- package/tests/assets/components/createAll/{Launchpad/Pega_DXIL_MyTwoColumnDetails/utils.js → Constellation/Pega_DXIL_MyTwoColumnDetails/utils.ts} +15 -13
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +11 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.tsx +4 -10
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/styles.ts +7 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/index.tsx +15 -71
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/styles.ts +7 -14
- package/{src/tasks/create/templates/Constellation/Field/Text-URL/text-url.jsx.mustache → tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/text-url.tsx} +4 -3
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/Boolean.ts +35 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.tsx +10 -47
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/index.tsx +3 -9
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/index.tsx +21 -75
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/styles.ts +7 -14
- package/tests/assets/components/createAll/{Constellation/Pega_DXIL_MyDate/DateFormatter.js → Launchpad/Pega_DXIL_MyDate/DateFormatter.ts} +6 -6
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/FormattedText.tsx +20 -0
- package/{src/tasks/create/templates/Constellation/Field/Date/date.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/date.ts} +2 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/index.tsx +18 -59
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/styles.ts +7 -14
- package/tests/assets/components/createAll/{Constellation/Pega_DXIL_MyDateTime/date-time.js → Launchpad/Pega_DXIL_MyDateTime/date-time.ts} +12 -12
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/date-utils.ts +288 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/{date.js → date.ts} +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/demo.stories.tsx +9 -6
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/index.tsx +12 -59
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/index.tsx +14 -67
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.tsx +12 -3
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/index.tsx +4 -17
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/index.tsx +9 -46
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/demo.stories.tsx +11 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/index.tsx +5 -13
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/index.tsx +23 -87
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/index.tsx +5 -16
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/styles.ts +7 -14
- package/{src/tasks/create/templates/Constellation/Template/PAGE/utils.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/utils.ts} +28 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +1 -11
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/Operator.tsx +33 -51
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/index.tsx +22 -20
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/index.tsx +4 -18
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/index.tsx +12 -48
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/index.tsx +13 -54
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/index.tsx +13 -52
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.tsx +12 -60
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/index.tsx +11 -55
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/styles.ts +7 -14
- package/{src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/date.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/date.ts} +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/demo.stories.tsx +8 -5
- package/{src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/embed-utils.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/embed-utils.ts} +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/index.tsx +15 -76
- package/{src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/picklist-utils.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/picklist-utils.ts} +1 -0
- package/{src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/repeat-constants.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/repeat-constants.ts} +1 -1
- package/tests/assets/components/createAll/{Constellation/Pega_DXIL_MySearchbox/repeat-utils.js → Launchpad/Pega_DXIL_MySearchbox/repeat-utils.ts} +6 -12
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/styles.ts +7 -14
- package/{src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/textformat-utils.jsx.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/textformat-utils.tsx} +30 -10
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/utils.ts +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/index.tsx +4 -22
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/demo.stories.tsx +7 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/index.tsx +10 -50
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +8 -6
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/index.tsx +16 -52
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/styles.ts +7 -14
- package/{src/tasks/create/templates/Constellation/Field/TimeofDay/time-of-day.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/time-of-day.ts} +24 -23
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +10 -3
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/index.tsx +4 -18
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/styles.ts +7 -14
- package/{src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.js.mustache → tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/utils.ts} +15 -13
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +11 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/index.tsx +4 -10
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/styles.ts +7 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/demo.stories.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/index.tsx +15 -71
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/styles.ts +7 -14
- package/tests/assets/components/createAll/{Constellation/Pega_DXIL_MyURL/text-url.jsx → Launchpad/Pega_DXIL_MyURL/text-url.tsx} +4 -3
- package/tests/functional/localCreateAllListDeleteAll.test.js +10 -3
- package/src/tasks/create/templates/Constellation/Field/Boolean/Boolean.js.mustache +0 -38
- package/src/tasks/create/templates/Constellation/Field/Date/FormattedText.jsx.mustache +0 -41
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/Boolean.js +0 -38
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/FormattedText.jsx +0 -41
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/Boolean.js +0 -38
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/FormattedText.jsx +0 -41
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/date-utils.js +0 -287
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/time-of-day.js +0 -287
- /package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/{component-constants.js → component-constants.ts} +0 -0
- /package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/{format-constants.js.mustache → format-constants.ts.mustache} +0 -0
- /package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/{component-constants.js → component-constants.ts} +0 -0
- /package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/{format-constants.js → format-constants.ts} +0 -0
- /package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/{component-constants.js → component-constants.ts} +0 -0
- /package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/{format-constants.js → format-constants.ts} +0 -0
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Fragment } from 'react';
|
|
2
|
-
import { Grid, Flex, FieldGroup } from '@pega/cosmos-react-core';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
2
|
+
import { Grid, Flex, FieldGroup, withConfiguration } from '@pega/cosmos-react-core';
|
|
5
3
|
import type { PConnFieldProps } from './PConnProps';
|
|
6
4
|
|
|
7
5
|
import StyledPegaDxilMyTwoColumnDetailsWrapper from './styles';
|
|
@@ -21,9 +19,9 @@ interface PegaDxilMyTwoColumnDetailsProps extends PConnFieldProps {
|
|
|
21
19
|
|
|
22
20
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
23
21
|
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
24
|
-
|
|
22
|
+
function PegaDxilMyTwoColumnDetails(props: PegaDxilMyTwoColumnDetailsProps) {
|
|
25
23
|
|
|
26
|
-
const { getPConnect, children, label, showLabel, showHighlightedData } = props;
|
|
24
|
+
const { getPConnect, children, label, showLabel = true, showHighlightedData = false } = props;
|
|
27
25
|
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
28
26
|
|
|
29
27
|
const numRegions = getAllFields(getPConnect)?.length;
|
|
@@ -85,16 +83,4 @@ export default function PegaDxilMyTwoColumnDetails(props: PegaDxilMyTwoColumnDet
|
|
|
85
83
|
|
|
86
84
|
}
|
|
87
85
|
|
|
88
|
-
|
|
89
|
-
label: undefined,
|
|
90
|
-
showLabel: true,
|
|
91
|
-
showHighlightedData: false
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
PegaDxilMyTwoColumnDetails.propTypes = {
|
|
96
|
-
showLabel: PropTypes.bool,
|
|
97
|
-
label: PropTypes.string,
|
|
98
|
-
getPConnect: PropTypes.func.isRequired,
|
|
99
|
-
showHighlightedData: PropTypes.bool
|
|
100
|
-
};
|
|
86
|
+
export default withConfiguration(PegaDxilMyTwoColumnDetails);
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
// utilizing theming, comment out, if want individual style
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { Configuration } from '@pega/cosmos-react-core';
|
|
5
|
-
|
|
6
|
-
export default styled(Configuration)``;
|
|
7
|
-
|
|
8
1
|
// individual style, comment out above, and uncomment here and add styles
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
export default styled.div(() => {
|
|
5
|
+
return css`
|
|
6
|
+
margin: 0px 0;
|
|
7
|
+
`;
|
|
8
|
+
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* metadata of all regions.
|
|
4
4
|
* @param {Function} pConnect PConnect of a Template component.
|
|
5
5
|
*/
|
|
6
|
-
export function getAllFields(pConnect) {
|
|
6
|
+
export function getAllFields(pConnect: Function) {
|
|
7
7
|
const metadata = pConnect().getRawMetadata();
|
|
8
8
|
if (!metadata.children) {
|
|
9
9
|
return [];
|
|
@@ -11,15 +11,15 @@ export function getAllFields(pConnect) {
|
|
|
11
11
|
|
|
12
12
|
let allFields = [];
|
|
13
13
|
|
|
14
|
-
const makeField = (f) => ({
|
|
14
|
+
const makeField = (f: any) => ({
|
|
15
15
|
...pConnect().resolveConfigProps(f.config),
|
|
16
16
|
type: f.type
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
const hasRegions = !!metadata.children[0]?.children;
|
|
20
20
|
if (hasRegions) {
|
|
21
|
-
allFields = metadata.children.map((region) =>
|
|
22
|
-
region.children.map((field) => {
|
|
21
|
+
allFields = metadata.children.map((region: any) =>
|
|
22
|
+
region.children.map((field: any) => {
|
|
23
23
|
// Do not resolve the config props if is status work, instead create component here as status badge and mark as status display
|
|
24
24
|
if (field.config?.value === '@P .pyStatusWork') {
|
|
25
25
|
field.type = 'TextInput';
|
|
@@ -39,7 +39,7 @@ export function getAllFields(pConnect) {
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
export function getFilteredFields(getPConnect) {
|
|
42
|
+
export function getFilteredFields(getPConnect: Function) {
|
|
43
43
|
let primaryFieldsRaw;
|
|
44
44
|
let secondaryFieldsRaw;
|
|
45
45
|
const metadata = getPConnect().getRawMetadata();
|
|
@@ -52,12 +52,12 @@ export function getFilteredFields(getPConnect) {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
// Filter out fields that are not visible and unsupported types for primary fields (for CaseSummary)
|
|
55
|
-
primaryFieldsRaw = primaryFieldsRaw.filter((item) => {
|
|
55
|
+
primaryFieldsRaw = primaryFieldsRaw.filter((item: any) => {
|
|
56
56
|
const resolvedItem = getPConnect().resolveConfigProps(item.config);
|
|
57
57
|
return resolvedItem.visibility !== false && item.type !== 'TextContent';
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
secondaryFieldsRaw = secondaryFieldsRaw.filter((item) => {
|
|
60
|
+
secondaryFieldsRaw = secondaryFieldsRaw.filter((item: any) => {
|
|
61
61
|
const resolvedItem = getPConnect().resolveConfigProps(item.config);
|
|
62
62
|
return resolvedItem.visibility !== false && item.type !== 'TextContent';
|
|
63
63
|
});
|
|
@@ -70,7 +70,7 @@ export function getFilteredFields(getPConnect) {
|
|
|
70
70
|
* @param {object[]} regionData template children item.
|
|
71
71
|
* @returns {object[]} ConfigurableLayout content.
|
|
72
72
|
*/
|
|
73
|
-
export function getLayoutDataFromRegion(regionData) {
|
|
73
|
+
export function getLayoutDataFromRegion(regionData: any) {
|
|
74
74
|
const defaultLayoutConfig = {
|
|
75
75
|
width: 'full',
|
|
76
76
|
fillAvailable: true,
|
|
@@ -80,7 +80,7 @@ export function getLayoutDataFromRegion(regionData) {
|
|
|
80
80
|
return regionData.props
|
|
81
81
|
?.getPConnect()
|
|
82
82
|
?.getChildren()
|
|
83
|
-
?.map((item, index) => {
|
|
83
|
+
?.map((item: any, index: any) => {
|
|
84
84
|
const itemPConnect = item?.getPConnect();
|
|
85
85
|
|
|
86
86
|
return {
|
|
@@ -98,15 +98,18 @@ export function getLayoutDataFromRegion(regionData) {
|
|
|
98
98
|
* Determine if the current view is the view of the case step/assignment.
|
|
99
99
|
* @param {Function} pConnect PConnect object for the component
|
|
100
100
|
*/
|
|
101
|
-
export function getIsAssignmentView(pConnect) {
|
|
101
|
+
export function getIsAssignmentView(pConnect: Function) {
|
|
102
102
|
// Get caseInfo content from the store which contains the view info about the current assignment/step
|
|
103
103
|
// TODO To be replaced with pConnect.getCaseInfo().getCurrentAssignmentView when it's available
|
|
104
|
+
// @ts-ignore
|
|
104
105
|
const assignmentViewClass = pConnect.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_CLASSID);
|
|
106
|
+
// @ts-ignore
|
|
105
107
|
const assignmentViewName = pConnect.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENTACTION_ID);
|
|
106
108
|
|
|
107
109
|
const assignmentViewId = `${assignmentViewName}!${assignmentViewClass}`;
|
|
108
110
|
|
|
109
111
|
// Get the info about the current view from pConnect
|
|
112
|
+
// @ts-ignore
|
|
110
113
|
const currentViewId = `${pConnect.getCurrentView()}!${pConnect.getCurrentClassID()}`;
|
|
111
114
|
|
|
112
115
|
return assignmentViewId === currentViewId;
|
|
@@ -117,7 +120,8 @@ export function getIsAssignmentView(pConnect) {
|
|
|
117
120
|
* @param {Function} pConnect PConnect object for the component
|
|
118
121
|
* @param {string} [instructions="casestep"] 'casestep', 'none', or the html content of a Rule-UI-Paragraph rule (processed via core's paragraph annotation handler)
|
|
119
122
|
*/
|
|
120
|
-
export function getInstructions(pConnect, instructions = 'casestep') {
|
|
123
|
+
export function getInstructions(pConnect: Function, instructions = 'casestep') {
|
|
124
|
+
// @ts-ignore
|
|
121
125
|
const caseStepInstructions = pConnect.getValue(PCore.getConstants().CASE_INFO.INSTRUCTIONS);
|
|
122
126
|
|
|
123
127
|
// Determine if this view is the current assignment/step view
|
|
@@ -135,9 +139,7 @@ export function getInstructions(pConnect, instructions = 'casestep') {
|
|
|
135
139
|
|
|
136
140
|
// If the annotation wasn't processed correctly, don't return any instruction text
|
|
137
141
|
if (instructions?.startsWith('@PARAGRAPH')) {
|
|
138
|
-
/* eslint-disable no-console */
|
|
139
142
|
console.error('@PARAGRAPH annotation was not processed. Hiding custom instructions.');
|
|
140
|
-
/* eslint-enable no-console */
|
|
141
143
|
return undefined;
|
|
142
144
|
}
|
|
143
145
|
|
package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx
CHANGED
|
@@ -2,19 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
// @ts-nocheck
|
|
4
4
|
import { useState } from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
6
6
|
|
|
7
7
|
import PegaDxilMyTwoColumnForm from './index';
|
|
8
8
|
import { DateInput, Input, FieldValueList, Text } from '@pega/cosmos-react-core';
|
|
9
9
|
import { PhoneInput as CosmosPhone } from '@pega/cosmos-react-core';
|
|
10
10
|
import { pyReviewRaw, regionChildrenResolved } from './mock';
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const meta: Meta<typeof PegaDxilMyTwoColumnForm> = {
|
|
13
13
|
title: 'PegaDxilMyTwoColumnForm',
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
component: PegaDxilMyTwoColumnForm,
|
|
15
|
+
excludeStories: /.*Data$/,
|
|
16
|
+
parameters: {
|
|
17
|
+
type: 'TwoColumnForm'
|
|
18
|
+
}
|
|
16
19
|
};
|
|
17
20
|
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<typeof PegaDxilMyTwoColumnForm>;
|
|
23
|
+
|
|
18
24
|
const renderField = resolvedProps => {
|
|
19
25
|
const { displayMode, value = '', label = '', key } = resolvedProps;
|
|
20
26
|
|
|
@@ -134,7 +140,7 @@ const renderField = resolvedProps => {
|
|
|
134
140
|
);
|
|
135
141
|
};
|
|
136
142
|
|
|
137
|
-
export const BasePegaDxilMyTwoColumnForm =
|
|
143
|
+
export const BasePegaDxilMyTwoColumnForm: Story = args => {
|
|
138
144
|
const props = {
|
|
139
145
|
template: 'DefaultForm',
|
|
140
146
|
getPConnect: () => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Grid, Flex, FieldGroup } from '@pega/cosmos-react-core';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import { Grid, Flex, FieldGroup, withConfiguration } from '@pega/cosmos-react-core';
|
|
3
2
|
|
|
4
3
|
import type { PConnFieldProps } from './PConnProps';
|
|
5
4
|
|
|
@@ -16,10 +15,10 @@ interface PegaDxilMyTwoColumnFormProps extends PConnFieldProps {
|
|
|
16
15
|
|
|
17
16
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
18
17
|
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
19
|
-
|
|
18
|
+
function PegaDxilMyTwoColumnForm(props: PegaDxilMyTwoColumnFormProps) {
|
|
20
19
|
|
|
21
20
|
|
|
22
|
-
const { children, label, showLabel, getPConnect } = props;
|
|
21
|
+
const { children = [], label, showLabel, getPConnect } = props;
|
|
23
22
|
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
24
23
|
|
|
25
24
|
const numRegions = children?.length;
|
|
@@ -51,10 +50,5 @@ export default function PegaDxilMyTwoColumnForm(props: PegaDxilMyTwoColumnFormPr
|
|
|
51
50
|
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
PegaDxilMyTwoColumnForm.defaultProps = {
|
|
55
|
-
children: []
|
|
56
|
-
};
|
|
57
53
|
|
|
58
|
-
|
|
59
|
-
children: PropTypes.arrayOf(PropTypes.node),
|
|
60
|
-
};
|
|
54
|
+
export default withConfiguration(PegaDxilMyTwoColumnForm);
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
// utilizing theming, comment out, if want individual style
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { Configuration } from '@pega/cosmos-react-core';
|
|
5
|
-
|
|
6
|
-
export default styled(Configuration)``;
|
|
7
|
-
|
|
8
1
|
// individual style, comment out above, and uncomment here and add styles
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
export default styled.div(() => {
|
|
5
|
+
return css`
|
|
6
|
+
margin: 0px 0;
|
|
7
|
+
`;
|
|
8
|
+
});
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
|
|
2
2
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
3
3
|
// @ts-nocheck
|
|
4
|
-
import {
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
import PegaDxilMyUrl from './index';
|
|
7
7
|
import { stateProps, configProps } from './mock';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const meta: Meta<typeof PegaDxilMyUrl> = {
|
|
10
10
|
title: 'PegaDxilMyUrl',
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
component: PegaDxilMyUrl,
|
|
12
|
+
excludeStories: /.*Data$/
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
export
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof PegaDxilMyUrl>;
|
|
17
|
+
|
|
18
|
+
export const BasePegaDxilMyUrl: Story = args => {
|
|
16
19
|
|
|
17
20
|
const props = {
|
|
18
21
|
value: configProps.value,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { useState, useEffect, useRef} from "react";
|
|
2
|
-
import { Input, FieldValueList, Text } from "@pega/cosmos-react-core";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
2
|
+
import { Input, FieldValueList, Text, withConfiguration } from "@pega/cosmos-react-core";
|
|
4
3
|
import type { PConnFieldProps } from './PConnProps';
|
|
5
4
|
|
|
6
5
|
// includes in bundle
|
|
7
|
-
import {formatExists,textFormatter, urlFormatter} from "./text-url
|
|
6
|
+
import {formatExists,textFormatter, urlFormatter} from "./text-url";
|
|
8
7
|
import handleEvent from "./event-utils";
|
|
9
8
|
import { suggestionsHandler } from './suggestions-handler';
|
|
10
9
|
|
|
@@ -41,31 +40,31 @@ interface StateProps {
|
|
|
41
40
|
|
|
42
41
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
43
42
|
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
44
|
-
|
|
43
|
+
function PegaDxilMyUrl(props: PegaDxilMyUrlProps) {
|
|
45
44
|
const {
|
|
46
45
|
getPConnect,
|
|
47
46
|
value,
|
|
48
|
-
hideLabel,
|
|
47
|
+
hideLabel = false,
|
|
49
48
|
placeholder,
|
|
50
49
|
validatemessage,
|
|
51
50
|
label,
|
|
52
51
|
helperText,
|
|
53
52
|
testId,
|
|
54
53
|
displayMode,
|
|
55
|
-
additionalProps,
|
|
56
|
-
variant,
|
|
57
|
-
isTableFormatter,
|
|
58
|
-
displayAs,
|
|
59
|
-
widthSel,
|
|
54
|
+
additionalProps = {},
|
|
55
|
+
variant = 'inline',
|
|
56
|
+
isTableFormatter = false,
|
|
57
|
+
displayAs = 'defaultURL',
|
|
58
|
+
widthSel = 'defaultWidth',
|
|
60
59
|
customWidth,
|
|
61
|
-
altText,
|
|
60
|
+
altText = 'constant',
|
|
62
61
|
altTextOfImage,
|
|
63
62
|
propaltTextOfImage,
|
|
64
63
|
urlLabel,
|
|
65
64
|
propUrlLabel,
|
|
66
|
-
urlLabelSelection,
|
|
67
|
-
tableDisplayAs,
|
|
68
|
-
hasSuggestions
|
|
65
|
+
urlLabelSelection = 'constant',
|
|
66
|
+
tableDisplayAs = 'link',
|
|
67
|
+
hasSuggestions = false
|
|
69
68
|
} = props;
|
|
70
69
|
const { formatter } = props;
|
|
71
70
|
const pConn = getPConnect();
|
|
@@ -76,7 +75,7 @@ export default function PegaDxilMyUrl(props: PegaDxilMyUrlProps) {
|
|
|
76
75
|
|
|
77
76
|
|
|
78
77
|
// BUG-547602: Temporary type coercion for 8.5 until DXAPIs are enhanced to pass original pxViewMetadata JSON, respecting boolean primitives
|
|
79
|
-
let { readOnly, required, disabled } = props;
|
|
78
|
+
let { readOnly = false, required = false, disabled = false } = props;
|
|
80
79
|
[readOnly, required, disabled] = [readOnly, required, disabled].map(
|
|
81
80
|
(prop) => prop === true || (typeof prop === 'string' && prop === 'true')
|
|
82
81
|
);
|
|
@@ -202,60 +201,5 @@ export default function PegaDxilMyUrl(props: PegaDxilMyUrlProps) {
|
|
|
202
201
|
);
|
|
203
202
|
}
|
|
204
203
|
|
|
205
|
-
PegaDxilMyUrl.defaultProps = {
|
|
206
|
-
value: '',
|
|
207
|
-
placeholder: '',
|
|
208
|
-
validatemessage: '',
|
|
209
|
-
helperText: '',
|
|
210
|
-
hideLabel: false,
|
|
211
|
-
disabled: false,
|
|
212
|
-
readOnly: false,
|
|
213
|
-
required: false,
|
|
214
|
-
testId: '',
|
|
215
|
-
displayMode: null,
|
|
216
|
-
additionalProps: {},
|
|
217
|
-
variant: 'inline',
|
|
218
|
-
formatter: '',
|
|
219
|
-
isTableFormatter: false,
|
|
220
|
-
displayAs: 'defaultURL',
|
|
221
|
-
widthSel: 'defaultWidth',
|
|
222
|
-
customWidth: null,
|
|
223
|
-
altText: 'constant',
|
|
224
|
-
altTextOfImage: '',
|
|
225
|
-
propaltTextOfImage: '',
|
|
226
|
-
urlLabel: '',
|
|
227
|
-
propUrlLabel: '',
|
|
228
|
-
urlLabelSelection: 'constant',
|
|
229
|
-
tableDisplayAs: 'link',
|
|
230
|
-
hasSuggestions: false
|
|
231
|
-
};
|
|
232
204
|
|
|
233
|
-
|
|
234
|
-
value: PropTypes.string,
|
|
235
|
-
placeholder: PropTypes.string,
|
|
236
|
-
label: PropTypes.string.isRequired,
|
|
237
|
-
hideLabel: PropTypes.bool,
|
|
238
|
-
getPConnect: PropTypes.func.isRequired,
|
|
239
|
-
validatemessage: PropTypes.string,
|
|
240
|
-
helperText: PropTypes.string,
|
|
241
|
-
disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
242
|
-
readOnly: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
243
|
-
required: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
244
|
-
testId: PropTypes.string,
|
|
245
|
-
displayMode: PropTypes.string,
|
|
246
|
-
additionalProps: PropTypes.objectOf(PropTypes.any),
|
|
247
|
-
variant: PropTypes.string,
|
|
248
|
-
formatter: PropTypes.string,
|
|
249
|
-
isTableFormatter: PropTypes.bool,
|
|
250
|
-
displayAs: PropTypes.string,
|
|
251
|
-
widthSel: PropTypes.string,
|
|
252
|
-
customWidth: PropTypes.number,
|
|
253
|
-
altText: PropTypes.string,
|
|
254
|
-
altTextOfImage: PropTypes.string,
|
|
255
|
-
propaltTextOfImage: PropTypes.string,
|
|
256
|
-
urlLabel: PropTypes.string,
|
|
257
|
-
propUrlLabel: PropTypes.string,
|
|
258
|
-
urlLabelSelection: PropTypes.string,
|
|
259
|
-
tableDisplayAs: PropTypes.string,
|
|
260
|
-
hasSuggestions: PropTypes.bool
|
|
261
|
-
};
|
|
205
|
+
export default withConfiguration(PegaDxilMyUrl);
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
// utilizing theming, comment out, if want individual style
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { Configuration } from '@pega/cosmos-react-core';
|
|
5
|
-
|
|
6
|
-
export default styled(Configuration)``;
|
|
7
|
-
|
|
8
1
|
// individual style, comment out above, and uncomment here and add styles
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
export default styled.div(() => {
|
|
5
|
+
return css`
|
|
6
|
+
margin: 0px 0;
|
|
7
|
+
`;
|
|
8
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { useState, useRef, Fragment} from "react";
|
|
2
3
|
import { EmailDisplay, PhoneDisplay, URLDisplay, Image, Button, Lightbox } from '@pega/cosmos-react-core';
|
|
3
4
|
|
|
4
5
|
export const formatExists = (formatterVal) => {
|
|
@@ -68,7 +69,7 @@ const TableImage = (imageProps) => {
|
|
|
68
69
|
let btnVal = value;
|
|
69
70
|
btnVal = urlLabelVal(urlLabelSelection, btnVal, urlLabel, propUrlLabel);
|
|
70
71
|
imageDisplayComp = (
|
|
71
|
-
<
|
|
72
|
+
<Fragment>
|
|
72
73
|
{btnVal !== null && (
|
|
73
74
|
<Button ref={demoButtonRef} variant='link' compact={false} onClick={onClick} autoFocus>
|
|
74
75
|
{btnVal}
|
|
@@ -85,7 +86,7 @@ const TableImage = (imageProps) => {
|
|
|
85
86
|
onItemDownload={isImage(images[0].src) ? onItemDownload : undefined}
|
|
86
87
|
/>
|
|
87
88
|
)}
|
|
88
|
-
</
|
|
89
|
+
</Fragment>
|
|
89
90
|
);
|
|
90
91
|
return imageDisplayComp;
|
|
91
92
|
};
|
|
@@ -34,7 +34,10 @@ describe('createAll list and deleteAll local', () => {
|
|
|
34
34
|
const newFileName = 'Pega_DXIL_MyBoolean';
|
|
35
35
|
|
|
36
36
|
// const fileDir = path.resolve(`src/components/${newFileName}`);
|
|
37
|
-
const createFile = path.resolve(
|
|
37
|
+
const createFile = path.resolve(
|
|
38
|
+
'../../..',
|
|
39
|
+
path.join(`src/components/${newFileName}`, 'index.tsx')
|
|
40
|
+
);
|
|
38
41
|
const doesExist = fs.existsSync(createFile);
|
|
39
42
|
expect(doesExist).toBeTruthy();
|
|
40
43
|
|
|
@@ -67,6 +70,8 @@ describe('createAll list and deleteAll local', () => {
|
|
|
67
70
|
expect(stdout).toContain('Pega_DXIL_MyDateTime');
|
|
68
71
|
expect(stdout).toContain('Pega_DXIL_MyTimeOfDay');
|
|
69
72
|
expect(stdout).toContain('Pega_DXIL_MyPicklist');
|
|
73
|
+
expect(stdout).toContain('Pega_DXIL_MySearchbox');
|
|
74
|
+
expect(stdout).toContain('Pega_DXIL_MyRadiobuttons');
|
|
70
75
|
expect(stdout).toContain('Pega_DXIL_MyDetails');
|
|
71
76
|
expect(stdout).toContain('Pega_DXIL_MyTwoColumnDetails');
|
|
72
77
|
expect(stdout).toContain('Pega_DXIL_MyForm');
|
|
@@ -95,6 +100,8 @@ describe('createAll list and deleteAll local', () => {
|
|
|
95
100
|
'Pega_DXIL_MyDateTime',
|
|
96
101
|
'Pega_DXIL_MyTimeOfDay',
|
|
97
102
|
'Pega_DXIL_MyPicklist',
|
|
103
|
+
'Pega_DXIL_MySearchbox',
|
|
104
|
+
'Pega_DXIL_MyRadiobuttons',
|
|
98
105
|
'Pega_DXIL_MyDetails',
|
|
99
106
|
'Pega_DXIL_MyTwoColumnDetails',
|
|
100
107
|
'Pega_DXIL_MyForm',
|
|
@@ -108,8 +115,8 @@ describe('createAll list and deleteAll local', () => {
|
|
|
108
115
|
const tasksConfigDir = path.resolve('../../..', 'tasks.config.json');
|
|
109
116
|
const tasksConfigData = fs.readFileSync(tasksConfigDir, { encoding: 'utf8' });
|
|
110
117
|
const tasksConfigJSON = JSON.parse(tasksConfigData);
|
|
111
|
-
const serverType = tasksConfigJSON[
|
|
112
|
-
const serverDir = serverType ===
|
|
118
|
+
const serverType = tasksConfigJSON['server-config'].serverType;
|
|
119
|
+
const serverDir = serverType === 'launchpad' ? 'Launchpad' : 'Constellation';
|
|
113
120
|
|
|
114
121
|
compList.forEach(component => {
|
|
115
122
|
const componentDir = path.resolve('../../..', `src/components/${component}`);
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
function Boolean(value, { allowEmpty = true, tick = "", cross = "" } = {}) {
|
|
2
|
-
if (
|
|
3
|
-
(!allowEmpty && !value) ||
|
|
4
|
-
value === false ||
|
|
5
|
-
value?.toString()?.toLowerCase() === "false" ||
|
|
6
|
-
value === 0 ||
|
|
7
|
-
value === "0"
|
|
8
|
-
) {
|
|
9
|
-
return cross || "";
|
|
10
|
-
}
|
|
11
|
-
if (
|
|
12
|
-
value === true ||
|
|
13
|
-
value?.toString()?.toLowerCase() === "true" ||
|
|
14
|
-
value === 1 ||
|
|
15
|
-
value === "1"
|
|
16
|
-
) {
|
|
17
|
-
return tick || "";
|
|
18
|
-
}
|
|
19
|
-
if (
|
|
20
|
-
allowEmpty &&
|
|
21
|
-
(value === "null" ||
|
|
22
|
-
value === "" ||
|
|
23
|
-
value === null ||
|
|
24
|
-
typeof value === "undefined")
|
|
25
|
-
) {
|
|
26
|
-
return "––";
|
|
27
|
-
}
|
|
28
|
-
return value;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default {
|
|
32
|
-
TrueFalse: (value, options) =>
|
|
33
|
-
Boolean(value, {
|
|
34
|
-
...options,
|
|
35
|
-
tick: "True",
|
|
36
|
-
cross: "False"
|
|
37
|
-
})
|
|
38
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { FieldValueList } from '@pega/cosmos-react-core';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
import { format } from './date.js';
|
|
5
|
-
|
|
6
|
-
export default function FormattedText(props) {
|
|
7
|
-
const { formatType, label, value, testId, hideLabel, variant, additionalProps } = props;
|
|
8
|
-
|
|
9
|
-
let text = value;
|
|
10
|
-
|
|
11
|
-
text = format(text, formatType, additionalProps);
|
|
12
|
-
|
|
13
|
-
const fields = [
|
|
14
|
-
{
|
|
15
|
-
id: label.toLowerCase(),
|
|
16
|
-
name: hideLabel ? '' : label,
|
|
17
|
-
value: text
|
|
18
|
-
}
|
|
19
|
-
];
|
|
20
|
-
return <FieldValueList variant={variant} fields={fields} data-testid={testId} />;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
FormattedText.defaultProps = {
|
|
24
|
-
formatType: 'none',
|
|
25
|
-
variant: 'stacked',
|
|
26
|
-
value: undefined,
|
|
27
|
-
label: '',
|
|
28
|
-
testId: null,
|
|
29
|
-
hideLabel: false,
|
|
30
|
-
additionalProps: {}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
FormattedText.propTypes = {
|
|
34
|
-
formatType: PropTypes.string,
|
|
35
|
-
variant: PropTypes.oneOf(['inline', 'stacked']),
|
|
36
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
|
|
37
|
-
label: PropTypes.string,
|
|
38
|
-
testId: PropTypes.string,
|
|
39
|
-
additionalProps: PropTypes.objectOf(PropTypes.any),
|
|
40
|
-
hideLabel: PropTypes.bool
|
|
41
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
function Boolean(value, { allowEmpty = true, tick = "", cross = "" } = {}) {
|
|
2
|
-
if (
|
|
3
|
-
(!allowEmpty && !value) ||
|
|
4
|
-
value === false ||
|
|
5
|
-
value?.toString()?.toLowerCase() === "false" ||
|
|
6
|
-
value === 0 ||
|
|
7
|
-
value === "0"
|
|
8
|
-
) {
|
|
9
|
-
return cross || "";
|
|
10
|
-
}
|
|
11
|
-
if (
|
|
12
|
-
value === true ||
|
|
13
|
-
value?.toString()?.toLowerCase() === "true" ||
|
|
14
|
-
value === 1 ||
|
|
15
|
-
value === "1"
|
|
16
|
-
) {
|
|
17
|
-
return tick || "";
|
|
18
|
-
}
|
|
19
|
-
if (
|
|
20
|
-
allowEmpty &&
|
|
21
|
-
(value === "null" ||
|
|
22
|
-
value === "" ||
|
|
23
|
-
value === null ||
|
|
24
|
-
typeof value === "undefined")
|
|
25
|
-
) {
|
|
26
|
-
return "––";
|
|
27
|
-
}
|
|
28
|
-
return value;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default {
|
|
32
|
-
TrueFalse: (value, options) =>
|
|
33
|
-
Boolean(value, {
|
|
34
|
-
...options,
|
|
35
|
-
tick: "True",
|
|
36
|
-
cross: "False"
|
|
37
|
-
})
|
|
38
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { FieldValueList } from '@pega/cosmos-react-core';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
import { format } from './date.js';
|
|
5
|
-
|
|
6
|
-
export default function FormattedText(props) {
|
|
7
|
-
const { formatType, label, value, testId, hideLabel, variant, additionalProps } = props;
|
|
8
|
-
|
|
9
|
-
let text = value;
|
|
10
|
-
|
|
11
|
-
text = format(text, formatType, additionalProps);
|
|
12
|
-
|
|
13
|
-
const fields = [
|
|
14
|
-
{
|
|
15
|
-
id: label.toLowerCase(),
|
|
16
|
-
name: hideLabel ? '' : label,
|
|
17
|
-
value: text
|
|
18
|
-
}
|
|
19
|
-
];
|
|
20
|
-
return <FieldValueList variant={variant} fields={fields} data-testid={testId} />;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
FormattedText.defaultProps = {
|
|
24
|
-
formatType: 'none',
|
|
25
|
-
variant: 'stacked',
|
|
26
|
-
value: undefined,
|
|
27
|
-
label: '',
|
|
28
|
-
testId: null,
|
|
29
|
-
hideLabel: false,
|
|
30
|
-
additionalProps: {}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
FormattedText.propTypes = {
|
|
34
|
-
formatType: PropTypes.string,
|
|
35
|
-
variant: PropTypes.oneOf(['inline', 'stacked']),
|
|
36
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
|
|
37
|
-
label: PropTypes.string,
|
|
38
|
-
testId: PropTypes.string,
|
|
39
|
-
additionalProps: PropTypes.objectOf(PropTypes.any),
|
|
40
|
-
hideLabel: PropTypes.bool
|
|
41
|
-
};
|