@pega/react-sdk-overrides 24.2.11 → 25.1.11

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.
Files changed (173) hide show
  1. package/lib/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
  2. package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +37 -20
  3. package/lib/designSystemExtension/Banner/Banner.css +1 -1
  4. package/lib/designSystemExtension/Banner/Banner.tsx +10 -7
  5. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
  6. package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +53 -37
  7. package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -13
  8. package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +8 -9
  9. package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +9 -9
  10. package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +7 -8
  11. package/lib/designSystemExtension/Operator/Operator.tsx +21 -19
  12. package/lib/designSystemExtension/Pulse/Pulse.tsx +1 -1
  13. package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +32 -4
  14. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.css +7 -14
  15. package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +13 -2
  16. package/lib/field/AutoComplete/AutoComplete.tsx +1 -1
  17. package/lib/field/CancelAlert/CancelAlert.css +4 -4
  18. package/lib/field/CancelAlert/CancelAlert.tsx +6 -6
  19. package/lib/field/Checkbox/Checkbox.tsx +97 -4
  20. package/lib/field/Currency/Currency.tsx +3 -3
  21. package/lib/field/Currency/currency-utils.ts +1 -2
  22. package/lib/field/Date/Date.tsx +3 -7
  23. package/lib/field/DateTime/DateTime.tsx +3 -8
  24. package/lib/field/Decimal/Decimal.tsx +3 -5
  25. package/lib/field/Dropdown/Dropdown.tsx +5 -7
  26. package/lib/field/Email/Email.tsx +11 -13
  27. package/lib/field/Group/Group.tsx +10 -8
  28. package/lib/field/Integer/Integer.tsx +5 -7
  29. package/lib/field/Location/Location.css +4 -0
  30. package/lib/field/Location/Location.tsx +258 -0
  31. package/lib/field/Location/config-ext.json +8 -0
  32. package/lib/field/Location/index.tsx +1 -0
  33. package/lib/field/Multiselect/utils.ts +1 -1
  34. package/lib/field/ObjectReference/ObjectReference.tsx +235 -0
  35. package/lib/field/ObjectReference/index.tsx +1 -0
  36. package/lib/field/ObjectReference/utils.ts +111 -0
  37. package/lib/field/Percentage/Percentage.tsx +3 -7
  38. package/lib/field/Phone/Phone.tsx +7 -5
  39. package/lib/field/RadioButtons/RadioButtons.tsx +47 -2
  40. package/lib/field/RichText/RichText.css +79 -0
  41. package/lib/field/RichText/RichText.tsx +3 -1
  42. package/lib/field/ScalarList/ScalarList.tsx +2 -3
  43. package/lib/field/SelectableCard/SelectableCard.tsx +189 -0
  44. package/lib/field/SelectableCard/index.tsx +1 -0
  45. package/lib/field/SelectableCard/utils.tsx +223 -0
  46. package/lib/field/SemanticLink/SemanticLink.tsx +160 -28
  47. package/lib/field/SemanticLink/utils.ts +1 -1
  48. package/lib/field/TextArea/TextArea.tsx +5 -7
  49. package/lib/field/TextContent/TextContent.tsx +1 -2
  50. package/lib/field/TextInput/TextInput.tsx +5 -7
  51. package/lib/field/Time/Time.tsx +3 -7
  52. package/lib/field/URL/URL.tsx +5 -7
  53. package/lib/field/UserReference/UserReference.tsx +2 -3
  54. package/lib/helpers/attachmentShared.ts +6 -0
  55. package/lib/helpers/common-utils.ts +3 -4
  56. package/lib/helpers/data_page.ts +0 -1
  57. package/lib/helpers/field-group-utils.ts +1 -1
  58. package/lib/helpers/formatters/Currency.ts +9 -4
  59. package/lib/helpers/formatters/CurrencyMap.ts +0 -2
  60. package/lib/helpers/object-utils.ts +10 -0
  61. package/lib/helpers/simpleTableHelpers.ts +118 -6
  62. package/lib/helpers/utils.ts +8 -1
  63. package/lib/helpers/versionHelpers.ts +0 -1
  64. package/lib/infra/ActionButtons/ActionButtons.tsx +28 -21
  65. package/lib/infra/Assignment/Assignment.tsx +47 -31
  66. package/lib/infra/Assignment/useValidationBanner.ts +29 -0
  67. package/lib/infra/AssignmentCard/AssignmentCard.tsx +2 -2
  68. package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +22 -102
  69. package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +1 -2
  70. package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +12 -6
  71. package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +8 -13
  72. package/lib/infra/Containers/container-helpers.ts +47 -1
  73. package/lib/infra/DashboardFilter/DashboardFilter.tsx +3 -6
  74. package/lib/infra/DashboardFilter/filterUtils.tsx +3 -4
  75. package/lib/infra/DeferLoad/DeferLoad.tsx +26 -13
  76. package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +1 -3
  77. package/lib/infra/MultiStep/MultiStep.css +48 -70
  78. package/lib/infra/MultiStep/MultiStep.tsx +27 -53
  79. package/lib/infra/NavBar/NavBar.css +1 -1
  80. package/lib/infra/NavBar/NavBar.tsx +49 -34
  81. package/lib/infra/Reference/Reference.tsx +8 -4
  82. package/lib/infra/Region/Region.tsx +1 -1
  83. package/lib/infra/RootContainer/RootContainer.tsx +6 -8
  84. package/lib/infra/Stages/Stages.tsx +3 -4
  85. package/lib/infra/View/View.tsx +9 -9
  86. package/lib/template/AdvancedSearch/AdvancedSearch.tsx +86 -0
  87. package/lib/template/AdvancedSearch/SearchGroup/persistUtils.ts +52 -0
  88. package/lib/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +244 -0
  89. package/lib/template/AdvancedSearch/SearchGroups/hooks.ts +37 -0
  90. package/lib/template/AdvancedSearch/SearchGroups/index.tsx +1 -0
  91. package/lib/template/AdvancedSearch/SearchGroups/utils.ts +29 -0
  92. package/lib/template/AdvancedSearch/TemplateContext.ts +11 -0
  93. package/lib/template/AdvancedSearch/config-ext.json +9 -0
  94. package/lib/template/AdvancedSearch/index.tsx +1 -0
  95. package/lib/template/AppShell/AppShell.css +1 -5
  96. package/lib/template/AppShell/AppShell.tsx +16 -17
  97. package/lib/template/BannerPage/BannerPage.tsx +2 -2
  98. package/lib/template/CaseSummary/CaseSummary.tsx +25 -43
  99. package/lib/template/CaseView/CaseView.tsx +28 -35
  100. package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
  101. package/lib/template/Confirmation/Confirmation.tsx +2 -3
  102. package/lib/template/DataReference/DataReference.tsx +312 -106
  103. package/lib/template/DataReference/DataReferenceAdvancedSearchContext.ts +10 -0
  104. package/lib/template/DataReference/SearchForm.tsx +149 -0
  105. package/lib/template/DataReference/utils.ts +90 -0
  106. package/lib/template/DefaultForm/DefaultForm.tsx +3 -3
  107. package/lib/template/DefaultForm/utils/index.ts +1 -3
  108. package/lib/template/DefaultPage/DefaultPage.tsx +108 -0
  109. package/lib/template/DefaultPage/index.tsx +1 -0
  110. package/lib/template/Details/Details/Details.tsx +11 -11
  111. package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +2 -2
  112. package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +11 -11
  113. package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +11 -11
  114. package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +1 -1
  115. package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +12 -6
  116. package/lib/template/HierarchicalForm/HierarchicalForm.tsx +58 -0
  117. package/lib/template/HierarchicalForm/hooks.ts +224 -0
  118. package/lib/template/HierarchicalForm/index.tsx +1 -0
  119. package/lib/template/InlineDashboard/InlineDashboard.tsx +14 -16
  120. package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +2 -2
  121. package/lib/template/ListPage/ListPage.tsx +1 -1
  122. package/lib/template/ListView/ListView.tsx +342 -204
  123. package/lib/template/ListView/hooks.ts +1 -5
  124. package/lib/template/ListView/utils.ts +38 -5
  125. package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +17 -2
  126. package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +5 -5
  127. package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +11 -11
  128. package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +2 -2
  129. package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +2 -2
  130. package/lib/template/ObjectPage/index.tsx +1 -0
  131. package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -7
  132. package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +1 -1
  133. package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +2 -2
  134. package/lib/template/PromotedFilters/PromotedFilters.tsx +1 -2
  135. package/lib/template/SelfServiceCaseView/SelfServiceCaseView.tsx +153 -0
  136. package/lib/template/SelfServiceCaseView/index.tsx +1 -0
  137. package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +2 -3
  138. package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +45 -34
  139. package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +1 -1
  140. package/lib/template/SimpleTable/SimpleTableSelectReadonly/SimpleTableSelectReadonly.tsx +179 -0
  141. package/lib/template/SimpleTable/SimpleTableSelectReadonly/index.tsx +1 -0
  142. package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +10 -2
  143. package/lib/template/SubTabs/SubTabs.tsx +2 -2
  144. package/lib/template/SubTabs/tabUtils.ts +118 -1
  145. package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +9 -10
  146. package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +1 -1
  147. package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +9 -10
  148. package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +5 -5
  149. package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +11 -11
  150. package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +2 -2
  151. package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +2 -2
  152. package/lib/template/WssNavBar/WssNavBar.css +1 -1
  153. package/lib/template/WssNavBar/WssNavBar.tsx +6 -6
  154. package/lib/template/utils.tsx +58 -0
  155. package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +1 -1
  156. package/lib/widget/Attachment/Attachment.css +6 -8
  157. package/lib/widget/Attachment/Attachment.tsx +303 -225
  158. package/lib/widget/Attachment/Attachment.types.ts +96 -0
  159. package/lib/widget/Attachment/AttachmentUtils.ts +316 -0
  160. package/lib/widget/CaseHistory/CaseHistory.tsx +5 -5
  161. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.css +0 -14
  162. package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +3 -3
  163. package/lib/widget/FileUtility/FileUtility/FileUtility.css +7 -6
  164. package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +29 -22
  165. package/lib/widget/Followers/Followers.tsx +2 -4
  166. package/lib/widget/QuickCreate/QuickCreate.tsx +1 -2
  167. package/lib/widget/SummaryItem/SummaryItem.css +9 -11
  168. package/lib/widget/SummaryItem/SummaryItem.tsx +2 -2
  169. package/lib/widget/SummaryList/SummaryList.tsx +1 -1
  170. package/lib/widget/ToDo/ToDo.css +1 -13
  171. package/lib/widget/ToDo/ToDo.tsx +37 -36
  172. package/package.json +1 -1
  173. package/lib/helpers/attachmentHelpers.ts +0 -76
@@ -0,0 +1,224 @@
1
+ import { useState, useEffect, useMemo, useCallback, useRef, Children, type PropsWithChildren, type SyntheticEvent } from 'react';
2
+
3
+ import useGetTabsCount from '@pega/react-sdk-components/lib/hooks/useGetTabsCount';
4
+ import { searchtabsClick as tabClick, getActiveTabId, getFirstVisibleTabId } from '@pega/react-sdk-components/lib/components/template/SubTabs/tabUtils';
5
+ import { getInstructions } from '@pega/react-sdk-components/lib/components/helpers/template-utils';
6
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
7
+
8
+ const ComponentName = 'HierarchicalForm';
9
+
10
+ const getLandingPageViewName = (contextName: string) => {
11
+ const target = contextName.substring(0, contextName.lastIndexOf('_'));
12
+ const activeContainerItemID = PCore.getContainerUtils().getActiveContainerItemName(target);
13
+ const containerItemData = PCore.getContainerUtils().getContainerItemData(target, activeContainerItemID);
14
+ return containerItemData?.view?.config?.name;
15
+ };
16
+
17
+ export interface HierarchicalFormProps extends PConnProps {
18
+ tabsVisibility?: Record<string, boolean>;
19
+ template?: string;
20
+ instructions?: string;
21
+ lastUpdateCaseTime?: string | number;
22
+ }
23
+
24
+ export function useHierarchicalForm(props: PropsWithChildren<HierarchicalFormProps>) {
25
+ const { children = [], getPConnect, tabsVisibility = {}, template } = props;
26
+ const [tabErrors, setTabErrors] = useState<Record<string, any>>({});
27
+ const tabErrorsRef = useRef<Record<string, any>>({});
28
+ const submitAttemptedRef = useRef(false);
29
+ const { lastUpdateCaseTime = getPConnect().getValue('caseInfo.lastUpdateTime') } = props;
30
+ const fullCaseId = getPConnect().getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID);
31
+
32
+ const deferLoadedTabs: any = Children.toArray(children)[0];
33
+ deferLoadedTabs.props.getPConnect().setInheritedProp('template', template);
34
+
35
+ const navigationKey = useMemo(() => {
36
+ const parentNavKey = `${
37
+ getPConnect().getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID) || getLandingPageViewName(getPConnect().getContextName())
38
+ }`;
39
+ return `${parentNavKey}-${getPConnect().getMetadata()?.name}-${ComponentName}`;
40
+ }, []);
41
+
42
+ const instructions = getInstructions(getPConnect(), props.instructions);
43
+
44
+ const storedTab = (PCore.getNavigationUtils().getComponentState(navigationKey) as any)?.activeTab;
45
+
46
+ const tabsFromChildren = deferLoadedTabs.props.getPConnect().getChildren();
47
+
48
+ const firstTabId = getFirstVisibleTabId(deferLoadedTabs, undefined);
49
+
50
+ const [currentTabId, setCurrentTabId] = useState(getActiveTabId(tabsFromChildren, storedTab || firstTabId));
51
+ const [tabVisibilityStr, setTabVisibilityStr] = useState('');
52
+ const { data: tabData, refreshTabData } = useGetTabsCount(deferLoadedTabs, 'hierarchical', currentTabId, template);
53
+
54
+ const handleCaseRefresh = (message: any) => {
55
+ if (message.subtype === 'tab') {
56
+ refreshTabData();
57
+ }
58
+ };
59
+
60
+ useEffect(() => {
61
+ let index = 0;
62
+ let caseSubId = '';
63
+ deferLoadedTabs.props
64
+ .getPConnect()
65
+ .getChildren()
66
+ ?.forEach((child: any) => {
67
+ const rawConfigProps = child.getPConnect().getRawConfigProps();
68
+ if ('visibility' in rawConfigProps) {
69
+ tabsVisibility[`${index}`] = rawConfigProps.visibility;
70
+ }
71
+ index += 1;
72
+ });
73
+
74
+ getPConnect().registerAdditionalProps({ tabsVisibility });
75
+ getPConnect().registerAdditionalProps({ lastUpdateCaseTime: '@P caseInfo.lastUpdateTime' });
76
+
77
+ if (fullCaseId) {
78
+ caseSubId = PCore.getMessagingServiceManager().getCaseSubscription(fullCaseId).subscribe({ caseId: fullCaseId }, handleCaseRefresh);
79
+ }
80
+
81
+ return () => {
82
+ if (fullCaseId) PCore.getMessagingServiceManager().getCaseSubscription(fullCaseId).unsubscribe(caseSubId);
83
+ };
84
+ }, []);
85
+
86
+ useEffect(() => {
87
+ refreshTabData();
88
+ }, [lastUpdateCaseTime]);
89
+
90
+ useEffect(() => {
91
+ const isVisibilityAvailable =
92
+ Object.values(tabsVisibility).length > 0 && Object.values(tabsVisibility).every(visibility => typeof visibility === 'boolean');
93
+ if (isVisibilityAvailable) {
94
+ let str = '';
95
+ Object.keys(tabsVisibility).forEach(key => {
96
+ str += key + tabsVisibility[key];
97
+ });
98
+ setTabVisibilityStr(str);
99
+ }
100
+ }, [tabsVisibility]);
101
+
102
+ useEffect(() => {
103
+ if (tabData && tabData.length) {
104
+ const activeTabId = getActiveTabId(tabData, currentTabId);
105
+ if (activeTabId !== currentTabId) {
106
+ setCurrentTabId(activeTabId);
107
+ }
108
+ }
109
+ }, [tabVisibilityStr, tabData]);
110
+
111
+ useEffect(() => {
112
+ PCore.getNavigationUtils().setComponentState(navigationKey, { activeTab: currentTabId });
113
+ const activeTabNavKey = `${getPConnect().getValue(PCore.getConstants().CASE_INFO.CASE_INFO_ID)}-CaseView-ActiveTab`;
114
+ PCore.getNavigationUtils().setComponentState(activeTabNavKey, { id: currentTabId });
115
+
116
+ return () => {
117
+ if (getPConnect().getContextName()?.includes('/modal')) {
118
+ PCore.getNavigationUtils().setComponentState(navigationKey, { activeTab: firstTabId });
119
+ }
120
+ };
121
+ }, [currentTabId, children]);
122
+
123
+ const handleTabClick = useCallback(
124
+ (event: SyntheticEvent, id: string) => {
125
+ tabClick(id, tabData, currentTabId, setCurrentTabId);
126
+ },
127
+ [tabData, currentTabId]
128
+ );
129
+
130
+ const tabItems = useMemo(() => tabData?.filter((tab: any) => tab.visibility()) ?? [], [tabData, tabVisibilityStr]);
131
+
132
+ const tabsRef = useRef(tabItems);
133
+ tabsRef.current = tabItems;
134
+
135
+ const updateTabErrorsOnViewMutate = useCallback((messageObject: any, tab: any) => {
136
+ if (!messageObject.type) {
137
+ return;
138
+ }
139
+ const previousTabErrors = tabErrorsRef.current;
140
+ let currentTabState = previousTabErrors[tab.id] || {};
141
+ const { MESSAGES_TYPE_ERROR } = PCore.getConstants().MESSAGES;
142
+ if (messageObject.type !== MESSAGES_TYPE_ERROR) {
143
+ delete currentTabState[messageObject.fieldName];
144
+ currentTabState = Object.keys(currentTabState).length > 0 ? currentTabState : undefined;
145
+ } else {
146
+ currentTabState = { ...currentTabState, [messageObject.fieldName]: messageObject.messages };
147
+ }
148
+ const newErrors = { ...previousTabErrors, [tab.id]: currentTabState };
149
+ tabErrorsRef.current = newErrors;
150
+ setTabErrors(newErrors);
151
+ }, []);
152
+
153
+ useEffect(() => {
154
+ const rawConfig = '_rawConfig';
155
+ tabItems.forEach((tab: any) => {
156
+ PCore.getContextTreeManager().onViewMutate(
157
+ tab.getPConnect().getContextName(),
158
+ tab.getPConnect().getPageReference(),
159
+ tab.getPConnect()[rawConfig].config?.name,
160
+ (messageObject: any) => updateTabErrorsOnViewMutate(messageObject, tab)
161
+ );
162
+ });
163
+ }, [tabItems, updateTabErrorsOnViewMutate]);
164
+
165
+ const navigateToFirstErrorTab = useCallback(() => {
166
+ const currentErrors = tabErrorsRef.current;
167
+ const firstTabWithError = tabsRef.current.find((tab: any) => {
168
+ const tabErrorState = currentErrors[tab.id];
169
+ return tabErrorState && Object.keys(tabErrorState).length > 0;
170
+ });
171
+ if (firstTabWithError) {
172
+ submitAttemptedRef.current = false;
173
+ setCurrentTabId(firstTabWithError.id);
174
+ }
175
+ }, []);
176
+
177
+ const highlightFirstErrorTab = useCallback(() => {
178
+ submitAttemptedRef.current = true;
179
+ navigateToFirstErrorTab();
180
+ }, [navigateToFirstErrorTab]);
181
+
182
+ useEffect(() => {
183
+ const { CURRENT_ASSIGNMENT_UPDATED } = PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS;
184
+ PCore.getPubSubUtils().subscribe(
185
+ CURRENT_ASSIGNMENT_UPDATED,
186
+ () => {
187
+ tabErrorsRef.current = {};
188
+ submitAttemptedRef.current = false;
189
+ setTabErrors({});
190
+ },
191
+ 'CURRENT_ASSIGNMENT_UPDATED-HierarchicalForm'
192
+ );
193
+
194
+ PCore.getPubSubUtils().subscribe(
195
+ PCore.getConstants().PUB_SUB_EVENTS.ERROR_ON_FINISH_ASSIGNMENT,
196
+ highlightFirstErrorTab,
197
+ 'ERROR_ON_FINISH_ASSIGNMENT-HierarchicalForm'
198
+ );
199
+
200
+ return () => {
201
+ PCore.getPubSubUtils().unsubscribe(CURRENT_ASSIGNMENT_UPDATED, 'CURRENT_ASSIGNMENT_UPDATED-HierarchicalForm');
202
+ PCore.getPubSubUtils().unsubscribe(
203
+ PCore.getConstants().PUB_SUB_EVENTS.ERROR_ON_FINISH_ASSIGNMENT,
204
+ 'ERROR_ON_FINISH_ASSIGNMENT-HierarchicalForm'
205
+ );
206
+ };
207
+ }, []);
208
+
209
+ useEffect(() => {
210
+ if (submitAttemptedRef.current) {
211
+ navigateToFirstErrorTab();
212
+ }
213
+ }, [tabErrors, navigateToFirstErrorTab]);
214
+
215
+ const processedTabs = useMemo(() => {
216
+ return tabItems.map(tab => {
217
+ const errorKeys = Object.keys(tabErrors[tab.id] ?? {});
218
+ const errors = errorKeys.length > 0 ? errorKeys.reduce((sum, fieldName) => sum + tabErrors[tab.id][fieldName].length, 0) : undefined;
219
+ return { ...tab, errors };
220
+ });
221
+ }, [tabItems, tabErrors]);
222
+
223
+ return { currentTabId, handleTabClick, processedTabs, instructions };
224
+ }
@@ -0,0 +1 @@
1
+ export { default } from './HierarchicalForm';
@@ -1,7 +1,7 @@
1
- import { PropsWithChildren, ReactElement } from 'react';
2
- import { Grid, Typography } from '@mui/material';
1
+ import type { PropsWithChildren, ReactElement } from 'react';
2
+ import { Grid2, Typography } from '@mui/material';
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 InlineDashboardProps extends PConnProps {
7
7
  // If any, enter additional props that only exist on this component
@@ -50,24 +50,22 @@ export default function InlineDashboard(props: PropsWithChildren<InlineDashboard
50
50
  </Typography>
51
51
 
52
52
  {filterPosition === 'block-start' && (
53
- <Grid container spacing={2} direction='column-reverse' className={classes.containerStyles}>
54
- <Grid item xs={12} className={classes.colStyles}>
53
+ <Grid2 container spacing={2} direction='column-reverse' className={classes.containerStyles}>
54
+ <Grid2 size={{ xs: 12 }} className={classes.colStyles}>
55
55
  {childrenToRender[0]}
56
- </Grid>
57
- <Grid id='filters' item xs={12} className={classes.filterContainerStyles}>
56
+ </Grid2>
57
+ <Grid2 id='filters' size={{ xs: 12 }} className={classes.filterContainerStyles}>
58
58
  {childrenToRender[1]}
59
- </Grid>
60
- </Grid>
59
+ </Grid2>
60
+ </Grid2>
61
61
  )}
62
62
  {filterPosition !== 'block-start' && (
63
- <Grid container spacing={2} direction={direction} className={classes.containerStyles}>
64
- <Grid item xs={9}>
65
- {childrenToRender[0]}
66
- </Grid>
67
- <Grid id='filters' item xs={3} className={classes.inlineStyles}>
63
+ <Grid2 container spacing={2} direction={direction} className={classes.containerStyles}>
64
+ <Grid2 size={{ xs: 9 }}>{childrenToRender[0]}</Grid2>
65
+ <Grid2 id='filters' size={{ xs: 3 }} className={classes.inlineStyles}>
68
66
  {childrenToRender[1]}
69
- </Grid>
70
- </Grid>
67
+ </Grid2>
68
+ </Grid2>
71
69
  )}
72
70
  </>
73
71
  );
@@ -1,8 +1,8 @@
1
- import { useMemo, Children, useEffect, useState, PropsWithChildren } from 'react';
1
+ import { useMemo, Children, useEffect, useState, type PropsWithChildren } from 'react';
2
2
 
3
3
  import { buildFilterComponents } from '@pega/react-sdk-components/lib/components/infra/DashboardFilter/filterUtils';
4
4
  import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
5
- import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
5
+ import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
6
6
 
7
7
  interface InlineDashboardPageProps extends PConnProps {
8
8
  // If any, enter additional props that only exist on this component
@@ -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 ListPageProps extends PConnProps {
5
5
  // If any, enter additional props that only exist on this component