@pega/dx-component-builder-sdk 0.23.17 → 0.23.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +3 -2
- package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +3 -9
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +7 -15
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +38 -37
- package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +3 -3
- package/src/tasks/map/map.js +29 -8
- package/tests/assets/sdk-r/components/create/override-sdk/field/Checkbox/Checkbox.tsx +3 -1
- package/tests/assets/sdk-r/components/create/override-sdk/field/Currency/Currency.tsx +7 -15
- package/tests/assets/sdk-r/components/create/override-sdk/field/DateTime/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/Decimal.tsx +3 -9
- package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/field/Dropdown/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/field/Email/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/field/Group/Group.tsx +2 -0
- package/tests/assets/sdk-r/components/create/override-sdk/field/Group/config-ext.json +7 -7
- package/tests/assets/sdk-r/components/create/override-sdk/field/Integer/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/Percentage.tsx +38 -36
- package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/field/RadioButtons/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/field/SemanticLink/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/field/TextArea/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/field/TextContent/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/field/TextInput/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/field/Time/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/field/URL/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/field/UserReference/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseSummary/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/Confirmation/config-ext.json +11 -11
- package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/config-ext.json +9 -9
- package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsSubTabs/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsThreeColumn/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsTwoColumn/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListPage/config-ext.json +7 -7
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/utils.ts +3 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/NarrowWideDetails/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/NarrowWideForm/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/NarrowWidePage/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/OneColumn/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/OneColumnPage/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/OneColumnTab/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTable/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +19 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/SubTabs/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/TwoColumn/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/TwoColumnPage/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/TwoColumnTab/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrowDetails/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrowForm/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrowPage/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/widget/AppAnnouncement/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.tsx +5 -1
- package/tests/assets/sdk-r/components/create/override-sdk/widget/CaseHistory/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/widget/FileUtility/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/widget/Followers/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/create/override-sdk/widget/QuickCreate/QuickCreate.tsx +52 -25
- package/tests/assets/sdk-r/components/create/override-sdk/widget/ToDo/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/index.tsx +3 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +7 -15
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +3 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +38 -37
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +3 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Checkbox/Checkbox.tsx +3 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Currency/Currency.tsx +7 -15
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/DateTime/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/Decimal.tsx +3 -9
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Dropdown/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Email/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/Group.tsx +2 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/config-ext.json +7 -7
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Integer/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx +38 -36
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/RadioButtons/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/SemanticLink/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextArea/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextContent/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextInput/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Time/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/URL/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/UserReference/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseSummary/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/Confirmation/config-ext.json +11 -11
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/config-ext.json +9 -9
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsSubTabs/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsThreeColumn/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsTwoColumn/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListPage/config-ext.json +7 -7
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/utils.ts +3 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/NarrowWideDetails/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/NarrowWideForm/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/NarrowWidePage/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/OneColumn/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/OneColumnPage/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/OneColumnTab/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTable/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +19 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SubTabs/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/TwoColumn/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/TwoColumnPage/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/TwoColumnTab/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrowDetails/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrowForm/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrowPage/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/AppAnnouncement/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.tsx +5 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/CaseHistory/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/FileUtility/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Followers/config-ext.json +8 -8
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/QuickCreate/QuickCreate.tsx +52 -25
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/ToDo/config-ext.json +8 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
|
-
import { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText } from '@material-ui/core';
|
|
2
|
+
import { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel } from '@material-ui/core';
|
|
3
3
|
|
|
4
4
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
@@ -20,6 +20,7 @@ export default function CheckboxComponent(props: CheckboxProps) {
|
|
|
20
20
|
|
|
21
21
|
const {
|
|
22
22
|
getPConnect,
|
|
23
|
+
label,
|
|
23
24
|
value = false,
|
|
24
25
|
readOnly,
|
|
25
26
|
testId,
|
|
@@ -73,6 +74,7 @@ export default function CheckboxComponent(props: CheckboxProps) {
|
|
|
73
74
|
|
|
74
75
|
return (
|
|
75
76
|
<FormControl required={required} error={status === 'error'}>
|
|
77
|
+
{!hideLabel && <FormLabel component='legend'>{label}</FormLabel>}
|
|
76
78
|
<FormGroup>
|
|
77
79
|
<FormControlLabel
|
|
78
80
|
control={theCheckbox}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
1
|
import CurrencyTextField from '@unicef/material-ui-currency-textfield';
|
|
3
2
|
|
|
4
|
-
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
5
|
-
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
6
3
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
4
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
|
-
|
|
5
|
+
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
6
|
+
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
9
7
|
import { getCurrencyCharacters, getCurrencyOptions } from './currency-utils';
|
|
10
8
|
|
|
11
9
|
// Using control from: https://github.com/unicef/material-ui-currency-textfield
|
|
@@ -48,17 +46,11 @@ export default function Currency(props: CurrrencyProps) {
|
|
|
48
46
|
'data-test-id': testId
|
|
49
47
|
};
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
// currencySymbols looks like this: { theCurrencySymbol: '$', theDecimalIndicator: '.', theSeparator: ',' }
|
|
57
|
-
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
58
|
-
setCurrSym(theSymbols.theCurrencySymbol);
|
|
59
|
-
setCurrDec(theSymbols.theDecimalIndicator);
|
|
60
|
-
setCurrSep(theSymbols.theDigitGroupSeparator);
|
|
61
|
-
}, [currencyISOCode]);
|
|
49
|
+
// currencySymbols looks like this: { theCurrencySymbol: '$', theDecimalIndicator: '.', theSeparator: ',' }
|
|
50
|
+
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
51
|
+
const theCurrSym = theSymbols.theCurrencySymbol;
|
|
52
|
+
const theCurrDec = theSymbols.theDecimalIndicator;
|
|
53
|
+
const theCurrSep = theSymbols.theDigitGroupSeparator;
|
|
62
54
|
|
|
63
55
|
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
64
56
|
const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"componentKey": "DateTime",
|
|
3
|
+
"name": "DateTime",
|
|
4
|
+
"label": "Date & time",
|
|
5
|
+
"description": "Date & time",
|
|
6
|
+
"type": "Field",
|
|
7
|
+
"subtype": "DateTime",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
1
|
import CurrencyTextField from '@unicef/material-ui-currency-textfield';
|
|
3
2
|
|
|
4
3
|
import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils';
|
|
@@ -45,14 +44,9 @@ export default function Decimal(props: DecimalProps) {
|
|
|
45
44
|
const propName = (pConn.getStateProps() as any).value;
|
|
46
45
|
const helperTextToDisplay = validatemessage || helperText;
|
|
47
46
|
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
53
|
-
setCurrDec(theSymbols.theDecimalIndicator);
|
|
54
|
-
setCurrSep(theSymbols.theDigitGroupSeparator);
|
|
55
|
-
}, [currencyISOCode]);
|
|
47
|
+
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
48
|
+
const theCurrDec = theSymbols.theDecimalIndicator;
|
|
49
|
+
const theCurrSep = theSymbols.theDigitGroupSeparator;
|
|
56
50
|
|
|
57
51
|
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
58
52
|
const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"componentKey": "Decimal",
|
|
3
|
+
"name": "Decimal",
|
|
4
|
+
"label": "Decimal",
|
|
5
|
+
"description": "Decimal",
|
|
6
|
+
"type": "Field",
|
|
7
|
+
"subtype": "Decimal",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"componentKey": "Dropdown",
|
|
3
|
+
"name": "Dropdown",
|
|
4
|
+
"label": "Dropdown",
|
|
5
|
+
"description": "Picklist",
|
|
6
|
+
"type": "Field",
|
|
7
|
+
"subtype": "Picklist",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"componentKey": "Email",
|
|
3
|
+
"name": "Email",
|
|
4
|
+
"label": "Email",
|
|
5
|
+
"description": "Email",
|
|
6
|
+
"type": "Field",
|
|
7
|
+
"subtype": "Text-Email",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
|
@@ -29,6 +29,8 @@ export default function Group(props: GroupProps) {
|
|
|
29
29
|
);
|
|
30
30
|
}, [children, type, isReadOnly]);
|
|
31
31
|
|
|
32
|
+
if (!children) return null;
|
|
33
|
+
|
|
32
34
|
return (
|
|
33
35
|
<FieldGroup name={showHeading ? heading : undefined} collapsible={collapsible} instructions={instructions}>
|
|
34
36
|
{content}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
2
|
+
"componentKey": "Group",
|
|
3
|
+
"name": "Group",
|
|
4
|
+
"label": "Field Group",
|
|
5
|
+
"description": "Field Group",
|
|
6
|
+
"type": "Group",
|
|
7
|
+
"properties": []
|
|
8
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"componentKey": "Integer",
|
|
3
|
+
"name": "Integer",
|
|
4
|
+
"label": "Integer",
|
|
5
|
+
"description": "Integer",
|
|
6
|
+
"type": "Field",
|
|
7
|
+
"subtype": "Integer",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx
CHANGED
|
@@ -1,67 +1,55 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
1
|
+
import CurrencyTextField from '@unicef/material-ui-currency-textfield';
|
|
3
2
|
|
|
4
3
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
4
|
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
input: {
|
|
10
|
-
'& input[type=number]': {
|
|
11
|
-
'-moz-appearance': 'textfield'
|
|
12
|
-
},
|
|
13
|
-
'& input[type=number]::-webkit-outer-spin-button': {
|
|
14
|
-
'-webkit-appearance': 'none',
|
|
15
|
-
margin: 0
|
|
16
|
-
},
|
|
17
|
-
'& input[type=number]::-webkit-inner-spin-button': {
|
|
18
|
-
'-webkit-appearance': 'none',
|
|
19
|
-
margin: 0
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}));
|
|
5
|
+
import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils';
|
|
6
|
+
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
7
|
+
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
23
8
|
|
|
24
9
|
interface PercentageProps extends PConnFieldProps {
|
|
25
10
|
// If any, enter additional props that only exist on Percentage here
|
|
11
|
+
currencyISOCode?: string;
|
|
26
12
|
}
|
|
27
13
|
|
|
28
14
|
export default function Percentage(props: PercentageProps) {
|
|
29
15
|
// Get emitted components from map (so we can get any override that may exist)
|
|
30
|
-
const TextInput = getComponentFromMap('TextInput');
|
|
31
16
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
32
17
|
|
|
33
|
-
const classes = useStyles();
|
|
34
|
-
|
|
35
18
|
const {
|
|
19
|
+
getPConnect,
|
|
36
20
|
label,
|
|
37
21
|
required,
|
|
38
22
|
disabled,
|
|
39
23
|
value = '',
|
|
40
24
|
validatemessage,
|
|
41
25
|
status,
|
|
42
|
-
onChange,
|
|
43
|
-
onBlur,
|
|
26
|
+
// onChange,
|
|
27
|
+
// onBlur,
|
|
44
28
|
readOnly,
|
|
29
|
+
currencyISOCode = 'USD',
|
|
45
30
|
testId,
|
|
46
31
|
helperText,
|
|
47
32
|
displayMode,
|
|
48
33
|
hideLabel,
|
|
49
34
|
placeholder
|
|
50
35
|
} = props;
|
|
36
|
+
|
|
37
|
+
const pConn = getPConnect();
|
|
38
|
+
const actions = pConn.getActionsApi();
|
|
39
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
51
40
|
const helperTextToDisplay = validatemessage || helperText;
|
|
52
41
|
|
|
42
|
+
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
43
|
+
const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
|
|
44
|
+
|
|
53
45
|
// console.log(`Percentage: label: ${label} value: ${value}`);
|
|
54
46
|
|
|
55
47
|
if (displayMode === 'LABELS_LEFT') {
|
|
56
|
-
return <FieldValueList name={hideLabel ? '' : label} value={
|
|
48
|
+
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;
|
|
57
49
|
}
|
|
58
50
|
|
|
59
51
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
60
|
-
return <FieldValueList name={hideLabel ? '' : label} value={
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (readOnly) {
|
|
64
|
-
return <TextInput {...props} />;
|
|
52
|
+
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;
|
|
65
53
|
}
|
|
66
54
|
|
|
67
55
|
let testProp = {};
|
|
@@ -70,9 +58,16 @@ export default function Percentage(props: PercentageProps) {
|
|
|
70
58
|
'data-test-id': testId
|
|
71
59
|
};
|
|
72
60
|
|
|
61
|
+
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
62
|
+
const theCurrDec = theSymbols.theDecimalIndicator;
|
|
63
|
+
const theCurrSep = theSymbols.theDigitGroupSeparator;
|
|
64
|
+
|
|
65
|
+
function PercentageOnBlur(event, inValue) {
|
|
66
|
+
handleEvent(actions, 'changeNblur', propName, inValue !== '' ? Number(inValue) : inValue);
|
|
67
|
+
}
|
|
68
|
+
|
|
73
69
|
return (
|
|
74
|
-
<
|
|
75
|
-
className={classes.input}
|
|
70
|
+
<CurrencyTextField
|
|
76
71
|
fullWidth
|
|
77
72
|
variant={readOnly ? 'standard' : 'outlined'}
|
|
78
73
|
helperText={helperTextToDisplay}
|
|
@@ -80,13 +75,20 @@ export default function Percentage(props: PercentageProps) {
|
|
|
80
75
|
size='small'
|
|
81
76
|
required={required}
|
|
82
77
|
disabled={disabled}
|
|
83
|
-
|
|
84
|
-
onBlur={!readOnly ? onBlur : undefined}
|
|
78
|
+
readOnly={!!readOnly}
|
|
85
79
|
error={status === 'error'}
|
|
86
80
|
label={label}
|
|
87
81
|
value={value}
|
|
88
|
-
type='
|
|
89
|
-
|
|
82
|
+
type='text'
|
|
83
|
+
outputFormat='number'
|
|
84
|
+
textAlign='left'
|
|
85
|
+
InputProps={{
|
|
86
|
+
inputProps: { ...testProp }
|
|
87
|
+
}}
|
|
88
|
+
currencySymbol=''
|
|
89
|
+
decimalCharacter={theCurrDec}
|
|
90
|
+
digitGroupSeparator={theCurrSep}
|
|
91
|
+
onBlur={!readOnly ? PercentageOnBlur : undefined}
|
|
90
92
|
/>
|
|
91
93
|
);
|
|
92
94
|
}
|
package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/config-ext.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"componentKey": "Percentage",
|
|
3
|
+
"name": "Percentage",
|
|
4
|
+
"label": "Percentage",
|
|
5
|
+
"description": "Percentage",
|
|
6
|
+
"type": "Field",
|
|
7
|
+
"subtype": "Decimal-Percentage",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
package/tests/assets/sdk-r/components/createAll/override-sdk/field/RadioButtons/config-ext.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"componentKey": "RadioButtons",
|
|
3
|
+
"name": "RadioButtons",
|
|
4
|
+
"label": "Radio buttons",
|
|
5
|
+
"description": "Picklist",
|
|
6
|
+
"type": "Field",
|
|
7
|
+
"subtype": "Picklist",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
package/tests/assets/sdk-r/components/createAll/override-sdk/field/SemanticLink/config-ext.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"label": "SemanticLink",
|
|
3
|
+
"componentKey": "SemanticLink",
|
|
4
|
+
"name": "SemanticLink",
|
|
5
|
+
"description": "SemanticLink",
|
|
6
|
+
"type": "Field",
|
|
7
|
+
"subtype": "ACTION",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"componentKey": "TextArea",
|
|
3
|
+
"name": "TextArea",
|
|
4
|
+
"label": "Text area",
|
|
5
|
+
"description": "Text (paragraph)",
|
|
6
|
+
"type": "Field",
|
|
7
|
+
"subtype": "Text-Paragraph",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextContent/config-ext.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"label": "TextContent",
|
|
3
|
+
"componentKey": "TextContent",
|
|
4
|
+
"name": "TextContent",
|
|
5
|
+
"description": "Text",
|
|
6
|
+
"type": "Field",
|
|
7
|
+
"subtype": "DATA_CAPTURE",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
package/tests/assets/sdk-r/components/createAll/override-sdk/field/TextInput/config-ext.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"componentKey": "TextInput",
|
|
3
|
+
"name": "TextInput",
|
|
4
|
+
"label": "Text input",
|
|
5
|
+
"description": "Text (single line)",
|
|
6
|
+
"type": "Field",
|
|
7
|
+
"subtype": "Text",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"componentKey": "Time",
|
|
3
|
+
"name": "Time",
|
|
4
|
+
"label": "Time only",
|
|
5
|
+
"description": "Time only",
|
|
6
|
+
"type": "Field",
|
|
7
|
+
"subtype": "TimeOfDay",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"componentKey": "URL",
|
|
3
|
+
"name": "URL",
|
|
4
|
+
"label": "URL",
|
|
5
|
+
"description": "URL",
|
|
6
|
+
"type": "Field",
|
|
7
|
+
"subtype": "Text-URL",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
package/tests/assets/sdk-r/components/createAll/override-sdk/field/UserReference/config-ext.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"label": "UserReference",
|
|
3
|
+
"componentKey": "UserReference",
|
|
4
|
+
"name": "UserReference",
|
|
5
|
+
"description": "User reference",
|
|
6
|
+
"type": "Field",
|
|
7
|
+
"subtype": "DATA_CAPTURE",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseSummary/config-ext.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"componentKey": "CaseSummary",
|
|
3
|
+
"name": "CaseSummary",
|
|
4
|
+
"label": "Summary data",
|
|
5
|
+
"description": "Case summary template",
|
|
6
|
+
"type": "Template",
|
|
7
|
+
"subtype": "SUMMARY",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/config-ext.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"componentKey": "CaseView",
|
|
3
|
+
"name": "CaseView",
|
|
4
|
+
"label": "Object page",
|
|
5
|
+
"description": "Standard case page",
|
|
6
|
+
"type": "Template",
|
|
7
|
+
"subtype": "CASEVIEW",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
package/tests/assets/sdk-r/components/createAll/override-sdk/template/Confirmation/config-ext.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
2
|
+
"componentKey": "Confirmation",
|
|
3
|
+
"name": "Confirmation",
|
|
4
|
+
"label": "Confirmation",
|
|
5
|
+
"description": "Confirmation template",
|
|
6
|
+
"type": "Template",
|
|
7
|
+
"subtype": "CASE",
|
|
8
|
+
"icon": "confirm-view.svg",
|
|
9
|
+
"hideTemplateEdit": true,
|
|
10
|
+
"hideViewName": true,
|
|
11
|
+
"properties": []
|
|
12
|
+
}
|
package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/config-ext.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
2
|
+
"label": "DataReference",
|
|
3
|
+
"componentKey": "DataReference",
|
|
4
|
+
"name": "DataReference",
|
|
5
|
+
"description": "Data Reference Template",
|
|
6
|
+
"type": "Template",
|
|
7
|
+
"icon": "DataReference.svg",
|
|
8
|
+
"subtype": "DATAVIEW",
|
|
9
|
+
"properties": []
|
|
10
|
+
}
|
package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/config-ext.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"componentKey": "DefaultForm",
|
|
3
|
+
"name": "DefaultForm",
|
|
4
|
+
"label": "Default form",
|
|
5
|
+
"description": "DefaultForm Template",
|
|
6
|
+
"type": "Template",
|
|
7
|
+
"subtype": "FORM",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|
package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsSubTabs/config-ext.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
2
|
+
"componentKey": "DetailsSubTabs",
|
|
3
|
+
"name": "DetailsSubTabs",
|
|
4
|
+
"label": "Details (Sub tabs)",
|
|
5
|
+
"description": "Details (Sub tabs)",
|
|
6
|
+
"type": "Template",
|
|
7
|
+
"subtype": "DETAILS",
|
|
8
|
+
"properties": []
|
|
9
|
+
}
|