@pega/custom-dx-components 0.23.24 → 0.23.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/tasks/build-all/helper.js +14 -10
- package/src/tasks/build-all/index.js +3 -1
- package/src/tasks/build-comp/helper.js +15 -5
- package/src/tasks/bundle/builder/index.js +3 -3
- package/src/tasks/create/templates/Constellation/Field/Boolean/event-utils.ts.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +9 -3
- package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +3 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.tsx.mustache +4 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +3 -1
- package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +3 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/date.js.mustache +5 -4
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +9 -7
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/picklist-utils.js.mustache +1 -2
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/repeat-utils.js.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +3 -1
- package/src/tasks/create/templates/Constellation/Field/Text/index.tsx.mustache +3 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +5 -3
- package/src/tasks/create/templates/Constellation/Field/Text-Input/StatusWork.tsx +2 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.tsx.mustache +5 -2
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +4 -2
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +6 -4
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.tsx.mustache +4 -2
- package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/StatusWork.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/StatusWork.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/GetNextWork.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Template/PAGE/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.tsx.mustache +3 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.tsx.mustache +2 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Avatar.tsx.mustache +5 -3
- package/src/tasks/init/template/.eslintrc.json +2 -4
- package/src/tasks/init/template/package.json.mustache +5 -2
- package/src/tasks/publish-all/index.js +9 -3
- package/tests/assets/components/create/Pega_DXIL_MyTestText/index.tsx +3 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyAutocomplete/date.js +5 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyAutocomplete/index.tsx +9 -7
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyAutocomplete/picklist-utils.js +1 -2
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyAutocomplete/repeat-utils.js +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/event-utils.ts +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.tsx +9 -3
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/index.tsx +3 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.tsx +4 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/StatusWork.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/index.tsx +5 -3
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/demo.stories.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Operator.tsx +3 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.tsx +4 -2
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.tsx +3 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/index.tsx +6 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +3 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/index.tsx +3 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/index.tsx +3 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/StatusWork.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.tsx +5 -2
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.tsx +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/index.tsx +4 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyAutocomplete/date.js +5 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyAutocomplete/index.tsx +9 -7
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyAutocomplete/picklist-utils.js +1 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyAutocomplete/repeat-utils.js +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/event-utils.ts +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.tsx +9 -3
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/index.tsx +3 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/index.tsx +4 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/StatusWork.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/index.tsx +5 -3
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/demo.stories.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/index.tsx +4 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/index.tsx +3 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/index.tsx +6 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.tsx +3 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/index.tsx +3 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/index.tsx +3 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/StatusWork.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/index.tsx +5 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/index.tsx +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/index.tsx +4 -2
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/PConnProps.d.ts.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/config.json.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/demo.stories.tsx.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/mock.ts.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/styles.ts.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/suggestions-handler.ts.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/Field/{TimeOfDay → TimeofDay}/time-of-day.js.mustache +0 -0
package/package.json
CHANGED
|
@@ -12,17 +12,21 @@ import {
|
|
|
12
12
|
import { COMPONENT_SCHEMA } from '../../constants.js';
|
|
13
13
|
|
|
14
14
|
export const cleanUp = async () => {
|
|
15
|
-
fs.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
if (fs.existsSync('dist/components')) {
|
|
16
|
+
fs.rm('dist/components', { recursive: true }, err => {
|
|
17
|
+
if (err) {
|
|
18
|
+
throw err;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
20
22
|
|
|
21
|
-
fs.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
if (fs.existsSync('lib')) {
|
|
24
|
+
fs.rm('lib', { recursive: true }, err => {
|
|
25
|
+
if (err) {
|
|
26
|
+
throw err;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
|
|
@@ -75,8 +75,10 @@ export default async (options) => {
|
|
|
75
75
|
|
|
76
76
|
// eslint-disable-next-line no-await-in-loop
|
|
77
77
|
await myCustomTasks.run().catch(err => {
|
|
78
|
-
|
|
78
|
+
console.log(chalk.bold.red(err.toString()));
|
|
79
|
+
process.exit(1);
|
|
79
80
|
});
|
|
81
|
+
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
// once done, remove leftover directories
|
|
@@ -54,11 +54,21 @@ export const zipComponent = async (componentKey) => {
|
|
|
54
54
|
const zipContent = zip.toBuffer().toString('base64');
|
|
55
55
|
|
|
56
56
|
const configContent = Buffer.from(fs.readFileSync(`${srcDirectory}/config.json`)).toString();
|
|
57
|
-
fs.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
if (fs.existsSync('dist/components')) {
|
|
58
|
+
fs.rm('dist/components', { recursive: true }, err => {
|
|
59
|
+
if (err) {
|
|
60
|
+
throw err;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (fs.existsSync('lib')) {
|
|
66
|
+
fs.rm('lib', { recursive: true }, err => {
|
|
67
|
+
if (err) {
|
|
68
|
+
throw err;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
62
72
|
return { zipContent, configContent };
|
|
63
73
|
};
|
|
64
74
|
|
|
@@ -31,7 +31,7 @@ process.env.NODE_ENV = Env;
|
|
|
31
31
|
// terminate the Node.js process with a non-zero exit code.
|
|
32
32
|
process.on('unhandledRejection', err => {
|
|
33
33
|
console.log(err);
|
|
34
|
-
process.exit(1);
|
|
34
|
+
// process.exit(1);
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
const measureFileSizesBeforeBuild = FileSizeReporter.measureFileSizesBeforeBuild;
|
|
@@ -203,7 +203,7 @@ export default ({
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
process.exit(1);
|
|
206
|
+
// process.exit(1);
|
|
207
207
|
}
|
|
208
208
|
else {
|
|
209
209
|
console.log(chalk.red('Failed to compile.\n'));
|
|
@@ -217,7 +217,7 @@ export default ({
|
|
|
217
217
|
if (err && err.message) {
|
|
218
218
|
console.log(err.message);
|
|
219
219
|
}
|
|
220
|
-
process.exit(1);
|
|
220
|
+
// process.exit(1);
|
|
221
221
|
});
|
|
222
222
|
});
|
|
223
223
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import {
|
|
2
4
|
Checkbox as CosmosCheckbox,
|
|
3
5
|
CheckboxGroup,
|
|
@@ -6,6 +8,7 @@ import {
|
|
|
6
8
|
} from "@pega/cosmos-react-core";
|
|
7
9
|
import PropTypes from "prop-types";
|
|
8
10
|
|
|
11
|
+
|
|
9
12
|
import type { PConnFieldProps } from './PConnProps';
|
|
10
13
|
|
|
11
14
|
// includes in bundle
|
|
@@ -59,7 +62,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
59
62
|
const actions = pConn.getActionsApi();
|
|
60
63
|
const actionsProps = pConn.getActionsApi() as unknown as ActionsProps;
|
|
61
64
|
const stateProps = pConn.getStateProps() as StateProps;
|
|
62
|
-
|
|
65
|
+
const propName: string = stateProps.value;
|
|
63
66
|
|
|
64
67
|
let { readOnly, required, disabled } = props;
|
|
65
68
|
[readOnly, required, disabled] = [readOnly, required, disabled].map(
|
|
@@ -82,7 +85,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
82
85
|
required={required}
|
|
83
86
|
onClick={actionsProps.onClick}
|
|
84
87
|
onChange={(event) => {
|
|
85
|
-
handleEvent(actions, "changeNblur", propName,
|
|
88
|
+
handleEvent(actions, "changeNblur", propName, event.target.checked);
|
|
86
89
|
}}
|
|
87
90
|
onBlur={(event: { target: { checked: any; }; }) => {
|
|
88
91
|
// @ts-ignore
|
|
@@ -97,7 +100,10 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
97
100
|
let displayComponent;
|
|
98
101
|
if (displayMode) {
|
|
99
102
|
// @ts-ignore
|
|
100
|
-
displayComponent =
|
|
103
|
+
displayComponent = (
|
|
104
|
+
// @ts-ignore
|
|
105
|
+
<PegaDxilMyBoolean value={value} trueLabel={trueLabel} falseLabel={falseLabel} />
|
|
106
|
+
);
|
|
101
107
|
}
|
|
102
108
|
|
|
103
109
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useEffect, useState } from 'react';
|
|
2
4
|
import { DateInput, FieldValueList, DateTimeDisplay, Text, } from '@pega/cosmos-react-core';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
@@ -88,6 +90,7 @@ export default function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}
|
|
|
88
90
|
|
|
89
91
|
// cast status
|
|
90
92
|
let myStatus: 'success' | 'warning' | 'error' | 'pending';
|
|
93
|
+
// eslint-disable-next-line prefer-const
|
|
91
94
|
myStatus = status as 'success' | 'warning' | 'error' | 'pending';
|
|
92
95
|
|
|
93
96
|
useEffect(() => {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useEffect, useState } from 'react';
|
|
2
4
|
import { DateTimeInput, FieldValueList, DateTimeDisplay, Text } from "@pega/cosmos-react-core";
|
|
3
5
|
import PropTypes from "prop-types";
|
|
@@ -80,7 +82,7 @@ export default function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}
|
|
|
80
82
|
const actions = pConn.getActionsApi();
|
|
81
83
|
const actionsProps = pConn.getActionsApi() as unknown as ActionsProps;
|
|
82
84
|
const stateProps = pConn.getStateProps() as StateProps;
|
|
83
|
-
|
|
85
|
+
const propName: string = stateProps.value;
|
|
84
86
|
|
|
85
87
|
const environmentInfo = PCore.getEnvironmentInfo();
|
|
86
88
|
const timezone = environmentInfo && environmentInfo.getTimeZone();
|
|
@@ -94,6 +96,7 @@ export default function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}
|
|
|
94
96
|
|
|
95
97
|
// cast status
|
|
96
98
|
let myStatus: 'success' | 'warning' | 'error' | 'pending';
|
|
99
|
+
// eslint-disable-next-line prefer-const
|
|
97
100
|
myStatus = status as 'success' | 'warning' | 'error' | 'pending';
|
|
98
101
|
|
|
99
102
|
useEffect(() => {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useState, useEffect, useRef } from 'react';
|
|
2
4
|
import { NumberInput, NumberDisplay, CurrencyDisplay, FieldValueList, Text } from '@pega/cosmos-react-core';
|
|
3
5
|
import PropTypes from 'prop-types';
|
package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useState, useEffect, useRef } from 'react';
|
|
2
4
|
import {
|
|
3
5
|
NumberInput,
|
|
@@ -104,7 +106,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
104
106
|
|
|
105
107
|
if (displayMode === 'LABELS_LEFT' || displayMode === 'DISPLAY_ONLY') {
|
|
106
108
|
let unit = 'percent';
|
|
107
|
-
let displayComp = null;
|
|
109
|
+
let displayComp:any = null;
|
|
108
110
|
|
|
109
111
|
if (isTableFormatter) {
|
|
110
112
|
switch (formatter) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useState, useEffect, useRef } from 'react';
|
|
2
4
|
import { NumberInput, NumberDisplay, Slider, FieldValueList, CurrencyDisplay, Text } from '@pega/cosmos-react-core';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3
|
+
import React from 'react';
|
|
2
4
|
// @ts-nocheck
|
|
3
5
|
import { useState, useEffect, useRef } from 'react';
|
|
4
6
|
import { Select, Option, FieldValueList, Text } from '@pega/cosmos-react-core';
|
|
@@ -60,7 +62,7 @@ export const formatExists = (formatterVal: string) => {
|
|
|
60
62
|
|
|
61
63
|
|
|
62
64
|
export const textFormatter = (formatter: string,value: any) => {
|
|
63
|
-
let displayComponent = null;
|
|
65
|
+
let displayComponent: any = null;
|
|
64
66
|
switch(formatter){
|
|
65
67
|
case "TextInput" : {
|
|
66
68
|
displayComponent = value;
|
package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/date.js.mustache
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-shadow */
|
|
2
1
|
import dayjs from 'dayjs';
|
|
3
2
|
import relativeTime from 'dayjs/plugin/relativeTime.js';
|
|
4
3
|
import localizedFormat from 'dayjs/plugin/localizedFormat.js';
|
|
@@ -83,8 +82,10 @@ const constellationToCosmosFormatterMap = new Map([
|
|
|
83
82
|
const types = ['fromNow', 'customFormat'];
|
|
84
83
|
|
|
85
84
|
// value should be in ISO 8601 format.
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
function DateFormatter(
|
|
86
|
+
value,
|
|
87
|
+
// eslint-disable-next-line no-shadow, @typescript-eslint/no-shadow
|
|
88
|
+
{ type = types[1], format = 'DD/MM/YYYY', timezone, fieldType } = {}) {
|
|
88
89
|
if (!value) return value;
|
|
89
90
|
switch (type) {
|
|
90
91
|
case types[1]:
|
|
@@ -127,7 +128,7 @@ function DateFormatter(value, { type = types[1], format = 'DD/MM/YYYY', timezone
|
|
|
127
128
|
export function format(value, options) {
|
|
128
129
|
if (!value) return null;
|
|
129
130
|
const { type, locale, timezone, formatter, translate } = options;
|
|
130
|
-
// eslint-disable-next-line no-shadow
|
|
131
|
+
// eslint-disable-next-line no-shadow, @typescript-eslint/no-shadow
|
|
131
132
|
const { format, variant } = constellationToCosmosFormatterMap.get(type).get(formatter);
|
|
132
133
|
return formatDateTime(parseToDate(value), {
|
|
133
134
|
t: translate,
|
package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
1
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/* eslint-disable sonarjs/cognitive-complexity */
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { useEffect, useRef, useState, memo, useMemo, type MutableRefObject, type SetStateAction } from 'react';
|
|
6
|
+
import { ComboBox, menuHelpers, debounce, throttle, Button, Icon, type MenuGroupProps, type MenuItemProps } from '@pega/cosmos-react-core';
|
|
5
7
|
import PropTypes from 'prop-types';
|
|
6
8
|
import get from 'lodash.get';
|
|
7
9
|
import type { PConnFieldProps } from './PConnProps';
|
|
@@ -206,7 +208,7 @@ export const doSearch = (
|
|
|
206
208
|
const updatedItems = menuHelpers.selectItem(searchedItems, value, AC_TYPE);
|
|
207
209
|
const selectedItem = menuHelpers.getSelected(updatedItems)[0];
|
|
208
210
|
if (!selectedItem) {
|
|
209
|
-
let searchedItem = [];
|
|
211
|
+
let searchedItem: any = [];
|
|
210
212
|
if (fetchDisplayValue) {
|
|
211
213
|
dataApiObj.matchPosition = 'equals';
|
|
212
214
|
buildColumnForDisplayValue(dataApiObj);
|
|
@@ -330,8 +332,8 @@ export const setValueToAssocProp = (
|
|
|
330
332
|
actions: any,
|
|
331
333
|
columns: Array<any>
|
|
332
334
|
) => {
|
|
333
|
-
let searchedEntry = null;
|
|
334
|
-
let retValue;
|
|
335
|
+
let searchedEntry: any = null;
|
|
336
|
+
let retValue: any;
|
|
335
337
|
if (listSource && listSource.length > 0 && listSource[0]) {
|
|
336
338
|
searchedEntry = listSource.filter(
|
|
337
339
|
item =>
|
|
@@ -734,7 +736,7 @@ export function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
734
736
|
|
|
735
737
|
useEffect(() => {
|
|
736
738
|
if (listType === 'datapage' && displayMode && displayMode?.length > 0 && value !== '') {
|
|
737
|
-
let displayItem = null;
|
|
739
|
+
let displayItem: any = null;
|
|
738
740
|
if (referenceType === 'Case' || referenceType === 'Data') {
|
|
739
741
|
displayItem =
|
|
740
742
|
referenceType === 'Case'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable sonarjs/no-collapsible-if */
|
|
2
2
|
/* eslint-disable default-param-last */
|
|
3
3
|
/* eslint-disable func-names */
|
|
4
|
+
/* eslint-disable sonarjs/cognitive-complexity */
|
|
4
5
|
import { splitConditionTree } from '@pega/cosmos-react-condition-builder';
|
|
5
6
|
import cloneDeep from 'lodash/cloneDeep.js';
|
|
6
7
|
|
package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-nested-ternary */
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3
|
+
import React from 'react';
|
|
2
4
|
import { useMemo } from 'react';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
4
6
|
import { RadioButton, RadioButtonGroup } from '@pega/cosmos-react-core';
|
|
@@ -108,7 +110,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
108
110
|
const localeName = localeContext === 'datapage' ? metaData?.datasource?.name : configProperty;
|
|
109
111
|
const localePath = localeContext === 'datapage' ? displayName : localeName;
|
|
110
112
|
|
|
111
|
-
const items = [];
|
|
113
|
+
const items: Array<any> = [];
|
|
112
114
|
const isDatapage = listType === 'datapage';
|
|
113
115
|
// @ts-ignore
|
|
114
116
|
const listSource = isDatapage ? configProps.listOutput : datasource;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import PropTypes from 'prop-types';
|
|
2
4
|
import { Input } from '@pega/cosmos-react-core';
|
|
3
5
|
|
|
@@ -27,7 +29,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
27
29
|
const pConn = getPConnect();
|
|
28
30
|
const actions = pConn.getActionsApi();
|
|
29
31
|
const stateProps = pConn.getStateProps() as StateProps;
|
|
30
|
-
|
|
32
|
+
const propName: string = stateProps.value;
|
|
31
33
|
|
|
32
34
|
const handleOnChange = (event: any) => {
|
|
33
35
|
const { value: updatedValue } = event.target;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useState, useEffect, useRef } from 'react';
|
|
2
4
|
import { Input, EmailDisplay, FieldValueList, Text, URLDisplay, PhoneDisplay } from '@pega/cosmos-react-core';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
@@ -44,7 +46,7 @@ export const formatExists = (formatterVal: string) => {
|
|
|
44
46
|
|
|
45
47
|
|
|
46
48
|
export const textFormatter = (formatter: string, value: any) => {
|
|
47
|
-
let displayComponent = null;
|
|
49
|
+
let displayComponent: any = null;
|
|
48
50
|
switch(formatter){
|
|
49
51
|
case "TextInput" : {
|
|
50
52
|
displayComponent = value;
|
|
@@ -93,7 +95,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
93
95
|
const pConn = getPConnect();
|
|
94
96
|
const actions = pConn.getActionsApi();
|
|
95
97
|
const stateProps = pConn.getStateProps() as StateProps;
|
|
96
|
-
|
|
98
|
+
const propName: string = stateProps.value;
|
|
97
99
|
|
|
98
100
|
const hasValueChange = useRef(false);
|
|
99
101
|
|
|
@@ -118,7 +120,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
118
120
|
}
|
|
119
121
|
}, [validatemessage, hasSuggestions, status]);
|
|
120
122
|
|
|
121
|
-
let displayComp = null;
|
|
123
|
+
let displayComp: any = null;
|
|
122
124
|
if (displayMode) {
|
|
123
125
|
displayComp = <EmailDisplay value={value} displayText={inputValue} variant='link' />;
|
|
124
126
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useEffect, useState, useRef } from 'react';
|
|
2
4
|
import { Input, FieldValueList, Text, EmailDisplay, PhoneDisplay, URLDisplay } from '@pega/cosmos-react-core';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
@@ -45,7 +47,7 @@ export const formatExists = (formatterVal: string) => {
|
|
|
45
47
|
|
|
46
48
|
|
|
47
49
|
export const textFormatter = (formatter: string, value: string) => {
|
|
48
|
-
let displayComponent = null;
|
|
50
|
+
let displayComponent: any = null;
|
|
49
51
|
switch(formatter){
|
|
50
52
|
case "TextInput" : {
|
|
51
53
|
displayComponent = value;
|
|
@@ -95,7 +97,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
95
97
|
const pConn = getPConnect();
|
|
96
98
|
const actions = pConn.getActionsApi();
|
|
97
99
|
const stateProps = pConn.getStateProps() as StateProps;
|
|
98
|
-
|
|
100
|
+
const propName: string = stateProps.value;
|
|
99
101
|
const maxLength = fieldMetadata?.maxLength;
|
|
100
102
|
const hasValueChange = useRef(false);
|
|
101
103
|
|
|
@@ -109,6 +111,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
109
111
|
|
|
110
112
|
// cast status
|
|
111
113
|
let myStatus: 'success' | 'warning' | 'error' | 'pending';
|
|
114
|
+
// eslint-disable-next-line prefer-const
|
|
112
115
|
myStatus = status as 'success' | 'warning' | 'error' | 'pending';
|
|
113
116
|
|
|
114
117
|
useEffect(() => setInputValue(value), [value]);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useState, useEffect, useRef } from 'react';
|
|
2
4
|
import { TextArea as CosmosTextArea, FieldValueList, ParagraphDisplay, Text, EmailDisplay, PhoneDisplay, URLDisplay } from '@pega/cosmos-react-core';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
@@ -44,7 +46,7 @@ export const formatExists = (formatterVal: string) => {
|
|
|
44
46
|
|
|
45
47
|
|
|
46
48
|
export const textFormatter = (formatter: string, value: any) => {
|
|
47
|
-
let displayComponent = null;
|
|
49
|
+
let displayComponent:any = null;
|
|
48
50
|
switch(formatter){
|
|
49
51
|
case "TextInput" : {
|
|
50
52
|
displayComponent = value;
|
|
@@ -94,7 +96,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
94
96
|
const pConn = getPConnect();
|
|
95
97
|
const actions = pConn.getActionsApi();
|
|
96
98
|
const stateProps = pConn.getStateProps() as StateProps;
|
|
97
|
-
|
|
99
|
+
const propName: string = stateProps.value;
|
|
98
100
|
const maxLength = fieldMetadata?.maxLength;
|
|
99
101
|
const hasValueChange = useRef(false);
|
|
100
102
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useState, useEffect, useRef } from 'react';
|
|
2
4
|
import {
|
|
3
5
|
PhoneInput as CosmosPhone,
|
|
@@ -53,7 +55,7 @@ export const formatExists = (formatterVal: string) => {
|
|
|
53
55
|
|
|
54
56
|
|
|
55
57
|
export const textFormatter = (formatter: string, value: any) => {
|
|
56
|
-
let displayComponent = null;
|
|
58
|
+
let displayComponent:any = null;
|
|
57
59
|
switch(formatter){
|
|
58
60
|
case "TextInput" : {
|
|
59
61
|
displayComponent = value;
|
|
@@ -104,7 +106,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
104
106
|
const pConn = getPConnect();
|
|
105
107
|
const actions = pConn.getActionsApi();
|
|
106
108
|
const stateProps = pConn.getStateProps() as StateProps;
|
|
107
|
-
|
|
109
|
+
const propName: string = stateProps.value;
|
|
108
110
|
const hasValueChange = useRef(false);
|
|
109
111
|
|
|
110
112
|
let callingCodesList: Array<any> = [];
|
|
@@ -139,7 +141,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
139
141
|
}
|
|
140
142
|
}, [validatemessage, hasSuggestions, status]);
|
|
141
143
|
|
|
142
|
-
//
|
|
144
|
+
// function to exclude country code from phone number
|
|
143
145
|
function getPhoneNumberAlone(phoneNumber: string) {
|
|
144
146
|
const phoneNumberParts = getPhoneNumberParts(phoneNumber, callingCodesList);
|
|
145
147
|
return phoneNumberParts && phoneNumberParts[1];
|
|
@@ -152,7 +154,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
152
154
|
handleEvent(actions, eventType, propName, enteredValue);
|
|
153
155
|
}
|
|
154
156
|
|
|
155
|
-
let displayComp = null;
|
|
157
|
+
let displayComp: any = null;
|
|
156
158
|
if (displayMode) {
|
|
157
159
|
displayComp = <PhoneDisplay value={value} variant='link' />;
|
|
158
160
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { useState, useEffect, useRef} from "react";
|
|
2
4
|
import { Input, FieldValueList, Text } from "@pega/cosmos-react-core";
|
|
3
5
|
import PropTypes from "prop-types";
|
|
@@ -71,7 +73,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
71
73
|
const pConn = getPConnect();
|
|
72
74
|
const actions = pConn.getActionsApi();
|
|
73
75
|
const stateProps = pConn.getStateProps() as StateProps;
|
|
74
|
-
|
|
76
|
+
const propName: string = stateProps.value;
|
|
75
77
|
const hasValueChange = useRef(false);
|
|
76
78
|
|
|
77
79
|
|
|
@@ -96,7 +98,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
96
98
|
}
|
|
97
99
|
}, [validatemessage, hasSuggestions, status]);
|
|
98
100
|
|
|
99
|
-
let displayComp = null;
|
|
101
|
+
let displayComp: any = null;
|
|
100
102
|
if (displayMode) {
|
|
101
103
|
displayComp = urlFormatter(value, {
|
|
102
104
|
displayAs,
|
|
@@ -98,6 +98,7 @@ export const BasePegaDxilMyDetails = () => {
|
|
|
98
98
|
return pyReviewRaw.config.inheritedProps;
|
|
99
99
|
},
|
|
100
100
|
createComponent: config => {
|
|
101
|
+
// eslint-disable-next-line default-case
|
|
101
102
|
switch (config.config.value) {
|
|
102
103
|
case '@P .pyStatusWork':
|
|
103
104
|
return renderField(pyReviewResolved.highlightedData[0].config);
|
package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache
CHANGED
|
@@ -98,6 +98,7 @@ export const Base{{COMPONENT_CLASS_NAME}} = () => {
|
|
|
98
98
|
return pyReviewRaw.config.inheritedProps;
|
|
99
99
|
},
|
|
100
100
|
createComponent: config => {
|
|
101
|
+
// eslint-disable-next-line default-case
|
|
101
102
|
switch (config.config.value) {
|
|
102
103
|
case '@P .pyStatusWork':
|
|
103
104
|
return renderField(pyReviewResolved.highlightedData[0].config);
|
|
@@ -147,6 +147,7 @@ export const Base{{COMPONENT_CLASS_NAME}} = () => {
|
|
|
147
147
|
return pyReviewRaw.config.inheritedProps;
|
|
148
148
|
},
|
|
149
149
|
createComponent: config => {
|
|
150
|
+
// eslint-disable-next-line default-case
|
|
150
151
|
switch (config.config.value) {
|
|
151
152
|
case '@P .FirstName':
|
|
152
153
|
return renderField(regionChildrenResolved[0]);
|
package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.tsx.mustache
CHANGED
|
@@ -149,6 +149,7 @@ export const Base{{COMPONENT_CLASS_NAME}} = () => {
|
|
|
149
149
|
return pyReviewRaw.config.inheritedProps;
|
|
150
150
|
},
|
|
151
151
|
createComponent: config => {
|
|
152
|
+
// eslint-disable-next-line default-case
|
|
152
153
|
switch (config.config.value) {
|
|
153
154
|
case '@P .FirstName':
|
|
154
155
|
return renderField(regionChildrenResolved[0]);
|