@pega/react-sdk-components 8.23.10 → 8.23.11-debug
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/lib/bridge/Context/StoreContext.d.ts +3 -2
- package/lib/bridge/Context/StoreContext.d.ts.map +1 -1
- package/lib/bridge/Context/StoreContext.js +2 -3
- package/lib/bridge/Context/StoreContext.js.map +1 -1
- package/lib/bridge/helpers/sdk_component_map.d.ts +1 -0
- package/lib/bridge/helpers/sdk_component_map.d.ts.map +1 -1
- package/lib/bridge/helpers/sdk_component_map.js +22 -0
- package/lib/bridge/helpers/sdk_component_map.js.map +1 -1
- package/lib/bridge/react_pconnect.d.ts.map +1 -1
- package/lib/bridge/react_pconnect.js +2 -14
- package/lib/bridge/react_pconnect.js.map +1 -1
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts +13 -0
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts.map +1 -0
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js +26 -0
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js.map +1 -0
- package/lib/components/designSystemExtension/AlertBanner/index.d.ts +2 -0
- package/lib/components/designSystemExtension/AlertBanner/index.d.ts.map +1 -0
- package/lib/components/designSystemExtension/AlertBanner/index.js +2 -0
- package/lib/components/designSystemExtension/AlertBanner/index.js.map +1 -0
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.d.ts.map +1 -1
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js +1 -1
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js.map +1 -1
- package/lib/components/designSystemExtension/Operator/Operator.d.ts.map +1 -1
- package/lib/components/designSystemExtension/Operator/Operator.js +12 -10
- package/lib/components/designSystemExtension/Operator/Operator.js.map +1 -1
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js +2 -2
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js.map +1 -1
- package/lib/components/field/CancelAlert/CancelAlert.d.ts.map +1 -1
- package/lib/components/field/CancelAlert/CancelAlert.js +9 -7
- package/lib/components/field/CancelAlert/CancelAlert.js.map +1 -1
- package/lib/components/field/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/field/Checkbox/Checkbox.js +3 -3
- package/lib/components/field/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/field/Currency/currency-utils.d.ts +1 -1
- package/lib/components/field/Currency/currency-utils.d.ts.map +1 -1
- package/lib/components/field/Currency/currency-utils.js.map +1 -1
- package/lib/components/field/Date/Date.d.ts.map +1 -1
- package/lib/components/field/Date/Date.js +11 -5
- package/lib/components/field/Date/Date.js.map +1 -1
- package/lib/components/field/DateTime/DateTime.js +1 -1
- package/lib/components/field/DateTime/DateTime.js.map +1 -1
- package/lib/components/field/Decimal/Decimal.d.ts.map +1 -1
- package/lib/components/field/Decimal/Decimal.js +41 -8
- package/lib/components/field/Decimal/Decimal.js.map +1 -1
- package/lib/components/field/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/components/field/Dropdown/Dropdown.js +21 -7
- package/lib/components/field/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/field/Phone/Phone.d.ts.map +1 -1
- package/lib/components/field/Phone/Phone.js +2 -1
- package/lib/components/field/Phone/Phone.js.map +1 -1
- package/lib/components/field/RadioButtons/RadioButtons.d.ts.map +1 -1
- package/lib/components/field/RadioButtons/RadioButtons.js +17 -4
- package/lib/components/field/RadioButtons/RadioButtons.js.map +1 -1
- package/lib/components/field/SemanticLink/utils.d.ts.map +1 -1
- package/lib/components/field/SemanticLink/utils.js.map +1 -1
- package/lib/components/field/TextInput/TextInput.d.ts.map +1 -1
- package/lib/components/field/TextInput/TextInput.js +20 -3
- package/lib/components/field/TextInput/TextInput.js.map +1 -1
- package/lib/components/field/Time/Time.d.ts.map +1 -1
- package/lib/components/field/Time/Time.js +6 -2
- package/lib/components/field/Time/Time.js.map +1 -1
- package/lib/components/field/URL/URL.d.ts.map +1 -1
- package/lib/components/field/URL/URL.js +6 -2
- package/lib/components/field/URL/URL.js.map +1 -1
- package/lib/components/field/UserReference/UserReference.d.ts.map +1 -1
- package/lib/components/field/UserReference/UserReference.js.map +1 -1
- package/lib/components/helpers/attachmentHelpers.d.ts +5 -5
- package/lib/components/helpers/attachmentHelpers.d.ts.map +1 -1
- package/lib/components/helpers/attachmentHelpers.js +2 -2
- package/lib/components/helpers/attachmentHelpers.js.map +1 -1
- package/lib/components/helpers/auth.d.ts.map +1 -1
- package/lib/components/helpers/auth.js +11 -3
- package/lib/components/helpers/auth.js.map +1 -1
- package/lib/components/helpers/authManager.d.ts.map +1 -1
- package/lib/components/helpers/authManager.js +15 -12
- package/lib/components/helpers/authManager.js.map +1 -1
- package/lib/components/helpers/case-utils.d.ts +20 -0
- package/lib/components/helpers/case-utils.d.ts.map +1 -0
- package/lib/components/helpers/case-utils.js +81 -0
- package/lib/components/helpers/case-utils.js.map +1 -0
- package/lib/components/helpers/common-utils.d.ts +2 -0
- package/lib/components/helpers/common-utils.d.ts.map +1 -0
- package/lib/components/helpers/common-utils.js +5 -0
- package/lib/components/helpers/common-utils.js.map +1 -0
- package/lib/components/helpers/config_access.d.ts.map +1 -1
- package/lib/components/helpers/config_access.js +75 -82
- package/lib/components/helpers/config_access.js.map +1 -1
- package/lib/components/helpers/data_page.d.ts.map +1 -1
- package/lib/components/helpers/data_page.js.map +1 -1
- package/lib/components/helpers/date-format-utils.d.ts.map +1 -1
- package/lib/components/helpers/date-format-utils.js +23 -14
- package/lib/components/helpers/date-format-utils.js.map +1 -1
- package/lib/components/helpers/event-utils.d.ts +1 -1
- package/lib/components/helpers/event-utils.d.ts.map +1 -1
- package/lib/components/helpers/event-utils.js.map +1 -1
- package/lib/components/helpers/field-group-utils.d.ts +15 -2
- package/lib/components/helpers/field-group-utils.d.ts.map +1 -1
- package/lib/components/helpers/field-group-utils.js +3 -3
- package/lib/components/helpers/field-group-utils.js.map +1 -1
- package/lib/components/helpers/formatters/Boolean.d.ts +3 -3
- package/lib/components/helpers/formatters/Boolean.d.ts.map +1 -1
- package/lib/components/helpers/formatters/Boolean.js.map +1 -1
- package/lib/components/helpers/formatters/Currency.d.ts.map +1 -1
- package/lib/components/helpers/formatters/Currency.js +4 -3
- package/lib/components/helpers/formatters/Currency.js.map +1 -1
- package/lib/components/helpers/formatters/CurrencyMap.d.ts +1132 -1399
- package/lib/components/helpers/formatters/CurrencyMap.d.ts.map +1 -1
- package/lib/components/helpers/formatters/CurrencyMap.js.map +1 -1
- package/lib/components/helpers/formatters/Date.d.ts.map +1 -1
- package/lib/components/helpers/formatters/Date.js +1 -1
- package/lib/components/helpers/formatters/Date.js.map +1 -1
- package/lib/components/helpers/formatters/common.d.ts +2 -2
- package/lib/components/helpers/formatters/common.d.ts.map +1 -1
- package/lib/components/helpers/formatters/common.js +4 -5
- package/lib/components/helpers/formatters/common.js.map +1 -1
- package/lib/components/helpers/formatters/index.d.ts +1 -1
- package/lib/components/helpers/formatters/index.d.ts.map +1 -1
- package/lib/components/helpers/formatters/index.js.map +1 -1
- package/lib/components/helpers/reactContextHelpers.d.ts +3 -2
- package/lib/components/helpers/reactContextHelpers.d.ts.map +1 -1
- package/lib/components/helpers/reactContextHelpers.js.map +1 -1
- package/lib/components/helpers/simpleTableHelpers.d.ts +2 -2
- package/lib/components/helpers/simpleTableHelpers.d.ts.map +1 -1
- package/lib/components/helpers/simpleTableHelpers.js +5 -2
- package/lib/components/helpers/simpleTableHelpers.js.map +1 -1
- package/lib/components/helpers/state-utils.d.ts +4 -0
- package/lib/components/helpers/state-utils.d.ts.map +1 -0
- package/lib/components/helpers/state-utils.js +36 -0
- package/lib/components/helpers/state-utils.js.map +1 -0
- package/lib/components/helpers/template-utils.d.ts.map +1 -1
- package/lib/components/helpers/template-utils.js +0 -1
- package/lib/components/helpers/template-utils.js.map +1 -1
- package/lib/components/helpers/utils.d.ts +1 -1
- package/lib/components/helpers/utils.d.ts.map +1 -1
- package/lib/components/helpers/utils.js +9 -3
- package/lib/components/helpers/utils.js.map +1 -1
- package/lib/components/helpers/versionHelpers.d.ts +0 -6
- package/lib/components/helpers/versionHelpers.d.ts.map +1 -1
- package/lib/components/helpers/versionHelpers.js +0 -6
- package/lib/components/helpers/versionHelpers.js.map +1 -1
- package/lib/components/infra/ActionButtons/ActionButtons.d.ts.map +1 -1
- package/lib/components/infra/ActionButtons/ActionButtons.js +4 -2
- package/lib/components/infra/ActionButtons/ActionButtons.js.map +1 -1
- package/lib/components/infra/Assignment/Assignment.d.ts +1 -0
- package/lib/components/infra/Assignment/Assignment.d.ts.map +1 -1
- package/lib/components/infra/Assignment/Assignment.js +27 -15
- package/lib/components/infra/Assignment/Assignment.js.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +17 -9
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/helpers.d.ts +12 -12
- package/lib/components/infra/Containers/FlowContainer/helpers.d.ts.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/helpers.js +17 -16
- package/lib/components/infra/Containers/FlowContainer/helpers.js.map +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js +17 -8
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js.map +1 -1
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.js +4 -2
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.js.map +1 -1
- package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts.map +1 -1
- package/lib/components/infra/DashboardFilter/DashboardFilter.js.map +1 -1
- package/lib/components/infra/DashboardFilter/filterUtils.d.ts.map +1 -1
- package/lib/components/infra/DashboardFilter/filterUtils.js.map +1 -1
- package/lib/components/infra/DeferLoad/DeferLoad.d.ts.map +1 -1
- package/lib/components/infra/DeferLoad/DeferLoad.js.map +1 -1
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.js +7 -4
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.js.map +1 -1
- package/lib/components/infra/MultiStep/MultiStep.js +2 -2
- package/lib/components/infra/MultiStep/MultiStep.js.map +1 -1
- package/lib/components/infra/NavBar/NavBar.d.ts.map +1 -1
- package/lib/components/infra/NavBar/NavBar.js +6 -4
- package/lib/components/infra/NavBar/NavBar.js.map +1 -1
- package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
- package/lib/components/infra/RootContainer/RootContainer.js +12 -15
- package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
- package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
- package/lib/components/infra/Stages/Stages.js +2 -1
- package/lib/components/infra/Stages/Stages.js.map +1 -1
- package/lib/components/infra/View/View.d.ts +1 -1
- package/lib/components/infra/View/View.d.ts.map +1 -1
- package/lib/components/infra/View/View.js +6 -34
- package/lib/components/infra/View/View.js.map +1 -1
- package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/template/AppShell/AppShell.js +8 -8
- package/lib/components/template/AppShell/AppShell.js.map +1 -1
- package/lib/components/template/CaseView/CaseView.d.ts +1 -1
- package/lib/components/template/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/template/CaseView/CaseView.js +37 -28
- package/lib/components/template/CaseView/CaseView.js.map +1 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts +3 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts.map +1 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js +13 -8
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js.map +1 -1
- package/lib/components/template/Confirmation/Confirmation.d.ts.map +1 -1
- package/lib/components/template/Confirmation/Confirmation.js.map +1 -1
- package/lib/components/template/DataReference/DataReference.d.ts.map +1 -1
- package/lib/components/template/DataReference/DataReference.js.map +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.js +9 -5
- package/lib/components/template/DefaultForm/DefaultForm.js.map +1 -1
- package/lib/components/template/DefaultForm/utils/index.d.ts +3 -0
- package/lib/components/template/DefaultForm/utils/index.d.ts.map +1 -0
- package/lib/components/template/DefaultForm/utils/index.js +27 -0
- package/lib/components/template/DefaultForm/utils/index.js.map +1 -0
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts.map +1 -1
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js +1 -1
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js.map +1 -1
- package/lib/components/template/ListView/DefaultViewMeta.d.ts +1 -90
- package/lib/components/template/ListView/DefaultViewMeta.d.ts.map +1 -1
- package/lib/components/template/ListView/DefaultViewMeta.js.map +1 -1
- package/lib/components/template/ListView/ListView.d.ts.map +1 -1
- package/lib/components/template/ListView/ListView.js +1 -1
- package/lib/components/template/ListView/ListView.js.map +1 -1
- package/lib/components/template/ListView/hooks.d.ts.map +1 -1
- package/lib/components/template/ListView/hooks.js +0 -1
- package/lib/components/template/ListView/hooks.js.map +1 -1
- package/lib/components/template/ListView/utils.d.ts +28 -16
- package/lib/components/template/ListView/utils.d.ts.map +1 -1
- package/lib/components/template/ListView/utils.js +1 -2
- package/lib/components/template/ListView/utils.js.map +1 -1
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts.map +1 -1
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js.map +1 -1
- package/lib/components/template/PromotedFilters/PromotedFilters.d.ts.map +1 -1
- package/lib/components/template/PromotedFilters/PromotedFilters.js +2 -2
- package/lib/components/template/PromotedFilters/PromotedFilters.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +3 -3
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js.map +1 -1
- package/lib/components/template/SubTabs/tabUtils.d.ts.map +1 -1
- package/lib/components/template/SubTabs/tabUtils.js.map +1 -1
- package/lib/components/template/WssNavBar/WssNavBar.js +2 -2
- package/lib/components/template/WssNavBar/WssNavBar.js.map +1 -1
- package/lib/components/widget/Attachment/Attachment.css +15 -3
- package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
- package/lib/components/widget/Attachment/Attachment.js +29 -25
- package/lib/components/widget/Attachment/Attachment.js.map +1 -1
- package/lib/components/widget/CaseHistory/CaseHistory.js +3 -3
- package/lib/components/widget/CaseHistory/CaseHistory.js.map +1 -1
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts.map +1 -1
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.js +17 -17
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.js.map +1 -1
- package/lib/components/widget/QuickCreate/QuickCreate.d.ts.map +1 -1
- package/lib/components/widget/QuickCreate/QuickCreate.js +2 -2
- package/lib/components/widget/QuickCreate/QuickCreate.js.map +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.js +2 -2
- package/lib/components/widget/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/widget/ToDo/ToDo.d.ts.map +1 -1
- package/lib/components/widget/ToDo/ToDo.js +10 -6
- package/lib/components/widget/ToDo/ToDo.js.map +1 -1
- package/lib/components_map.d.ts +3 -3
- package/lib/components_map.d.ts.map +1 -1
- package/lib/components_map.js +819 -818
- package/lib/components_map.js.map +1 -1
- package/lib/doc/KeyReleaseUpdates.md +44 -9
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CancelAlert.d.ts","sourceRoot":"","sources":["../../../../src/components/field/CancelAlert/CancelAlert.tsx"],"names":[],"mappings":";AAIA,OAAO,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"CancelAlert.d.ts","sourceRoot":"","sources":["../../../../src/components/field/CancelAlert/CancelAlert.tsx"],"names":[],"mappings":";AAIA,OAAO,mBAAmB,CAAC;AAM3B,QAAA,MAAM,WAAW,6BAqHhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -10,6 +10,8 @@ const CancelAlert = props => {
|
|
|
10
10
|
const caseInfo = pConn.getCaseInfo();
|
|
11
11
|
const caseName = caseInfo.getName();
|
|
12
12
|
const ID = caseInfo.getID();
|
|
13
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
14
|
+
const localeCategory = 'ModalContainer';
|
|
13
15
|
function showToast(message) {
|
|
14
16
|
setSnackbarMessage(message);
|
|
15
17
|
setShowSnackbar(true);
|
|
@@ -38,7 +40,7 @@ const CancelAlert = props => {
|
|
|
38
40
|
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CASE_CREATED);
|
|
39
41
|
})
|
|
40
42
|
.catch(() => {
|
|
41
|
-
showToast('Save failed');
|
|
43
|
+
showToast(localizedVal('Save failed', localeCategory));
|
|
42
44
|
});
|
|
43
45
|
break;
|
|
44
46
|
case 'continue':
|
|
@@ -53,7 +55,7 @@ const CancelAlert = props => {
|
|
|
53
55
|
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);
|
|
54
56
|
})
|
|
55
57
|
.catch(() => {
|
|
56
|
-
showToast('Delete failed.');
|
|
58
|
+
showToast(localizedVal('Delete failed.', localeCategory));
|
|
57
59
|
});
|
|
58
60
|
break;
|
|
59
61
|
default:
|
|
@@ -65,15 +67,15 @@ const CancelAlert = props => {
|
|
|
65
67
|
React.createElement("div", { className: 'cancel-alert-top' },
|
|
66
68
|
React.createElement("h3", null, `Delete ${caseName}(${ID})`),
|
|
67
69
|
React.createElement("div", null,
|
|
68
|
-
React.createElement("p", null,
|
|
69
|
-
React.createElement("p", null,
|
|
70
|
+
React.createElement("p", null, `${localizedVal('Are you sure you want to delete', localeCategory)} ${caseName} (${ID})?`),
|
|
71
|
+
React.createElement("p", null, localizedVal('Alternatively, you can continue working or save your work for later.', localeCategory))),
|
|
70
72
|
React.createElement("div", { className: 'action-controls' },
|
|
71
73
|
React.createElement(Grid, { container: true, spacing: 4, justifyContent: 'space-between' },
|
|
72
74
|
React.createElement(Grid, { item: true },
|
|
73
|
-
React.createElement(Button, { variant: 'outlined', color: 'primary', onClick: () => buttonClick('save') },
|
|
75
|
+
React.createElement(Button, { variant: 'outlined', color: 'primary', onClick: () => buttonClick('save') }, localizedVal('Save for later', localeCategory))),
|
|
74
76
|
React.createElement(Grid, { item: true },
|
|
75
|
-
React.createElement(Button, { variant: 'outlined', color: 'primary', onClick: () => buttonClick('continue') },
|
|
76
|
-
React.createElement(Button, { variant: 'contained', color: 'primary', onClick: () => buttonClick('delete') },
|
|
77
|
+
React.createElement(Button, { variant: 'outlined', color: 'primary', onClick: () => buttonClick('continue') }, localizedVal('Continue Working', localeCategory)),
|
|
78
|
+
React.createElement(Button, { variant: 'contained', color: 'primary', onClick: () => buttonClick('delete') }, localizedVal('Delete', localeCategory))))))),
|
|
77
79
|
React.createElement(Snackbar, { open: showSnackbar, autoHideDuration: 3000, onClose: handleSnackbarClose, message: snackbarMessage, action: React.createElement(IconButton, { size: 'small', "aria-label": 'close', color: 'inherit', onClick: handleSnackbarClose },
|
|
78
80
|
React.createElement(CloseIcon, { fontSize: 'small' })) })));
|
|
79
81
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CancelAlert.js","sourceRoot":"","sources":["../../../../src/components/field/CancelAlert/CancelAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,SAAS,MAAM,0BAA0B,CAAC;AAEjD,OAAO,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"CancelAlert.js","sourceRoot":"","sources":["../../../../src/components/field/CancelAlert/CancelAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,SAAS,MAAM,0BAA0B,CAAC;AAEjD,OAAO,mBAAmB,CAAC;AAM3B,MAAM,WAAW,GAAG,KAAK,CAAC,EAAE;IAC1B,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAC;IAC1C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAE3D,MAAM,OAAO,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;IACvC,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IACrC,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC;IACpC,MAAM,EAAE,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC;IAC5B,MAAM,YAAY,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC,cAAc,CAAC;IAC3D,MAAM,cA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EAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,IAC7E,YAAY,CAAC,QAAQ,EAAE,cAAc,CAAC,CAChC,CACJ,CACF,CACH,CACF,CACF;QACN,oBAAC,QAAQ,IACP,IAAI,EAAE,YAAY,EAClB,gBAAgB,EAAE,IAAI,EACtB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,eAAe,EACxB,MAAM,EACJ,oBAAC,UAAU,IAAC,IAAI,EAAC,OAAO,gBAAY,OAAO,EAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,mBAAmB;gBACtF,oBAAC,SAAS,IAAC,QAAQ,EAAC,OAAO,GAAG,CACnB,GAEf,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import React, { useState } from 'react';\nimport { Button, Grid, IconButton, Snackbar } from '@material-ui/core';\nimport CloseIcon from '@material-ui/icons/Close';\n\nimport './CancelAlert.css';\n\n// Remove this and use \"real\" PCore type once .d.ts is fixed (currently shows 2 errors)\ndeclare const PCore: any;\n\n\nconst CancelAlert = props => {\n const { pConn, updateAlertState } = props;\n const [showSnackbar, setShowSnackbar] = useState(false);\n const [snackbarMessage, setSnackbarMessage] = useState('');\n\n const itemKey = pConn.getContextName();\n const caseInfo = pConn.getCaseInfo();\n const caseName = caseInfo.getName();\n const ID = caseInfo.getID();\n const localizedVal = PCore.getLocaleUtils().getLocaleValue;\n const localeCategory = 'ModalContainer';\n\n function showToast(message: string) {\n setSnackbarMessage(message);\n setShowSnackbar(true);\n }\n\n const dismissCancelAlertOnly = () => {\n updateAlertState(true);\n };\n\n const dismissModal = () => {\n updateAlertState(false);\n };\n\n function handleSnackbarClose(event: React.SyntheticEvent | React.MouseEvent, reason?: string) {\n if (reason === 'clickaway') {\n return;\n }\n setShowSnackbar(false);\n }\n\n const buttonClick = action => {\n const actionsAPI = pConn.getActionsApi();\n\n switch (action) {\n case 'save':\n // eslint-disable-next-line no-case-declarations\n const savePromise = actionsAPI.saveAndClose(itemKey);\n\n savePromise\n .then(() => {\n dismissModal();\n\n PCore.getPubSubUtils().publish(\n PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CASE_CREATED\n );\n })\n .catch(() => {\n showToast(localizedVal('Save failed', localeCategory));\n });\n break;\n\n case 'continue':\n dismissCancelAlertOnly();\n break;\n\n case 'delete':\n // eslint-disable-next-line no-case-declarations\n const deletePromise = actionsAPI.deleteCaseInCreateStage(itemKey);\n\n deletePromise\n .then(() => {\n dismissModal();\n PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);\n })\n .catch(() => {\n showToast(localizedVal('Delete failed.', localeCategory));\n });\n break;\n\n default:\n break;\n }\n };\n\n return (\n <>\n <div className='cancel-alert-background'>\n <div className='cancel-alert-top'>\n <h3>{`Delete ${caseName}(${ID})`}</h3>\n <div>\n <p>{`${localizedVal('Are you sure you want to delete', localeCategory)} ${caseName} (${ID})?`}</p>\n <p>{localizedVal('Alternatively, you can continue working or save your work for later.', localeCategory)}</p>\n </div>\n <div className='action-controls'>\n <Grid container spacing={4} justifyContent='space-between'>\n <Grid item>\n <Button variant='outlined' color='primary' onClick={() => buttonClick('save')}>\n {localizedVal('Save for later', localeCategory)}\n </Button>\n </Grid>\n <Grid item>\n <Button variant='outlined' color='primary' onClick={() => buttonClick('continue')}>\n {localizedVal('Continue Working', localeCategory)}\n </Button>\n <Button variant='contained' color='primary' onClick={() => buttonClick('delete')}>\n {localizedVal('Delete', localeCategory)}\n </Button>\n </Grid>\n </Grid>\n </div>\n </div>\n </div>\n <Snackbar\n open={showSnackbar}\n autoHideDuration={3000}\n onClose={handleSnackbarClose}\n message={snackbarMessage}\n action={\n <IconButton size='small' aria-label='close' color='inherit' onClick={handleSnackbarClose}>\n <CloseIcon fontSize='small' />\n </IconButton>\n }\n />\n </>\n );\n};\n\nexport default CancelAlert;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Checkbox/Checkbox.tsx"],"names":[],"mappings":";AAWA,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,KAAA,
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Checkbox/Checkbox.tsx"],"names":[],"mappings":";AAWA,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,KAAA,eAqE9C"}
|
|
@@ -3,7 +3,7 @@ import { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText } fr
|
|
|
3
3
|
import handleEvent from '../../helpers/event-utils';
|
|
4
4
|
import FieldValueList from '../../designSystemExtension/FieldValueList';
|
|
5
5
|
export default function CheckboxComponent(props) {
|
|
6
|
-
const { getPConnect, label, value = false, readOnly, testId, required, status, helperText, validatemessage, displayMode, hideLabel } = props;
|
|
6
|
+
const { getPConnect, label, value = false, readOnly, testId, required, disabled, status, helperText, validatemessage, displayMode, hideLabel } = props;
|
|
7
7
|
const helperTextToDisplay = validatemessage || helperText;
|
|
8
8
|
const thePConn = getPConnect();
|
|
9
9
|
const theConfigProps = thePConn.getConfigProps();
|
|
@@ -27,11 +27,11 @@ export default function CheckboxComponent(props) {
|
|
|
27
27
|
const handleBlur = event => {
|
|
28
28
|
thePConn.getValidationApi().validate(event.target.checked);
|
|
29
29
|
};
|
|
30
|
-
let theCheckbox = React.createElement(Checkbox, { color: 'primary' });
|
|
30
|
+
let theCheckbox = React.createElement(Checkbox, { color: 'primary', disabled: disabled });
|
|
31
31
|
if (readOnly) {
|
|
32
32
|
// Workaround for lack of InputProps readOnly from https://github.com/mui-org/material-ui/issues/17043
|
|
33
33
|
// Also note that we need to turn off the onChange call in the FormControlLabel wrapper, too. See below!
|
|
34
|
-
theCheckbox = React.createElement(Checkbox, { value: value || false,
|
|
34
|
+
theCheckbox = React.createElement(Checkbox, { value: value || false, readOnly: readOnly });
|
|
35
35
|
}
|
|
36
36
|
return (React.createElement(FormControl, { required: required, error: status === 'error' },
|
|
37
37
|
React.createElement(FormGroup, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../../src/components/field/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EACL,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,cAAc,MAAM,4CAA4C,CAAC;AAExE,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK;IAC7C,MAAM,EACJ,WAAW,EACX,KAAK,EACL,KAAK,GAAG,KAAK,EACb,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,UAAU,EACV,eAAe,EACf,WAAW,EACX,SAAS,EACV,GAAG,KAAK,CAAC;IACV,MAAM,mBAAmB,GAAG,eAAe,IAAI,UAAU,CAAC;IAE1D,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,cAAc,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;IACjD,MAAM,EAAE,OAAO,EAAE,GAAG,cAAc,CAAC;IACnC,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC;IAC5C,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC;IAEhD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,SAAS,CAAC,GAAG,EAAE;QACb,+FAA+F;QAC/F,UAAU,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,I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AAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC,CAAC;IAEF,IAAI,WAAW,GAAG,oBAAC,QAAQ,IAAC,KAAK,EAAC,SAAS,EAAC,QAAQ,EAAE,QAAQ,GAAI,CAAC;IAEnE,IAAI,QAAQ,EAAE;QACZ,sGAAsG;QACtG,yGAAyG;QACzG,WAAW,GAAG,oBAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAAI,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;KACvE;IAED,OAAO,CACL,oBAAC,WAAW,IAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO;QACxD,oBAAC,SAAS;YACR,oBAAC,gBAAgB,IACf,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EAC9C,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAC1C,KAAK,EAAE,OAAO,EACd,cAAc,EAAC,KAAK,kBACN,MAAM,GACpB,CACQ;QACZ,oBAAC,cAAc,QAAE,mBAAmB,CAAkB,CAC1C,CACf,CAAC;AACJ,CAAC","sourcesContent":["import React, { useState, useEffect } from 'react';\nimport {\n Checkbox,\n FormControl,\n FormControlLabel,\n FormGroup,\n FormHelperText\n} from '@material-ui/core';\nimport handleEvent from '../../helpers/event-utils';\nimport FieldValueList from '../../designSystemExtension/FieldValueList';\n\nexport default function CheckboxComponent(props) {\n const {\n getPConnect,\n label,\n value = false,\n readOnly,\n testId,\n required,\n disabled,\n status,\n helperText,\n validatemessage,\n displayMode,\n hideLabel\n } = props;\n const helperTextToDisplay = validatemessage || helperText;\n\n const thePConn = getPConnect();\n const theConfigProps = thePConn.getConfigProps();\n const { caption } = theConfigProps;\n const actionsApi = thePConn.getActionsApi();\n const propName = thePConn.getStateProps().value;\n\n const [checked, setChecked] = useState(false);\n useEffect(() => {\n // This update theSelectedButton which will update the UI to show the selected button correctly\n setChecked(value);\n }, [value]);\n\n if (displayMode === 'LABELS_LEFT') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;\n }\n\n const handleChange = event => {\n handleEvent(actionsApi, 'changeNblur', propName, event.target.checked);\n };\n\n const handleBlur = event => {\n thePConn.getValidationApi().validate(event.target.checked);\n };\n\n let theCheckbox = <Checkbox color='primary' disabled={disabled} />;\n\n if (readOnly) {\n // Workaround for lack of InputProps readOnly from https://github.com/mui-org/material-ui/issues/17043\n // Also note that we need to turn off the onChange call in the FormControlLabel wrapper, too. See below!\n theCheckbox = <Checkbox value={value || false} readOnly={readOnly} />;\n }\n\n return (\n <FormControl required={required} error={status === 'error'}>\n <FormGroup>\n <FormControlLabel\n control={theCheckbox}\n checked={checked}\n onChange={!readOnly ? handleChange : undefined}\n onBlur={!readOnly ? handleBlur : undefined}\n label={caption}\n labelPlacement='end'\n data-test-id={testId}\n />\n </FormGroup>\n <FormHelperText>{helperTextToDisplay}</FormHelperText>\n </FormControl>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currency-utils.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Currency/currency-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"currency-utils.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Currency/currency-utils.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,kBAAkB,cAAe,MAAM;;;;CAsCnD,CAAA;AAGD,eAAO,MAAM,qBAAqB,cAAe,MAAM;;;;CA2BtD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currency-utils.js","sourceRoot":"","sources":["../../../../src/components/field/Currency/currency-utils.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAC,MAAM,mCAAmC,CAAC;AAC5E,mDAAmD;AACnD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"currency-utils.js","sourceRoot":"","sources":["../../../../src/components/field/Currency/currency-utils.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAC,MAAM,mCAAmC,CAAC;AAC5E,mDAAmD;AACnD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAOnF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,SAAiB,EAAE,EAAE;IAEtD,MAAM,cAAc,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAC,YAAY,EAAE,IAAI,OAAO,CAAC;IAE5E,IAAI,YAAY,GAAG,gBAAgB,CAAC,EAAE,CAAC;IACvC,IAAI,WAAW,GAAG,cAAc,CAAC;IAEjC,iEAAiE;IACjE,8BAA8B;IAC9B,+BAA+B;IAC/B,IAAI,SAAS,EAAE;QACb,IAAI,SAAS,KAAK,KAAK,EAAE;YACvB,YAAY,GAAG,gBAAgB,CAAC,EAAE,CAAC;YACnC,WAAW,GAAG,OAAO,CAAC;SACvB;aAAM;YACL,iFAAiF;YACjF,MAAM,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;YAC7C,YAAY,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;SAC9C;KACF;SAAM,IAAI,cAAc,EAAE;QACzB,6EAA6E;QAC7E,MAAM,WAAW,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9D,YAAY,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;KAC9C;SAAM;QACL,oDAAoD;QACpD,YAAY,GAAG,gBAAgB,CAAC,EAAE,CAAC;KACpC;IAED,gEAAgE;IAChE,IAAI,CAAC,YAAY,EAAE;QACjB,YAAY,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;KACvC;IAED,MAAM,OAAO,GAAG,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1D,MAAM,eAAe,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAA;IAErF,OAAO,eAAe,CAAC;AAEzB,CAAC,CAAA;AAGD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,SAAiB,EAAE,EAAE;IACzD,MAAM,gBAAgB,GAAG;QACvB,iBAAiB,EAAE,GAAG;QACtB,mBAAmB,EAAE,GAAG;QACxB,sBAAsB,EAAE,GAAG;KAC5B,CAAA;IAED,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAEzD,MAAM,SAAS,GAAG,OAAO,CAAC;IAC1B,MAAM,eAAe,GAAG,aAAa,CAAC,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;IAE9E,sDAAsD;IAEtD,4DAA4D;IAC5D,wCAAwC;IACxC,kCAAkC;IAClC,0CAA0C;IAE1C,gBAAgB,CAAC,iBAAiB,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;IACxD,gBAAgB,CAAC,sBAAsB,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;IAC7D,gBAAgB,CAAC,mBAAmB,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;IAE1D,sNAAsN;IAEtN,OAAO,gBAAgB,CAAC;AAE1B,CAAC,CAAA","sourcesContent":["// eslint-disable-next-line import/no-named-default\nimport { default as CurrencyAlias} from '../../helpers/formatters/Currency';\n// eslint-disable-next-line import/no-named-default\nimport { default as CurrencyMapAlias } from '../../helpers/formatters/CurrencyMap';\n\nimport PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';\n\ndeclare const PCore: typeof PCoreType;\n\n\nexport const getCurrencyOptions = (inISOCode: string) => {\n\n const operatorLocale = PCore.getEnvironmentInfo().getUseLocale() || 'en-US';\n\n let currMapToUse = CurrencyMapAlias.US;\n let localeToUse = operatorLocale;\n\n // Determine CurrencyMap lookup based on ISO code (if specified).\n // If no ISO code, use locale\n // If no locale, default to US\n if (inISOCode) {\n if (inISOCode === \"EUR\") {\n currMapToUse = CurrencyMapAlias.NL;\n localeToUse = \"nl-NL\";\n } else {\n // For all other ISO codes, use first 2 characters as the lookup from CurrencyMap\n const countryCode = inISOCode.substring(0,2);\n currMapToUse = CurrencyMapAlias[countryCode];\n }\n } else if (operatorLocale) {\n // No ISO Code so check for operator locale (and force upper case for lookup)\n const countryCode = operatorLocale.substring(3).toUpperCase();\n currMapToUse = CurrencyMapAlias[countryCode];\n } else {\n // no ISO code and no operator locale, default to US\n currMapToUse = CurrencyMapAlias.US;\n }\n\n // If no currMapToUse at this point, default to US as a failsafe\n if (!currMapToUse) {\n currMapToUse = CurrencyMapAlias['US'];\n }\n\n const theCode = currMapToUse.currencyCode.substring(0, 3);\n const currencyOptions = { locale: localeToUse, style: \"currency\", currency: theCode }\n\n return currencyOptions;\n\n}\n\n\nexport const getCurrencyCharacters = (inISOCode: string) => {\n const theCurrencyChars = {\n theCurrencySymbol: '$',\n theDecimalIndicator: '.',\n theDigitGroupSeparator: ','\n }\n\n const theCurrencyOptions = getCurrencyOptions(inISOCode);\n\n const testValue = 1234.56;\n const formattedString = CurrencyAlias.Currency(testValue, theCurrencyOptions);\n\n // console.log(`formattedString: ${formattedString}`);\n\n // Here, we have the formatted string (ex: $1,234.56) where:\n // Currency symbol = formattedString[0]\n // Separator = formattedString[2]\n // DecimalIndicator = formattedString[6];\n\n theCurrencyChars.theCurrencySymbol = formattedString[0];\n theCurrencyChars.theDigitGroupSeparator = formattedString[2];\n theCurrencyChars.theDecimalIndicator = formattedString[6];\n\n // console.log(`theCurrencyChars: symbol: ${theCurrencyChars.theCurrencySymbol} | theDigitGroupSeparator: ${theCurrencyChars.theDigitGroupSeparator} | theDecimalIndicator: ${theCurrencyChars.theDecimalIndicator}`);\n\n return theCurrencyChars;\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Date.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Date/Date.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Date.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Date/Date.tsx"],"names":[],"mappings":";AAaA,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,KAAA,eAwFjC"}
|
|
@@ -3,8 +3,12 @@ import { KeyboardDatePicker } from '@material-ui/pickers';
|
|
|
3
3
|
import TextInput from '../TextInput';
|
|
4
4
|
import handleEvent from '../../helpers/event-utils';
|
|
5
5
|
import FieldValueList from '../../designSystemExtension/FieldValueList';
|
|
6
|
-
import { format } from '../../helpers/formatters
|
|
6
|
+
import { format } from '../../helpers/formatters';
|
|
7
7
|
import { dateFormatInfoDefault, getDateFormatInfo } from '../../helpers/date-format-utils';
|
|
8
|
+
// Will return the date string in YYYY-MM-DD format which we'll be POSTing to the server
|
|
9
|
+
function getFormattedDate(date) {
|
|
10
|
+
return `${date.$y.toString()}-${(date.$M + 1).toString().padStart(2, '0')}-${date.$D.toString().padStart(2, '0')}`;
|
|
11
|
+
}
|
|
8
12
|
export default function Date(props) {
|
|
9
13
|
const { getPConnect, label, required, disabled, value = '', validatemessage, status, onChange, onBlur, readOnly, testId, helperText, displayMode, hideLabel } = props;
|
|
10
14
|
const pConn = getPConnect();
|
|
@@ -35,12 +39,14 @@ export default function Date(props) {
|
|
|
35
39
|
'data-test-id': testId
|
|
36
40
|
};
|
|
37
41
|
const handleChange = date => {
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
if (date && date.isValid()) {
|
|
43
|
+
onChange({ value: getFormattedDate(date) });
|
|
44
|
+
}
|
|
40
45
|
};
|
|
41
46
|
const handleAccept = date => {
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
if (date && date.isValid()) {
|
|
48
|
+
handleEvent(actions, 'changeNblur', propName, getFormattedDate(date));
|
|
49
|
+
}
|
|
44
50
|
};
|
|
45
51
|
return (React.createElement(KeyboardDatePicker, { disableToolbar: true, variant: 'inline', inputVariant: 'outlined', placeholder: dateFormatInfo.dateFormatStringLC, format: dateFormatInfo.dateFormatString, mask: dateFormatInfo.dateFormatMask, fullWidth: true, autoOk: true, required: required, disabled: disabled, error: status === 'error', helperText: helperTextToDisplay, size: 'small', label: label, value: value || null, onChange: handleChange, onBlur: !readOnly ? onBlur : undefined, onAccept: handleAccept, InputProps: { ...testProp } }));
|
|
46
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Date.js","sourceRoot":"","sources":["../../../../src/components/field/Date/Date.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,cAAc,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Date.js","sourceRoot":"","sources":["../../../../src/components/field/Date/Date.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,cAAc,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAC,MAAM,iCAAiC,CAAC;AAE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AAE,cAAc,CAAC,gBAAgB,EACvC,IAAI,EAAE,cAAc,CAAC,cAAc,EACnC,SAAS,QACT,MAAM,QACN,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,KAAK,OAAO,EACzB,UAAU,EAAE,mBAAmB,EAC/B,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,IAAI,IAAI,EACpB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACtC,QAAQ,EAAE,YAAY,EACtB,UAAU,EAAE,EAAE,GAAG,QAAQ,EAAE,GAC3B,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { KeyboardDatePicker } from '@material-ui/pickers';\nimport TextInput from '../TextInput';\nimport handleEvent from '../../helpers/event-utils';\nimport FieldValueList from '../../designSystemExtension/FieldValueList';\nimport { format } from '../../helpers/formatters';\nimport { dateFormatInfoDefault, getDateFormatInfo} from '../../helpers/date-format-utils';\n\n// Will return the date string in YYYY-MM-DD format which we'll be POSTing to the server\nfunction getFormattedDate(date){\n return `${date.$y.toString()}-${(date.$M + 1).toString().padStart(2, '0')}-${date.$D.toString().padStart(2, '0')}`;\n}\n\nexport default function Date(props) {\n const {\n getPConnect,\n label,\n required,\n disabled,\n value = '',\n validatemessage,\n status,\n onChange,\n onBlur,\n readOnly,\n testId,\n helperText,\n displayMode,\n hideLabel\n } = props;\n\n const pConn = getPConnect();\n const actions = pConn.getActionsApi();\n const propName = pConn.getStateProps().value;\n const helperTextToDisplay = validatemessage || helperText;\n\n // Start with default dateFormatInfo\n const dateFormatInfo = dateFormatInfoDefault;\n // and then update, as needed, based on locale, etc.\n const theDateFormat = getDateFormatInfo()\n dateFormatInfo.dateFormatString = theDateFormat.dateFormatString;\n dateFormatInfo.dateFormatStringLC = theDateFormat.dateFormatStringLC;\n dateFormatInfo.dateFormatMask = theDateFormat.dateFormatMask;\n\n\n if (displayMode === 'LABELS_LEFT') {\n const formattedDate = format(props.value, 'date', { format: dateFormatInfo.dateFormatString });\n return <FieldValueList name={hideLabel ? '' : label} value={formattedDate} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n const formattedDate = format(props.value, 'date', { format: dateFormatInfo.dateFormatString });\n return <FieldValueList name={hideLabel ? '' : label} value={formattedDate} variant='stacked' />;\n }\n\n if (readOnly) {\n // const theReadOnlyComp = <TextInput props />\n return <TextInput {...props} />;\n }\n\n let testProp = {};\n\n testProp = {\n 'data-test-id': testId\n };\n\n const handleChange = date => {\n if(date && date.isValid()){\n onChange({ value: getFormattedDate(date) });\n }\n };\n\n const handleAccept = date => {\n if(date && date.isValid()){\n handleEvent(actions, 'changeNblur', propName, getFormattedDate(date));\n }\n };\n\n return (\n <KeyboardDatePicker\n disableToolbar\n variant='inline'\n inputVariant='outlined'\n placeholder={dateFormatInfo.dateFormatStringLC}\n format={dateFormatInfo.dateFormatString}\n mask={dateFormatInfo.dateFormatMask}\n fullWidth\n autoOk\n required={required}\n disabled={disabled}\n error={status === 'error'}\n helperText={helperTextToDisplay}\n size='small'\n label={label}\n value={value || null}\n onChange={handleChange}\n onBlur={!readOnly ? onBlur : undefined}\n onAccept={handleAccept}\n InputProps={{ ...testProp }}\n />\n );\n}\n"]}
|
|
@@ -3,7 +3,7 @@ import { KeyboardDateTimePicker } from '@material-ui/pickers';
|
|
|
3
3
|
import TextInput from '../TextInput';
|
|
4
4
|
import handleEvent from '../../helpers/event-utils';
|
|
5
5
|
import FieldValueList from '../../designSystemExtension/FieldValueList';
|
|
6
|
-
import { format } from '../../helpers/formatters
|
|
6
|
+
import { format } from '../../helpers/formatters';
|
|
7
7
|
import { dateFormatInfoDefault, getDateFormatInfo } from '../../helpers/date-format-utils';
|
|
8
8
|
export default function DateTime(props) {
|
|
9
9
|
const { getPConnect, label, required, disabled, value = '', validatemessage, status, onChange, readOnly, testId, helperText, displayMode, hideLabel } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTime.js","sourceRoot":"","sources":["../../../../src/components/field/DateTime/DateTime.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,cAAc,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"DateTime.js","sourceRoot":"","sources":["../../../../src/components/field/DateTime/DateTime.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,cAAc,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAC,MAAM,iCAAiC,CAAC;AAE1F,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK;IACpC,MAAM,EACJ,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,KAAK,GAAG,EAAE,EACV,eAAe,EACf,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,UAAU,EACV,WAAW,EACX,SAAS,EACV,GAAG,KAAK,CAAC;IAEV,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC;IAC5B,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;IACtC,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC;IAC7C,MAAM,mBAAmB,GAA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AAG,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACvE,QAAQ,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;IACnC,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,CAAC,EAAE;QAC1B,MAAM,WAAW,GAAG,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACvE,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;IAC7D,CAAC,CAAC;IAEF,EAAE;IACF,iGAAiG;IACjG,8DAA8D;IAC9D,EAAE;IAEF,OAAO,CACL,oBAAC,sBAAsB,IACrB,OAAO,EAAC,QAAQ,EAChB,YAAY,EAAC,UAAU,EACvB,SAAS,QACT,MAAM,QACN,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,GAAG,cAAc,CAAC,kBAAkB,UAAU,EAC3D,MAAM,EAAE,GAAG,cAAc,CAAC,gBAAgB,UAAU,EACpD,IAAI,EAAE,GAAG,cAAc,CAAC,cAAc,WAAW,EACjD,WAAW,EAAE,CAAC,EACd,KAAK,EAAE,MAAM,KAAK,OAAO,EACzB,UAAU,EAAE,mBAAmB,EAC/B,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,IAAI,IAAI,EACpB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,YAAY,kBACR,MAAM,GACpB,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { KeyboardDateTimePicker } from '@material-ui/pickers';\nimport TextInput from '../TextInput';\nimport handleEvent from '../../helpers/event-utils';\nimport FieldValueList from '../../designSystemExtension/FieldValueList';\nimport { format } from '../../helpers/formatters';\nimport { dateFormatInfoDefault, getDateFormatInfo} from '../../helpers/date-format-utils';\n\nexport default function DateTime(props) {\n const {\n getPConnect,\n label,\n required,\n disabled,\n value = '',\n validatemessage,\n status,\n onChange,\n readOnly,\n testId,\n helperText,\n displayMode,\n hideLabel\n } = props;\n\n const pConn = getPConnect();\n const actions = pConn.getActionsApi();\n const propName = pConn.getStateProps().value;\n const helperTextToDisplay = validatemessage || helperText;\n\n // Start with default dateFormatInfo\n const dateFormatInfo = dateFormatInfoDefault;\n // and then update, as needed, based on locale, etc.\n const theDateFormat = getDateFormatInfo()\n dateFormatInfo.dateFormatString = theDateFormat.dateFormatString;\n dateFormatInfo.dateFormatStringLC = theDateFormat.dateFormatStringLC;\n dateFormatInfo.dateFormatMask = theDateFormat.dateFormatMask;\n\n\n if (displayMode === 'LABELS_LEFT') {\n const formattedDateTime = format(props.value, 'datetime', { format: `${dateFormatInfo.dateFormatString} hh:mm a` });\n return <FieldValueList name={hideLabel ? '' : label} value={formattedDateTime} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n const formattedDateTime = format(props.value, 'datetime', { format: `${dateFormatInfo.dateFormatString} hh:mm a` });\n return <FieldValueList name={hideLabel ? '' : label} value={formattedDateTime} variant='stacked' />;\n }\n\n if (readOnly) {\n const formattedDateTime = format(props.value, 'datetime');\n return <TextInput {...props} value={formattedDateTime} />;\n }\n\n const handleChange = date => {\n const changeValue = date && date.isValid() ? date.toISOString() : null;\n onChange({ value: changeValue });\n };\n\n const handleAccept = date => {\n const changeValue = date && date.isValid() ? date.toISOString() : null;\n handleEvent(actions, 'changeNblur', propName, changeValue);\n };\n\n //\n // TODO: Keyboard doesn't work in the minute field, it updates one digit then jump to am/pm field\n // try an older version of the lib or use DateTimePicker\n //\n\n return (\n <KeyboardDateTimePicker\n variant='inline'\n inputVariant='outlined'\n fullWidth\n autoOk\n required={required}\n disabled={disabled}\n placeholder={`${dateFormatInfo.dateFormatStringLC} hh:mm a`}\n format={`${dateFormatInfo.dateFormatString} hh:mm a`}\n mask={`${dateFormatInfo.dateFormatMask} __:__ _m`}\n minutesStep={5}\n error={status === 'error'}\n helperText={helperTextToDisplay}\n size='small'\n label={label}\n value={value || null}\n onChange={handleChange}\n onAccept={handleAccept}\n data-test-id={testId}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Decimal.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Decimal/Decimal.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Decimal.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Decimal/Decimal.tsx"],"names":[],"mappings":";AASA,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,KAAA,eA+FpC"}
|
|
@@ -1,19 +1,52 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import TextInput from '../TextInput';
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import CurrencyTextField from '@unicef/material-ui-currency-textfield';
|
|
4
3
|
import FieldValueList from '../../designSystemExtension/FieldValueList';
|
|
4
|
+
import { getCurrencyCharacters, getCurrencyOptions } from '../Currency/currency-utils';
|
|
5
|
+
import handleEvent from '../../helpers/event-utils';
|
|
6
|
+
import { format } from "../../helpers/formatters";
|
|
7
|
+
// Using control from: https://github.com/unicef/material-ui-currency-textfield
|
|
5
8
|
export default function Decimal(props) {
|
|
6
|
-
const { label, required, disabled, value = '', validatemessage, status,
|
|
9
|
+
const { getPConnect, label, required, disabled, value = '', validatemessage, status,
|
|
10
|
+
/* onChange, onBlur, */
|
|
11
|
+
readOnly, helperText, displayMode, hideLabel, currencyISOCode = "USD", decimalPrecision = 2, showGroupSeparators = true, testId } = props;
|
|
12
|
+
const pConn = getPConnect();
|
|
13
|
+
const actions = pConn.getActionsApi();
|
|
14
|
+
const propName = pConn.getStateProps().value;
|
|
7
15
|
const helperTextToDisplay = validatemessage || helperText;
|
|
16
|
+
const [decValue, setDecimalvalue] = useState();
|
|
17
|
+
const [theCurrDec, setCurrDec] = useState(".");
|
|
18
|
+
const [theCurrSep, setCurrSep] = useState(",");
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
21
|
+
setCurrDec(theSymbols.theDecimalIndicator);
|
|
22
|
+
setCurrSep(theSymbols.theDigitGroupSeparator);
|
|
23
|
+
}, [currencyISOCode]);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
setDecimalvalue(value.toString());
|
|
26
|
+
}, [value]);
|
|
27
|
+
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
28
|
+
const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
|
|
8
29
|
if (displayMode === 'LABELS_LEFT') {
|
|
9
|
-
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value:
|
|
30
|
+
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: formattedValue });
|
|
10
31
|
}
|
|
11
32
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
12
|
-
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value:
|
|
33
|
+
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: formattedValue, variant: 'stacked' });
|
|
13
34
|
}
|
|
35
|
+
let readOnlyProp = {}; // Note: empty if NOT ReadOnly
|
|
14
36
|
if (readOnly) {
|
|
15
|
-
|
|
37
|
+
readOnlyProp = { readOnly: true };
|
|
16
38
|
}
|
|
17
|
-
|
|
39
|
+
let testProp = {};
|
|
40
|
+
testProp = {
|
|
41
|
+
'data-test-id': testId
|
|
42
|
+
};
|
|
43
|
+
function decimalOnChange(event) {
|
|
44
|
+
// update internal value
|
|
45
|
+
setDecimalvalue(event?.target?.value);
|
|
46
|
+
}
|
|
47
|
+
function decimalOnBlur(event, inValue) {
|
|
48
|
+
handleEvent(actions, 'changeNblur', propName, inValue !== '' ? Number(inValue) : inValue);
|
|
49
|
+
}
|
|
50
|
+
return (React.createElement(CurrencyTextField, { fullWidth: true, variant: readOnly ? 'standard' : 'outlined', helperText: helperTextToDisplay, placeholder: '', size: 'small', required: required, disabled: disabled, onChange: decimalOnChange, onBlur: !readOnly ? decimalOnBlur : undefined, error: status === 'error', label: label, value: decValue, type: 'text', outputFormat: 'number', textAlign: 'left', InputProps: { ...readOnlyProp, inputProps: { ...testProp, value: decValue } }, currencySymbol: '', decimalCharacter: theCurrDec, digitGroupSeparator: showGroupSeparators ? theCurrSep : '', decimalPlaces: decimalPrecision }));
|
|
18
51
|
}
|
|
19
52
|
//# sourceMappingURL=Decimal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Decimal.js","sourceRoot":"","sources":["../../../../src/components/field/Decimal/Decimal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Decimal.js","sourceRoot":"","sources":["../../../../src/components/field/Decimal/Decimal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,iBAAiB,MAAM,wCAAwC,CAAC;AACvE,OAAO,cAAc,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,+EAA+E;AAE/E,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK;IACnC,MAAM,EACJ,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,KAAK,GAAG,EAAE,EACV,eAAe,EACf,MAAM;IACN,uBAAuB;IACvB,QAAQ,EACR,UAAU,EACV,WAAW,EACX,SAAS,EACT,eAAe,GAAG,KAAK,EACvB,gBAAgB,GAAG,CAAC,EACpB,mBAAmB,GAAG,IAAI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,MAAM,EAChB,UAAU,EAAE,EAAE,GAAG,YAAY,EAAE,UAAU,EAAE,EAAE,GAAG,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAC7E,cAAc,EAAC,EAAE,EACjB,gBAAgB,EAAE,UAAU,EAC5B,mBAAmB,EAAE,mBAAmB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAC1D,aAAa,EAAE,gBAAgB,GAC/B,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React, { useState, useEffect } from 'react';\nimport CurrencyTextField from '@unicef/material-ui-currency-textfield';\nimport FieldValueList from '../../designSystemExtension/FieldValueList';\nimport { getCurrencyCharacters, getCurrencyOptions } from '../Currency/currency-utils';\nimport handleEvent from '../../helpers/event-utils';\nimport { format } from \"../../helpers/formatters\";\n\n// Using control from: https://github.com/unicef/material-ui-currency-textfield\n\nexport default function Decimal(props) {\n const {\n getPConnect,\n label,\n required,\n disabled,\n value = '',\n validatemessage,\n status,\n /* onChange, onBlur, */\n readOnly,\n helperText,\n displayMode,\n hideLabel,\n currencyISOCode = \"USD\",\n decimalPrecision = 2,\n showGroupSeparators = true,\n testId\n } = props;\n\n const pConn = getPConnect();\n const actions = pConn.getActionsApi();\n const propName = pConn.getStateProps().value;\n const helperTextToDisplay = validatemessage || helperText;\n\n const [decValue, setDecimalvalue] = useState();\n const [theCurrDec, setCurrDec] = useState(\".\");\n const [theCurrSep, setCurrSep] = useState(\",\");\n\n useEffect(() => {\n const theSymbols = getCurrencyCharacters(currencyISOCode);\n setCurrDec(theSymbols.theDecimalIndicator);\n setCurrSep(theSymbols.theDigitGroupSeparator);\n }, [currencyISOCode]);\n\n useEffect(() => {\n setDecimalvalue(value.toString());\n }, [value]);\n\n const theCurrencyOptions = getCurrencyOptions(currencyISOCode);\n const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);\n\n if (displayMode === 'LABELS_LEFT') {\n return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;\n }\n\n let readOnlyProp = {}; // Note: empty if NOT ReadOnly\n\n if (readOnly) {\n readOnlyProp = { readOnly: true };\n }\n\n let testProp = {};\n\n testProp = {\n 'data-test-id': testId\n };\n\n function decimalOnChange(event) {\n // update internal value\n setDecimalvalue(event?.target?.value);\n }\n\n function decimalOnBlur(event, inValue) {\n handleEvent(actions, 'changeNblur', propName, inValue !== '' ? Number(inValue) : inValue);\n }\n\n return (\n <CurrencyTextField\n fullWidth\n variant={readOnly ? 'standard' : 'outlined'}\n helperText={helperTextToDisplay}\n placeholder=''\n size='small'\n required={required}\n disabled={disabled}\n onChange={decimalOnChange}\n onBlur={!readOnly ? decimalOnBlur : undefined}\n error={status === 'error'}\n label={label}\n value={decValue}\n type='text'\n outputFormat='number'\n textAlign='left'\n InputProps={{ ...readOnlyProp, inputProps: { ...testProp, value: decValue } }}\n currencySymbol=''\n decimalCharacter={theCurrDec}\n digitGroupSeparator={showGroupSeparators ? theCurrSep : ''}\n decimalPlaces={decimalPrecision}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Dropdown/Dropdown.tsx"],"names":[],"mappings":";AAYA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,KAAA,
|
|
1
|
+
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Dropdown/Dropdown.tsx"],"names":[],"mappings":";AAYA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,KAAA,sBA2HrC"}
|
|
@@ -5,23 +5,37 @@ import Utils from '../../helpers/utils';
|
|
|
5
5
|
import handleEvent from '../../helpers/event-utils';
|
|
6
6
|
import FieldValueList from '../../designSystemExtension/FieldValueList';
|
|
7
7
|
export default function Dropdown(props) {
|
|
8
|
-
const { getPConnect, label, required, disabled,
|
|
8
|
+
const { getPConnect, label, required, disabled, value = '', datasource = [], validatemessage, status, readOnly, testId, helperText, displayMode, hideLabel, onRecordChange, fieldMetadata } = props;
|
|
9
|
+
let { placeholder } = props;
|
|
10
|
+
placeholder = placeholder || 'Select...';
|
|
9
11
|
const [options, setOptions] = useState([]);
|
|
10
12
|
const helperTextToDisplay = validatemessage || helperText;
|
|
11
13
|
const thePConn = getPConnect();
|
|
12
14
|
const actionsApi = thePConn.getActionsApi();
|
|
13
15
|
const propName = thePConn.getStateProps().value;
|
|
16
|
+
const className = thePConn.getCaseInfo().getClassName();
|
|
17
|
+
const refName = propName?.slice(propName.lastIndexOf('.') + 1);
|
|
14
18
|
useEffect(() => {
|
|
15
|
-
const
|
|
16
|
-
optionsList
|
|
19
|
+
const list = Utils.getOptionList(props, getPConnect().getDataObject());
|
|
20
|
+
const optionsList = [...list];
|
|
21
|
+
optionsList.unshift({ key: placeholder, value: thePConn.getLocalizedValue(placeholder) });
|
|
17
22
|
setOptions(optionsList);
|
|
18
23
|
}, [datasource]);
|
|
24
|
+
const metaData = Array.isArray(fieldMetadata)
|
|
25
|
+
? fieldMetadata.filter(field => field?.classID === className)[0]
|
|
26
|
+
: fieldMetadata;
|
|
27
|
+
let displayName = metaData?.datasource?.propertyForDisplayText;
|
|
28
|
+
displayName = displayName?.slice(displayName.lastIndexOf('.') + 1);
|
|
29
|
+
const localeContext = metaData?.datasource?.tableType === 'DataPage' ? 'datapage' : 'associated';
|
|
30
|
+
const localeClass = localeContext === 'datapage' ? '@baseclass' : className;
|
|
31
|
+
const localeName = localeContext === 'datapage' ? metaData?.datasource?.name : refName;
|
|
32
|
+
const localePath = localeContext === 'datapage' ? displayName : localeName;
|
|
19
33
|
let readOnlyProp = {};
|
|
20
34
|
if (displayMode === 'LABELS_LEFT') {
|
|
21
|
-
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value });
|
|
35
|
+
return (React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)) }));
|
|
22
36
|
}
|
|
23
37
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
24
|
-
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value, variant: 'stacked' });
|
|
38
|
+
return (React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)), variant: 'stacked' }));
|
|
25
39
|
}
|
|
26
40
|
if (readOnly) {
|
|
27
41
|
readOnlyProp = { readOnly: true };
|
|
@@ -31,7 +45,7 @@ export default function Dropdown(props) {
|
|
|
31
45
|
'data-test-id': testId
|
|
32
46
|
};
|
|
33
47
|
const handleChange = evt => {
|
|
34
|
-
const selectedValue = evt.target.value ===
|
|
48
|
+
const selectedValue = evt.target.value === placeholder ? '' : evt.target.value;
|
|
35
49
|
handleEvent(actionsApi, 'changeNblur', propName, selectedValue);
|
|
36
50
|
if (onRecordChange) {
|
|
37
51
|
onRecordChange(evt);
|
|
@@ -39,6 +53,6 @@ export default function Dropdown(props) {
|
|
|
39
53
|
};
|
|
40
54
|
// Material UI shows a warning if the component is rendered before options are set.
|
|
41
55
|
// So, hold off on rendering anything until options are available...
|
|
42
|
-
return options.length === 0 ? null : (React.createElement(TextField, { fullWidth: true, variant: readOnly ? 'standard' : 'outlined', helperText: helperTextToDisplay, placeholder: placeholder, size: 'small', required: required, disabled: disabled, onChange: !readOnly ? handleChange : undefined, error: status === 'error', label: label, value: value === '' && !readOnly ?
|
|
56
|
+
return options.length === 0 ? null : (React.createElement(TextField, { fullWidth: true, variant: readOnly ? 'standard' : 'outlined', helperText: helperTextToDisplay, placeholder: thePConn.getLocalizedValue(placeholder), size: 'small', required: required, disabled: disabled, onChange: !readOnly ? handleChange : undefined, error: status === 'error', label: label, value: value === '' && !readOnly ? placeholder : value, select: true, InputProps: { ...readOnlyProp, ...testProp } }, options.map((option) => (React.createElement(MenuItem, { key: option.key, value: option.key }, thePConn.getLocalizedValue(option.value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)))))));
|
|
43
57
|
}
|
|
44
58
|
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../../src/components/field/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAClD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,cAAc,MAAM,4CAA4C,CAAC;AAOxE,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK;IACpC,MAAM,EACJ,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../../src/components/field/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAClD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,cAAc,MAAM,4CAA4C,CAAC;AAOxE,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK;IACpC,MAAM,EACJ,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,KAAK,GAAG,EAAE,EACV,UAAU,GAAG,EAAE,EACf,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,CAAC,CAAC,CAAC,KAAK,EACtD,MAAM,QACN,UAAU,EAAE,EAAE,GAAG,YAAY,EAAE,GAAG,QAAQ,EAAE,IAE3C,OAAO,CAAC,GAAG,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,CAC5B,oBAAC,QAAQ,IAAC,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,IACzC,QAAQ,CAAC,iBAAiB,CACzB,MAAM,CAAC,KAAK,EACZ,UAAU,EACV,QAAQ,CAAC,yBAAyB,CAAC,WAAW,EAAE,aAAa,EAAE,UAAU,CAAC,CAC3E,CACQ,CACZ,CAAC,CACQ,CACb,CAAC;AACJ,CAAC","sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { TextField } from '@material-ui/core';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Utils from '../../helpers/utils';\nimport handleEvent from '../../helpers/event-utils';\nimport FieldValueList from '../../designSystemExtension/FieldValueList';\n\ninterface IOption {\n key: string;\n value: string;\n}\n\nexport default function Dropdown(props) {\n const {\n getPConnect,\n label,\n required,\n disabled,\n value = '',\n datasource = [],\n validatemessage,\n status,\n readOnly,\n testId,\n helperText,\n displayMode,\n hideLabel,\n onRecordChange,\n fieldMetadata\n } = props;\n let { placeholder } = props;\n placeholder = placeholder || 'Select...';\n const [options, setOptions] = useState<Array<IOption>>([]);\n const helperTextToDisplay = validatemessage || helperText;\n\n const thePConn = getPConnect();\n const actionsApi = thePConn.getActionsApi();\n const propName = thePConn.getStateProps().value;\n const className = thePConn.getCaseInfo().getClassName();\n const refName = propName?.slice(propName.lastIndexOf('.') + 1);\n\n useEffect(() => {\n const list = Utils.getOptionList(props, getPConnect().getDataObject());\n const optionsList = [...list];\n optionsList.unshift({ key: placeholder, value: thePConn.getLocalizedValue(placeholder) });\n setOptions(optionsList);\n }, [datasource]);\n\n const metaData = Array.isArray(fieldMetadata)\n ? fieldMetadata.filter(field => field?.classID === className)[0]\n : fieldMetadata;\n\n let displayName = metaData?.datasource?.propertyForDisplayText;\n displayName = displayName?.slice(displayName.lastIndexOf('.') + 1);\n const localeContext = metaData?.datasource?.tableType === 'DataPage' ? 'datapage' : 'associated';\n const localeClass = localeContext === 'datapage' ? '@baseclass' : className;\n const localeName = localeContext === 'datapage' ? metaData?.datasource?.name : refName;\n const localePath = localeContext === 'datapage' ? displayName : localeName;\n\n let readOnlyProp = {};\n\n if (displayMode === 'LABELS_LEFT') {\n return (\n <FieldValueList\n name={hideLabel ? '' : label}\n value={thePConn.getLocalizedValue(\n value,\n localePath,\n thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)\n )}\n />\n );\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return (\n <FieldValueList\n name={hideLabel ? '' : label}\n value={thePConn.getLocalizedValue(\n value,\n localePath,\n thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)\n )}\n variant='stacked'\n />\n );\n }\n\n if (readOnly) {\n readOnlyProp = { readOnly: true };\n }\n\n let testProp = {};\n\n testProp = {\n 'data-test-id': testId\n };\n\n const handleChange = evt => {\n const selectedValue = evt.target.value === placeholder ? '' : evt.target.value;\n handleEvent(actionsApi, 'changeNblur', propName, selectedValue);\n if (onRecordChange) {\n onRecordChange(evt);\n }\n };\n\n // Material UI shows a warning if the component is rendered before options are set.\n // So, hold off on rendering anything until options are available...\n return options.length === 0 ? null : (\n <TextField\n fullWidth\n variant={readOnly ? 'standard' : 'outlined'}\n helperText={helperTextToDisplay}\n placeholder={thePConn.getLocalizedValue(placeholder)}\n size='small'\n required={required}\n disabled={disabled}\n onChange={!readOnly ? handleChange : undefined}\n error={status === 'error'}\n label={label}\n value={value === '' && !readOnly ? placeholder : value}\n select\n InputProps={{ ...readOnlyProp, ...testProp }}\n >\n {options.map((option: any) => (\n <MenuItem key={option.key} value={option.key}>\n {thePConn.getLocalizedValue(\n option.value,\n localePath,\n thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)\n )}\n </MenuItem>\n ))}\n </TextField>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Phone.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Phone/Phone.tsx"],"names":[],"mappings":";AAIA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAK,KAAA,
|
|
1
|
+
{"version":3,"file":"Phone.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Phone/Phone.tsx"],"names":[],"mappings":";AAIA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAK,KAAA,eAuFlC"}
|
|
@@ -18,7 +18,8 @@ export default function Phone(props) {
|
|
|
18
18
|
const disableDropdown = true;
|
|
19
19
|
return (React.createElement("div", null,
|
|
20
20
|
React.createElement(MuiPhoneNumber, { fullWidth: true, helperText: helperTextToDisplay, placeholder: '', size: 'small', required: required, disabled: disabled, onChange: onChange, error: status === 'error', label: label, value: value, InputProps: {
|
|
21
|
-
readOnly: true
|
|
21
|
+
readOnly: true,
|
|
22
|
+
inputProps: { ...testProp }
|
|
22
23
|
}, disableDropdown: disableDropdown })));
|
|
23
24
|
}
|
|
24
25
|
const handleChange = inputVal => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Phone.js","sourceRoot":"","sources":["../../../../src/components/field/Phone/Phone.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,MAAM,0BAA0B,CAAC;AACtD,OAAO,cAAc,MAAM,4CAA4C,CAAC;AAExE,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAK;IACjC,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,KAAK,GAAG,EAAE,EACV,eAAe,EACf,MAAM,EACN,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,UAAU,EACV,WAAW,EACX,SAAS,EACV,GAAG,KAAK,CAAC;IACV,MAAM,mBAAmB,GAAG,eAAe,IAAI,UA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AU,GAAG,IAAI,UAAU,EAAE,CAAC;QAC9B,QAAQ,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;IAClC,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,KAAK,CAAC,EAAE;QACzB,MAAM,UAAU,GAAG,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;QACxC,KAAK,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,UAAU,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;QACxE,MAAM,CAAC,KAAK,CAAC,CAAC;IAChB,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,cAAc,IACb,SAAS,QACT,OAAO,EAAC,UAAU,EAClB,UAAU,EAAE,mBAAmB,EAC/B,WAAW,EAAC,EAAE,EACd,IAAI,EAAC,OAAO,EACZ,cAAc,EAAC,IAAI,EACnB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAC1C,KAAK,EAAE,MAAM,KAAK,OAAO,EACzB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,EAAE,GAAG,QAAQ,EAAE,GAC3B,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport MuiPhoneNumber from 'material-ui-phone-number';\nimport FieldValueList from '../../designSystemExtension/FieldValueList';\n\nexport default function Phone(props) {\n const {\n label,\n required,\n disabled,\n value = '',\n validatemessage,\n status,\n onChange,\n onBlur,\n readOnly,\n testId,\n helperText,\n displayMode,\n hideLabel\n } = props;\n const helperTextToDisplay = validatemessage || helperText;\n\n let testProp = {};\n\n testProp = {\n 'data-test-id': testId\n };\n\n if (displayMode === 'LABELS_LEFT') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;\n }\n\n if (readOnly) {\n const disableDropdown = true;\n return (\n <div>\n <MuiPhoneNumber\n fullWidth\n helperText={helperTextToDisplay}\n placeholder=''\n size='small'\n required={required}\n disabled={disabled}\n onChange={onChange}\n error={status === 'error'}\n label={label}\n value={value}\n InputProps={{\n readOnly: true,\n inputProps: { ...testProp }\n }}\n disableDropdown={disableDropdown}\n />\n </div>\n );\n }\n\n const handleChange = inputVal => {\n let phoneValue = inputVal && inputVal.replace(/\\D+/g, '');\n phoneValue = `+${phoneValue}`;\n onChange({ value: phoneValue });\n };\n\n const handleBlur = event => {\n const phoneValue = event?.target?.value;\n event.target.value = `+${phoneValue && phoneValue.replace(/\\D+/g, '')}`;\n onBlur(event);\n };\n\n return (\n <MuiPhoneNumber\n fullWidth\n variant='outlined'\n helperText={helperTextToDisplay}\n placeholder=''\n size='small'\n defaultCountry='us'\n required={required}\n disabled={disabled}\n onChange={handleChange}\n onBlur={!readOnly ? handleBlur : undefined}\n error={status === 'error'}\n label={label}\n value={value}\n InputProps={{ ...testProp }}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButtons.d.ts","sourceRoot":"","sources":["../../../../src/components/field/RadioButtons/RadioButtons.tsx"],"names":[],"mappings":";AAcA,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,KAAA,
|
|
1
|
+
{"version":3,"file":"RadioButtons.d.ts","sourceRoot":"","sources":["../../../../src/components/field/RadioButtons/RadioButtons.tsx"],"names":[],"mappings":";AAcA,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,KAAA,eA6GzC"}
|