@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
|
@@ -14,7 +14,7 @@ window.PCore = {
|
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
18
|
|
|
19
19
|
const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
|
|
20
20
|
title: '{{COMPONENT_CLASS_NAME}}',
|
|
@@ -25,21 +25,33 @@ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
|
|
|
25
25
|
export default meta;
|
|
26
26
|
type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
|
|
27
27
|
|
|
28
|
-
export const Base{{COMPONENT_CLASS_NAME}}: Story =
|
|
28
|
+
export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
29
29
|
|
|
30
30
|
const props = {
|
|
31
31
|
getPConnect: () => {
|
|
32
32
|
return {
|
|
33
33
|
getActionsApi: () => {
|
|
34
34
|
return {
|
|
35
|
-
updateFieldValue: () => {
|
|
36
|
-
|
|
35
|
+
updateFieldValue: () => {
|
|
36
|
+
/* nothing */
|
|
37
|
+
},
|
|
38
|
+
triggerFieldChange: () => {
|
|
39
|
+
/* nothing */
|
|
40
|
+
}
|
|
37
41
|
};
|
|
38
42
|
},
|
|
39
|
-
ignoreSuggestion: () => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
ignoreSuggestion: () => {
|
|
44
|
+
/* nothing */
|
|
45
|
+
},
|
|
46
|
+
acceptSuggestion: () => {
|
|
47
|
+
/* nothing */
|
|
48
|
+
},
|
|
49
|
+
setInheritedProps: () => {
|
|
50
|
+
/* nothing */
|
|
51
|
+
},
|
|
52
|
+
resolveConfigProps: () => {
|
|
53
|
+
/* nothing */
|
|
54
|
+
}
|
|
43
55
|
};
|
|
44
56
|
}
|
|
45
57
|
};
|
|
@@ -49,4 +61,4 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args) => {
|
|
|
49
61
|
|
|
50
62
|
Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
51
63
|
...caseOpConfig
|
|
52
|
-
}
|
|
64
|
+
};
|
|
@@ -13,13 +13,13 @@ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
|
13
13
|
|
|
14
14
|
interface {{COMPONENT_CLASS_NAME}}Props extends PConnProps {
|
|
15
15
|
// If any, enter additional props that only exist on this component
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
label: string;
|
|
17
|
+
createDateTime: string;
|
|
18
|
+
createLabel: string;
|
|
19
|
+
createOperator: { userName: string; userId: string };
|
|
20
|
+
updateDateTime: string;
|
|
21
|
+
updateLabel: string;
|
|
22
|
+
updateOperator: { userName: string; userId: string };
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
const useStyles = makeStyles(theme => ({
|
|
@@ -38,7 +38,6 @@ const useStyles = makeStyles(theme => ({
|
|
|
38
38
|
// Page Case Widget example
|
|
39
39
|
|
|
40
40
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
41
|
-
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
42
41
|
export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
43
42
|
// const componentName = "Operator";
|
|
44
43
|
const classes = useStyles();
|
|
@@ -192,37 +191,38 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
192
191
|
// End of popover-related
|
|
193
192
|
|
|
194
193
|
return (
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
{{=<% %>=}}
|
|
198
|
-
<TextField
|
|
199
|
-
defaultValue={caseOpName}
|
|
200
|
-
label={caseOpLabel}
|
|
201
|
-
onClick={showOperatorDetails}
|
|
202
|
-
InputProps={{
|
|
203
|
-
readOnly: true,
|
|
204
|
-
disableUnderline: true,
|
|
205
|
-
inputProps: { style: { cursor: 'pointer' } }
|
|
206
|
-
}}
|
|
207
|
-
/>
|
|
208
|
-
<br />
|
|
209
|
-
{Utils.generateDateTime(caseTime, 'DateTime-Since')}
|
|
210
|
-
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
211
|
-
<Popover
|
|
212
|
-
id={popoverId}
|
|
213
|
-
open={popoverOpen}
|
|
214
|
-
anchorEl={popoverAnchorEl}
|
|
215
|
-
onClose={handlePopoverClose}
|
|
194
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
195
|
+
<>
|
|
216
196
|
{{! pick new delimiters for mustache }}
|
|
217
197
|
{{=<% %>=}}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
198
|
+
<TextField
|
|
199
|
+
defaultValue={caseOpName}
|
|
200
|
+
label={caseOpLabel}
|
|
201
|
+
onClick={showOperatorDetails}
|
|
202
|
+
InputProps={{
|
|
203
|
+
readOnly: true,
|
|
204
|
+
disableUnderline: true,
|
|
205
|
+
inputProps: { style: { cursor: 'pointer' } }
|
|
206
|
+
}}
|
|
207
|
+
/>
|
|
208
|
+
<br />
|
|
209
|
+
{Utils.generateDateTime(caseTime, 'DateTime-Since')}
|
|
221
210
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
211
|
+
<Popover
|
|
212
|
+
id={popoverId}
|
|
213
|
+
open={popoverOpen}
|
|
214
|
+
anchorEl={popoverAnchorEl}
|
|
215
|
+
onClose={handlePopoverClose}
|
|
216
|
+
{{! pick new delimiters for mustache }}
|
|
217
|
+
{{=<% %>=}}
|
|
218
|
+
anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}
|
|
219
|
+
transformOrigin={{ vertical: 'top', horizontal: 'center' }}
|
|
220
|
+
PaperProps={{ style: { maxWidth: '45ch' } }}
|
|
221
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
222
|
+
>
|
|
223
|
+
{getPopoverGrid()}
|
|
224
|
+
</Popover>
|
|
225
|
+
</>
|
|
226
226
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
227
227
|
);
|
|
228
|
-
}
|
|
228
|
+
}
|
|
@@ -5,22 +5,19 @@ import chalk from 'chalk';
|
|
|
5
5
|
import inquirer from 'inquirer';
|
|
6
6
|
import Ajv from 'ajv';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
COMPONENT_SCHEMA,
|
|
10
|
-
CATEGORY_CUSTOM,
|
|
11
|
-
CATEGORY_OVERRIDE } from '../../constants.js';
|
|
12
|
-
|
|
8
|
+
import { COMPONENT_SCHEMA, CATEGORY_CUSTOM, CATEGORY_OVERRIDE } from '../../constants.js';
|
|
13
9
|
import {
|
|
14
10
|
getComponentDirectoryPath,
|
|
15
11
|
getComponents,
|
|
16
12
|
getOOTBComponents,
|
|
17
13
|
removeComponentPrefix,
|
|
18
|
-
getFramework,
|
|
19
|
-
getLocalComponentKeyFromConfig
|
|
14
|
+
getFramework,
|
|
15
|
+
getLocalComponentKeyFromConfig
|
|
16
|
+
} from '../../util.js';
|
|
20
17
|
|
|
21
18
|
const ajv = new Ajv({ allErrors: true });
|
|
22
19
|
|
|
23
|
-
const combinationTypes = ['PAGE', 'CASE'];
|
|
20
|
+
// const combinationTypes = ['PAGE', 'CASE'];
|
|
24
21
|
|
|
25
22
|
const allowedSubtypes = [
|
|
26
23
|
...new Set([
|
|
@@ -30,13 +27,25 @@ const allowedSubtypes = [
|
|
|
30
27
|
])
|
|
31
28
|
];
|
|
32
29
|
|
|
30
|
+
const allowedOverrideTypes = [
|
|
31
|
+
...new Set([...COMPONENT_SCHEMA.type.map(({ value }) => value)]),
|
|
32
|
+
'Group'
|
|
33
|
+
];
|
|
34
|
+
|
|
33
35
|
// additional subtypes are manually added below
|
|
34
36
|
const allowedOverrideSubtypes = [
|
|
35
37
|
...new Set([
|
|
36
38
|
...COMPONENT_SCHEMA.subtype.field.map(({ value }) => value),
|
|
37
39
|
...COMPONENT_SCHEMA.subtype.template.map(({ value }) => value),
|
|
38
40
|
...COMPONENT_SCHEMA.subtype.widget.map(({ value }) => value)
|
|
39
|
-
]),
|
|
41
|
+
]),
|
|
42
|
+
'ACTION',
|
|
43
|
+
'DATA_CAPTURE',
|
|
44
|
+
'SUMMARY',
|
|
45
|
+
'CASEVIEW',
|
|
46
|
+
'DATAVIEW',
|
|
47
|
+
'LIST',
|
|
48
|
+
'TAB'
|
|
40
49
|
];
|
|
41
50
|
|
|
42
51
|
const schema = {
|
|
@@ -93,16 +102,16 @@ const schema = {
|
|
|
93
102
|
{
|
|
94
103
|
type: 'object',
|
|
95
104
|
properties: {
|
|
96
|
-
key: { type: 'string'},
|
|
105
|
+
key: { type: 'string' },
|
|
97
106
|
name: { type: 'string' },
|
|
98
107
|
label: { type: 'string' },
|
|
99
108
|
format: { type: 'string' }
|
|
100
109
|
},
|
|
101
|
-
required: ['key','name', 'label', 'format']
|
|
110
|
+
required: ['key', 'name', 'label', 'format']
|
|
102
111
|
}
|
|
103
112
|
]
|
|
104
113
|
}
|
|
105
|
-
}
|
|
114
|
+
}
|
|
106
115
|
},
|
|
107
116
|
required: ['format']
|
|
108
117
|
},
|
|
@@ -159,13 +168,12 @@ const schema = {
|
|
|
159
168
|
}
|
|
160
169
|
},
|
|
161
170
|
required: ['format', 'elements']
|
|
162
|
-
}
|
|
171
|
+
}
|
|
163
172
|
]
|
|
164
173
|
}
|
|
165
174
|
}
|
|
166
|
-
|
|
167
175
|
},
|
|
168
|
-
required: ['label', 'format']
|
|
176
|
+
required: ['label', 'format']
|
|
169
177
|
}
|
|
170
178
|
]
|
|
171
179
|
}
|
|
@@ -188,7 +196,7 @@ const overrideSchema = {
|
|
|
188
196
|
version: { type: 'string' },
|
|
189
197
|
library: { type: 'string' },
|
|
190
198
|
allowedApplications: { type: 'array' },
|
|
191
|
-
type: { type: 'string', enum:
|
|
199
|
+
type: { type: 'string', enum: allowedOverrideTypes },
|
|
192
200
|
subtype: {
|
|
193
201
|
anyOf: [{ type: 'string' }, { type: 'array' }],
|
|
194
202
|
|
|
@@ -230,16 +238,16 @@ const overrideSchema = {
|
|
|
230
238
|
{
|
|
231
239
|
type: 'object',
|
|
232
240
|
properties: {
|
|
233
|
-
key: { type: 'string'},
|
|
241
|
+
key: { type: 'string' },
|
|
234
242
|
name: { type: 'string' },
|
|
235
243
|
label: { type: 'string' },
|
|
236
244
|
format: { type: 'string' }
|
|
237
245
|
},
|
|
238
|
-
required: ['key','name', 'label', 'format']
|
|
246
|
+
required: ['key', 'name', 'label', 'format']
|
|
239
247
|
}
|
|
240
248
|
]
|
|
241
249
|
}
|
|
242
|
-
}
|
|
250
|
+
}
|
|
243
251
|
},
|
|
244
252
|
required: ['format']
|
|
245
253
|
},
|
|
@@ -296,13 +304,12 @@ const overrideSchema = {
|
|
|
296
304
|
}
|
|
297
305
|
},
|
|
298
306
|
required: ['format', 'elements']
|
|
299
|
-
}
|
|
307
|
+
}
|
|
300
308
|
]
|
|
301
309
|
}
|
|
302
310
|
}
|
|
303
|
-
|
|
304
311
|
},
|
|
305
|
-
required: ['label', 'format']
|
|
312
|
+
required: ['label', 'format']
|
|
306
313
|
}
|
|
307
314
|
]
|
|
308
315
|
}
|
|
@@ -316,8 +323,6 @@ const overrideSchema = {
|
|
|
316
323
|
const validateSchema = ajv.compile(schema);
|
|
317
324
|
const validateOverrideSchema = ajv.compile(overrideSchema);
|
|
318
325
|
|
|
319
|
-
|
|
320
|
-
|
|
321
326
|
export default async (option, category = CATEGORY_CUSTOM) => {
|
|
322
327
|
let componentToValidate = null;
|
|
323
328
|
const framework = await getFramework();
|
|
@@ -341,55 +346,57 @@ export default async (option, category = CATEGORY_CUSTOM) => {
|
|
|
341
346
|
}
|
|
342
347
|
|
|
343
348
|
const componentDirectory = await getComponentDirectoryPath(componentToValidate, category);
|
|
344
|
-
let configFileName =
|
|
349
|
+
let configFileName = 'config.json';
|
|
345
350
|
if (category === CATEGORY_OVERRIDE) {
|
|
346
|
-
configFileName =
|
|
351
|
+
configFileName = 'config-ext.json';
|
|
347
352
|
}
|
|
348
353
|
const configFile = path.join(componentDirectory, configFileName);
|
|
349
354
|
let configData;
|
|
350
355
|
try {
|
|
351
356
|
configData = fs.readFileSync(path.resolve(configFile), 'utf8');
|
|
352
|
-
}
|
|
353
|
-
catch (err) {
|
|
357
|
+
} catch (err) {
|
|
354
358
|
if (category === CATEGORY_CUSTOM) {
|
|
355
359
|
throw new Error(`Missing config file for: ${componentToValidate}`);
|
|
356
|
-
}
|
|
357
|
-
else if (category === CATEGORY_OVERRIDE) {
|
|
360
|
+
} else if (category === CATEGORY_OVERRIDE) {
|
|
358
361
|
// for now, if now file just end
|
|
359
|
-
console.log(`${chalk.bold.yellow(
|
|
362
|
+
console.log(`${chalk.bold.yellow(`Config file not available for: ${componentToValidate}`)}`);
|
|
360
363
|
return;
|
|
361
364
|
}
|
|
362
365
|
}
|
|
363
366
|
|
|
364
|
-
//const data = JSON.parse(fs.readFileSync(path.resolve(configFile), 'utf8'));
|
|
367
|
+
// const data = JSON.parse(fs.readFileSync(path.resolve(configFile), 'utf8'));
|
|
365
368
|
const data = JSON.parse(configData);
|
|
366
369
|
|
|
367
|
-
// for now a special case for ScalarList,
|
|
370
|
+
// for now a special case for ScalarList & Group, those doesn't have a "subtype", so for now manualy
|
|
368
371
|
// add one in here, just to pass validation
|
|
369
|
-
if (data
|
|
370
|
-
data
|
|
372
|
+
if (data.name === 'ScalarList') {
|
|
373
|
+
data.subtype = 'LIST';
|
|
374
|
+
}
|
|
375
|
+
if (data.name === 'Group') {
|
|
376
|
+
data.subtype = 'DATA_CAPTURE';
|
|
371
377
|
}
|
|
372
378
|
|
|
373
|
-
const valid =
|
|
379
|
+
const valid =
|
|
380
|
+
category === CATEGORY_OVERRIDE ? validateOverrideSchema(data) : validateSchema(data);
|
|
374
381
|
|
|
375
382
|
if (valid) {
|
|
376
|
-
|
|
377
383
|
// need to remove path
|
|
378
384
|
const originalComponentToValidate = componentToValidate;
|
|
379
385
|
componentToValidate = removeComponentPrefix(componentToValidate);
|
|
380
386
|
|
|
381
387
|
// don't check for out the box if override
|
|
382
|
-
if (category
|
|
383
|
-
|
|
388
|
+
if (category !== CATEGORY_OVERRIDE) {
|
|
384
389
|
// we are validating the component name, not the actual component
|
|
385
390
|
// so need to get the component name (or key) from config.json
|
|
386
|
-
switch(framework) {
|
|
387
|
-
case
|
|
391
|
+
switch (framework) {
|
|
392
|
+
case 'SDK-Angular':
|
|
388
393
|
componentToValidate = await getLocalComponentKeyFromConfig(originalComponentToValidate);
|
|
389
394
|
break;
|
|
390
|
-
case
|
|
395
|
+
case 'SDK-React':
|
|
396
|
+
break;
|
|
397
|
+
case 'SDK-WebComponents':
|
|
391
398
|
break;
|
|
392
|
-
|
|
399
|
+
default:
|
|
393
400
|
break;
|
|
394
401
|
}
|
|
395
402
|
|
|
@@ -404,15 +411,13 @@ export default async (option, category = CATEGORY_CUSTOM) => {
|
|
|
404
411
|
}
|
|
405
412
|
}
|
|
406
413
|
|
|
407
|
-
|
|
408
414
|
console.log(`${chalk.bold.green(componentToValidate)} schema is valid`);
|
|
409
415
|
} else {
|
|
416
|
+
// eslint-disable-next-line no-lonely-if
|
|
410
417
|
if (category === CATEGORY_OVERRIDE) {
|
|
411
418
|
throw new Error(`Invalid: ${ajv.errorsText(validateOverrideSchema.errors)}`);
|
|
412
|
-
}
|
|
413
|
-
else {
|
|
419
|
+
} else {
|
|
414
420
|
throw new Error(`Invalid: ${ajv.errorsText(validateSchema.errors)}`);
|
|
415
421
|
}
|
|
416
|
-
|
|
417
422
|
}
|
|
418
423
|
};
|
|
@@ -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
|
+
}
|
package/tests/assets/sdk-a/components/create/override-sdk/field/check-box/check-box.component.html
CHANGED
|
@@ -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">
|