@pega/react-sdk-overrides 24.2.10 → 25.1.10
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/designSystemExtension/Banner/Banner.css +1 -1
- package/lib/designSystemExtension/Banner/Banner.tsx +10 -7
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +53 -37
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -13
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +8 -9
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +9 -9
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +8 -9
- package/lib/designSystemExtension/Operator/Operator.tsx +21 -19
- package/lib/designSystemExtension/Pulse/Pulse.tsx +1 -1
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +32 -4
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.css +7 -14
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +13 -2
- package/lib/field/AutoComplete/AutoComplete.tsx +1 -1
- package/lib/field/CancelAlert/CancelAlert.css +4 -4
- package/lib/field/CancelAlert/CancelAlert.tsx +7 -10
- package/lib/field/Checkbox/Checkbox.tsx +97 -4
- package/lib/field/Currency/Currency.tsx +10 -7
- package/lib/field/Currency/currency-utils.ts +1 -2
- package/lib/field/Date/Date.tsx +8 -8
- package/lib/field/DateTime/DateTime.tsx +16 -13
- package/lib/field/Decimal/Decimal.tsx +10 -7
- package/lib/field/Dropdown/Dropdown.tsx +30 -25
- package/lib/field/Email/Email.tsx +11 -13
- package/lib/field/Group/Group.tsx +10 -8
- package/lib/field/Integer/Integer.tsx +5 -7
- package/lib/field/Location/Location.css +4 -0
- package/lib/field/Location/Location.tsx +258 -0
- package/lib/field/Location/config-ext.json +8 -0
- package/lib/field/Location/index.tsx +1 -0
- package/lib/field/Multiselect/utils.ts +1 -1
- package/lib/field/ObjectReference/ObjectReference.tsx +235 -0
- package/lib/field/ObjectReference/index.tsx +1 -0
- package/lib/field/ObjectReference/utils.ts +111 -0
- package/lib/field/Percentage/Percentage.tsx +9 -9
- package/lib/field/Phone/Phone.tsx +7 -5
- package/lib/field/RadioButtons/RadioButtons.tsx +47 -5
- package/lib/field/RichText/RichText.css +79 -0
- package/lib/field/RichText/RichText.tsx +3 -1
- package/lib/field/ScalarList/ScalarList.tsx +2 -4
- package/lib/field/SelectableCard/SelectableCard.tsx +175 -0
- package/lib/field/SelectableCard/index.tsx +1 -0
- package/lib/field/SelectableCard/utils.tsx +223 -0
- package/lib/field/SemanticLink/SemanticLink.tsx +160 -28
- package/lib/field/SemanticLink/utils.ts +1 -1
- package/lib/field/TextArea/TextArea.tsx +5 -7
- package/lib/field/TextContent/TextContent.tsx +1 -2
- package/lib/field/TextInput/TextInput.tsx +5 -7
- package/lib/field/Time/Time.tsx +4 -8
- package/lib/field/URL/URL.tsx +5 -7
- package/lib/field/UserReference/UserReference.tsx +3 -6
- package/lib/helpers/attachmentShared.ts +6 -0
- package/lib/helpers/common-utils.ts +24 -2
- package/lib/helpers/data_page.ts +0 -1
- package/lib/helpers/field-group-utils.ts +1 -1
- package/lib/helpers/formatters/Currency.ts +20 -20
- package/lib/helpers/formatters/CurrencyMap.ts +0 -2
- package/lib/helpers/formatters/common.ts +2 -1
- package/lib/helpers/formatters/index.ts +2 -4
- package/lib/helpers/object-utils.ts +10 -0
- package/lib/helpers/simpleTableHelpers.ts +118 -6
- package/lib/helpers/utils.ts +8 -1
- package/lib/helpers/versionHelpers.ts +0 -1
- package/lib/infra/ActionButtons/ActionButtons.tsx +28 -21
- package/lib/infra/Assignment/Assignment.tsx +39 -36
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +2 -2
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +21 -113
- package/lib/infra/Containers/FlowContainer/helpers.ts +1 -5
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +4 -3
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +7 -6
- package/lib/infra/Containers/SimpleView/helper.ts +1 -1
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +4 -5
- package/lib/infra/Containers/container-helpers.ts +52 -0
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +5 -9
- package/lib/infra/DashboardFilter/filterUtils.tsx +3 -6
- package/lib/infra/DeferLoad/DeferLoad.tsx +7 -9
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +1 -3
- package/lib/infra/MultiStep/MultiStep.css +48 -70
- package/lib/infra/MultiStep/MultiStep.tsx +27 -58
- package/lib/infra/NavBar/NavBar.css +1 -1
- package/lib/infra/NavBar/NavBar.tsx +43 -32
- package/lib/infra/Reference/Reference.tsx +3 -4
- package/lib/infra/Region/Region.tsx +1 -1
- package/lib/infra/RootContainer/RootContainer.tsx +3 -4
- package/lib/infra/Stages/Stages.tsx +3 -4
- package/lib/infra/View/View.tsx +4 -3
- package/lib/template/AdvancedSearch/AdvancedSearch.tsx +86 -0
- package/lib/template/AdvancedSearch/SearchGroup/persistUtils.ts +52 -0
- package/lib/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +244 -0
- package/lib/template/AdvancedSearch/SearchGroups/hooks.ts +37 -0
- package/lib/template/AdvancedSearch/SearchGroups/index.tsx +1 -0
- package/lib/template/AdvancedSearch/SearchGroups/utils.ts +29 -0
- package/lib/template/AdvancedSearch/TemplateContext.ts +11 -0
- package/lib/template/AdvancedSearch/config-ext.json +9 -0
- package/lib/template/AdvancedSearch/index.tsx +1 -0
- package/lib/template/AppShell/AppShell.css +1 -1
- package/lib/template/AppShell/AppShell.tsx +22 -23
- package/lib/template/BannerPage/BannerPage.tsx +2 -2
- package/lib/template/CaseSummary/CaseSummary.tsx +28 -41
- package/lib/template/CaseView/CaseView.tsx +32 -38
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
- package/lib/template/Confirmation/Confirmation.tsx +3 -4
- package/lib/template/DataReference/DataReference.tsx +312 -106
- package/lib/template/DataReference/DataReferenceAdvancedSearchContext.ts +10 -0
- package/lib/template/DataReference/SearchForm.tsx +149 -0
- package/lib/template/DataReference/utils.ts +90 -0
- package/lib/template/DefaultForm/DefaultForm.tsx +3 -3
- package/lib/template/DefaultForm/utils/index.ts +1 -3
- package/lib/template/DefaultPage/DefaultPage.tsx +108 -0
- package/lib/template/DefaultPage/index.tsx +1 -0
- package/lib/template/Details/Details/Details.tsx +11 -11
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +2 -2
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +11 -11
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +11 -11
- package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +1 -2
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +2 -5
- package/lib/template/InlineDashboard/InlineDashboard.tsx +14 -16
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +2 -2
- package/lib/template/ListPage/ListPage.tsx +1 -1
- package/lib/template/ListView/ListView.tsx +285 -204
- package/lib/template/ListView/hooks.ts +1 -5
- package/lib/template/ListView/utils.ts +38 -6
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +5 -5
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +11 -11
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +2 -2
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +2 -2
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -7
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +1 -1
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +2 -2
- package/lib/template/PromotedFilters/PromotedFilters.tsx +1 -3
- package/lib/template/SelfServiceCaseView/SelfServiceCaseView.tsx +145 -0
- package/lib/template/SelfServiceCaseView/index.tsx +1 -0
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +2 -5
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +99 -84
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +3 -5
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +10 -2
- package/lib/template/SubTabs/SubTabs.tsx +2 -2
- package/lib/template/SubTabs/tabUtils.ts +118 -1
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +9 -10
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +1 -1
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +9 -10
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +5 -5
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +11 -11
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +2 -2
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +2 -2
- package/lib/template/WssNavBar/WssNavBar.css +1 -1
- package/lib/template/WssNavBar/WssNavBar.tsx +6 -6
- package/lib/template/utils.tsx +58 -0
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +1 -1
- package/lib/widget/Attachment/Attachment.css +7 -8
- package/lib/widget/Attachment/Attachment.tsx +304 -231
- package/lib/widget/Attachment/Attachment.types.ts +96 -0
- package/lib/widget/Attachment/AttachmentUtils.ts +316 -0
- package/lib/widget/CaseHistory/CaseHistory.tsx +5 -5
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.css +0 -14
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +3 -3
- package/lib/widget/FileUtility/FileUtility/FileUtility.css +7 -6
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +30 -23
- package/lib/widget/Followers/Followers.tsx +2 -4
- package/lib/widget/QuickCreate/QuickCreate.tsx +1 -3
- package/lib/widget/SummaryItem/SummaryItem.css +9 -11
- package/lib/widget/SummaryItem/SummaryItem.tsx +3 -3
- package/lib/widget/SummaryList/SummaryList.tsx +1 -1
- package/lib/widget/ToDo/ToDo.css +1 -13
- package/lib/widget/ToDo/ToDo.tsx +38 -37
- package/package.json +1 -1
- package/lib/helpers/attachmentHelpers.ts +0 -76
- package/lib/infra/Containers/helpers.ts +0 -6
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import React, { PropsWithChildren, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
1
|
+
import React, { type PropsWithChildren, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
3
2
|
import Table from '@mui/material/Table';
|
|
4
3
|
import TableBody from '@mui/material/TableBody';
|
|
5
4
|
import TableCell from '@mui/material/TableCell';
|
|
@@ -28,8 +27,9 @@ import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react
|
|
|
28
27
|
import { Utils } from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
29
28
|
import { getReferenceList } from '@pega/react-sdk-components/lib/components/helpers/field-group-utils';
|
|
30
29
|
import { getDataPage } from '@pega/react-sdk-components/lib/components/helpers/data_page';
|
|
30
|
+
import { getGenericFieldsLocalizedValue } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
|
|
31
31
|
import { buildFieldsForTable, filterData, getContext } from '@pega/react-sdk-components/lib/components/helpers/simpleTableHelpers';
|
|
32
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
32
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
33
33
|
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
34
34
|
|
|
35
35
|
interface SimpleTableManualProps extends PConnProps {
|
|
@@ -52,14 +52,29 @@ interface SimpleTableManualProps extends PConnProps {
|
|
|
52
52
|
displayMode?: string;
|
|
53
53
|
useSeparateViewForEdit: any;
|
|
54
54
|
viewForEditModal: any;
|
|
55
|
+
validatemessage?: string;
|
|
56
|
+
required?: boolean;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
const useStyles = makeStyles((/* theme */) => ({
|
|
58
60
|
label: {
|
|
59
61
|
margin: '8px'
|
|
60
62
|
},
|
|
63
|
+
tableLabel: {
|
|
64
|
+
'&::after': {
|
|
65
|
+
display: 'inline',
|
|
66
|
+
content: '" *"',
|
|
67
|
+
verticalAlign: 'top',
|
|
68
|
+
color: 'var(--app-error-color)'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
message: {
|
|
72
|
+
margin: '8px',
|
|
73
|
+
color: 'var(--app-error-color)',
|
|
74
|
+
fontSize: '14px'
|
|
75
|
+
},
|
|
61
76
|
header: {
|
|
62
|
-
background: '
|
|
77
|
+
background: 'var(--table-header-background)'
|
|
63
78
|
},
|
|
64
79
|
tableCell: {
|
|
65
80
|
borderRight: '1px solid lightgray',
|
|
@@ -110,7 +125,9 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
110
125
|
editModeConfig,
|
|
111
126
|
displayMode,
|
|
112
127
|
useSeparateViewForEdit,
|
|
113
|
-
viewForEditModal
|
|
128
|
+
viewForEditModal,
|
|
129
|
+
required,
|
|
130
|
+
validatemessage
|
|
114
131
|
} = props;
|
|
115
132
|
const pConn = getPConnect();
|
|
116
133
|
const [rowData, setRowData] = useState([]);
|
|
@@ -130,7 +147,8 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
130
147
|
const [displayDialogDateFilter, setDisplayDialogDateFilter] = useState<string>('notequal');
|
|
131
148
|
const [displayDialogDateValue, setDisplayDialogDateValue] = useState<string>('');
|
|
132
149
|
const selectedRowIndex: any = useRef(null);
|
|
133
|
-
|
|
150
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
151
|
+
const localeCategory = 'SimpleTable';
|
|
134
152
|
const parameters = fieldMetadata?.datasource?.parameters;
|
|
135
153
|
const { referenceListStr } = getContext(getPConnect());
|
|
136
154
|
const label = labelProp || propertyLabel;
|
|
@@ -145,6 +163,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
145
163
|
const menuIconOverride$ = Utils.getImageSrc('trash', Utils.getSDKStaticConentUrl());
|
|
146
164
|
|
|
147
165
|
const resolvedFields = children?.[0]?.children || presets?.[0].children?.[0].children;
|
|
166
|
+
const primaryFieldsViewIndex = resolvedFields.findIndex(field => field.config.value === 'pyPrimaryFields');
|
|
148
167
|
// NOTE: props has each child.config with datasource and value undefined
|
|
149
168
|
// but getRawMetadata() has each child.config with datasource and value showing their unresolved values (ex: "@P thePropName")
|
|
150
169
|
// We need to use the prop name as the "glue" to tie the table dataSource, displayColumns and data together.
|
|
@@ -176,15 +195,8 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
176
195
|
});
|
|
177
196
|
|
|
178
197
|
useEffect(() => {
|
|
179
|
-
|
|
180
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
181
|
-
buildElementsForTable();
|
|
182
|
-
}
|
|
183
|
-
}, [referenceList.length]);
|
|
184
|
-
|
|
185
|
-
useEffect(() => {
|
|
198
|
+
buildElementsForTable();
|
|
186
199
|
if (readOnlyMode || allowEditingInModal) {
|
|
187
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
188
200
|
generateRowsData();
|
|
189
201
|
}
|
|
190
202
|
}, [referenceList]);
|
|
@@ -195,19 +207,21 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
195
207
|
// Constellation DX Components do). It will also have the "label", and "meta" contains the original,
|
|
196
208
|
// unchanged config info. For now, much of the info here is carried over from
|
|
197
209
|
// Constellation DX Components.
|
|
198
|
-
const fieldDefs = buildFieldsForTable(rawFields,
|
|
210
|
+
const fieldDefs = buildFieldsForTable(rawFields, getPConnect(), showDeleteButton, {
|
|
211
|
+
primaryFieldsViewIndex,
|
|
212
|
+
fields: resolvedFields
|
|
213
|
+
});
|
|
199
214
|
|
|
200
215
|
useLayoutEffect(() => {
|
|
201
216
|
if (allowEditingInModal) {
|
|
202
217
|
getPConnect()
|
|
203
218
|
.getListActions()
|
|
204
|
-
// @ts-ignore - An argument for 'uniqueField' was not provided.
|
|
205
219
|
.initDefaultPageInstructions(
|
|
206
220
|
getPConnect().getReferenceList(),
|
|
207
221
|
fieldDefs.filter(item => item.name).map(item => item.name)
|
|
208
222
|
);
|
|
209
223
|
} else {
|
|
210
|
-
// @ts-
|
|
224
|
+
// @ts-expect-error - An argument for 'fields' was not provided
|
|
211
225
|
getPConnect().getListActions().initDefaultPageInstructions(getPConnect().getReferenceList());
|
|
212
226
|
}
|
|
213
227
|
}, []);
|
|
@@ -234,7 +248,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
234
248
|
|
|
235
249
|
// return the value that should be shown as the contents for the given row data
|
|
236
250
|
// of the given row field
|
|
237
|
-
function getRowValue(inRowData:
|
|
251
|
+
function getRowValue(inRowData: object, inColKey: string): any {
|
|
238
252
|
// See what data (if any) we have to display
|
|
239
253
|
const refKeys: string[] = inColKey?.split('.');
|
|
240
254
|
let valBuilder = inRowData;
|
|
@@ -265,7 +279,6 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
265
279
|
setRowData(data);
|
|
266
280
|
})
|
|
267
281
|
.catch(e => {
|
|
268
|
-
// eslint-disable-next-line no-console
|
|
269
282
|
console.log(e);
|
|
270
283
|
});
|
|
271
284
|
} else {
|
|
@@ -274,7 +287,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
274
287
|
// we're using as the table's dataSource
|
|
275
288
|
const data: any = [];
|
|
276
289
|
for (const row of referenceList) {
|
|
277
|
-
const dataForRow:
|
|
290
|
+
const dataForRow: object = {};
|
|
278
291
|
for (const col of displayedColumns) {
|
|
279
292
|
const colKey: string = col;
|
|
280
293
|
const theVal = getRowValue(row, colKey);
|
|
@@ -306,9 +319,9 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
306
319
|
if (allowEditingInModal && defaultView) {
|
|
307
320
|
pConn
|
|
308
321
|
.getActionsApi()
|
|
322
|
+
// @ts-expect-error
|
|
309
323
|
.openEmbeddedDataModal(defaultView, pConn, referenceListStr, referenceList.length, PCore.getConstants().RESOURCE_STATUS.CREATE);
|
|
310
324
|
} else {
|
|
311
|
-
// @ts-ignore - An argument for 'pageRef' was not provided.
|
|
312
325
|
pConn.getListActions().insert({ classID: contextClass }, referenceList.length);
|
|
313
326
|
}
|
|
314
327
|
|
|
@@ -322,6 +335,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
322
335
|
if (typeof selectedRowIndex.current === 'number') {
|
|
323
336
|
pConn
|
|
324
337
|
.getActionsApi()
|
|
338
|
+
// @ts-expect-error
|
|
325
339
|
.openEmbeddedDataModal(
|
|
326
340
|
bUseSeparateViewForEdit ? editView : defaultView,
|
|
327
341
|
pConn,
|
|
@@ -334,12 +348,10 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
334
348
|
|
|
335
349
|
const deleteRecord = () => {
|
|
336
350
|
setEditAnchorEl(null);
|
|
337
|
-
// @ts-ignore - An argument for 'pageRef' was not provided.
|
|
338
351
|
pConn.getListActions().deleteEntry(selectedRowIndex.current);
|
|
339
352
|
};
|
|
340
353
|
|
|
341
354
|
const deleteRecordFromInlineEditable = (index: number) => {
|
|
342
|
-
// @ts-ignore - An argument for 'pageRef' was not provided.
|
|
343
355
|
pConn.getListActions().deleteEntry(index);
|
|
344
356
|
};
|
|
345
357
|
|
|
@@ -349,23 +361,25 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
349
361
|
const data: any = [];
|
|
350
362
|
rawFields.forEach(item => {
|
|
351
363
|
// removing label field from config to hide title in the table cell
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
364
|
+
if (!item.config.hide) {
|
|
365
|
+
item = { ...item, config: { ...item.config, label: '', displayMode: readOnlyMode || allowEditingInModal ? 'DISPLAY_ONLY' : undefined } };
|
|
366
|
+
const referenceListData = getReferenceList(pConn);
|
|
367
|
+
const isDatapage = referenceListData.startsWith('D_');
|
|
368
|
+
const pageReferenceValue = isDatapage
|
|
369
|
+
? `${referenceListData}[${index}]`
|
|
370
|
+
: `${pConn.getPageReference()}${referenceListData.substring(referenceListData.lastIndexOf('.'))}[${index}]`;
|
|
371
|
+
const config = {
|
|
372
|
+
meta: item,
|
|
373
|
+
options: {
|
|
374
|
+
context,
|
|
375
|
+
pageReference: pageReferenceValue,
|
|
376
|
+
referenceList: referenceListData,
|
|
377
|
+
hasForm: true
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
const view = PCore.createPConnect(config);
|
|
381
|
+
data.push(createElement(createPConnectComponent(), view));
|
|
382
|
+
}
|
|
369
383
|
});
|
|
370
384
|
eleData.push(data);
|
|
371
385
|
});
|
|
@@ -397,23 +411,27 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
397
411
|
|
|
398
412
|
type Order = 'asc' | 'desc';
|
|
399
413
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
414
|
+
interface Comparator<T> {
|
|
415
|
+
(a: T, b: T): number;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
function getComparator<Key extends keyof any, T extends Record<Key, any>>(theOrder: Order, orderedBy: Key): Comparator<T> {
|
|
419
|
+
return theOrder === 'desc' ? (a: T, b: T) => descendingComparator<T>(a, b, orderedBy) : (a: T, b: T) => -descendingComparator<T>(a, b, orderedBy);
|
|
405
420
|
}
|
|
406
421
|
|
|
407
422
|
function stableSort<T>(array: T[], comparator: (a: T, b: T) => number) {
|
|
408
423
|
const stabilizedThis = array.map((el, index) => [el, index] as [T, number]);
|
|
409
424
|
stabilizedThis.sort((a, b) => {
|
|
410
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
411
425
|
const order = comparator(a[0], b[0]);
|
|
412
426
|
if (order !== 0) return order;
|
|
413
427
|
return a[1] - b[1];
|
|
414
428
|
});
|
|
415
429
|
|
|
416
|
-
|
|
430
|
+
const newElements = new Array(stabilizedThis.length);
|
|
431
|
+
stabilizedThis.forEach((el, index) => {
|
|
432
|
+
newElements[index] = elements[el[1]];
|
|
433
|
+
});
|
|
434
|
+
return newElements;
|
|
417
435
|
}
|
|
418
436
|
|
|
419
437
|
function _menuClick(event, columnId: string, columnType: string, labelValue: string) {
|
|
@@ -558,7 +576,6 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
558
576
|
function _showFilteredIcon(columnId) {
|
|
559
577
|
for (const filterObj of filterByColumns) {
|
|
560
578
|
if (filterObj.ref === columnId) {
|
|
561
|
-
// eslint-disable-next-line sonarjs/prefer-single-boolean-return
|
|
562
579
|
if (filterObj.containsFilterValue !== '') {
|
|
563
580
|
return true;
|
|
564
581
|
}
|
|
@@ -583,19 +600,24 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
583
600
|
<>
|
|
584
601
|
<TableContainer component={Paper} style={{ margin: '4px 0px' }} id='simple-table-manual'>
|
|
585
602
|
{propsToUse.label && (
|
|
586
|
-
<h3 className={classes.label}>
|
|
603
|
+
<h3 className={`${classes.label} ${required ? classes.tableLabel : ''}`}>
|
|
587
604
|
{propsToUse.label} {results()}
|
|
588
605
|
</h3>
|
|
589
606
|
)}
|
|
607
|
+
{validatemessage && <div className={classes.message}>{validatemessage}</div>}
|
|
590
608
|
<Table>
|
|
591
609
|
<TableHead className={classes.header}>
|
|
592
610
|
<TableRow>
|
|
593
611
|
{fieldDefs.map((field: any, index) => {
|
|
612
|
+
if (field?.meta?.config?.hide) {
|
|
613
|
+
return null; // Skip rendering if hide = true
|
|
614
|
+
}
|
|
594
615
|
return (
|
|
595
616
|
<TableCell key={`head-${displayedColumns[index]}`} className={classes.tableCell}>
|
|
596
|
-
{readOnlyMode ? (
|
|
597
|
-
<div>
|
|
617
|
+
{(readOnlyMode || allowEditingInModal) && field.cellRenderer !== 'DeleteIcon' ? (
|
|
618
|
+
<div style={{ display: 'flex' }}>
|
|
598
619
|
<TableSortLabel
|
|
620
|
+
style={{ width: '75%' }}
|
|
599
621
|
active={orderBy === displayedColumns[index]}
|
|
600
622
|
direction={orderBy === displayedColumns[index] ? order : 'asc'}
|
|
601
623
|
onClick={createSortHandler(displayedColumns[index])}
|
|
@@ -607,8 +629,8 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
607
629
|
) : null}
|
|
608
630
|
</TableSortLabel>
|
|
609
631
|
<MoreIcon
|
|
632
|
+
style={{ cursor: 'pointer', zIndex: 1000 }}
|
|
610
633
|
id='menu-icon'
|
|
611
|
-
className={classes.moreIcon}
|
|
612
634
|
onClick={event => {
|
|
613
635
|
_menuClick(event, field.name, field.meta.type, field.label);
|
|
614
636
|
}}
|
|
@@ -624,6 +646,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
624
646
|
</TableHead>
|
|
625
647
|
<TableBody>
|
|
626
648
|
{editableMode &&
|
|
649
|
+
!allowEditingInModal &&
|
|
627
650
|
elements.map((row: any, index) => {
|
|
628
651
|
const theKey = `row-${index}`;
|
|
629
652
|
return (
|
|
@@ -659,55 +682,47 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
|
|
|
659
682
|
.slice(0)
|
|
660
683
|
.map((row, index) => {
|
|
661
684
|
return (
|
|
662
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
663
685
|
<TableRow key={index}>
|
|
664
|
-
{
|
|
686
|
+
{row.map((item, childIndex) => {
|
|
687
|
+
const theColKey = displayedColumns[childIndex];
|
|
665
688
|
return (
|
|
666
|
-
<TableCell key={
|
|
667
|
-
{
|
|
668
|
-
<div>
|
|
669
|
-
<MoreIcon
|
|
670
|
-
id='table-edit-menu-icon'
|
|
671
|
-
className={classes.moreIcon}
|
|
672
|
-
onClick={event => {
|
|
673
|
-
editMenuClick(event, index);
|
|
674
|
-
}}
|
|
675
|
-
/>
|
|
676
|
-
<Menu id='table-edit-menu' anchorEl={editAnchorEl} keepMounted open={Boolean(editAnchorEl)} onClose={_menuClose}>
|
|
677
|
-
<MenuItem onClick={() => editRecord()}>Edit</MenuItem>
|
|
678
|
-
<MenuItem onClick={() => deleteRecord()}>Delete</MenuItem>
|
|
679
|
-
</Menu>
|
|
680
|
-
</div>
|
|
681
|
-
) : typeof row[colKey] === 'boolean' && !row[colKey] ? (
|
|
682
|
-
'False'
|
|
683
|
-
) : typeof row[colKey] === 'boolean' && row[colKey] ? (
|
|
684
|
-
'True'
|
|
685
|
-
) : (
|
|
686
|
-
row[colKey] || '---'
|
|
687
|
-
)}
|
|
689
|
+
<TableCell key={theColKey} className={classes.tableCell}>
|
|
690
|
+
{item}
|
|
688
691
|
</TableCell>
|
|
689
692
|
);
|
|
690
693
|
})}
|
|
694
|
+
{showDeleteButton && (
|
|
695
|
+
<TableCell key='DeleteIcon' className={classes.tableCell}>
|
|
696
|
+
<div>
|
|
697
|
+
<MoreIcon
|
|
698
|
+
id='table-edit-menu-icon'
|
|
699
|
+
className={classes.moreIcon}
|
|
700
|
+
onClick={event => {
|
|
701
|
+
editMenuClick(event, index);
|
|
702
|
+
}}
|
|
703
|
+
/>
|
|
704
|
+
<Menu id='table-edit-menu' anchorEl={editAnchorEl} keepMounted open={Boolean(editAnchorEl)} onClose={_menuClose}>
|
|
705
|
+
<MenuItem onClick={() => editRecord()}>Edit</MenuItem>
|
|
706
|
+
<MenuItem onClick={() => deleteRecord()}>Delete</MenuItem>
|
|
707
|
+
</Menu>
|
|
708
|
+
</div>
|
|
709
|
+
</TableCell>
|
|
710
|
+
)}
|
|
691
711
|
</TableRow>
|
|
692
712
|
);
|
|
693
713
|
})}
|
|
694
714
|
</TableBody>
|
|
695
715
|
</Table>
|
|
696
|
-
{readOnlyMode && rowData
|
|
697
|
-
<div className='no-records' id='no-records'>
|
|
698
|
-
No records found.
|
|
699
|
-
</div>
|
|
700
|
-
)}
|
|
701
|
-
{editableMode && referenceList && referenceList.length === 0 && (
|
|
716
|
+
{((readOnlyMode && (!rowData || rowData?.length === 0)) || (editableMode && (!referenceList || referenceList?.length === 0))) && (
|
|
702
717
|
<div className='no-records' id='no-records'>
|
|
703
|
-
No records found.
|
|
718
|
+
{getGenericFieldsLocalizedValue('COSMOSFIELDS.lists', 'No records found.')}
|
|
704
719
|
</div>
|
|
705
720
|
)}
|
|
706
721
|
</TableContainer>
|
|
707
722
|
{showAddRowButton && (
|
|
708
723
|
<div style={{ fontSize: '1rem' }}>
|
|
709
724
|
<Link style={{ cursor: 'pointer' }} onClick={addRecord} underline='hover'>
|
|
710
|
-
+ Add
|
|
725
|
+
+ {localizedVal('Add', localeCategory)}
|
|
711
726
|
</Link>
|
|
712
727
|
</div>
|
|
713
728
|
)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
2
2
|
|
|
3
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
4
4
|
|
|
5
5
|
interface SimpleTableSelectProps extends PConnProps {
|
|
6
6
|
// If any, enter additional props that only exist on this component
|
|
@@ -57,10 +57,8 @@ export default function SimpleTableSelect(props: SimpleTableSelectProps) {
|
|
|
57
57
|
|
|
58
58
|
// Need to get this written so typedefs work
|
|
59
59
|
const { datasource: { parameters: fieldParameters = {} } = {}, pageClass } = isMultiSelectMode
|
|
60
|
-
?
|
|
61
|
-
|
|
62
|
-
: // @ts-ignore - Property 'getCurrentPageFieldMetadata' is private and only accessible within class 'C11nEnv'.
|
|
63
|
-
pConn.getCurrentPageFieldMetadata(contextPageReference);
|
|
60
|
+
? pConn.getFieldMetadata(`@P .${referenceProp}`)
|
|
61
|
+
: pConn.getCurrentPageFieldMetadata(contextPageReference);
|
|
64
62
|
|
|
65
63
|
const compositeKeys: any[] = [];
|
|
66
64
|
Object.values(fieldParameters).forEach((param: any) => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FormControl, FormLabel } from '@mui/material';
|
|
2
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
2
3
|
|
|
3
4
|
interface SingleReferenceReadOnlyProps extends PConnProps {
|
|
4
5
|
// If any, enter additional props that only exist on this component
|
|
@@ -59,5 +60,12 @@ export default function SingleReferenceReadOnly(props: SingleReferenceReadOnlyPr
|
|
|
59
60
|
{}
|
|
60
61
|
); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
61
62
|
|
|
62
|
-
return
|
|
63
|
+
return (
|
|
64
|
+
<>
|
|
65
|
+
<FormControl variant='standard' sx={{ display: 'flex', flexDirection: 'row' }}>
|
|
66
|
+
<FormLabel sx={{ marginRight: '2rem' }}>{label}</FormLabel>
|
|
67
|
+
{component}
|
|
68
|
+
</FormControl>
|
|
69
|
+
</>
|
|
70
|
+
);
|
|
63
71
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Children, PropsWithChildren, useEffect, useState } from 'react';
|
|
1
|
+
import { Children, type PropsWithChildren, useEffect, useState } from 'react';
|
|
2
2
|
import { Tab, Tabs } from '@mui/material';
|
|
3
3
|
import { TabContext, TabPanel } from '@mui/lab';
|
|
4
4
|
|
|
5
5
|
import { getTransientTabs, getVisibleTabs, tabClick } from './tabUtils';
|
|
6
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
7
|
|
|
8
8
|
interface SubTabsProps extends PConnProps {
|
|
9
9
|
// If any, enter additional props that only exist on this component
|
|
@@ -19,7 +19,8 @@ export const getVisibleTabs = (allTabs, uuid) => {
|
|
|
19
19
|
const { name: viewName, deferLoadId = `${viewName}_${uuid}_${index}` } = config;
|
|
20
20
|
child.getPConnect().registerAdditionalProps({
|
|
21
21
|
deferLoadId,
|
|
22
|
-
isChildDeferLoad: true
|
|
22
|
+
isChildDeferLoad: true,
|
|
23
|
+
lastUpdateCaseTime: '@P caseInfo.lastUpdateTime'
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
index += 1;
|
|
@@ -66,3 +67,119 @@ export const tabClick = (id, availableTabs, currentTabId, setCurrentTabId, tabIt
|
|
|
66
67
|
PCore.getDeferLoadManager().activate(activeId, nextPConn?.getContextName());
|
|
67
68
|
PCore.getDeferLoadManager().refreshComponent(activeId, nextPConn?.getContextName());
|
|
68
69
|
};
|
|
70
|
+
|
|
71
|
+
export const searchtabsClick = (id, mainTabs, currentTabId, setCurrentTabId) => {
|
|
72
|
+
const currentTab = mainTabs.find(item => item.id === currentTabId && item.visibility());
|
|
73
|
+
const currentPConn = currentTab?.getPConnect();
|
|
74
|
+
const { deferLoadId } = currentPConn?.getConfigProps() ?? {};
|
|
75
|
+
PCore.getDeferLoadManager().deactivate(deferLoadId, currentPConn.getContextName());
|
|
76
|
+
|
|
77
|
+
setCurrentTabId(id);
|
|
78
|
+
const nextActiveTab = mainTabs.find(item => item.id === id && item.visibility());
|
|
79
|
+
if (mainTabs && nextActiveTab?.content === null) {
|
|
80
|
+
nextActiveTab.content = nextActiveTab.getPConnect().getComponent();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const nextPConn = nextActiveTab.getPConnect();
|
|
84
|
+
const { deferLoadId: activeId } = nextPConn.getConfigProps();
|
|
85
|
+
PCore.getDeferLoadManager().activate(activeId, nextPConn.getContextName());
|
|
86
|
+
PCore.getDeferLoadManager().refreshComponent(activeId, nextPConn.getContextName());
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const getTabLabel = tabPConnect => {
|
|
90
|
+
const config = tabPConnect.getConfigProps();
|
|
91
|
+
|
|
92
|
+
const label = config.inheritedProps?.find(obj => obj.prop === 'label')?.value;
|
|
93
|
+
|
|
94
|
+
if (label) {
|
|
95
|
+
return label;
|
|
96
|
+
}
|
|
97
|
+
if (config.label) {
|
|
98
|
+
return config.label;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (tabPConnect.getReferencedView()?.config?.label) {
|
|
102
|
+
return tabPConnect.getReferencedView()?.config?.label;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return PCore.getLocaleUtils().getLocaleValue('No label specified in config', 'Generic');
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const getActiveTabId = (mainTabs, currentTabId) => {
|
|
109
|
+
let firstVisibleTabId = null;
|
|
110
|
+
let updatedActiveId = currentTabId;
|
|
111
|
+
let isCurrentTabFound = false;
|
|
112
|
+
|
|
113
|
+
if (!mainTabs?.length) {
|
|
114
|
+
return updatedActiveId;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
for (let i = 0; i < mainTabs.length; i += 1) {
|
|
118
|
+
const tab = mainTabs[i];
|
|
119
|
+
const tabConfig = tab.getPConnect().getConfigProps();
|
|
120
|
+
const tabId = tab?.id || `${tab.getPConnect().viewName}-${tabConfig.name || getTabLabel(tab.getPConnect())}-${i}`;
|
|
121
|
+
const isTabVisible = !Object.hasOwn(tabConfig, 'visibility') || tabConfig.visibility === true;
|
|
122
|
+
if (isTabVisible && !firstVisibleTabId) {
|
|
123
|
+
firstVisibleTabId = tabId;
|
|
124
|
+
if (isCurrentTabFound) {
|
|
125
|
+
updatedActiveId = firstVisibleTabId;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (tabId === currentTabId) {
|
|
130
|
+
isCurrentTabFound = true;
|
|
131
|
+
if (isTabVisible) {
|
|
132
|
+
break;
|
|
133
|
+
} else if (firstVisibleTabId) {
|
|
134
|
+
updatedActiveId = firstVisibleTabId;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return updatedActiveId;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
*
|
|
143
|
+
* @param {*} deferLoadedTabs list of deferLoadedTabs
|
|
144
|
+
* @param {string} tabViewName (optional) if provided, tabId of the given tabView will be returned
|
|
145
|
+
* @returns {string} a tab id is returned
|
|
146
|
+
*/
|
|
147
|
+
export const getFirstVisibleTabId = (deferLoadedTabs, tabViewName) => {
|
|
148
|
+
let tabIndex = 0;
|
|
149
|
+
|
|
150
|
+
const viewName = deferLoadedTabs?.props?.getPConnect()?.options?.viewName;
|
|
151
|
+
|
|
152
|
+
const deferTabsChildren = deferLoadedTabs.props.getPConnect().getChildren();
|
|
153
|
+
if (tabViewName) {
|
|
154
|
+
const firstVisibleTab = deferTabsChildren?.find((item, index) => {
|
|
155
|
+
const tabConfig = item.getPConnect().getConfigProps();
|
|
156
|
+
if (tabViewName === tabConfig.name) {
|
|
157
|
+
tabIndex = index;
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
return false;
|
|
161
|
+
});
|
|
162
|
+
const tabConfig = firstVisibleTab.getPConnect().getConfigProps();
|
|
163
|
+
|
|
164
|
+
return `${viewName}-${tabConfig.name || getTabLabel(firstVisibleTab.getPConnect())}-${tabIndex}`;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const firstVisibleTab = deferLoadedTabs.props
|
|
168
|
+
.getPConnect()
|
|
169
|
+
.getChildren()
|
|
170
|
+
?.find((item, index) => {
|
|
171
|
+
const tabConfig = item.getPConnect().getConfigProps();
|
|
172
|
+
if (!('visibility' in tabConfig) || tabConfig.visibility === true) {
|
|
173
|
+
tabIndex = index;
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
return false;
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
if (!firstVisibleTab) {
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const tabConfig = firstVisibleTab.getPConnect().getConfigProps();
|
|
184
|
+
return `${viewName}-${tabConfig.name || getTabLabel(firstVisibleTab.getPConnect())}-${tabIndex}`;
|
|
185
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import type { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import Grid2, { type GridSize } from '@mui/material/Grid2';
|
|
3
3
|
import makeStyles from '@mui/styles/makeStyles';
|
|
4
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
4
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
5
|
|
|
6
6
|
interface TwoColumnProps extends PConnProps {
|
|
7
7
|
// If any, enter additional props that only exist on this component
|
|
@@ -23,7 +23,6 @@ export default function TwoColumn(props: PropsWithChildren<TwoColumnProps>) {
|
|
|
23
23
|
const childrenToRender = children as ReactElement[];
|
|
24
24
|
|
|
25
25
|
if (childrenToRender.length !== 2) {
|
|
26
|
-
// eslint-disable-next-line no-console
|
|
27
26
|
console.error(`TwoColumn template sees more than 2 columns: ${childrenToRender.length}`);
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -43,13 +42,13 @@ export default function TwoColumn(props: PropsWithChildren<TwoColumnProps>) {
|
|
|
43
42
|
bSize = (ratio * colAArray[1]) as GridSize;
|
|
44
43
|
|
|
45
44
|
return (
|
|
46
|
-
<
|
|
47
|
-
<
|
|
45
|
+
<Grid2 container spacing={1}>
|
|
46
|
+
<Grid2 size={{ xs: 12, md: aSize }} className={classes.colStyles}>
|
|
48
47
|
{childrenToRender[0]}
|
|
49
|
-
</
|
|
50
|
-
<
|
|
48
|
+
</Grid2>
|
|
49
|
+
<Grid2 size={{ xs: 12, md: bSize }} className={classes.colStyles}>
|
|
51
50
|
{childrenToRender[1]}
|
|
52
|
-
</
|
|
53
|
-
</
|
|
51
|
+
</Grid2>
|
|
52
|
+
</Grid2>
|
|
54
53
|
);
|
|
55
54
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
2
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
2
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
3
|
|
|
4
4
|
interface TwoColumnPageProps extends PConnProps {
|
|
5
5
|
// If any, enter additional props that only exist on this component
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import type { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import Grid2, { type GridSize } from '@mui/material/Grid2';
|
|
3
3
|
import makeStyles from '@mui/styles/makeStyles';
|
|
4
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
4
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
5
|
|
|
6
6
|
interface TwoColumnTabProps extends PConnProps {
|
|
7
7
|
// If any, enter additional props that only exist on this component
|
|
@@ -23,7 +23,6 @@ export default function TwoColumnTab(props: PropsWithChildren<TwoColumnTabProps>
|
|
|
23
23
|
const childrenToRender = children as ReactElement[];
|
|
24
24
|
|
|
25
25
|
if (childrenToRender.length !== 2) {
|
|
26
|
-
// eslint-disable-next-line no-console
|
|
27
26
|
console.error(`TwoColumn template sees more than 2 columns: ${childrenToRender.length}`);
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -43,13 +42,13 @@ export default function TwoColumnTab(props: PropsWithChildren<TwoColumnTabProps>
|
|
|
43
42
|
bSize = (ratio * colAArray[1]) as GridSize;
|
|
44
43
|
|
|
45
44
|
return (
|
|
46
|
-
<
|
|
47
|
-
<
|
|
45
|
+
<Grid2 container spacing={1}>
|
|
46
|
+
<Grid2 size={{ xs: 12, md: aSize }} className={classes.colStyles}>
|
|
48
47
|
{childrenToRender[0]}
|
|
49
|
-
</
|
|
50
|
-
<
|
|
48
|
+
</Grid2>
|
|
49
|
+
<Grid2 size={{ xs: 12, md: bSize }} className={classes.colStyles}>
|
|
51
50
|
{childrenToRender[1]}
|
|
52
|
-
</
|
|
53
|
-
</
|
|
51
|
+
</Grid2>
|
|
52
|
+
</Grid2>
|
|
54
53
|
);
|
|
55
54
|
}
|