@topconsultnpm/sdkui-react 6.21.0-dev5.6 → 6.21.0-dev5.8
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.
|
@@ -515,16 +515,8 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
515
515
|
expanded: true,
|
|
516
516
|
isRoot: true
|
|
517
517
|
};
|
|
518
|
-
//
|
|
519
|
-
|
|
520
|
-
const containerChildren = docItems?.filter(child => child.isContainer) ?? [];
|
|
521
|
-
if (containerChildren.length === 1 && docItems && docItems.length > 0 && docItems[0].isContainer) {
|
|
522
|
-
const newFirstCorrelation = { ...docItems[0], expanded: true };
|
|
523
|
-
newFirstDoc = {
|
|
524
|
-
...newFirstDoc,
|
|
525
|
-
items: [newFirstCorrelation, ...docItems.slice(1)]
|
|
526
|
-
};
|
|
527
|
-
}
|
|
518
|
+
// NOTE: Le cartelle di correlazione rimangono con expanded: false.
|
|
519
|
+
// Verranno espanse solo tramite il pulsante "espandi n livelli" o espansione manuale.
|
|
528
520
|
// Update the container's items
|
|
529
521
|
newContainer = {
|
|
530
522
|
...newContainer,
|
|
@@ -533,11 +525,11 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
533
525
|
}
|
|
534
526
|
else if (firstDocOrContainer.isContainer) {
|
|
535
527
|
// First item is a container (correlation folder)
|
|
536
|
-
|
|
537
|
-
|
|
528
|
+
// NOTE: Le cartelle di correlazione rimangono con expanded: false.
|
|
529
|
+
// Verranno espanse solo tramite il pulsante "espandi n livelli" o espansione manuale.
|
|
538
530
|
let newFirstCorrelation = {
|
|
539
531
|
...firstDocOrContainer,
|
|
540
|
-
expanded:
|
|
532
|
+
expanded: false
|
|
541
533
|
};
|
|
542
534
|
// Find first document inside this container and mark for focus
|
|
543
535
|
const correlationItems = newFirstCorrelation.items;
|
|
@@ -1279,6 +1271,8 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
1279
1271
|
/**
|
|
1280
1272
|
* Recursively set the `expanded` property on every node that has children loaded.
|
|
1281
1273
|
* Nodes without `items` are left untouched (will be loaded lazily on user click).
|
|
1274
|
+
* NOTE: Solo i nodi con figli già caricati (isLoaded o hasChildren) vengono espansi.
|
|
1275
|
+
* I nodi con isExpandible ma senza figli caricati rimangono chiusi.
|
|
1282
1276
|
*/
|
|
1283
1277
|
const setExpandedRecursively = useCallback((nodes, expanded) => {
|
|
1284
1278
|
if (!nodes || !Array.isArray(nodes))
|
|
@@ -1286,8 +1280,9 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
1286
1280
|
return nodes.map(node => {
|
|
1287
1281
|
const hasChildren = Array.isArray(node.items) && node.items.length > 0;
|
|
1288
1282
|
const newItems = hasChildren ? setExpandedRecursively(node.items, expanded) : node.items;
|
|
1289
|
-
// Only toggle expansion if the node
|
|
1290
|
-
|
|
1283
|
+
// Only toggle expansion if the node has children already loaded.
|
|
1284
|
+
// Nodes with isExpandible but no loaded children stay collapsed (will be loaded lazily).
|
|
1285
|
+
const canExpand = hasChildren || node.isLoaded;
|
|
1291
1286
|
return { ...node, expanded: canExpand ? expanded : node.expanded, items: newItems };
|
|
1292
1287
|
});
|
|
1293
1288
|
}, []);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topconsultnpm/sdkui-react",
|
|
3
|
-
"version": "6.21.0-dev5.
|
|
3
|
+
"version": "6.21.0-dev5.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"lib"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@topconsultnpm/sdk-ts": "6.21.0-dev5.
|
|
42
|
+
"@topconsultnpm/sdk-ts": "6.21.0-dev5.3",
|
|
43
43
|
"@zip.js/zip.js": "2.8.26",
|
|
44
44
|
"buffer": "^6.0.3",
|
|
45
45
|
"devextreme": "^25.2.6",
|