@pega/dx-component-builder-sdk 0.23.13 → 0.23.15
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/constants.js +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.html.mustache +5 -1
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.ts.mustache +6 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.html.mustache +5 -1
- package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.ts.mustache +7 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.ts.mustache +2 -1
- package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.scss.mustache +14 -5
- package/src/tasks/create/templates/SDK-React/field/Boolean/demo.stories.tsx.mustache +8 -4
- package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +23 -21
- package/src/tasks/create/templates/SDK-React/field/Date/demo.stories.tsx.mustache +17 -15
- package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +24 -26
- package/src/tasks/create/templates/SDK-React/field/DateTime/demo.stories.tsx.mustache +15 -14
- package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +20 -22
- package/src/tasks/create/templates/SDK-React/field/Decimal/demo.stories.tsx.mustache +15 -14
- package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +4 -5
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/demo.stories.tsx.mustache +14 -12
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +3 -4
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/demo.stories.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +3 -4
- package/src/tasks/create/templates/SDK-React/field/Integer/demo.stories.tsx.mustache +3 -3
- package/src/tasks/create/templates/SDK-React/field/Integer/index.tsx.mustache +3 -4
- package/src/tasks/create/templates/SDK-React/field/Picklist/demo.stories.tsx.mustache +2 -3
- package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +3 -4
- package/src/tasks/create/templates/SDK-React/field/Picklist-Autocomplete/demo.stories.tsx.mustache +3 -3
- package/src/tasks/create/templates/SDK-React/field/Picklist-Autocomplete/index.tsx.mustache +31 -32
- package/src/tasks/create/templates/SDK-React/field/Picklist-RadioButtons/demo.stories.tsx.mustache +6 -4
- package/src/tasks/create/templates/SDK-React/field/Picklist-RadioButtons/index.tsx.mustache +22 -23
- package/src/tasks/create/templates/SDK-React/field/Text/demo.stories.tsx.mustache +8 -4
- package/src/tasks/create/templates/SDK-React/field/Text/index.tsx.mustache +18 -19
- package/src/tasks/create/templates/SDK-React/field/Text-Email/demo.stories.tsx.mustache +8 -4
- package/src/tasks/create/templates/SDK-React/field/Text-Email/index.tsx.mustache +26 -27
- package/src/tasks/create/templates/SDK-React/field/Text-Input/demo.stories.tsx.mustache +8 -4
- package/src/tasks/create/templates/SDK-React/field/Text-Input/index.tsx.mustache +18 -19
- package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/index.tsx.mustache +21 -22
- package/src/tasks/create/templates/SDK-React/field/Text-Phone/demo.stories.tsx.mustache +6 -4
- package/src/tasks/create/templates/SDK-React/field/Text-Phone/index.tsx.mustache +39 -40
- package/src/tasks/create/templates/SDK-React/field/Text-URL/demo.stories.tsx.mustache +8 -4
- package/src/tasks/create/templates/SDK-React/field/Text-URL/index.tsx.mustache +19 -20
- package/src/tasks/create/templates/SDK-React/field/TimeOfDay/demo.stories.tsx.mustache +6 -4
- package/src/tasks/create/templates/SDK-React/field/TimeOfDay/index.tsx.mustache +4 -5
- package/src/tasks/create/templates/SDK-React/template/DETAILS/demo.stories.tsx.mustache +22 -22
- package/src/tasks/create/templates/SDK-React/template/DETAILS/index.tsx.mustache +19 -20
- package/src/tasks/create/templates/SDK-React/template/DETAILS-region/demo.stories.tsx.mustache +17 -17
- package/src/tasks/create/templates/SDK-React/template/DETAILS-region/index.tsx.mustache +19 -20
- package/src/tasks/create/templates/SDK-React/template/FORM/demo.stories.tsx.mustache +30 -18
- package/src/tasks/create/templates/SDK-React/template/FORM/index.tsx.mustache +6 -7
- package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.tsx.mustache +50 -24
- package/src/tasks/create/templates/SDK-React/template/FORM-region/index.tsx.mustache +8 -9
- package/src/tasks/create/templates/SDK-React/template/PAGE/demo.stories.tsx.mustache +37 -21
- package/src/tasks/create/templates/SDK-React/template/PAGE/index.tsx.mustache +4 -5
- package/src/tasks/create/templates/SDK-React/widget/CASE/demo.stories.tsx.mustache +22 -10
- package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +10 -11
- package/src/tasks/create/templates/SDK-React/widget/PAGE/demo.stories.tsx.mustache +3 -4
- package/src/tasks/create/templates/SDK-React/widget/PAGE/index.tsx.mustache +23 -24
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/demo.stories.tsx.mustache +21 -9
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +37 -37
- package/src/tasks/validator/index.js +52 -47
- package/tests/assets/sdk-a/components/create/override-sdk/designSystemExtension/field-group/field-group.component.html +21 -0
- package/tests/assets/sdk-a/components/create/override-sdk/designSystemExtension/field-group/field-group.component.scss +18 -0
- package/tests/assets/sdk-a/components/create/override-sdk/designSystemExtension/field-group/field-group.component.spec.ts +21 -0
- package/tests/assets/sdk-a/components/create/override-sdk/designSystemExtension/field-group/field-group.component.ts +24 -0
- package/tests/assets/sdk-a/components/create/override-sdk/designSystemExtension/material-details-fields/material-details-fields.component.html +8 -2
- package/tests/assets/sdk-a/components/create/override-sdk/designSystemExtension/rich-text-editor/rich-text-editor.component.html +33 -0
- package/tests/assets/sdk-a/components/create/override-sdk/designSystemExtension/rich-text-editor/rich-text-editor.component.scss +19 -0
- package/tests/assets/sdk-a/components/create/override-sdk/designSystemExtension/rich-text-editor/rich-text-editor.component.spec.ts +24 -0
- package/tests/assets/sdk-a/components/create/override-sdk/designSystemExtension/rich-text-editor/rich-text-editor.component.ts +89 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/check-box/check-box.component.html +5 -1
- package/tests/assets/sdk-a/components/create/override-sdk/field/check-box/check-box.component.ts +6 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/date/date.component.html +5 -1
- package/tests/assets/sdk-a/components/create/override-sdk/field/date/date.component.ts +7 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/group/config-ext.json +8 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/group/group.component.html +25 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/group/group.component.scss +0 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/group/group.component.spec.ts +21 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/group/group.component.ts +84 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/rich-text/rich-text.component.html +20 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/rich-text/rich-text.component.scss +0 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/rich-text/rich-text.component.spec.ts +24 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/rich-text/rich-text.component.ts +131 -0
- package/tests/assets/sdk-a/components/create/override-sdk/template/app-shell/app-shell.component.ts +2 -2
- package/tests/assets/sdk-a/components/create/override-sdk/template/case-view/case-view.component.ts +1 -1
- package/tests/assets/sdk-a/components/create/override-sdk/template/default-form/default-form.component.scss +9 -5
- package/tests/assets/sdk-a/components/create/override-sdk/template/details/details.component.ts +2 -1
- package/tests/assets/sdk-a/components/create/override-sdk/widget/file-utility/file-utility.component.ts +21 -15
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-boolean/pega-dxil-my-boolean.component.html +5 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-boolean/pega-dxil-my-boolean.component.ts +6 -0
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-date/pega-dxil-my-date.component.html +5 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-date/pega-dxil-my-date.component.ts +7 -0
- package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-details/pega-dxil-my-details.component.ts +2 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-form/pega-dxil-my-form.component.scss +14 -5
- package/tests/assets/sdk-a/components/createAll/override-sdk/designSystemExtension/field-group/field-group.component.html +21 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/designSystemExtension/field-group/field-group.component.scss +18 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/designSystemExtension/field-group/field-group.component.spec.ts +21 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/designSystemExtension/field-group/field-group.component.ts +24 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/designSystemExtension/material-details-fields/material-details-fields.component.html +8 -2
- package/tests/assets/sdk-a/components/createAll/override-sdk/designSystemExtension/rich-text-editor/rich-text-editor.component.html +33 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/designSystemExtension/rich-text-editor/rich-text-editor.component.scss +19 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/designSystemExtension/rich-text-editor/rich-text-editor.component.spec.ts +24 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/designSystemExtension/rich-text-editor/rich-text-editor.component.ts +89 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/check-box/check-box.component.html +5 -1
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/check-box/check-box.component.ts +6 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/date/date.component.html +5 -1
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/date/date.component.ts +7 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/group/config-ext.json +8 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/group/group.component.html +25 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/group/group.component.scss +0 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/group/group.component.spec.ts +21 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/group/group.component.ts +84 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/rich-text/rich-text.component.html +20 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/rich-text/rich-text.component.scss +0 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/rich-text/rich-text.component.spec.ts +24 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/rich-text/rich-text.component.ts +131 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/template/app-shell/app-shell.component.ts +2 -2
- package/tests/assets/sdk-a/components/createAll/override-sdk/template/case-view/case-view.component.ts +1 -1
- package/tests/assets/sdk-a/components/createAll/override-sdk/template/default-form/default-form.component.scss +9 -5
- package/tests/assets/sdk-a/components/createAll/override-sdk/template/details/details.component.ts +2 -1
- package/tests/assets/sdk-a/components/createAll/override-sdk/widget/file-utility/file-utility.component.ts +21 -15
- package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/demo.stories.tsx +8 -4
- package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +15 -16
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldGroup/FieldGroup.tsx +35 -6
- package/tests/assets/sdk-r/components/create/override-sdk/field/Checkbox/Checkbox.tsx +7 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Group/Group.tsx +37 -0
- package/tests/assets/sdk-r/components/create/override-sdk/field/Group/config-ext.json +8 -0
- package/tests/assets/sdk-r/components/create/override-sdk/field/Group/index.tsx +1 -0
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +14 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/DefaultForm.css +6 -2
- package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +19 -1
- package/tests/assets/sdk-r/components/create/override-sdk/widget/FileUtility/FileUtility.tsx +22 -16
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/PConnProps.d.ts +46 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/demo.stories.tsx +54 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/index.tsx +73 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/mock.ts +15 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/styles.ts +15 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/demo.stories.tsx +8 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/index.tsx +23 -21
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/demo.stories.tsx +14 -12
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/demo.stories.tsx +17 -15
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/index.tsx +21 -23
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +15 -14
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/index.tsx +20 -22
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/demo.stories.tsx +15 -14
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +1 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/demo.stories.tsx +8 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/index.tsx +23 -24
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/demo.stories.tsx +3 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/demo.stories.tsx +8 -5
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/index.tsx +18 -19
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/demo.stories.tsx +2 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/demo.stories.tsx +6 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +33 -34
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/demo.stories.tsx +2 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyRadiobuttons/demo.stories.tsx +6 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyRadiobuttons/index.tsx +22 -23
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MySearchbox/demo.stories.tsx +3 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MySearchbox/index.tsx +28 -29
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/config.json +83 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/demo.stories.tsx +59 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +101 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/mock.ts +16 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/styles.js +7 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/demo.stories.tsx +8 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/index.tsx +15 -16
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/demo.stories.tsx +8 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/index.tsx +15 -16
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +6 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/index.tsx +1 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/demo.stories.tsx +8 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/index.tsx +16 -17
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/demo.stories.tsx +22 -22
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/index.tsx +16 -17
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/demo.stories.tsx +56 -18
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/index.tsx +3 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/demo.stories.tsx +37 -21
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/index.tsx +4 -5
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +17 -17
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/index.tsx +16 -17
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +50 -24
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/index.tsx +8 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/demo.stories.tsx +22 -10
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +10 -11
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +21 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +34 -34
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/demo.stories.tsx +3 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/index.tsx +23 -24
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldGroup/FieldGroup.tsx +35 -6
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Checkbox/Checkbox.tsx +7 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/Group.tsx +37 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/config-ext.json +8 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/index.tsx +1 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +14 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/DefaultForm.css +6 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +19 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/FileUtility/FileUtility.tsx +22 -16
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<div class="field-group-container">
|
|
2
|
+
<div *ngIf="name" class="field-group-heading">
|
|
3
|
+
<span *ngIf="collapsible; else no_collapse" id="field-group-header" class="field-group-header" (click)="headerClickHandler()">
|
|
4
|
+
<mat-icon *ngIf="collapsed; else down_arrow" aria-hidden="false" aria-label="Arrow Right" fontIcon="keyboard_arrow_right"></mat-icon>
|
|
5
|
+
<ng-template #down_arrow>
|
|
6
|
+
<mat-icon aria-hidden="false" aria-label="Arrow Down" fontIcon="keyboard_arrow_down"></mat-icon>
|
|
7
|
+
</ng-template>
|
|
8
|
+
<b>{{ name }}</b>
|
|
9
|
+
</span>
|
|
10
|
+
<ng-template #no_collapse>
|
|
11
|
+
<span>{{ name }}</span>
|
|
12
|
+
</ng-template>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div *ngIf="instructions && instructions !== 'none'" class="field-group-instructions">
|
|
16
|
+
<div key="instructions" id="instruction-text" [innerHTML]="instructions"></div>
|
|
17
|
+
</div>
|
|
18
|
+
<div *ngIf="!collapsed" class="field-group-content">
|
|
19
|
+
<ng-container [ngTemplateOutlet]="childrenTemplate"></ng-container>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.field-group-container {
|
|
2
|
+
.field-group-heading {
|
|
3
|
+
padding-top: 8px;
|
|
4
|
+
padding-bottom: 8px;
|
|
5
|
+
font-weight: bold;
|
|
6
|
+
|
|
7
|
+
.field-group-header {
|
|
8
|
+
gap: 5px;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.field-group-instructions {
|
|
16
|
+
padding: 5px 0;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { FieldGroupComponent } from './field-group.component';
|
|
4
|
+
|
|
5
|
+
describe('FieldGroupComponent', () => {
|
|
6
|
+
let component: FieldGroupComponent;
|
|
7
|
+
let fixture: ComponentFixture<FieldGroupComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [FieldGroupComponent]
|
|
12
|
+
});
|
|
13
|
+
fixture = TestBed.createComponent(FieldGroupComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { Component, Input, TemplateRef } from '@angular/core';
|
|
3
|
+
import { MatGridListModule } from '@angular/material/grid-list';
|
|
4
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'app-field-group',
|
|
8
|
+
templateUrl: './field-group.component.html',
|
|
9
|
+
styleUrls: ['./field-group.component.scss'],
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [CommonModule, MatGridListModule, MatIconModule]
|
|
12
|
+
})
|
|
13
|
+
export class FieldGroupComponent {
|
|
14
|
+
@Input() name?: string;
|
|
15
|
+
@Input() collapsible = false;
|
|
16
|
+
@Input() instructions: string;
|
|
17
|
+
@Input() childrenTemplate: TemplateRef<any>;
|
|
18
|
+
|
|
19
|
+
collapsed = false;
|
|
20
|
+
|
|
21
|
+
headerClickHandler() {
|
|
22
|
+
this.collapsed = !this.collapsed;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
<div id="details-fields-list">
|
|
2
2
|
<div *ngFor="let field of arFields$">
|
|
3
|
-
<div *ngIf="field.type === '
|
|
4
|
-
<component-mapper name="
|
|
3
|
+
<div *ngIf="field.type === 'group'; else noGroup">
|
|
4
|
+
<component-mapper name="Group" [props]="{ pConn$: field.pConn }"></component-mapper>
|
|
5
5
|
</div>
|
|
6
|
+
<ng-template #noGroup>
|
|
7
|
+
<div *ngIf="field.type === 'reference'; else showDetails">
|
|
8
|
+
<component-mapper name="View" [props]="{ pConn$: field.pConn }"></component-mapper>
|
|
9
|
+
</div>
|
|
10
|
+
</ng-template>
|
|
11
|
+
|
|
6
12
|
<ng-template #showDetails>
|
|
7
13
|
<div class="psdk-grid-filter" *ngIf="field.config.label">
|
|
8
14
|
<div class="psdk-details-fields-label">
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<div [attr.data-test-id]="testId">
|
|
2
|
+
<label [ngClass]="{ 'label-required': required === true }" class="rich-text-label">{{ label }}</label>
|
|
3
|
+
<div class="rich-text-editor" *ngIf="!readonly">
|
|
4
|
+
<editor
|
|
5
|
+
[formControl]="richText"
|
|
6
|
+
[attr.disabled]="disabled"
|
|
7
|
+
[initialValue]="value"
|
|
8
|
+
[init]="{
|
|
9
|
+
base_url: '/tinymce',
|
|
10
|
+
suffix: '.min',
|
|
11
|
+
menubar: false,
|
|
12
|
+
placeholder,
|
|
13
|
+
statusbar: false,
|
|
14
|
+
min_height: 130,
|
|
15
|
+
plugins: ['lists', 'advlist', 'autolink', 'image', 'link', 'autoresize'],
|
|
16
|
+
autoresize_bottom_margin: 0,
|
|
17
|
+
toolbar: disabled ? false : 'blocks | bold italic strikethrough | bullist numlist outdent indent | link image',
|
|
18
|
+
toolbar_location: 'bottom',
|
|
19
|
+
content_style: 'body { font-family:Helvetica, Arial,sans-serif; font-size:14px }',
|
|
20
|
+
branding: false,
|
|
21
|
+
paste_data_images: true,
|
|
22
|
+
file_picker_types: 'image',
|
|
23
|
+
file_picker_callback: filePickerCallback
|
|
24
|
+
}"
|
|
25
|
+
(onBlur)="blur()"
|
|
26
|
+
(onChange)="change($event)"
|
|
27
|
+
></editor>
|
|
28
|
+
<p *ngIf="richText.invalid" [ngClass]="'text-editor-error'">{{ info }}</p>
|
|
29
|
+
</div>
|
|
30
|
+
<div *ngIf="readonly">
|
|
31
|
+
<div class="readonly-richtext-editor" style="margin: 10px 5px" [innerHTML]="value || '--'"></div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.rich-text-label {
|
|
2
|
+
margin: 5px;
|
|
3
|
+
font-size: 16px;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.rich-text-editor {
|
|
7
|
+
margin: 10px 0px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.label-required::after {
|
|
11
|
+
display: inline;
|
|
12
|
+
content: ' *';
|
|
13
|
+
vertical-align: top;
|
|
14
|
+
color: var(--app-neutral-dark-color);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.text-editor-error {
|
|
18
|
+
color: var(--app-error-light-color);
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { RichTextEditorComponent } from './rich-text-editor.component';
|
|
4
|
+
|
|
5
|
+
describe('RichTextComponent', () => {
|
|
6
|
+
let component: RichTextEditorComponent;
|
|
7
|
+
let fixture: ComponentFixture<RichTextEditorComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(waitForAsync(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [RichTextEditorComponent]
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(RichTextEditorComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Component, Input, Output, EventEmitter, OnChanges } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
4
|
+
import { EditorModule, TINYMCE_SCRIPT_SRC } from '@tinymce/tinymce-angular';
|
|
5
|
+
|
|
6
|
+
declare let tinymce: any;
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'app-rich-text-editor',
|
|
10
|
+
templateUrl: './rich-text-editor.component.html',
|
|
11
|
+
styleUrls: ['./rich-text-editor.component.scss'],
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [CommonModule, EditorModule, ReactiveFormsModule],
|
|
14
|
+
providers: [{ provide: TINYMCE_SCRIPT_SRC, useValue: 'tinymce/tinymce.min.js' }]
|
|
15
|
+
})
|
|
16
|
+
export class RichTextEditorComponent implements OnChanges {
|
|
17
|
+
@Input() placeholder;
|
|
18
|
+
@Input() disabled;
|
|
19
|
+
@Input() readonly;
|
|
20
|
+
@Input() value;
|
|
21
|
+
@Input() label;
|
|
22
|
+
@Input() required;
|
|
23
|
+
@Input() info;
|
|
24
|
+
@Input() error;
|
|
25
|
+
@Input() testId;
|
|
26
|
+
|
|
27
|
+
@Output() onBlur: EventEmitter<any> = new EventEmitter();
|
|
28
|
+
@Output() onChange: EventEmitter<any> = new EventEmitter();
|
|
29
|
+
|
|
30
|
+
richText = new FormControl();
|
|
31
|
+
|
|
32
|
+
ngOnChanges() {
|
|
33
|
+
if (this.required) {
|
|
34
|
+
this.richText.addValidators(Validators.required);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (this.disabled) {
|
|
38
|
+
this.richText.disable();
|
|
39
|
+
} else {
|
|
40
|
+
this.richText.enable();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (this.value) {
|
|
44
|
+
this.richText.setValue(this.value);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
filePickerCallback = cb => {
|
|
49
|
+
const input = document.createElement('input');
|
|
50
|
+
input.setAttribute('type', 'file');
|
|
51
|
+
input.setAttribute('accept', 'image/*');
|
|
52
|
+
|
|
53
|
+
input.addEventListener('change', (e: any) => {
|
|
54
|
+
const file = e.target.files[0];
|
|
55
|
+
|
|
56
|
+
const reader: any = new FileReader();
|
|
57
|
+
reader.addEventListener('load', () => {
|
|
58
|
+
/*
|
|
59
|
+
Note: Now we need to register the blob in TinyMCEs image blob
|
|
60
|
+
registry. In the next release this part hopefully won't be
|
|
61
|
+
necessary, as we are looking to handle it internally.
|
|
62
|
+
*/
|
|
63
|
+
const blobId = `blobid${new Date().getTime()}`;
|
|
64
|
+
console.log('editorRef', tinymce.activeEditor);
|
|
65
|
+
const blobCache = tinymce.activeEditor.editorUpload.blobCache;
|
|
66
|
+
const base64 = reader.result.split(',')[1];
|
|
67
|
+
const blobInfo = blobCache.create(blobId, file, base64);
|
|
68
|
+
blobCache.add(blobInfo);
|
|
69
|
+
|
|
70
|
+
/* call the callback and populate the Title field with the file name */
|
|
71
|
+
cb(blobInfo.blobUri(), { title: file.name });
|
|
72
|
+
});
|
|
73
|
+
reader.readAsDataURL(file);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
input.click();
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
blur() {
|
|
80
|
+
if (tinymce.activeEditor) {
|
|
81
|
+
const editorValue = tinymce.activeEditor.getContent({ format: 'html' });
|
|
82
|
+
this.onBlur.emit(editorValue);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
change(event) {
|
|
87
|
+
this.onChange.emit(event);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<div *ngIf="displayMode$; else noDisplayMode">
|
|
2
|
-
<component-mapper
|
|
2
|
+
<component-mapper
|
|
3
|
+
*ngIf="bVisible$ !== false"
|
|
4
|
+
name="FieldValueList"
|
|
5
|
+
[props]="{ label$: caption$, value$: value$ ? trueLabel$ : falseLabel$, displayMode$ }"
|
|
6
|
+
></component-mapper>
|
|
3
7
|
</div>
|
|
4
8
|
<ng-template #noDisplayMode>
|
|
5
9
|
<div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
|
package/tests/assets/sdk-a/components/createAll/override-sdk/field/check-box/check-box.component.ts
CHANGED
|
@@ -13,6 +13,8 @@ interface CheckboxProps extends Omit<PConnFieldProps, 'value'> {
|
|
|
13
13
|
// Everything from PConnFieldProps except value and change type of value to boolean
|
|
14
14
|
value: boolean;
|
|
15
15
|
caption?: string;
|
|
16
|
+
trueLabel?: string;
|
|
17
|
+
falseLabel?: string;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
@Component({
|
|
@@ -45,6 +47,8 @@ export class CheckBoxComponent implements OnInit, OnDestroy {
|
|
|
45
47
|
bHasForm$ = true;
|
|
46
48
|
componentReference = '';
|
|
47
49
|
helperText: string;
|
|
50
|
+
trueLabel$?: string;
|
|
51
|
+
falseLabel$?: string;
|
|
48
52
|
|
|
49
53
|
fieldControl = new FormControl('', null);
|
|
50
54
|
|
|
@@ -116,6 +120,8 @@ export class CheckBoxComponent implements OnInit, OnDestroy {
|
|
|
116
120
|
|
|
117
121
|
this.caption$ = this.configProps$.caption;
|
|
118
122
|
this.helperText = this.configProps$.helperText;
|
|
123
|
+
this.trueLabel$ = this.configProps$.trueLabel;
|
|
124
|
+
this.falseLabel$ = this.configProps$.falseLabel;
|
|
119
125
|
|
|
120
126
|
// timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
121
127
|
setTimeout(() => {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<div *ngIf="displayMode$; else noDisplayMode">
|
|
2
|
-
<component-mapper
|
|
2
|
+
<component-mapper
|
|
3
|
+
*ngIf="bVisible$ !== false"
|
|
4
|
+
name="FieldValueList"
|
|
5
|
+
[props]="{ label$, value$: getFormattedValue(), displayMode$ }"
|
|
6
|
+
></component-mapper>
|
|
3
7
|
</div>
|
|
4
8
|
<ng-template #noDisplayMode>
|
|
5
9
|
<div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
|
|
@@ -14,6 +14,7 @@ import { Utils } from '@pega/angular-sdk-components';
|
|
|
14
14
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
15
15
|
import { dateFormatInfoDefault, getDateFormatInfo } from '@pega/angular-sdk-components';
|
|
16
16
|
import { PConnFieldProps } from '@pega/angular-sdk-components';
|
|
17
|
+
import { format } from '@pega/angular-sdk-components';
|
|
17
18
|
|
|
18
19
|
interface DateProps extends PConnFieldProps {
|
|
19
20
|
// If any, enter additional props that only exist on Date here
|
|
@@ -242,4 +243,10 @@ export class DateComponent implements OnInit, OnDestroy {
|
|
|
242
243
|
}
|
|
243
244
|
return errMessage;
|
|
244
245
|
}
|
|
246
|
+
|
|
247
|
+
getFormattedValue() {
|
|
248
|
+
return format(this.value$, 'date', {
|
|
249
|
+
format: this.theDateFormat.dateFormatString
|
|
250
|
+
});
|
|
251
|
+
}
|
|
245
252
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<ng-container *ngIf="visibility$">
|
|
2
|
+
<component-mapper
|
|
3
|
+
name="FieldGroup"
|
|
4
|
+
[props]="{
|
|
5
|
+
name: showHeading$ ? heading$ : undefined,
|
|
6
|
+
collapsible: collapsible$,
|
|
7
|
+
instructions: instructions$,
|
|
8
|
+
childrenTemplate: childrenTemplate
|
|
9
|
+
}"
|
|
10
|
+
>
|
|
11
|
+
</component-mapper>
|
|
12
|
+
|
|
13
|
+
<ng-template #childrenTemplate>
|
|
14
|
+
<div *ngFor="let kid of arChildren$">
|
|
15
|
+
<component-mapper
|
|
16
|
+
[name]="kid.getPConnect().getComponentName()"
|
|
17
|
+
[props]="{
|
|
18
|
+
pConn$: kid.getPConnect(),
|
|
19
|
+
formGroup$: formGroup$
|
|
20
|
+
}"
|
|
21
|
+
errorMsg="Field Group wants component not yet available: {{ kid.getPConnect().getComponentName() }}"
|
|
22
|
+
></component-mapper>
|
|
23
|
+
</div>
|
|
24
|
+
</ng-template>
|
|
25
|
+
</ng-container>
|
|
File without changes
|
package/tests/assets/sdk-a/components/createAll/override-sdk/field/group/group.component.spec.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { GroupComponent } from './group.component';
|
|
4
|
+
|
|
5
|
+
describe('GroupComponent', () => {
|
|
6
|
+
let component: GroupComponent;
|
|
7
|
+
let fixture: ComponentFixture<GroupComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [GroupComponent]
|
|
12
|
+
});
|
|
13
|
+
fixture = TestBed.createComponent(GroupComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { Component, forwardRef, Input, OnInit } from '@angular/core';
|
|
3
|
+
import { FormGroup } from '@angular/forms';
|
|
4
|
+
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
5
|
+
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
6
|
+
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
7
|
+
import { PConnFieldProps } from '@pega/angular-sdk-components';
|
|
8
|
+
|
|
9
|
+
interface GroupProps extends PConnFieldProps {
|
|
10
|
+
// If any, enter additional props that only exist on Group here
|
|
11
|
+
showHeading: boolean;
|
|
12
|
+
heading: string;
|
|
13
|
+
instructions: string;
|
|
14
|
+
collapsible: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: 'app-group',
|
|
19
|
+
templateUrl: './group.component.html',
|
|
20
|
+
styleUrls: ['./group.component.scss'],
|
|
21
|
+
standalone: true,
|
|
22
|
+
imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
|
|
23
|
+
})
|
|
24
|
+
export class GroupComponent implements OnInit {
|
|
25
|
+
@Input() pConn$: typeof PConnect;
|
|
26
|
+
@Input() formGroup$: FormGroup;
|
|
27
|
+
|
|
28
|
+
arChildren$: any[];
|
|
29
|
+
visibility$?: boolean;
|
|
30
|
+
showHeading$?: boolean;
|
|
31
|
+
heading$: string;
|
|
32
|
+
instructions$: string;
|
|
33
|
+
collapsible$: boolean;
|
|
34
|
+
|
|
35
|
+
// Used with AngularPConnect
|
|
36
|
+
angularPConnectData: AngularPConnectData = {};
|
|
37
|
+
configProps$: GroupProps;
|
|
38
|
+
|
|
39
|
+
constructor(private angularPConnect: AngularPConnectService) {}
|
|
40
|
+
|
|
41
|
+
ngOnInit(): void {
|
|
42
|
+
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
43
|
+
|
|
44
|
+
this.checkAndUpdate();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Callback passed when subscribing to store change
|
|
48
|
+
onStateChange() {
|
|
49
|
+
this.checkAndUpdate();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
checkAndUpdate() {
|
|
53
|
+
// Should always check the bridge to see if the component should
|
|
54
|
+
// update itself (re-render)
|
|
55
|
+
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
56
|
+
|
|
57
|
+
// ONLY call updateSelf when the component should update
|
|
58
|
+
if (bUpdateSelf) {
|
|
59
|
+
this.updateSelf();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
updateSelf(): void {
|
|
64
|
+
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as GroupProps;
|
|
65
|
+
this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
|
|
66
|
+
this.visibility$ = this.configProps$.visibility;
|
|
67
|
+
this.showHeading$ = this.configProps$.showHeading;
|
|
68
|
+
this.heading$ = this.configProps$.heading;
|
|
69
|
+
this.instructions$ = this.configProps$.instructions;
|
|
70
|
+
this.collapsible$ = this.configProps$.collapsible;
|
|
71
|
+
|
|
72
|
+
if (this.configProps$.displayMode === 'LABELS_LEFT') {
|
|
73
|
+
if (this.configProps$.visibility === undefined) this.visibility$ = true;
|
|
74
|
+
|
|
75
|
+
this.arChildren$.forEach(child => {
|
|
76
|
+
const pConn = child.getPConnect();
|
|
77
|
+
pConn.setInheritedProp('displayMode', 'LABELS_LEFT');
|
|
78
|
+
pConn.setInheritedProp('readOnly', true);
|
|
79
|
+
|
|
80
|
+
return child;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<div *ngIf="displayMode$; else noDisplayMode">
|
|
2
|
+
<component-mapper *ngIf="bVisible$ !== false" name="FieldValueList" [props]="{ label$, value$, displayMode$ }"></component-mapper>
|
|
3
|
+
</div>
|
|
4
|
+
<ng-template #noDisplayMode>
|
|
5
|
+
<div *ngIf="!bReadonly$; else noEdit">
|
|
6
|
+
<div *ngIf="bVisible$">
|
|
7
|
+
<component-mapper
|
|
8
|
+
name="RichTextEditor"
|
|
9
|
+
[props]="{ placeholder, required: bRequired$, disabled: bDisabled$, label: label$, readonly: false, error, info, testId, value: value$ }"
|
|
10
|
+
[parent]="this"
|
|
11
|
+
[outputEvents]="{ onBlur: fieldOnBlur, onChange: fieldOnChange }"
|
|
12
|
+
></component-mapper>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</ng-template>
|
|
16
|
+
<ng-template #noEdit>
|
|
17
|
+
<div *ngIf="bVisible$ !== false">
|
|
18
|
+
<component-mapper name="RichTextEditor" [props]="{ label: label$, value: value$, readonly: true, testId }" [parent]="this"></component-mapper>
|
|
19
|
+
</div>
|
|
20
|
+
</ng-template>
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { RichTextComponent } from './rich-text.component';
|
|
4
|
+
|
|
5
|
+
describe('RichTextComponent', () => {
|
|
6
|
+
let component: RichTextComponent;
|
|
7
|
+
let fixture: ComponentFixture<RichTextComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(waitForAsync(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [RichTextComponent]
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(RichTextComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
package/tests/assets/sdk-a/components/createAll/override-sdk/field/rich-text/rich-text.component.ts
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { Component, OnInit, Input, forwardRef, OnDestroy } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
+
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
5
|
+
import { Utils } from '@pega/angular-sdk-components';
|
|
6
|
+
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
7
|
+
import { handleEvent } from '@pega/angular-sdk-components';
|
|
8
|
+
import { PConnFieldProps } from '@pega/angular-sdk-components';
|
|
9
|
+
|
|
10
|
+
interface RichTextProps extends PConnFieldProps {
|
|
11
|
+
// If any, enter additional props that only exist on RichText here
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'app-rich-text',
|
|
16
|
+
templateUrl: './rich-text.component.html',
|
|
17
|
+
styleUrls: ['./rich-text.component.scss'],
|
|
18
|
+
standalone: true,
|
|
19
|
+
imports: [CommonModule, ReactiveFormsModule, forwardRef(() => ComponentMapperComponent)]
|
|
20
|
+
})
|
|
21
|
+
export class RichTextComponent implements OnInit, OnDestroy {
|
|
22
|
+
@Input() pConn$: typeof PConnect;
|
|
23
|
+
@Input() formGroup$: FormGroup;
|
|
24
|
+
|
|
25
|
+
// Used with AngularPConnect
|
|
26
|
+
angularPConnectData: AngularPConnectData = {};
|
|
27
|
+
configProps$: RichTextProps;
|
|
28
|
+
|
|
29
|
+
label$ = '';
|
|
30
|
+
value$ = '';
|
|
31
|
+
bRequired$ = false;
|
|
32
|
+
bReadonly$ = false;
|
|
33
|
+
bDisabled$ = false;
|
|
34
|
+
bVisible$ = true;
|
|
35
|
+
displayMode$?: string = '';
|
|
36
|
+
controlName$: string;
|
|
37
|
+
testId: string;
|
|
38
|
+
helperText: string;
|
|
39
|
+
placeholder: any;
|
|
40
|
+
info: any;
|
|
41
|
+
error: boolean;
|
|
42
|
+
status: any;
|
|
43
|
+
|
|
44
|
+
constructor(
|
|
45
|
+
private angularPConnect: AngularPConnectService,
|
|
46
|
+
private utils: Utils
|
|
47
|
+
) {}
|
|
48
|
+
|
|
49
|
+
ngOnInit(): void {
|
|
50
|
+
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
51
|
+
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
52
|
+
|
|
53
|
+
// call updateSelf when initializing
|
|
54
|
+
this.checkAndUpdate();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
ngOnDestroy(): void {
|
|
58
|
+
if (this.angularPConnectData.unsubscribeFn) {
|
|
59
|
+
this.angularPConnectData.unsubscribeFn();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Callback passed when subscribing to store change
|
|
64
|
+
onStateChange() {
|
|
65
|
+
this.checkAndUpdate();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
checkAndUpdate() {
|
|
69
|
+
// Should always check the bridge to see if the component should
|
|
70
|
+
// update itself (re-render)
|
|
71
|
+
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
72
|
+
|
|
73
|
+
// ONLY call updateSelf when the component should update
|
|
74
|
+
if (bUpdateSelf) {
|
|
75
|
+
this.updateSelf();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// updateSelf
|
|
80
|
+
updateSelf(): void {
|
|
81
|
+
// moved this from ngOnInit() and call this from there instead...
|
|
82
|
+
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as RichTextProps;
|
|
83
|
+
const stateProps: any = this.pConn$.getStateProps();
|
|
84
|
+
this.status = stateProps?.status;
|
|
85
|
+
|
|
86
|
+
if (this.configProps$.value != undefined) {
|
|
87
|
+
this.value$ = this.configProps$.value;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
this.testId = this.configProps$.testId;
|
|
91
|
+
this.displayMode$ = this.configProps$.displayMode;
|
|
92
|
+
this.label$ = this.configProps$.label;
|
|
93
|
+
this.placeholder = this.configProps$.placeholder;
|
|
94
|
+
this.info = stateProps?.validatemessage || this.configProps$.helperText;
|
|
95
|
+
this.error = stateProps?.status === 'error';
|
|
96
|
+
|
|
97
|
+
if (this.configProps$.required != null) {
|
|
98
|
+
this.bRequired$ = this.utils.getBooleanValue(this.configProps$.required);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (this.configProps$.visibility != null) {
|
|
102
|
+
this.bVisible$ = this.utils.getBooleanValue(this.configProps$.visibility);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (this.configProps$.disabled != undefined) {
|
|
106
|
+
this.bDisabled$ = this.utils.getBooleanValue(this.configProps$.disabled);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (this.configProps$.readOnly != null) {
|
|
110
|
+
this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
fieldOnChange() {
|
|
115
|
+
if (this.status === 'error') {
|
|
116
|
+
const property = (this.pConn$.getStateProps() as any).value;
|
|
117
|
+
this.pConn$.clearErrorMessages({
|
|
118
|
+
property,
|
|
119
|
+
category: '',
|
|
120
|
+
context: ''
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
fieldOnBlur(editorValue: any) {
|
|
126
|
+
// PConnect wants to use eventHandler for onBlur
|
|
127
|
+
const actionsApi = this.pConn$?.getActionsApi();
|
|
128
|
+
const propName = (this.pConn$?.getStateProps() as any).value;
|
|
129
|
+
handleEvent(actionsApi, 'changeNblur', propName, editorValue);
|
|
130
|
+
}
|
|
131
|
+
}
|