@topconsultnpm/sdkui-react-beta 6.13.65 → 6.13.67
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/components/base/TMShowAllOrMaxItemsButton.js +6 -5
- package/lib/components/features/archive/TMArchive.js +130 -44
- package/lib/components/features/documents/TMDcmtForm.js +5 -6
- package/lib/components/features/documents/TMDcmtPreview.js +2 -2
- package/lib/components/features/documents/TMFileUploader.js +1 -1
- package/lib/components/features/search/TMSavedQuerySelector.js +4 -5
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchQueryPanel.js +1 -1
- package/lib/components/grids/TMRecentsManager.js +1 -1
- package/lib/components/index.d.ts +0 -3
- package/lib/components/index.js +0 -3
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +2 -2
- package/lib/helper/SDKUI_Localizator.d.ts +4 -0
- package/lib/helper/SDKUI_Localizator.js +40 -0
- package/lib/hooks/useDcmtOperations.js +2 -2
- package/lib/utils/theme.d.ts +1 -0
- package/lib/utils/theme.js +1 -0
- package/package.json +1 -1
- package/lib/components/base/TMPanelManager.d.ts +0 -11
- package/lib/components/base/TMPanelManager.js +0 -478
- package/lib/components/base/TMPanelManagerToolbar.d.ts +0 -23
- package/lib/components/base/TMPanelManagerToolbar.js +0 -109
- package/lib/components/base/TMPanelManagerUtils.d.ts +0 -37
- package/lib/components/base/TMPanelManagerUtils.js +0 -27
@@ -1,27 +0,0 @@
|
|
1
|
-
// Type guard to check if a value is an array of TMPanelItemConfig objects.
|
2
|
-
// Ensures that every item in the array is a non-null object with 'id' and 'contentOptions' properties.
|
3
|
-
export const isPanelArray = (content) => Array.isArray(content) && content.every(p => typeof p === 'object' && p !== null && 'id' in p && 'contentOptions' in p);
|
4
|
-
// Recursively flattens a nested array of panel configurations into a flat array of TMPanelEntry objects.
|
5
|
-
// - panels: the input array of TMPanelItemConfig.
|
6
|
-
// - parentId: optional ID of the parent panel (used for hierarchical relationships).
|
7
|
-
// - parentPath: string path of ancestor IDs, used to build a full, unique identifier for each panel.
|
8
|
-
export const flattenPanels = (panels, parentId = null, parentPath = '') => {
|
9
|
-
return panels.flatMap(panel => {
|
10
|
-
// Construct the full ID by appending the current panel ID to the parent path.
|
11
|
-
const fullId = parentPath ? `${parentPath}.${panel.id}` : panel.id;
|
12
|
-
let children = [];
|
13
|
-
// If the panel has nested content that is also a valid panel array, recursively flatten them.
|
14
|
-
if (isPanelArray(panel.contentOptions?.content)) {
|
15
|
-
children = flattenPanels(panel.contentOptions.content, fullId, fullId);
|
16
|
-
}
|
17
|
-
// Extract full IDs of all child entries.
|
18
|
-
const childrenIds = children.map(c => c.fullId);
|
19
|
-
const alternativePanelIds = panel.alternativePanelIds ?? [];
|
20
|
-
// Return the current panel as a TMPanelEntry followed by its flattened children.
|
21
|
-
return [{ fullId, config: panel, parentId, childrenIds, alternativePanelIds }, ...children];
|
22
|
-
});
|
23
|
-
};
|
24
|
-
// Checks if at least one panel is currently visible (i.e., at least one active button is true)
|
25
|
-
export const isAtLeastOnePanelVisible = (activeButtons) => Object.values(activeButtons).some(Boolean);
|
26
|
-
// Checks if exactly one panel is currently visible (i.e., only one active button is true)
|
27
|
-
export const isExactlyOnePanelVisible = (activeButtons) => Object.values(activeButtons).filter(Boolean).length === 1;
|