@topconsultnpm/sdkui-react 6.21.0-dev3.2 → 6.21.0-dev3.21

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 (51) hide show
  1. package/lib/components/NewComponents/ContextMenu/styles.d.ts +4 -4
  2. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +2 -2
  3. package/lib/components/base/TMDataGrid.js +12 -2
  4. package/lib/components/base/TMDataGridExportForm.js +19 -8
  5. package/lib/components/base/TMFileManagerDataGridView.js +4 -4
  6. package/lib/components/base/TMFileManagerThumbnailItems.js +3 -3
  7. package/lib/components/base/TMFileManagerUtils.d.ts +7 -0
  8. package/lib/components/base/TMFileManagerUtils.js +14 -1
  9. package/lib/components/base/TMModal.js +2 -2
  10. package/lib/components/base/TMTreeView.js +12 -15
  11. package/lib/components/choosers/TMDynDataListItemChooser.js +6 -1
  12. package/lib/components/editors/TMEditorStyled.d.ts +6 -6
  13. package/lib/components/editors/TMMetadataEditor.js +6 -2
  14. package/lib/components/editors/TMMetadataValues.js +10 -2
  15. package/lib/components/features/blog/TMBlogCommentForm.js +5 -2
  16. package/lib/components/features/documents/TMCopyToFolderForm.js +2 -2
  17. package/lib/components/features/documents/TMDcmtIcon.js +1 -1
  18. package/lib/components/features/documents/TMMergeToPdfForm.js +2 -2
  19. package/lib/components/features/documents/TMRelationViewer.js +6 -1
  20. package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +0 -13
  21. package/lib/components/features/documents/copyAndMergeDcmtsShared.js +1 -39
  22. package/lib/components/features/search/TMMetadataOutputForm.d.ts +17 -0
  23. package/lib/components/features/search/TMMetadataOutputForm.js +225 -0
  24. package/lib/components/features/search/TMMetadataSorterForm.d.ts +17 -0
  25. package/lib/components/features/search/TMMetadataSorterForm.js +243 -0
  26. package/lib/components/features/search/TMSearchQueryEditor.js +14 -8
  27. package/lib/components/features/search/TMSearchQueryPanel.js +249 -58
  28. package/lib/components/features/search/TMSearchResult.js +2 -3
  29. package/lib/components/features/search/TMViewHistoryDcmt.js +1 -1
  30. package/lib/components/features/search/metadataFormHelper.d.ts +16 -0
  31. package/lib/components/features/search/metadataFormHelper.js +77 -0
  32. package/lib/components/grids/TMBlogAttachments.js +2 -2
  33. package/lib/components/grids/TMBlogsPost.js +5 -3
  34. package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
  35. package/lib/components/grids/TMBlogsPostUtils.js +3 -1
  36. package/lib/helper/MergePdfManager.js +7 -4
  37. package/lib/helper/SDKUI_Globals.js +2 -1
  38. package/lib/helper/SDKUI_Localizator.d.ts +4 -0
  39. package/lib/helper/SDKUI_Localizator.js +40 -0
  40. package/lib/helper/TMUtils.d.ts +23 -0
  41. package/lib/helper/TMUtils.js +55 -0
  42. package/lib/helper/checkinCheckoutManager.d.ts +4 -3
  43. package/lib/helper/checkinCheckoutManager.js +29 -11
  44. package/lib/hooks/useCheckInOutOperations.d.ts +4 -3
  45. package/lib/hooks/useDataUserIdItem.js +1 -1
  46. package/lib/hooks/useDcmtOperations.d.ts +18 -1
  47. package/lib/hooks/useDcmtOperations.js +67 -21
  48. package/lib/hooks/useDocumentOperations.js +3 -3
  49. package/lib/hooks/useRelatedDocuments.js +4 -4
  50. package/lib/services/platform_services.d.ts +4 -4
  51. package/package.json +10 -7
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
- import { PlatformObjectValidator, QueryDescriptor, WhereItem, SDK_Localizator, OrderByItem, SelectItem, SelectItemVisibilities, SDK_Globals, SavedQueryCacheService, SearchEngine, QueryOperators, AccessLevelsEx, AccessLevels } from '@topconsultnpm/sdk-ts';
3
+ import { PlatformObjectValidator, QueryDescriptor, WhereItem, SDK_Localizator, SelectItemVisibilities, SDK_Globals, SavedQueryCacheService, SearchEngine, QueryOperators, AccessLevelsEx, AccessLevels } from '@topconsultnpm/sdk-ts';
4
4
  import styled from 'styled-components';
5
5
  import TMSearchQueryEditor from './TMSearchQueryEditor';
6
- import { getDcmtTypesByQdAsync, SDKUI_Localizator, getQD, IconMenuVertical, IconAddCircleOutline, IconEdit, IconEasy, IconAdvanced, deepCompare, IconSearch, IconClear, getDefaultOperator, prepareQdForSearchAsync, IsParametricQuery, SDKUI_Globals, IconArrowRight, IconMenuCAArchive, getListMaxItems, DEFAULT_MAX_DCMTS_TO_BE_RETURNED } from '../../../helper';
6
+ import { getDcmtTypesByQdAsync, SDKUI_Localizator, getQD, IconMenuVertical, IconAddCircleOutline, IconEdit, IconEasy, IconAdvanced, deepCompare, IconSearch, IconClear, getDefaultOperator, prepareQdForSearchAsync, IsParametricQuery, SDKUI_Globals, IconArrowRight, IconMenuCAArchive, getListMaxItems, DEFAULT_MAX_DCMTS_TO_BE_RETURNED, IconSortAsc, IconSortDesc, IconFilter, IconColumns, IconSort } from '../../../helper';
7
7
  import { useQueryParametersDialog } from '../../../hooks/useQueryParametersDialog';
8
8
  import { FormModes } from '../../../ts';
9
9
  import { TMColors } from '../../../utils/theme';
@@ -21,6 +21,9 @@ import TMSavedQueryForm from './TMSavedQueryForm';
21
21
  import { ContextMenu } from '../../NewComponents/ContextMenu';
22
22
  import { AdvancedMenuButtons } from '../../editors/TMMetadataValues';
23
23
  import TMToppyMessage from '../../../helper/TMToppyMessage';
24
+ import TMMetadataSorterForm from './TMMetadataSorterForm';
25
+ import TMMetadataOutputForm from './TMMetadataOutputForm';
26
+ import TMTooltip from '../../base/TMTooltip';
24
27
  const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, SQD, inputMids, onSearchCompleted, onSqdSaved, onBack, onClosePanel, allowMaximize = true, onMaximizePanel, onBackToResult, passToArchiveCallback, maxDcmtsToBeReturned }) => {
25
28
  const [confirmQueryParams, ConfirmQueryParamsDialog] = useQueryParametersDialog();
26
29
  const [qd, setQd] = useState();
@@ -34,7 +37,7 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
34
37
  const [showAdvancedSearch, setShowAdvancedSearch] = useState(false);
35
38
  const [showFiltersConfig, setShowFiltersConfig] = useState(false);
36
39
  const [showOutputConfig, setShowOutputConfig] = useState(false);
37
- const [showOrderByConfig, setShowOrderByConfig] = useState(false);
40
+ const [showMetadataSorterForm, setShowMetadataSorterForm] = useState(false);
38
41
  const [showDistinctValuesPanel, setShowDistinctValuesPanel] = useState(false);
39
42
  const [focusedTidMid, setFocusedTidMid] = useState();
40
43
  const [modalIsOpen, setModalIsOpen] = useState(false);
@@ -162,7 +165,7 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
162
165
  newWi.init({ ...curItem, value1: undefined, value2: undefined });
163
166
  return newWi;
164
167
  });
165
- setQd({ ...qd, where: newWhere });
168
+ setQd({ ...qd, where: newWhere, orderBy: [] });
166
169
  };
167
170
  const searchAsync = async (qdInput, isAdvancedSearch) => {
168
171
  onSearchCompleted?.([], undefined); // reset results
@@ -266,70 +269,84 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
266
269
  setQd({ ...qd, where: newWhere });
267
270
  }, [qd, fromDTD?.metadata, SQD?.masterTID]);
268
271
  const handleCloseOutputConfig = useCallback(() => setShowOutputConfig(false), []);
269
- const handleChooseOutput = useCallback((tid_mids) => {
270
- if (!fromDTD?.metadata)
271
- return;
272
- if (!tid_mids)
273
- return;
274
- // copia dei SelectItems senza i rimossi
275
- let newSelect = qd?.select?.filter(item => tid_mids?.some(tm => tm.mid == item.mid)) ?? [];
276
- // aggiungiamo i nuovi
277
- for (const tm of tid_mids.filter(tm => !qd?.select?.some(item => item.mid == tm.mid))) {
278
- let md = fromDTD?.metadata.find(o => o.id == tm.mid);
279
- let si = new SelectItem();
280
- si.visibility = SelectItemVisibilities.Visible;
281
- si.tid = SQD?.masterTID;
282
- si.mid = md?.id;
283
- let indexMD = 0;
284
- for (const m of fromDTD?.metadata ?? []) {
285
- if (m.id == si.mid)
286
- break;
287
- if (newSelect.findIndex(o => o.mid == m.id && o.tid == SQD?.masterTID) < 0)
288
- continue;
289
- indexMD++;
290
- }
291
- newSelect.splice(indexMD, 0, si);
292
- }
293
- setQd({ ...qd, select: newSelect });
294
- }, [qd, fromDTD?.metadata, SQD?.masterTID]);
295
- const handleCloseOrderByConfig = useCallback(() => setShowOrderByConfig(false), []);
296
- const handleChooseOrderBy = useCallback((tid_mids) => {
297
- if (!fromDTD?.metadata)
298
- return;
299
- if (!tid_mids)
300
- return;
301
- // copia dei OrderByItems senza i rimossi
302
- let newOrderBy = qd?.orderBy?.filter(item => tid_mids?.some(tm => tm.mid == item.mid)) ?? [];
303
- // aggiungiamo i nuovi
304
- for (const tm of tid_mids.filter(tm => !qd?.orderBy?.some(item => item.mid == tm.mid))) {
305
- let md = fromDTD?.metadata.find(o => o.id == tm.mid);
306
- let oi = new OrderByItem();
307
- oi.tid = SQD?.masterTID;
308
- oi.mid = md?.id;
309
- oi.asc = true;
310
- newOrderBy.push(oi);
311
- }
312
- setQd({ ...qd, orderBy: newOrderBy });
313
- }, [qd, fromDTD?.metadata, SQD?.masterTID]);
314
272
  const contextMenuItems = useMemo(() => [
315
273
  ...(showBackToResultButton ? [{ icon: _jsx(IconArrowRight, {}), name: "Vai a risultato", onClick: () => { onBackToResult?.(); } }] : []),
316
274
  { icon: _jsx(IconAddCircleOutline, {}), name: SDKUI_Localizator.SavedQueryNew, beginGroup: showBackToResultButton, onClick: () => { openSqdForm(FormModes.Create); } },
317
275
  { icon: _jsx(IconEdit, {}), name: SDKUI_Localizator.SavedQueryUpdate, disabled: (SQD && SQD.id == 1), onClick: () => { openSqdForm(FormModes.Update); } },
318
276
  { icon: showAdvancedSearch ? _jsx(IconEasy, {}) : _jsx(IconAdvanced, {}), beginGroup: true, name: showAdvancedSearch ? SDKUI_Localizator.Search_Easy : SDKUI_Localizator.Search_Advanced, onClick: () => { changeAdvancedSearchAsync(!showAdvancedSearch); } },
319
- { icon: _jsx(IconEdit, {}), name: `${SDKUI_Localizator.Configure} - ${SDK_Localizator.QueryWhere}`, beginGroup: true, onClick: () => { setShowFiltersConfig(true); } },
320
- { icon: _jsx(IconEdit, {}), name: `${SDKUI_Localizator.Configure} - ${SDK_Localizator.QuerySelect}`, onClick: () => { setShowOutputConfig(true); } },
321
- { icon: _jsx(IconEdit, {}), name: `${SDKUI_Localizator.Configure} - ${SDK_Localizator.QueryOrderBy}`, onClick: () => { setShowOrderByConfig(true); } },
277
+ { icon: _jsx(IconFilter, {}), name: `${SDKUI_Localizator.Configure} - ${SDK_Localizator.QueryWhere}`, beginGroup: true, onClick: () => { setShowFiltersConfig(true); } },
278
+ { icon: _jsx(IconColumns, {}), name: `${SDKUI_Localizator.Configure} - ${SDK_Localizator.QuerySelect}`, onClick: () => { setShowOutputConfig(true); } },
279
+ { icon: _jsx(IconSort, {}), name: `${SDKUI_Localizator.Configure} - ${SDK_Localizator.QueryOrderBy}`, onClick: () => { setShowMetadataSorterForm(true); } },
322
280
  { icon: _jsx(IconMenuCAArchive, { viewBox: '11 11.5 26 27', fontSize: 16, strokeWidth: 2, color: 'black' }), beginGroup: true, name: SDKUI_Localizator.PassToArchive, disabled: fromDTD?.perm?.canArchive !== AccessLevelsEx.Yes && fromDTD?.perm?.canArchive !== AccessLevelsEx.Mixed, onClick: handlePassToArchive }
323
- ], [showBackToResultButton, showAdvancedSearch, SQD, onBackToResult, openSqdForm, changeAdvancedSearchAsync, setShowFiltersConfig, setShowOutputConfig, setShowOrderByConfig, handlePassToArchive, fromDTD?.perm?.canArchive]);
281
+ ], [showBackToResultButton, showAdvancedSearch, SQD, onBackToResult, openSqdForm, changeAdvancedSearchAsync, setShowFiltersConfig, setShowOutputConfig, handlePassToArchive, fromDTD?.perm?.canArchive]);
324
282
  const captionText = showAllMdWhere ? SDKUI_Localizator.ShowLess : SDKUI_Localizator.ShowAll;
325
283
  let maxItems = getListMaxItems(deviceType ?? DeviceType.DESKTOP);
326
284
  const diff = (qd?.where?.length ?? 0) - maxItems;
285
+ // Calcola se mostrare i badges di output
286
+ // Non mostrare se: modalità avanzata, tutti i metadati selezionati, o tutti tranne quelli di sistema
287
+ const shouldShowOutputBadges = useMemo(() => {
288
+ // In modalità avanzata non mostrare mai i badges di output
289
+ if (showAdvancedSearch)
290
+ return false;
291
+ if (!qd?.select || qd.select.length === 0)
292
+ return false;
293
+ if (!fromDTD?.metadata)
294
+ return true;
295
+ // Filtra i metadati disponibili per output (stessa logica usata in TMMetadataOutputForm)
296
+ const availableOutputMetadata = fromDTD.metadata.filter(o => o.perm?.canView === AccessLevels.Yes || o.perm?.canUpdate === AccessLevels.Yes);
297
+ // Metadati non di sistema disponibili per output
298
+ const availableNonSystemMetadata = availableOutputMetadata.filter(o => o.isSystem !== 1);
299
+ const selectedCount = qd.select.length;
300
+ const totalAvailable = availableOutputMetadata.length;
301
+ const totalNonSystem = availableNonSystemMetadata.length;
302
+ // Non mostrare se sono selezionati tutti i metadati disponibili
303
+ if (selectedCount === totalAvailable)
304
+ return false;
305
+ // Non mostrare se sono selezionati tutti i metadati non di sistema
306
+ // (verifica che tutti quelli selezionati siano non di sistema e che siano tutti)
307
+ const selectedMids = new Set(qd.select.map(s => s.mid));
308
+ const allSelectedAreNonSystem = qd.select.every(s => {
309
+ const md = fromDTD.metadata?.find(m => m.id === s.mid);
310
+ return md && md.isSystem !== 1;
311
+ });
312
+ const allNonSystemAreSelected = availableNonSystemMetadata.every(m => selectedMids.has(m.id));
313
+ if (allSelectedAreNonSystem && allNonSystemAreSelected && selectedCount === totalNonSystem) {
314
+ return false;
315
+ }
316
+ return true;
317
+ }, [showAdvancedSearch, qd?.select, fromDTD?.metadata]);
318
+ // In modalità avanzata non mostrare i badges di ordinamento
319
+ const shouldShowOrderByBadges = useMemo(() => {
320
+ if (showAdvancedSearch)
321
+ return false;
322
+ return qd?.orderBy && qd.orderBy.length > 0;
323
+ }, [showAdvancedSearch, qd?.orderBy]);
327
324
  return (_jsxs(_Fragment, { children: [_jsxs(TMPanel, { title: fromDTD?.nameLoc ?? SDKUI_Localizator.Search_Metadata, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, onBack: onBack, onActiveChanged: handlePanelActiveChanged, toolbar: _jsx(_Fragment, { children: (SQD && !showSqdForm) ?
328
325
  _jsx(ContextMenu, { items: contextMenuItems, trigger: "left", children: _jsx(TMButton, { btnStyle: 'icon', caption: 'Altro', icon: _jsx(IconMenuVertical, { color: 'white' }), showTooltip: false, onClick: () => setIsQueryPanelActive(true) }) })
329
326
  : _jsx(_Fragment, {}) }), children: [_jsx(ConfirmQueryParamsDialog, {}), SQD
330
327
  ? _jsxs("div", { onContextMenu: (e) => e.preventDefault(), style: { height: '100%', width: '100%', position: 'relative', display: showSqdForm ? 'none' : 'flex', flexDirection: 'column', gap: 5 }, children: [showAdvancedSearch
331
328
  ? _jsx(TMQueryEditor, { formMode: FormModes.Update, showToolbar: false, inputData: qd, validateSelect: true, showApply: false, onQDChanged: handleQdChanged, updateIsModalOpen: updateIsModalOpen })
332
- : _jsx(TMSearchQueryEditor, { qd: qd, dcmtTypesList: dcmtTypesList, isExpertMode: isExpertMode, showAllMdWhere: showAllMdWhere, onQdChanged: handleQdChanged, onFocusedMetadataChanged: setFocusedTidMid, onAdvancedMenuClick: handleAdvancedMenuClick, updateIsModalOpen: updateIsModalOpen }), _jsxs("div", { style: {
329
+ : _jsx(TMSearchQueryEditor, { qd: qd, dcmtTypesList: dcmtTypesList, isExpertMode: isExpertMode, showAllMdWhere: showAllMdWhere, onQdChanged: handleQdChanged, onFocusedMetadataChanged: setFocusedTidMid, onAdvancedMenuClick: handleAdvancedMenuClick, updateIsModalOpen: updateIsModalOpen }), shouldShowOutputBadges && qd?.select && qd.select.length > 0 && (_jsxs(StyledSelectBadgesContainer, { children: [_jsxs(StyledSelectLabel, { children: [SDK_Localizator.QuerySelect, ":"] }), _jsx(StyledSelectBadgesWrapper, { children: (() => {
330
+ const selectItems = qd.select ?? [];
331
+ const maxVisible = isMobile ? 1 : 2;
332
+ const visibleItems = selectItems.slice(0, maxVisible);
333
+ const hiddenCount = selectItems.length - maxVisible;
334
+ return (_jsxs(_Fragment, { children: [visibleItems.map((si, index) => {
335
+ const md = fromDTD?.metadata?.find(m => m.id === si.mid);
336
+ const mdName = md?.nameLoc ?? md?.name ?? `MID ${si.mid}`;
337
+ return (_jsxs(StyledSelectBadge, { children: [_jsx(IconColumns, { fontSize: 12 }), _jsx("span", { className: "badge-name", children: mdName })] }, `${si.tid}-${si.mid}-${index}`));
338
+ }), hiddenCount > 0 && (_jsxs(StyledSelectBadgeMore, { onClick: () => setShowOutputConfig(true), children: ["+", hiddenCount] }))] }));
339
+ })() }), _jsx(StyledSelectEditButton, { title: SDKUI_Localizator.Configure, onClick: () => setShowOutputConfig(true), children: _jsx(IconEdit, { fontSize: 16 }) })] })), shouldShowOrderByBadges && qd?.orderBy && qd.orderBy.length > 0 && (_jsxs(StyledOrderByBadgesContainer, { children: [_jsxs(StyledOrderByLabel, { children: [qd.orderBy.length === 1 ? SDKUI_Localizator.SortBy : SDKUI_Localizator.SortByPlural, ":"] }), _jsx(StyledOrderByBadgesWrapper, { children: (() => {
340
+ const orderByItems = qd.orderBy ?? [];
341
+ const maxVisible = isMobile ? 1 : 2;
342
+ const visibleItems = orderByItems.slice(0, maxVisible);
343
+ const hiddenCount = orderByItems.length - maxVisible;
344
+ return (_jsxs(_Fragment, { children: [visibleItems.map((obi, index) => {
345
+ const md = fromDTD?.metadata?.find(m => m.id === obi.mid);
346
+ const mdName = md?.nameLoc ?? md?.name ?? `MID ${obi.mid}`;
347
+ return (_jsxs(StyledOrderByBadge, { children: [_jsx(TMTooltip, { content: obi.asc !== false ? SDKUI_Localizator.ValueAscending : SDKUI_Localizator.ValueDescending, children: obi.asc !== false ? (_jsx(IconSortAsc, { fontSize: 12 })) : (_jsx(IconSortDesc, { fontSize: 12 })) }), _jsx("span", { className: "badge-name", children: mdName })] }, `${obi.tid}-${obi.mid}-${index}`));
348
+ }), hiddenCount > 0 && (_jsxs(StyledOrderByBadgeMore, { onClick: () => setShowMetadataSorterForm(true), children: ["+", hiddenCount] }))] }));
349
+ })() }), _jsx(StyledOrderByEditButton, { title: SDKUI_Localizator.Configure, onClick: () => setShowMetadataSorterForm(true), children: _jsx(IconEdit, { fontSize: 16 }) })] })), _jsxs("div", { style: {
333
350
  display: 'flex',
334
351
  flexWrap: 'wrap',
335
352
  justifyContent: 'center',
@@ -338,8 +355,12 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
338
355
  width: '100%'
339
356
  }, children: [_jsx(TMButton, { btnStyle: 'advanced', icon: _jsx(IconSearch, {}), showTooltip: false, width: '90px', caption: SDKUI_Localizator.Search, advancedColor: '#4A96D2', onClick: handleSearchButtonClick }), _jsx(TMButton, { width: '90px', btnStyle: 'advanced', advancedType: 'primary', showTooltip: false, caption: SDKUI_Localizator.Clear, icon: _jsx(IconClear, {}), advancedColor: 'white', color: 'primaryOutline', onClick: clearFilters }), (!showAdvancedSearch && qd?.where && qd.where.length > initialMaxItems) && (_jsx(TMButton, { width: '120px', btnStyle: isMobile ? 'icon' : 'advanced', advancedColor: TMColors.button_primary, caption: captionText, showTooltip: false, icon: isMobile ? (_jsx("div", { children: _jsx("p", { children: showAllMdWhere ? `-${diff}` : `+${diff}` }) })) : (_jsx("p", { children: showAllMdWhere ? `-${diff}` : `+${diff}` })), onClick: () => setShowAllMdWhere(!showAllMdWhere) }))] }), showFiltersConfig &&
340
357
  _jsx(TMMetadataChooserForm, { allowMultipleSelection: true, height: '500px', width: '600px', allowSysMetadata: true, filterMetadata: (o => o.perm?.canSearch === AccessLevels.Yes), qd: qd, selectedIDs: qd?.where?.map((w) => ({ tid: w.tid, mid: w.mid })), onClose: handleCloseFiltersConfig, onChoose: handleChooseFilters }), showOutputConfig &&
341
- _jsx(TMMetadataChooserForm, { allowMultipleSelection: true, height: '500px', width: '600px', allowSysMetadata: true, filterMetadata: (o => o.perm?.canView === AccessLevels.Yes || o.perm?.canUpdate === AccessLevels.Yes), qd: qd, selectedIDs: qd?.select?.map((item) => ({ tid: item.tid, mid: item.mid })), onClose: handleCloseOutputConfig, onChoose: handleChooseOutput }), showOrderByConfig &&
342
- _jsx(TMMetadataChooserForm, { allowMultipleSelection: true, height: '500px', width: '600px', allowSysMetadata: true, filterMetadata: (o => o.perm?.canView === AccessLevels.Yes || o.perm?.canUpdate === AccessLevels.Yes), qd: qd, selectedIDs: qd?.orderBy?.map((item) => ({ tid: item.tid, mid: item.mid })), onClose: handleCloseOrderByConfig, onChoose: handleChooseOrderBy })] })
358
+ _jsx(TMMetadataOutputForm, { qd: qd, selectedSelectItems: qd?.select, allowSysMetadata: true, filterMetadata: (o => o.perm?.canView === AccessLevels.Yes || o.perm?.canUpdate === AccessLevels.Yes), onClose: handleCloseOutputConfig, onChoose: (selectItems) => {
359
+ setQd({ ...qd, select: selectItems });
360
+ } }), showMetadataSorterForm &&
361
+ _jsx(TMMetadataSorterForm, { qd: qd, selectedOrderByItems: qd?.orderBy, allowSysMetadata: true, filterMetadata: (o => o.perm?.canView === AccessLevels.Yes || o.perm?.canUpdate === AccessLevels.Yes), onClose: () => setShowMetadataSorterForm(false), onChoose: (orderByItems) => {
362
+ setQd({ ...qd, orderBy: orderByItems });
363
+ } })] })
343
364
  :
344
365
  _jsx(TMToppyMessage, { message: SDKUI_Localizator.DcmtTypeSelectOrQuickSearch, titleTooltip: SDKUI_Localizator.DcmtTypeSelectOrQuickSearch }), showSqdForm &&
345
366
  _jsx(StyledModalContainer, { style: { backgroundColor: `${TMColors.backgroundColorHeader}12` }, children: _jsx(TMSavedQueryForm, { height: '50%', width: '50%', id: formModeSqdForm === FormModes.Create ? -1 : SQD?.id, title: 'Ricerca rapida', formMode: formModeSqdForm, showBackButton: true, qd: qd, isAdvancedSearch: showAdvancedSearch, isModal: false, onClose: () => { setShowSqdForm(false); }, onSaved: onSqdSaved }) })] }), showDistinctValuesPanel &&
@@ -415,6 +436,174 @@ export const refreshLastSearch = async (qd) => {
415
436
  }
416
437
  return searchResults;
417
438
  };
439
+ // =============================================================================
440
+ // STYLED COMPONENTS per i badge degli ordinamenti
441
+ // =============================================================================
442
+ const StyledOrderByBadgesContainer = styled.div `
443
+ display: flex;
444
+ flex-wrap: wrap;
445
+ align-items: center;
446
+ gap: 8px;
447
+ padding: 6px 10px;
448
+ margin: 1px 0;
449
+ background: linear-gradient(135deg, rgba(74, 150, 210, 0.08) 0%, rgba(37, 89, 165, 0.08) 100%);
450
+ border-radius: 8px;
451
+ border: 1px solid rgba(74, 150, 210, 0.2);
452
+ `;
453
+ const StyledOrderByLabel = styled.span `
454
+ font-size: 0.82rem;
455
+ font-weight: 600;
456
+ color: #4A96D2;
457
+ white-space: nowrap;
458
+ `;
459
+ const StyledOrderByBadgesWrapper = styled.div `
460
+ display: flex;
461
+ flex-wrap: wrap;
462
+ gap: 6px;
463
+ align-items: center;
464
+ flex: 1;
465
+ `;
466
+ const StyledOrderByBadge = styled.div `
467
+ display: inline-flex;
468
+ align-items: center;
469
+ gap: 4px;
470
+ padding: 3px 8px;
471
+ background: white;
472
+ border: 1px solid #d1d9e6;
473
+ border-radius: 16px;
474
+ font-size: 0.82rem;
475
+ color: #333;
476
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
477
+
478
+ .badge-name {
479
+ max-width: 120px;
480
+ overflow: hidden;
481
+ text-overflow: ellipsis;
482
+ white-space: nowrap;
483
+
484
+ @media (max-width: 600px) {
485
+ max-width: 80px;
486
+ }
487
+ }
488
+ `;
489
+ const StyledOrderByBadgeMore = styled.div `
490
+ display: inline-flex;
491
+ align-items: center;
492
+ justify-content: center;
493
+ padding: 3px 10px;
494
+ background: linear-gradient(135deg, #4A96D2 0%, #2559A5 100%);
495
+ border: none;
496
+ border-radius: 16px;
497
+ font-size: 0.82rem;
498
+ font-weight: 600;
499
+ color: white;
500
+ cursor: pointer;
501
+ transition: all 0.2s ease;
502
+
503
+ &:hover {
504
+ transform: scale(1.05);
505
+ box-shadow: 0 2px 6px rgba(74, 150, 210, 0.4);
506
+ }
507
+ `;
508
+ const StyledOrderByEditButton = styled.div `
509
+ display: flex;
510
+ align-items: center;
511
+ justify-content: center;
512
+ width: 28px;
513
+ height: 28px;
514
+ border-radius: 4px;
515
+ color: #4A96D2;
516
+ cursor: pointer;
517
+ transition: all 0.2s ease;
518
+
519
+ &:hover {
520
+ background-color: rgba(74, 150, 210, 0.15);
521
+ }
522
+ `;
523
+ // =============================================================================
524
+ // STYLED COMPONENTS per i badge degli output (select) - colore verde/teal
525
+ // =============================================================================
526
+ const StyledSelectBadgesContainer = styled.div `
527
+ display: flex;
528
+ flex-wrap: wrap;
529
+ align-items: center;
530
+ gap: 8px;
531
+ padding: 6px 10px;
532
+ margin: 1px 0;
533
+ background: linear-gradient(135deg, rgba(46, 125, 50, 0.08) 0%, rgba(27, 94, 32, 0.08) 100%);
534
+ border-radius: 8px;
535
+ border: 1px solid rgba(46, 125, 50, 0.2);
536
+ `;
537
+ const StyledSelectLabel = styled.span `
538
+ font-size: 0.82rem;
539
+ font-weight: 600;
540
+ color: #2E7D32;
541
+ white-space: nowrap;
542
+ `;
543
+ const StyledSelectBadgesWrapper = styled.div `
544
+ display: flex;
545
+ flex-wrap: wrap;
546
+ gap: 6px;
547
+ align-items: center;
548
+ flex: 1;
549
+ `;
550
+ const StyledSelectBadge = styled.div `
551
+ display: inline-flex;
552
+ align-items: center;
553
+ gap: 4px;
554
+ padding: 3px 8px;
555
+ background: white;
556
+ border: 1px solid #c8e6c9;
557
+ border-radius: 16px;
558
+ font-size: 0.82rem;
559
+ color: #333;
560
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
561
+
562
+ .badge-name {
563
+ max-width: 120px;
564
+ overflow: hidden;
565
+ text-overflow: ellipsis;
566
+ white-space: nowrap;
567
+
568
+ @media (max-width: 600px) {
569
+ max-width: 80px;
570
+ }
571
+ }
572
+ `;
573
+ const StyledSelectBadgeMore = styled.div `
574
+ display: inline-flex;
575
+ align-items: center;
576
+ justify-content: center;
577
+ padding: 3px 10px;
578
+ background: linear-gradient(135deg, #43A047 0%, #2E7D32 100%);
579
+ border: none;
580
+ border-radius: 16px;
581
+ font-size: 0.82rem;
582
+ font-weight: 600;
583
+ color: white;
584
+ cursor: pointer;
585
+ transition: all 0.2s ease;
586
+
587
+ &:hover {
588
+ transform: scale(1.05);
589
+ box-shadow: 0 2px 6px rgba(46, 125, 50, 0.4);
590
+ }
591
+ `;
592
+ const StyledSelectEditButton = styled.div `
593
+ display: flex;
594
+ align-items: center;
595
+ justify-content: center;
596
+ width: 28px;
597
+ height: 28px;
598
+ border-radius: 4px;
599
+ color: #2E7D32;
600
+ cursor: pointer;
601
+ transition: all 0.2s ease;
602
+
603
+ &:hover {
604
+ background-color: rgba(46, 125, 50, 0.15);
605
+ }
606
+ `;
418
607
  export const StyledToppyTextContainer = styled.div `
419
608
  padding: 22px 8px;
420
609
  width: 100%;
@@ -433,11 +622,13 @@ export const StyledToppyText = styled.p `
433
622
  font-size: 1rem;
434
623
  user-select: none;
435
624
  -webkit-touch-callout: none;
436
- -webkit-user-select: none;
625
+ -webkit-user-select: none;
626
+ -moz-user-select: none;
627
+ -ms-user-select: none;
437
628
  margin: 0;
438
629
  display: -webkit-box;
439
630
  -webkit-box-orient: vertical;
440
- -webkit-line-clamp: 3; /* non è una proprietà standard ma è così diffusa e ben supportata che è considerata una "best practice pragmatica" */
631
+ -webkit-line-clamp: 3;
441
632
  overflow: hidden;
442
633
  text-overflow: ellipsis;
443
634
  white-space: normal;
@@ -635,7 +635,7 @@ handleNavigateToWGs, handleNavigateToDossiers, }) => {
635
635
  _jsxs(_Fragment, { children: [_jsxs(TMLayoutItem, { height: '100%', children: [_jsxs("div", { ref: floatingBarContainerRef, style: { position: 'relative', height: '100%', width: '100%' }, children: [_jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: Gutters.getGutters(), separatorActiveColor: 'transparent', separatorColor: 'transparent', min: ['0', '0'], showSeparator: showSelector && deviceType !== DeviceType.MOBILE, start: showSelector ? deviceType !== DeviceType.MOBILE ? ['30%', '70%'] : splitterSize : ['0%', '100%'], children: [showSelector ?
636
636
  _jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, selectedSearchResult: selectedSearchResult, autoSelectFirst: !isMobile || currentSearchResults.length === 1, onSelectionChanged: onSearchResultSelectionChanged }) })
637
637
  :
638
- _jsx(_Fragment, {}), _jsx(TMLayoutItem, { children: _jsx(TMSearchResultGrid, { openInOffice: openInOffice, fromDTD: fromDTD, operationItems: operationItems, allUsers: allUsers, inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, showExportForm: showExportForm, onFocusedItemChanged: setFocusedItem, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync(inputDcmts, downloadType, downloadMode, onFileOpened, confirmAttachments), lastUpdateSearchTime: lastUpdateSearchTime, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], onSelectionChanged: (items) => { setSelectedItems(items); }, onDblClick: () => openFormHandler(LayoutModes.Update), showSearchTMDatagrid: showSearchTMDatagrid, onVisibleItemChanged: setVisibleItems, updateDataColumnsFromDataGrid: updateDataColumnsFromDataGrid, updateDataSourceFromDataGrid: updateDataSourceFromDataGrid, updateSelectedRowKeysFromDataGrid: updateSelectedRowKeysFromDataGrid }) })] }), renderFloatingBar] }), _jsx(TMToppyDraggableHelpCenter, { usePortal: toppyHelpCenterUsePortal, isVisible: isToppyHelpCenterVisible, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { dtd: fromDTD, deviceType: deviceType, onApprove: () => {
638
+ _jsx(_Fragment, {}), _jsx(TMLayoutItem, { children: _jsx(TMSearchResultGrid, { openInOffice: openInOffice, fromDTD: fromDTD, operationItems: operationItems, allUsers: allUsers, inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, showExportForm: showExportForm, onFocusedItemChanged: setFocusedItem, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync({ inputDcmts, downloadType, downloadMode, onFileDownloaded: onFileOpened, confirmAttachments }), lastUpdateSearchTime: lastUpdateSearchTime, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], onSelectionChanged: (items) => { setSelectedItems(items); }, onDblClick: () => openFormHandler(LayoutModes.Update), showSearchTMDatagrid: showSearchTMDatagrid, onVisibleItemChanged: setVisibleItems, updateDataColumnsFromDataGrid: updateDataColumnsFromDataGrid, updateDataSourceFromDataGrid: updateDataSourceFromDataGrid, updateSelectedRowKeysFromDataGrid: updateSelectedRowKeysFromDataGrid }) })] }), renderFloatingBar] }), _jsx(TMToppyDraggableHelpCenter, { usePortal: toppyHelpCenterUsePortal, isVisible: isToppyHelpCenterVisible, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { dtd: fromDTD, deviceType: deviceType, onApprove: () => {
639
639
  updateShowApprovePopup(true);
640
640
  }, onSignApprove: () => {
641
641
  handleSignApprove();
@@ -1124,8 +1124,7 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, i
1124
1124
  // Previene l'errore E1047 quando il filtro riferisce campi non più presenti nelle nuove colonne.
1125
1125
  const oldFields = columns.map(c => c.dataField);
1126
1126
  const newFields = cols.map(c => c.dataField);
1127
- const columnsChanged = oldFields.length !== newFields.length ||
1128
- oldFields.some((f, i) => f !== newFields[i]);
1127
+ const columnsChanged = oldFields.length !== newFields.length || oldFields.some((f, i) => f !== newFields[i]);
1129
1128
  if (columnsChanged) {
1130
1129
  const gridInstance = dataGridRef.current?.instance();
1131
1130
  if (gridInstance) {
@@ -142,7 +142,7 @@ const TMViewHistoryDcmt = (props) => {
142
142
  files.push({ TID: Number(focusedRow.TID), DID: Number(focusedRow.DID), FILEEXT: focusedRow.FileExt });
143
143
  }
144
144
  if (files.length > 0)
145
- await downloadDcmtsAsync(files, DownloadTypes.Dcmt, "download");
145
+ await downloadDcmtsAsync({ inputDcmts: files, downloadType: DownloadTypes.Dcmt, downloadMode: "download" });
146
146
  };
147
147
  const deleteFilesCallback = () => {
148
148
  if (!focusedRowKey)
@@ -0,0 +1,16 @@
1
+ import { DcmtTypeDescriptor, MetadataDescriptor, QueryDescriptor } from "@topconsultnpm/sdk-ts";
2
+ export type MetadataDescriptorWithKey = MetadataDescriptor & {
3
+ uniqueKey: string;
4
+ };
5
+ export declare function removeDuplicatesByTidMid<T extends {
6
+ tid?: number;
7
+ mid?: number;
8
+ }>(items: T[]): T[];
9
+ export declare function loadMetadataFromQd(qd: QueryDescriptor | undefined, filterMetadata?: (value: MetadataDescriptor, index: number, array: MetadataDescriptor[]) => unknown): Promise<{
10
+ metadata: MetadataDescriptorWithKey[];
11
+ dcmtTypes: DcmtTypeDescriptor[];
12
+ }>;
13
+ export declare function areArraysEqual<T extends {
14
+ tid?: number;
15
+ mid?: number;
16
+ }>(arr1: T[], arr2: T[], additionalCompare?: (a: T, b: T) => boolean): boolean;
@@ -0,0 +1,77 @@
1
+ import { DcmtTypeDescriptor, DcmtTypeListCacheService, SDK_Localizator } from "@topconsultnpm/sdk-ts";
2
+ import { getTIDsByQd } from "../../../helper/queryHelper";
3
+ import { SDKUI_Localizator } from "../../../helper";
4
+ import TMSpinner from "../../base/TMSpinner";
5
+ // =============================================================================
6
+ // HELPER: Rimuove duplicati dalla lista (basato su tid + mid)
7
+ // =============================================================================
8
+ export function removeDuplicatesByTidMid(items) {
9
+ const seen = new Set();
10
+ return items.filter(item => {
11
+ const key = `${item.tid}_${item.mid}`;
12
+ if (seen.has(key))
13
+ return false;
14
+ seen.add(key);
15
+ return true;
16
+ });
17
+ }
18
+ // =============================================================================
19
+ // FUNZIONE PRINCIPALE: Estrae i metadati dal QueryDescriptor
20
+ // =============================================================================
21
+ export async function loadMetadataFromQd(qd, filterMetadata) {
22
+ if (!qd)
23
+ return { metadata: [], dcmtTypes: [] };
24
+ const dtdList = [];
25
+ const metadata = [];
26
+ try {
27
+ const tidsFromQd = getTIDsByQd(qd);
28
+ const inputTIDs = tidsFromQd.map((item) => item.tid);
29
+ if (inputTIDs.length === 0)
30
+ return { metadata: [], dcmtTypes: [] };
31
+ TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.DcmtType} ...` });
32
+ const dtds = await DcmtTypeListCacheService.GetFromTIDsAsync(inputTIDs, true, undefined, false, false);
33
+ for (let i = 0; i < dtds.length; i++) {
34
+ const dtd = new DcmtTypeDescriptor();
35
+ dtd.init({ ...dtds[i] });
36
+ const alias = tidsFromQd?.[i]?.alias ?? '';
37
+ dtd.customData2 = alias;
38
+ dtd.metadata?.forEach((md) => {
39
+ const mdWithKey = md;
40
+ mdWithKey.customData1 = dtd.id;
41
+ mdWithKey.customData2 = alias;
42
+ mdWithKey.uniqueKey = `${dtd.id}_${md.id}_${alias}`;
43
+ });
44
+ const filteredMetadata = filterMetadata
45
+ ? dtd.metadata?.filter(filterMetadata)
46
+ : dtd.metadata;
47
+ dtdList.push({ ...dtd, metadata: filteredMetadata });
48
+ }
49
+ for (const dtd of dtdList) {
50
+ if (!dtd.metadata)
51
+ continue;
52
+ for (const md of dtd.metadata) {
53
+ metadata.push(md);
54
+ }
55
+ }
56
+ return { metadata, dcmtTypes: dtdList };
57
+ }
58
+ finally {
59
+ TMSpinner.hide();
60
+ }
61
+ }
62
+ // =============================================================================
63
+ // HELPER: Confronta due array per determinare se sono stati modificati
64
+ // =============================================================================
65
+ export function areArraysEqual(arr1, arr2, additionalCompare) {
66
+ if (arr1.length !== arr2.length)
67
+ return false;
68
+ for (let i = 0; i < arr1.length; i++) {
69
+ const a = arr1[i];
70
+ const b = arr2[i];
71
+ if (a.tid !== b.tid || a.mid !== b.mid)
72
+ return false;
73
+ if (additionalCompare && !additionalCompare(a, b))
74
+ return false;
75
+ }
76
+ return true;
77
+ }
@@ -23,7 +23,7 @@ const TMBlogAttachments = (props) => {
23
23
  openDcmtForm({ TID: blogPostAttachment.tid, DID: blogPostAttachment.did, fileName });
24
24
  };
25
25
  return _jsx("div", { style: { width: "100%", marginTop: "5px", overflow: "hidden" }, children: attachments.map((blogPostAttachment, index) => {
26
- const { name, nameElement, tooltipContent, fileExt, archivedDocumentsExist, draftExist } = getAttachmentInfo(blogPostAttachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, isSelected, searchText);
26
+ const { name, nameElement, tooltipContent, fileExt, archivedDocumentsExist, draftExist, isSigned } = getAttachmentInfo(blogPostAttachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, isSelected, searchText);
27
27
  return _jsx("div", { onDoubleClick: (e) => !isLoading && onDoubleClick(e, blogPostAttachment, name, fileExt), onMouseEnter: (e) => !isLoading && handleMouseEnter(e, blogPostAttachment, name, fileExt), onMouseLeave: (e) => !isLoading && handleMouseLeave(e), style: {
28
28
  display: layoutMode === "extended" ? "inline-flex" : "flex",
29
29
  padding: '4px 8px',
@@ -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 }, children: _jsx(TMDcmtIcon, { tid: blogPostAttachment.tid, did: blogPostAttachment.did, fileExtension: fileExt, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent }) }), _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',
@@ -510,9 +510,11 @@ const TMBlogsPost = (props) => {
510
510
  icon: _jsx("span", { className: "dx-icon-download" }),
511
511
  name: 'Download',
512
512
  onClick: async () => {
513
- await downloadDcmtsAsync([
514
- { TID: focusedAttachment.TID, DID: focusedAttachment.DID, fileName: focusedAttachment.fileName }
515
- ], DownloadTypes.Dcmt, "download");
513
+ await downloadDcmtsAsync({
514
+ inputDcmts: [{ TID: focusedAttachment.TID, DID: focusedAttachment.DID, fileName: focusedAttachment.fileName }],
515
+ downloadType: DownloadTypes.Dcmt,
516
+ downloadMode: "download"
517
+ });
516
518
  },
517
519
  });
518
520
  }
@@ -82,6 +82,7 @@ export declare const getAttachmentInfo: (attachment: BlogPostAttachment, treeFs:
82
82
  fileExt: string;
83
83
  draftExist: boolean;
84
84
  archivedDocumentsExist: boolean;
85
+ isSigned: number;
85
86
  };
86
87
  export declare const getDcmtTypeDescriptor: (blogPosts: Array<BlogPost>) => Promise<Map<number, DcmtTypeDescriptor>>;
87
88
  export declare const BlogPostHomeHeader: (header: string | undefined, classId: string | undefined, isSelected: boolean, searchText: string, headerClickCallback: () => void) => import("react/jsx-runtime").JSX.Element;
@@ -86,6 +86,7 @@ export const getAttachmentInfo = (attachment, treeFs, draftLatestInfoMap, archiv
86
86
  let archivedDocumentsExist = false;
87
87
  let name = '';
88
88
  let tooltipContent = _jsx(_Fragment, {});
89
+ let isSigned = 0;
89
90
  if (attachment.tid === DRAFT_TYPE_TID && treeFs) {
90
91
  const draftfileItem = findFileItemByDraftID(treeFs, attachment.draftID);
91
92
  if (draftfileItem) {
@@ -94,6 +95,7 @@ export const getAttachmentInfo = (attachment, treeFs, draftLatestInfoMap, archiv
94
95
  draftExist = true;
95
96
  let fileSize = '0';
96
97
  name = draftfileItem.name;
98
+ isSigned = draftfileItem.isSigned ? 1 : 0;
97
99
  if (draftLatestInfoMap && attachment.draftID && attachment.version) {
98
100
  const draftInfo = draftLatestInfoMap.get(attachment.draftID);
99
101
  if (draftInfo) {
@@ -139,7 +141,7 @@ export const getAttachmentInfo = (attachment, treeFs, draftLatestInfoMap, archiv
139
141
  nameElement = (_jsx("span", { children: highlightText(`${name} (DID: ${attachment.did})`, searchText, isSelected) }));
140
142
  }
141
143
  }
142
- return { name, nameElement, tooltipContent, folderId, fileExt, draftExist, archivedDocumentsExist };
144
+ return { name, nameElement, tooltipContent, folderId, fileExt, draftExist, archivedDocumentsExist, isSigned };
143
145
  };
144
146
  export const getDcmtTypeDescriptor = async (blogPosts) => {
145
147
  const dcmtTypeMap = new Map();
@@ -1,3 +1,4 @@
1
+ import { SDKUI_Localizator } from './SDKUI_Localizator';
1
2
  // ============================================================================
2
3
  // LAZY LOADING - Carica pdf-lib solo quando necessario
3
4
  // ============================================================================
@@ -59,10 +60,11 @@ export class MergePdfManager {
59
60
  /**
60
61
  * Merge -> File - Restituisce un oggetto File
61
62
  */
62
- static async mergeToFile(files, fileName = 'merged.pdf', options = {}) {
63
+ static async mergeToFile(files, fileName, options = {}) {
63
64
  try {
64
65
  const { blob } = await this.merge(files, options);
65
- return new File([blob], fileName, { type: 'application/pdf' });
66
+ const finalFileName = fileName || `${SDKUI_Localizator.Result.toLowerCase()}.pdf`;
67
+ return new File([blob], finalFileName, { type: 'application/pdf' });
66
68
  }
67
69
  catch (error) {
68
70
  const errorMessage = error instanceof Error ? error.message : String(error);
@@ -72,15 +74,16 @@ export class MergePdfManager {
72
74
  /**
73
75
  * Merge + Download - Unisce e scarica automaticamente
74
76
  */
75
- static async mergeAndDownload(files, fileName = 'merged.pdf', options = {}) {
77
+ static async mergeAndDownload(files, fileName, options = {}) {
76
78
  let url = null;
79
+ const finalFileName = fileName || `${SDKUI_Localizator.Result.toLowerCase()}.pdf`;
77
80
  try {
78
81
  const result = await this.merge(files, options);
79
82
  url = URL.createObjectURL(result.blob);
80
83
  // Crea link temporaneo per download
81
84
  const a = document.createElement('a');
82
85
  a.href = url;
83
- a.download = fileName;
86
+ a.download = finalFileName;
84
87
  document.body.appendChild(a);
85
88
  a.click();
86
89
  a.remove();
@@ -1,10 +1,11 @@
1
1
  import { InvoiceRetrieveFormats, LocalStorageService, OrderRetrieveFormats } from "@topconsultnpm/sdk-ts";
2
2
  import { FontSize } from "../utils/theme";
3
+ import { SDKUI_Localizator } from "./SDKUI_Localizator";
3
4
  export class DocumentDownloadSettings {
4
5
  constructor() {
5
6
  this.exportMode = 'copy';
6
7
  this.destinationFolder = 'Download';
7
- this.zipFileName = '';
8
+ this.zipFileName = SDKUI_Localizator.Result.toLowerCase() + '.zip';
8
9
  this.zipPassword = '';
9
10
  this.fileNamingMode = 'documentTypeAndDid';
10
11
  this.separatorChar = '_';