@topconsultnpm/sdkui-react 6.21.0-dev3.5 → 6.21.0-dev3.7

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.
@@ -138,22 +138,19 @@ const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMul
138
138
  }
139
139
  if (delayFocus) {
140
140
  // Logica per il ritardo del focus (es. click singolo su icona desktop, gestito dal padre)
141
- if (clickTimeoutRef.current) {
142
- // Questo è il secondo click di un potenziale doppio click.
143
- // Annulla l'azione di focus dal click singolo precedente.
144
- clearTimeout(clickTimeoutRef.current);
145
- clickTimeoutRef.current = null;
146
- lastClickedNodeKeyRef.current = undefined;
147
- return; // Non attivare onFocusedItemChanged per il doppio click
141
+ // Il focus viene ritardato per permettere al doppio click di registrarsi sull'icona,
142
+ // ma il focus avviene comunque (sia con click singolo che doppio)
143
+ if (!clickTimeoutRef.current) {
144
+ // Primo click: imposta il timer per il focus
145
+ lastClickedNodeKeyRef.current = node.key;
146
+ clickTimeoutRef.current = setTimeout(() => {
147
+ onFocusedItemChanged?.(node);
148
+ clickTimeoutRef.current = null;
149
+ lastClickedNodeKeyRef.current = undefined;
150
+ }, 200);
148
151
  }
149
- // Primo click di un potenziale doppio click o un click singolo che necessita di ritardo
150
- lastClickedNodeKeyRef.current = node.key;
151
- clickTimeoutRef.current = setTimeout(() => {
152
- // Se il timer scade, significa che è stato solo un click singolo.
153
- onFocusedItemChanged?.(node);
154
- clickTimeoutRef.current = null;
155
- lastClickedNodeKeyRef.current = undefined;
156
- }, 200);
152
+ // Se c'è già un timer attivo (secondo click di doppio click), non fare nulla
153
+ // Il focus avverrà comunque quando scade il timer del primo click
157
154
  }
158
155
  else {
159
156
  // Logica per il focus immediato (per tutti gli altri click, o se shouldDelayFocusOnEvent è false)
@@ -264,7 +264,7 @@ const TMBlogCommentForm = (props) => {
264
264
  }, onMouseLeave: (e) => {
265
265
  e.currentTarget.style.boxShadow = '0 2px 4px rgba(0, 0, 0, 0.1)';
266
266
  e.currentTarget.style.backgroundColor = '#fff';
267
- }, children: [draft.ext ? (_jsxs("span", { style: { marginRight: '10px', display: 'flex', alignItems: 'center', position: 'relative', width: '30px' }, children: [getFileIcon(draft.ext, undefined, tooltipContent), draft.isSigned == 1 && _jsx("div", { style: { position: 'absolute', bottom: '-4px', right: '-7px' }, children: _jsx(TMTooltip, { content: "Documento firmato", children: _jsx(IconSignature, { fontSize: 28 }) }) })] })) : (_jsx(IconAttachment, { style: { marginRight: '5px' } })), _jsx("span", { style: { marginRight: '8px', display: 'flex', alignItems: 'center' }, children: draft.name }), draft.version && (_jsx("span", { style: {
267
+ }, children: [draft.ext ? (_jsxs("span", { style: { marginRight: '10px', display: 'flex', alignItems: 'center', position: 'relative', width: draft.isSigned ? '30px' : undefined }, children: [getFileIcon(draft.ext, undefined, tooltipContent), draft.isSigned == 1 && _jsx("div", { style: { position: 'absolute', bottom: '-4px', right: '-7px' }, children: _jsx(TMTooltip, { content: "Documento firmato", children: _jsx(IconSignature, { fontSize: 28 }) }) })] })) : (_jsx(IconAttachment, { style: { marginRight: '5px' } })), _jsx("span", { style: { marginRight: '8px', display: 'flex', alignItems: 'center' }, children: draft.name }), draft.version && (_jsx("span", { style: {
268
268
  display: 'inline-flex',
269
269
  width: '20px',
270
270
  height: '20px',
@@ -1238,7 +1238,12 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
1238
1238
  cursor: 'pointer',
1239
1239
  lineHeight: 1,
1240
1240
  whiteSpace: 'nowrap'
1241
- }, children: [allExpanded ? _jsx(IconChevronRight, { fontSize: 14 }) : _jsx(IconChevronDown, { fontSize: 14 }), _jsx("span", { children: allExpanded ? SDKUI_Localizator.CollapseAll : SDKUI_Localizator.ExpandAll })] }) })), _jsx("div", { style: { flex: 1, minHeight: 0, overflow: 'auto' }, children: _jsx(TMTreeView, { dataSource: mergedTreeData, itemRender: finalItemRender, calculateItemsForNode: calculateItemsForNode, onDataChanged: handleDataChanged, focusedItem: focusedItem, onFocusedItemChanged: handleFocusedItemChanged, allowMultipleSelection: allowMultipleSelection, selectedItems: selectedItems, itemsPerPage: 100, onSelectionChanged: handleSelectedItemsChanged, onItemContextMenu: onItemContextMenu }) }), showExpansionWaitPanel && (_jsx(TMWaitPanel, { title: isForMaster ? 'Caricamento documenti master' : 'Caricamento documenti dettaglio', showPrimary: true, textPrimary: expansionWaitPanelText, valuePrimary: expansionWaitPanelValue, maxValuePrimary: expansionWaitPanelMaxValue, isCancelable: true, abortController: expansionAbortController, onAbortClick: (abortController) => {
1241
+ }, children: [allExpanded ? _jsx(IconChevronRight, { fontSize: 14 }) : _jsx(IconChevronDown, { fontSize: 14 }), _jsx("span", { children: allExpanded ? SDKUI_Localizator.CollapseAll : SDKUI_Localizator.ExpandAll })] }) })), _jsx("div", { style: { flex: 1, minHeight: 0, overflow: 'auto' }, children: _jsx(TMTreeView, { dataSource: mergedTreeData, itemRender: finalItemRender, calculateItemsForNode: calculateItemsForNode, onDataChanged: handleDataChanged, focusedItem: focusedItem, onFocusedItemChanged: handleFocusedItemChanged, allowMultipleSelection: allowMultipleSelection, selectedItems: selectedItems, itemsPerPage: 100, onSelectionChanged: handleSelectedItemsChanged, onItemContextMenu: onItemContextMenu, shouldDelayFocusOnEvent: (node, e) => {
1242
+ // Ritarda il focus quando si clicca sull'icona del documento
1243
+ // per permettere al doppio click di funzionare
1244
+ const target = e.target;
1245
+ return !!target.closest('.tm-dcmt-icon');
1246
+ } }) }), showExpansionWaitPanel && (_jsx(TMWaitPanel, { title: isForMaster ? 'Caricamento documenti master' : 'Caricamento documenti dettaglio', showPrimary: true, textPrimary: expansionWaitPanelText, valuePrimary: expansionWaitPanelValue, maxValuePrimary: expansionWaitPanelMaxValue, isCancelable: true, abortController: expansionAbortController, onAbortClick: (abortController) => {
1242
1247
  setTimeout(() => {
1243
1248
  abortController?.abort();
1244
1249
  }, 100);
@@ -63,7 +63,7 @@ const TMBlogAttachments = (props) => {
63
63
  }
64
64
  ` })] })) : (_jsxs(_Fragment, { children: [(!archivedDocumentsExist && !draftExist) ?
65
65
  _jsx(IconAttachment, { style: { marginRight: "5px", flexShrink: 0 } }) :
66
- _jsx("div", { style: { marginRight: "10px", flexShrink: 0, width: "40px", }, children: _jsx(TMDcmtIcon, { tid: blogPostAttachment.tid, did: blogPostAttachment.did, fileExtension: fileExt, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent, isSigned: isSigned }) }), _jsx("span", { title: layoutMode === 'compact' ? name + " (DID: " + blogPostAttachment.did + ")" : undefined, style: {
66
+ _jsx("div", { style: { marginRight: "10px", flexShrink: 0, width: isSigned ? "40px" : undefined }, children: _jsx(TMDcmtIcon, { tid: blogPostAttachment.tid, did: blogPostAttachment.did, fileExtension: fileExt, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent, isSigned: isSigned }) }), _jsx("span", { title: layoutMode === 'compact' ? name + " (DID: " + blogPostAttachment.did + ")" : undefined, style: {
67
67
  whiteSpace: 'nowrap',
68
68
  overflow: 'hidden',
69
69
  textOverflow: 'ellipsis',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.21.0-dev3.5",
3
+ "version": "6.21.0-dev3.7",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",