@topconsultnpm/sdkui-react 6.22.0-t1 → 6.22.0-t2

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 (159) hide show
  1. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +1 -1
  2. package/lib/components/NewComponents/ContextMenu/styles.d.ts +45 -43
  3. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +1 -1
  4. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +67 -60
  5. package/lib/components/base/Styled.d.ts +92 -76
  6. package/lib/components/base/TMButton.d.ts +13 -0
  7. package/lib/components/base/TMButton.js +137 -5
  8. package/lib/components/base/TMDataGrid.d.ts +2 -0
  9. package/lib/components/base/TMDataGrid.js +260 -8
  10. package/lib/components/base/TMDataGridExportForm.js +39 -30
  11. package/lib/components/base/TMEditorBase.d.ts +2 -0
  12. package/lib/components/base/TMFileManager.js +5 -3
  13. package/lib/components/base/TMFileManagerDataGridView.js +11 -2
  14. package/lib/components/base/TMFileManagerThumbnailItems.js +19 -9
  15. package/lib/components/base/TMFileManagerUtils.d.ts +6 -6
  16. package/lib/components/base/TMFileManagerUtils.js +37 -1
  17. package/lib/components/base/TMModal.d.ts +11 -0
  18. package/lib/components/base/TMModal.js +47 -13
  19. package/lib/components/base/TMPanel.d.ts +6 -0
  20. package/lib/components/base/TMPanel.js +138 -25
  21. package/lib/components/base/TMPopUp.js +3 -0
  22. package/lib/components/base/TMTooltip.d.ts +2 -1
  23. package/lib/components/base/TMTooltip.js +24 -8
  24. package/lib/components/base/TMTreeView.d.ts +13 -7
  25. package/lib/components/base/TMTreeView.js +108 -67
  26. package/lib/components/choosers/TMDcmtTypeChooser.js +4 -3
  27. package/lib/components/choosers/TMDistinctValues.d.ts +9 -7
  28. package/lib/components/choosers/TMDistinctValues.js +149 -142
  29. package/lib/components/choosers/TMMetadataChooser.js +1 -1
  30. package/lib/components/choosers/TMQuickSearchInfo.d.ts +13 -0
  31. package/lib/components/choosers/TMQuickSearchInfo.js +279 -0
  32. package/lib/components/choosers/TMQuickSearchSettingsForm.d.ts +16 -0
  33. package/lib/components/choosers/TMQuickSearchSettingsForm.js +94 -0
  34. package/lib/components/choosers/TMSelectedValuesSummary.d.ts +13 -0
  35. package/lib/components/choosers/TMSelectedValuesSummary.js +91 -0
  36. package/lib/components/editors/TMDateBox.d.ts +16 -1
  37. package/lib/components/editors/TMDateBox.js +90 -22
  38. package/lib/components/editors/TMDropDown.d.ts +3 -0
  39. package/lib/components/editors/TMDropDown.js +197 -5
  40. package/lib/components/editors/TMEditorStyled.d.ts +20 -42
  41. package/lib/components/editors/TMMetadataEditor.d.ts +5 -1
  42. package/lib/components/editors/TMMetadataEditor.js +27 -23
  43. package/lib/components/editors/TMTextArea.d.ts +1 -0
  44. package/lib/components/editors/TMTextArea.js +23 -15
  45. package/lib/components/editors/TMTextBox.d.ts +2 -0
  46. package/lib/components/editors/TMTextBox.js +30 -19
  47. package/lib/components/features/archive/TMArchive.js +17 -3
  48. package/lib/components/features/documents/TMBatchUpdateForm.js +19 -5
  49. package/lib/components/features/documents/TMDcmtBlog.d.ts +3 -0
  50. package/lib/components/features/documents/TMDcmtBlog.js +4 -4
  51. package/lib/components/features/documents/TMDcmtForm.d.ts +7 -0
  52. package/lib/components/features/documents/TMDcmtForm.js +232 -53
  53. package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +11 -0
  54. package/lib/components/features/documents/TMDcmtFormActionButtons.js +77 -7
  55. package/lib/components/features/documents/TMDcmtIcon.js +5 -3
  56. package/lib/components/features/documents/TMDcmtPreview.d.ts +7 -5
  57. package/lib/components/features/documents/TMDcmtPreview.js +10 -6
  58. package/lib/components/features/documents/TMMasterDetailDcmts.js +95 -33
  59. package/lib/components/features/documents/TMMasterInfoFields.d.ts +20 -0
  60. package/lib/components/features/documents/TMMasterInfoFields.js +186 -0
  61. package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
  62. package/lib/components/features/documents/TMMergeToPdfForm.js +30 -5
  63. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +46 -0
  64. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +323 -0
  65. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +370 -0
  66. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +283 -0
  67. package/lib/components/features/documents/TMRelationViewer.d.ts +14 -1
  68. package/lib/components/features/documents/TMRelationViewer.js +82 -52
  69. package/lib/components/features/search/TMSearch.js +103 -24
  70. package/lib/components/features/search/TMSearchQueryEditor.js +5 -3
  71. package/lib/components/features/search/TMSearchQueryPanel.d.ts +14 -4
  72. package/lib/components/features/search/TMSearchQueryPanel.js +152 -57
  73. package/lib/components/features/search/TMSearchResult.d.ts +16 -0
  74. package/lib/components/features/search/TMSearchResult.js +438 -145
  75. package/lib/components/features/search/TMTreeSelector.js +109 -64
  76. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +10 -0
  77. package/lib/components/features/workflow/TMWorkflowPopup.js +8 -4
  78. package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +3 -1
  79. package/lib/components/forms/Login/ChangePasswordInputs.d.ts +3 -1
  80. package/lib/components/grids/TMBlogAttachments.js +13 -2
  81. package/lib/components/grids/TMBlogHeader.js +5 -1
  82. package/lib/components/grids/TMBlogsPost.d.ts +2 -0
  83. package/lib/components/grids/TMBlogsPost.js +31 -4
  84. package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
  85. package/lib/components/grids/TMBlogsPostUtils.js +14 -3
  86. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
  87. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +24 -14
  88. package/lib/components/layout/panelManager/TMPanelManagerContext.js +68 -93
  89. package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +4 -5
  90. package/lib/components/layout/panelManager/TMPanelWrapper.js +2 -2
  91. package/lib/components/layout/panelManager/types.d.ts +3 -0
  92. package/lib/components/layout/panelManager/utils.js +13 -11
  93. package/lib/components/query/TMQueryEditor.d.ts +14 -10
  94. package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
  95. package/lib/components/sidebar/TMHeader.js +30 -20
  96. package/lib/components/viewers/TMMidViewer.js +5 -2
  97. package/lib/components/viewers/TMTidViewer.js +86 -25
  98. package/lib/css/tm-sdkui.css +1 -1
  99. package/lib/devextreme-license.d.ts +1 -0
  100. package/lib/devextreme-license.js +3 -0
  101. package/lib/helper/Globalization.d.ts +1 -1
  102. package/lib/helper/SDKUI_Globals.d.ts +110 -0
  103. package/lib/helper/SDKUI_Globals.js +151 -0
  104. package/lib/helper/SDKUI_Localizator.d.ts +55 -0
  105. package/lib/helper/SDKUI_Localizator.js +550 -0
  106. package/lib/helper/TMAppUpdatedModal.d.ts +2 -0
  107. package/lib/helper/TMAppUpdatedModal.js +134 -0
  108. package/lib/helper/TMIcons.d.ts +1 -0
  109. package/lib/helper/TMIcons.js +3 -0
  110. package/lib/helper/TMUtils.d.ts +51 -4
  111. package/lib/helper/TMUtils.js +272 -11
  112. package/lib/helper/dataGridSearchHelper.d.ts +28 -0
  113. package/lib/helper/dataGridSearchHelper.js +51 -0
  114. package/lib/helper/dcmtsHelper.d.ts +20 -0
  115. package/lib/helper/dcmtsHelper.js +58 -1
  116. package/lib/helper/helpers.d.ts +23 -1
  117. package/lib/helper/helpers.js +57 -1
  118. package/lib/helper/index.d.ts +2 -0
  119. package/lib/helper/index.js +2 -0
  120. package/lib/helper/queryHelper.d.ts +6 -1
  121. package/lib/helper/queryHelper.js +8 -3
  122. package/lib/hooks/tmDistinctValuesGridHelper.d.ts +16 -0
  123. package/lib/hooks/tmDistinctValuesGridHelper.js +31 -0
  124. package/lib/hooks/useArchiveListForm.d.ts +39 -0
  125. package/lib/hooks/useArchiveListForm.js +46 -0
  126. package/lib/hooks/useCaseFlowApprove.d.ts +56 -0
  127. package/lib/hooks/useCaseFlowApprove.js +157 -0
  128. package/lib/hooks/useDataUserIdItem.d.ts +1 -0
  129. package/lib/hooks/useDataUserIdItem.js +1 -0
  130. package/lib/hooks/useDocumentOperations.d.ts +4 -0
  131. package/lib/hooks/useDocumentOperations.js +52 -10
  132. package/lib/hooks/useMultiMasterDetailDcmts.d.ts +113 -0
  133. package/lib/hooks/useMultiMasterDetailDcmts.js +760 -0
  134. package/lib/hooks/useRelatedDocuments.d.ts +1 -0
  135. package/lib/hooks/useRelatedDocuments.js +22 -27
  136. package/lib/hooks/useShowDossiersV5.d.ts +12 -0
  137. package/lib/hooks/useShowDossiersV5.js +37 -0
  138. package/lib/hooks/useTMDistinctValuesMetadataDisplay.d.ts +18 -0
  139. package/lib/hooks/useTMDistinctValuesMetadataDisplay.js +103 -0
  140. package/lib/hooks/useTMDistinctValuesQuickSearch.d.ts +49 -0
  141. package/lib/hooks/useTMDistinctValuesQuickSearch.js +307 -0
  142. package/lib/hooks/useTMDistinctValuesSelection.d.ts +42 -0
  143. package/lib/hooks/useTMDistinctValuesSelection.js +103 -0
  144. package/lib/hooks/useTMDistinctValuesSource.d.ts +29 -0
  145. package/lib/hooks/useTMDistinctValuesSource.js +105 -0
  146. package/lib/index.d.ts +2 -0
  147. package/lib/index.js +5 -2
  148. package/lib/services/caseflow/CaseFlowService.d.ts +236 -0
  149. package/lib/services/caseflow/CaseFlowService.js +693 -0
  150. package/lib/services/caseflow/CaseFlowTemplateCacheService.d.ts +28 -0
  151. package/lib/services/caseflow/CaseFlowTemplateCacheService.js +121 -0
  152. package/lib/services/caseflow/caseFlowNameCache.d.ts +32 -0
  153. package/lib/services/caseflow/caseFlowNameCache.js +116 -0
  154. package/lib/services/caseflow/caseFlowWorkItemUtils.d.ts +61 -0
  155. package/lib/services/caseflow/caseFlowWorkItemUtils.js +113 -0
  156. package/lib/services/index.d.ts +4 -0
  157. package/lib/services/index.js +4 -0
  158. package/lib/services/platform_services.d.ts +1 -1
  159. package/package.json +9 -5
@@ -0,0 +1,51 @@
1
+ import { formatDateTimeByMetadataFormat, formatNumberByMetadataFormat } from './TMUtils';
2
+ /** Testo con cui una data viene mostrata nella griglia: è quello che l'utente vede e quindi quello che cerca */
3
+ export const getDateDisplayText = (value, format, formatCulture) => {
4
+ if (value === undefined || value === null || value === '')
5
+ return '';
6
+ const date = value instanceof Date ? value : new Date(value);
7
+ return Number.isNaN(date.getTime()) ? '' : formatDateTimeByMetadataFormat(date, format, formatCulture);
8
+ };
9
+ /** Testo con cui un numero viene mostrato nella griglia (separatore delle migliaia, valuta, decimali) */
10
+ export const getNumberDisplayText = (value, format, formatCulture) => {
11
+ if (value === undefined || value === null || value === '')
12
+ return '';
13
+ return formatNumberByMetadataFormat(value, format, formatCulture);
14
+ };
15
+ /**
16
+ * Dirotta la ricerca della griglia sul testo mostrato, per le colonne indicate (chiave: il `dataField`).
17
+ *
18
+ * La ricerca di DevExtreme lavora sul valore archiviato, quindi non trova nulla dove il testo mostrato è
19
+ * diverso:
20
+ * - **date**, che nei dati sono stringhe ISO: DevExtreme prova a interpretare il testo digitato con il
21
+ * formato della colonna, non riesce (il formato è un formatter personalizzato, non un pattern) e scarta
22
+ * la colonna dalla ricerca — cercando `29/01/2023` non trova nulla;
23
+ * - **numeri formattati**, per lo stesso motivo (separatore delle migliaia, simbolo di valuta);
24
+ * - **liste dati e utenti**, dove viene confrontata la chiave archiviata invece della descrizione
25
+ * visualizzata — cercando `FATTURA` non trova nulla, cercando `TD01` sì.
26
+ *
27
+ * Da passare a `customizeColumns` della griglia. Va fatto lì perché solo lì è disponibile la
28
+ * `calculateFilterExpression` predefinita di DevExtreme, che resta in uso per il filtro di intestazione e
29
+ * per il generatore di filtri: quelli funzionano già correttamente e vanno lasciati intatti.
30
+ *
31
+ * @example
32
+ * const searchTextGetters = useMemo(() => new Map([['TM_1_2', (row) => getDateDisplayText(row?.TM_1_2, format, culture)]]), [...]);
33
+ * const customizeColumns = useMemo(() => customizeSearchByDisplayText(searchTextGetters), [searchTextGetters]);
34
+ */
35
+ export const customizeSearchByDisplayText = (searchTextGetters) => (columns) => {
36
+ columns.forEach((column) => {
37
+ const getSearchText = column?.dataField ? searchTextGetters.get(column.dataField) : undefined;
38
+ // customizeColumns viene richiamata a ogni aggiornamento delle colonne: senza il marcatore i wrapper si anniderebbero
39
+ if (!getSearchText || column.tmSearchByDisplayText)
40
+ return;
41
+ const defaultCalculateFilterExpression = column.calculateFilterExpression;
42
+ // Senza questo DevExtreme prova a convertire il testo digitato nel tipo della colonna e, non riuscendo, la scarta
43
+ column.parseValue = (text) => text;
44
+ column.calculateFilterExpression = function (filterValue, selectedFilterOperation, target) {
45
+ if (target === 'search')
46
+ return [getSearchText, 'contains', filterValue];
47
+ return defaultCalculateFilterExpression?.apply(this, arguments);
48
+ };
49
+ column.tmSearchByDisplayText = true;
50
+ });
51
+ };
@@ -1,8 +1,28 @@
1
+ import { DcmtTypeDescriptor, MetadataDataTypes, MetadataDescriptor, MetadataFormats, RelationDescriptor } from "@topconsultnpm/sdk-ts";
1
2
  import { MetadataValueDescriptorEx } from "../ts";
3
+ /** Metadati utente (esclusi quelli di sistema) del tipo documento, in ordine di visualizzazione */
4
+ export declare const getUserMetadataSorted: (dtd: DcmtTypeDescriptor | undefined) => Array<MetadataDescriptor>;
5
+ /** Formatta un valore scalare (non lista dati): date e numeri rispettano Format e FormatCulture del metadato */
6
+ export declare const formatScalarValue: (value: any, dataType: MetadataDataTypes | undefined, format: MetadataFormats | undefined, formatCulture: string | undefined) => string;
2
7
  /** Check if dcmtType (mTID) has configured Detail or Many-to-Many relations */
3
8
  export declare const hasDetailRelations: (mTID: number | undefined) => Promise<boolean>;
4
9
  /** Check if dcmtType (mTID) has configured Master or Many-to-Many relations */
5
10
  export declare const hasMasterRelations: (mTID: number | undefined) => Promise<boolean>;
11
+ export declare const getDcmtMetadataByMid: (dcmt: {
12
+ TID?: number;
13
+ DID?: number;
14
+ } | undefined) => Promise<Map<number, any>>;
15
+ export declare const mapAssociationsFromMetadata: (relation: RelationDescriptor, type: "detail" | "master", metadataByMid: Map<number, any>) => Array<{
16
+ mid: number;
17
+ value: string;
18
+ }>;
19
+ export declare const mapRelationAssociationsToMids: (relation: RelationDescriptor, type: "detail" | "master", dcmt: {
20
+ TID?: number;
21
+ DID?: number;
22
+ } | undefined) => Promise<Array<{
23
+ mid: number;
24
+ value: string;
25
+ }>>;
6
26
  export declare const isXMLFileExt: (fileExt: string | undefined) => boolean;
7
27
  export declare const getButtonAttributes: (args: string | undefined, formData: MetadataValueDescriptorEx[] | undefined, selectedItems: Array<any> | undefined) => Record<string, any> | undefined;
8
28
  export declare const getSelectedItem: (args: string | undefined, formData: MetadataValueDescriptorEx[] | undefined, item: any) => Record<string, any> | undefined;
@@ -1,4 +1,21 @@
1
- import { RelationCacheService, RelationTypes, SDK_Globals } from "@topconsultnpm/sdk-ts";
1
+ import { MetadataDataTypes, RelationCacheService, RelationTypes, SDK_Globals } from "@topconsultnpm/sdk-ts";
2
+ import { formatDateTimeByMetadataFormat, formatNumberByMetadataFormat } from "./TMUtils";
3
+ /** Metadati utente (esclusi quelli di sistema) del tipo documento, in ordine di visualizzazione */
4
+ export const getUserMetadataSorted = (dtd) => {
5
+ return (dtd?.metadata ?? [])
6
+ .filter(md => md.id !== undefined && md.id > 100 && md.isSystem !== 1)
7
+ .sort((a, b) => (a.ordinalPosition ?? 0) - (b.ordinalPosition ?? 0));
8
+ };
9
+ /** Formatta un valore scalare (non lista dati): date e numeri rispettano Format e FormatCulture del metadato */
10
+ export const formatScalarValue = (value, dataType, format, formatCulture) => {
11
+ if (value === undefined || value === null || value === '')
12
+ return '';
13
+ switch (dataType) {
14
+ case MetadataDataTypes.DateTime: return formatDateTimeByMetadataFormat(value instanceof Date ? value : new Date(value), format, formatCulture);
15
+ case MetadataDataTypes.Number: return formatNumberByMetadataFormat(value, format, formatCulture ?? window.navigator.language);
16
+ default: return String(value);
17
+ }
18
+ };
2
19
  /** Check if dcmtType (mTID) has configured Detail or Many-to-Many relations */
3
20
  export const hasDetailRelations = async (mTID) => {
4
21
  let allRelations = await RelationCacheService.GetAllAsync();
@@ -13,6 +30,46 @@ export const hasMasterRelations = async (mTID) => {
13
30
  let rdlManyToMany = allRelations?.filter(o => o.relationType == RelationTypes.ManyToMany && (o.masterTID == mTID || o.detailTID == mTID)) ?? [];
14
31
  return rdlManyToMany.length > 0 || rdlOneToMany.length > 0;
15
32
  };
33
+ // Legge i metadati di un documento
34
+ export const getDcmtMetadataByMid = async (dcmt) => {
35
+ const metadataMap = new Map();
36
+ if (!dcmt?.TID || !dcmt?.DID)
37
+ return metadataMap; // Documento non identificabile: mappa vuota
38
+ const searchEngine = SDK_Globals.tmSession?.NewSearchEngine();
39
+ if (!searchEngine)
40
+ return metadataMap; // Nessuna sessione attiva: mappa vuota
41
+ const allMetadata = await searchEngine.GetMetadataAsync(dcmt.TID, dcmt.DID, false);
42
+ const row = allMetadata?.dtdResult?.rows?.[0]; // Prima (e unica) riga = il documento richiesto
43
+ const mids = allMetadata?.selectMIDs; // MID nello stesso ordine dei valori di riga
44
+ if (row && mids)
45
+ mids.forEach((mid, index) => metadataMap.set(mid, row[index])); // Accoppia mid -> valore per posizione
46
+ return metadataMap;
47
+ };
48
+ // Mappa le associazioni della relazione nei MID di destinazione, usando i metadati sorgente già letti.
49
+ // 'detail' = archivio dettagli dal master (sorgente item1 -> destinazione item2); 'master' = archivio master dal dettaglio (item2 -> item1).
50
+ // Emette una voce per ogni associazione, anche vuota, per coprire tutti i collegamenti.
51
+ export const mapAssociationsFromMetadata = (relation, type, metadataByMid) => {
52
+ if (!relation.associations || relation.associations.length === 0)
53
+ return []; // Relazione senza collegamenti
54
+ return relation.associations.map(assoc => {
55
+ const sourceMid = type === 'detail' ? (assoc.item1 ?? 0) : (assoc.item2 ?? 0); // MID da cui leggere il valore
56
+ const targetMid = type === 'detail' ? (assoc.item2 ?? 0) : (assoc.item1 ?? 0); // MID da valorizzare
57
+ const value = metadataByMid.get(sourceMid); // Valore sorgente (può mancare)
58
+ return { mid: targetMid, value: value !== undefined && value !== null ? value.toString() : '' }; // Assente/null -> stringa vuota
59
+ });
60
+ };
61
+ // Legge il documento sorgente (master per 'detail', dettaglio per 'master') e mappa le associazioni nei MID di destinazione.
62
+ // Per letture ripetute dello stesso documento, riusare la mappa e chiamare direttamente `mapAssociationsFromMetadata`.
63
+ export const mapRelationAssociationsToMids = async (relation, type, dcmt) => {
64
+ if (!relation.associations || relation.associations.length === 0)
65
+ return []; // Relazione senza collegamenti
66
+ if (!dcmt?.TID || !dcmt?.DID)
67
+ return []; // Documento sorgente non identificabile
68
+ const metadataByMid = await getDcmtMetadataByMid(dcmt);
69
+ if (metadataByMid.size === 0)
70
+ return []; // Nessun metadato leggibile: [] come nel flusso originale (niente collegamenti a vuoto)
71
+ return mapAssociationsFromMetadata(relation, type, metadataByMid);
72
+ };
16
73
  export const isXMLFileExt = (fileExt) => {
17
74
  const fileExtension = fileExt?.toLowerCase() ?? '';
18
75
  switch (fileExtension) {
@@ -2,6 +2,15 @@ import { Colors as ColorsType } from "../components/base/TMEditorBase";
2
2
  import { DeviceType } from "../components";
3
3
  import { AppModules, DataColumnDescriptor, DcmtTypeDescriptor, ITopMediaSession, MetadataDescriptor, QueryDescriptor, SearchResultDescriptor, TaskDescriptor } from "@topconsultnpm/sdk-ts";
4
4
  import { FileExtensionHandler, FormModes, moduleTypes } from "../ts";
5
+ import React from "react";
6
+ /**
7
+ * Handler di hover per elementi con stili inline: applica `over` all'ingresso del mouse e `out` all'uscita.
8
+ * Da spandere sull'elemento: `{...hoverStyle({ background: 'red' }, { background: 'transparent' })}`
9
+ */
10
+ export declare const hoverStyle: (over: React.CSSProperties, out: React.CSSProperties) => {
11
+ onMouseEnter: (e: React.MouseEvent<HTMLElement>) => CSSStyleDeclaration & React.CSSProperties;
12
+ onMouseLeave: (e: React.MouseEvent<HTMLElement>) => CSSStyleDeclaration & React.CSSProperties;
13
+ };
5
14
  declare const calcResponsiveSizes: (deviceType: DeviceType | undefined, desktopSize: string, tabletSize: string, mobileSize: string) => string;
6
15
  declare const taskModalSizes: (deviceType: DeviceType | undefined, formMode: FormModes) => {
7
16
  width: string;
@@ -35,6 +44,17 @@ export declare const getDataColumnName: (fromTID: number | undefined, dtColumn:
35
44
  */
36
45
  export declare const generateUniqueColumnKeys: (columns: DataColumnDescriptor[] | undefined, fromTID: number | undefined) => string[];
37
46
  export declare const searchResultDescriptorToSimpleArray: (searchResult: SearchResultDescriptor | undefined) => any[] | undefined;
47
+ /**
48
+ * Unisce ("accoda") il risultato di una nuova ricerca a quello precedente, sullo stesso tipo documento.
49
+ * - Le righe della nuova ricerca vengono messe in cima (più recenti in alto)
50
+ * - Le righe duplicate sono accettate: lo stesso documento può comparire più volte
51
+ * - Aggiorna i contatori globali (dcmtsFound / dcmtsReturned) sul totale unito
52
+ *
53
+ * @param previous Risultato attualmente in memoria (può essere undefined al primo giro)
54
+ * @param next Nuovo risultato appena ottenuto
55
+ * @returns Un nuovo SearchResultDescriptor con le righe unite, oppure il singolo risultato disponibile
56
+ */
57
+ export declare const mergeSearchResultsAppend: (previous: SearchResultDescriptor | undefined, next: SearchResultDescriptor | undefined) => SearchResultDescriptor | undefined;
38
58
  export declare const getCompleteMetadataName: (dcmtTypeName: string | undefined, metadataName: string | undefined) => string;
39
59
  export declare const getQueryCountAsync: (qd: QueryDescriptor, showSpinner: boolean) => Promise<void>;
40
60
  export declare function getTIDByMID(mid: number | undefined, defaultTid?: number): number;
@@ -42,6 +62,8 @@ export declare const getSystemMetadata: (withPerm?: boolean) => MetadataDescript
42
62
  export declare function deepCompare(obj1: any, obj2: any): boolean;
43
63
  export declare const extensionHandler: (fileExt: string | undefined) => FileExtensionHandler;
44
64
  export declare const downloadBase64File: (base64Data: string, fileName: string) => void;
65
+ export declare const WHATS_NEWS_FILE_NAME = "what's new";
66
+ export declare const WHATS_NEWS_LINK_URL = "https://www.topconsult.it/it/documentazionetopmedia";
45
67
  export declare const TASK_MORE_INFO_PREFIX_NAME: string;
46
68
  export declare const isTaskMoreInfo: (taskName: string | undefined) => boolean | undefined;
47
69
  export declare const getMoreInfoTasksForDocument: (allTasks: TaskDescriptor[], TID: number | null | undefined, DID: number | null | undefined) => TaskDescriptor[];
@@ -55,7 +77,7 @@ export { openApps, calcResponsiveDirection, calcResponsiveSizes, taskModalSizes,
55
77
  export declare function moduleVersion(module: moduleTypes): string;
56
78
  export declare function buildtype(module: moduleTypes): string;
57
79
  export declare const highlightText: (text: string, searchValue: string) => JSX.Element;
58
- export declare const renderHighlightedText: (text: string, searchText: string, isSelected: boolean) => string | (string | import("react").JSX.Element)[];
80
+ export declare const renderHighlightedText: (text: string, searchText: string, isSelected: boolean) => string | (string | React.JSX.Element)[];
59
81
  export declare function versionAndBuildtypeInfo(module: moduleTypes): string;
60
82
  export declare const getListMaxItems: (deviceType: DeviceType | undefined) => number;
61
83
  export declare const svgToString: (icon: React.ReactElement) => string;
@@ -7,6 +7,14 @@ import { buildTypes, FileExtensionHandler, FormModes, moduleTypes } from "../ts"
7
7
  import { SDKUI_Localizator } from "./SDKUI_Localizator";
8
8
  import ReactDOMServer from "react-dom/server";
9
9
  import { DeepCompareHelper } from "./DeepCompareHelper";
10
+ /**
11
+ * Handler di hover per elementi con stili inline: applica `over` all'ingresso del mouse e `out` all'uscita.
12
+ * Da spandere sull'elemento: `{...hoverStyle({ background: 'red' }, { background: 'transparent' })}`
13
+ */
14
+ export const hoverStyle = (over, out) => ({
15
+ onMouseEnter: (e) => Object.assign(e.currentTarget.style, over),
16
+ onMouseLeave: (e) => Object.assign(e.currentTarget.style, out),
17
+ });
10
18
  const calcResponsiveSizes = (deviceType, desktopSize, tabletSize, mobileSize) => {
11
19
  if (deviceType === DeviceType.DESKTOP)
12
20
  return desktopSize;
@@ -239,6 +247,38 @@ export const searchResultDescriptorToSimpleArray = (searchResult) => {
239
247
  });
240
248
  return result;
241
249
  };
250
+ /**
251
+ * Unisce ("accoda") il risultato di una nuova ricerca a quello precedente, sullo stesso tipo documento.
252
+ * - Le righe della nuova ricerca vengono messe in cima (più recenti in alto)
253
+ * - Le righe duplicate sono accettate: lo stesso documento può comparire più volte
254
+ * - Aggiorna i contatori globali (dcmtsFound / dcmtsReturned) sul totale unito
255
+ *
256
+ * @param previous Risultato attualmente in memoria (può essere undefined al primo giro)
257
+ * @param next Nuovo risultato appena ottenuto
258
+ * @returns Un nuovo SearchResultDescriptor con le righe unite, oppure il singolo risultato disponibile
259
+ */
260
+ export const mergeSearchResultsAppend = (previous, next) => {
261
+ // Se manca uno dei due, non c'è nulla da unire
262
+ if (!next?.dtdResult?.rows?.length)
263
+ return previous;
264
+ if (!previous?.dtdResult?.rows?.length)
265
+ return next;
266
+ // L'accodamento ha senso solo sullo stesso tipo documento (colonne compatibili)
267
+ if (previous.fromTID !== next.fromTID)
268
+ return next;
269
+ const prevRows = previous.dtdResult.rows ?? [];
270
+ const nextRows = next.dtdResult.rows ?? [];
271
+ // Nessuna deduplica: le nuove righe in cima, poi le precedenti (i duplicati sono ammessi)
272
+ const mergedRows = [...nextRows, ...prevRows];
273
+ // Costruisce il nuovo descrittore basandosi sull'ultimo risultato (colonne/qd più recenti), con le righe unite
274
+ const merged = structuredClone(next);
275
+ const mergedDtd = structuredClone(next.dtdResult);
276
+ mergedDtd.rows = mergedRows;
277
+ merged.dtdResult = mergedDtd;
278
+ merged.dcmtsReturned = mergedRows.length;
279
+ merged.dcmtsFound = mergedRows.length;
280
+ return merged;
281
+ };
242
282
  export const getCompleteMetadataName = (dcmtTypeName, metadataName) => `${dcmtTypeName}...${metadataName}`;
243
283
  export const getQueryCountAsync = async (qd, showSpinner) => {
244
284
  try {
@@ -573,6 +613,8 @@ export const downloadBase64File = (base64Data, fileName) => {
573
613
  // Libera l'URL del Blob
574
614
  URL.revokeObjectURL(blobUrl);
575
615
  };
616
+ export const WHATS_NEWS_FILE_NAME = "what's new";
617
+ export const WHATS_NEWS_LINK_URL = 'https://www.topconsult.it/it/documentazionetopmedia';
576
618
  export const TASK_MORE_INFO_PREFIX_NAME = `${SDKUI_Localizator.MoreInformation} - `;
577
619
  export const isTaskMoreInfo = (taskName) => taskName?.startsWith(TASK_MORE_INFO_PREFIX_NAME);
578
620
  // Filtra i task di tipo "More Info" non completati associati a un documento specifico.
@@ -781,7 +823,21 @@ export var LandingPages;
781
823
  // #region Exception
782
824
  export function getExceptionMessage(ex) {
783
825
  let msg = ex.isApiException ? ex.response.title : ex.message;
784
- return msg ?? ex.toString();
826
+ if (msg !== undefined && msg !== null)
827
+ return msg;
828
+ let asString = ex.toString();
829
+ if (asString !== '[object Object]')
830
+ return asString;
831
+ if (ex.errorMessage)
832
+ return ex.errorMessage;
833
+ if (ex.title)
834
+ return ex.title;
835
+ try {
836
+ return JSON.stringify(ex) ?? asString;
837
+ }
838
+ catch {
839
+ return asString;
840
+ }
785
841
  }
786
842
  export function getContrastColor(inputColor) {
787
843
  let hex = inputColor;
@@ -5,6 +5,7 @@ export * from './Globalization';
5
5
  export * from './TMIcons';
6
6
  export * from './TMImageLibrary';
7
7
  export * from './helpers';
8
+ export * from './dataGridSearchHelper';
8
9
  export * from './queryHelper';
9
10
  export * from './TMUtils';
10
11
  export * from './TMCommandsContextMenu';
@@ -18,3 +19,4 @@ export * from './devextremeCustomMessages';
18
19
  export * from './ZipManager';
19
20
  export * from './certificateImportHelper';
20
21
  export * from './grafometricSignaturesCache';
22
+ export * from './TMAppUpdatedModal';
@@ -5,6 +5,7 @@ export * from './Globalization';
5
5
  export * from './TMIcons';
6
6
  export * from './TMImageLibrary';
7
7
  export * from './helpers';
8
+ export * from './dataGridSearchHelper';
8
9
  export * from './queryHelper';
9
10
  export * from './TMUtils';
10
11
  export * from './TMCommandsContextMenu';
@@ -18,3 +19,4 @@ export * from './devextremeCustomMessages';
18
19
  export * from './ZipManager';
19
20
  export * from './certificateImportHelper';
20
21
  export * from './grafometricSignaturesCache';
22
+ export * from './TMAppUpdatedModal';
@@ -5,7 +5,10 @@ export type TID_Alias = {
5
5
  alias: string | undefined;
6
6
  };
7
7
  export declare const getTIDsByQd: (qd: QueryDescriptor | undefined) => TID_Alias[];
8
- export declare const getDcmtTypesByQdAsync: (qd: QueryDescriptor) => Promise<import("@topconsultnpm/sdk-ts").DcmtTypeDescriptor[]>;
8
+ /** Restituisce i tipi documento (con metadati) referenziati da qd.
9
+ * Con refreshCache = true i descrittori vengono riletti dal server, così la lista dei metadati
10
+ * recepisce quelli aggiunti o rimossi dopo il popolamento della cache. */
11
+ export declare const getDcmtTypesByQdAsync: (qd: QueryDescriptor, refreshCache?: boolean) => Promise<import("@topconsultnpm/sdk-ts").DcmtTypeDescriptor[]>;
9
12
  export declare const displayMetadataValue: (md: MetadataDescriptor | undefined, value: string | undefined, valueEmptyDescription?: string) => string;
10
13
  export declare const IsParametricQuery: (qd: QueryDescriptor | undefined) => boolean;
11
14
  export declare const addHiddenSelectItem: (select: SelectItem[], tid: number | undefined, mid: SystemMIDsAsNumber) => void;
@@ -14,6 +17,8 @@ export declare function addWhereClausesForConnect(qd: QueryDescriptor): void;
14
17
  export declare function getDefaultOperator(dataDomain: MetadataDataDomains | undefined, dataType: MetadataDataTypes | undefined): QueryOperators.Equal | QueryOperators.Contain | QueryOperators.In;
15
18
  export declare const getQD: (tid: number | undefined, easyOr: boolean, newMaxDcmtsToBeReturned: number) => Promise<QueryDescriptor | undefined>;
16
19
  export declare const getWorkItemSetIDAsync: (vid: number, did: number) => Promise<string | undefined>;
20
+ /** Id assegnato alla ricerca di sistema con tutti i documenti: non è in cache, va ricostruita a runtime con getSysAllDcmtsSQD */
21
+ export declare const SYS_ALL_DCMTS_SQD_ID = 1;
17
22
  export declare const getSysAllDcmtsSQD: (tid: number | undefined, easyOr: boolean) => Promise<SavedQueryDescriptor>;
18
23
  export declare const searchResultToMetadataValues: (tid: number | undefined, dtd: DataTableDescriptor | undefined, rows: string[], mids: number[], metadata: MetadataDescriptor[], layoutMode: LayoutModes, isReadOnlyOrigin?: boolean) => MetadataValueDescriptorEx[];
19
24
  export declare const handleArchiveVisibility: (md: MetadataDescriptor) => boolean;
@@ -15,8 +15,11 @@ export const getTIDsByQd = (qd) => {
15
15
  }
16
16
  return tids;
17
17
  };
18
- export const getDcmtTypesByQdAsync = async (qd) => {
19
- return await DcmtTypeListCacheService.GetFromQdAsync(qd);
18
+ /** Restituisce i tipi documento (con metadati) referenziati da qd.
19
+ * Con refreshCache = true i descrittori vengono riletti dal server, così la lista dei metadati
20
+ * recepisce quelli aggiunti o rimossi dopo il popolamento della cache. */
21
+ export const getDcmtTypesByQdAsync = async (qd, refreshCache = false) => {
22
+ return await DcmtTypeListCacheService.GetFromQdAsync(qd, undefined, false, refreshCache);
20
23
  };
21
24
  export const displayMetadataValue = (md, value, valueEmptyDescription = "") => {
22
25
  if (!value)
@@ -251,9 +254,11 @@ export const getWorkItemSetIDAsync = async (vid, did) => {
251
254
  let result = await SDK_Globals.tmSession?.NewSearchEngine().SearchByIDAsync(qd);
252
255
  return result?.dtdResult?.rows?.[0]?.[0];
253
256
  };
257
+ /** Id assegnato alla ricerca di sistema con tutti i documenti: non è in cache, va ricostruita a runtime con getSysAllDcmtsSQD */
258
+ export const SYS_ALL_DCMTS_SQD_ID = 1;
254
259
  export const getSysAllDcmtsSQD = async (tid, easyOr) => {
255
260
  let sqd = new SavedQueryDescriptor();
256
- sqd.id = 1;
261
+ sqd.id = SYS_ALL_DCMTS_SQD_ID;
257
262
  sqd.masterTID = tid;
258
263
  sqd.isEasyWhere = 1;
259
264
  sqd.name = SDKUI_Localizator.AllDcmts;
@@ -0,0 +1,16 @@
1
+ import { DataColumnDescriptor, DataColumnTypes, MetadataDescriptor, MetadataFormats } from '@topconsultnpm/sdk-ts';
2
+ /**
3
+ * Funzioni condivise dalle due sorgenti di TMDistinctValues (valori distinti e ricerca rapida):
4
+ * stanno fuori dagli hook perché non dipendono da alcuno stato.
5
+ */
6
+ export declare const withRowIndex: <T>(rows: Array<T>) => T[];
7
+ export declare const toGridDataType: (dataType: DataColumnTypes | undefined) => "string" | "number" | "datetime" | "boolean";
8
+ export declare const getMetadataName: (columnMd: MetadataDescriptor | undefined) => string | undefined;
9
+ export declare const getDateDisplayFormat: (format: MetadataFormats | undefined, formatCulture: string | undefined | null) => {
10
+ formatter: (value: string | number | Date) => string;
11
+ };
12
+ /**
13
+ * Risolve il MID della colonna di un risultato di ricerca: la proprietà estesa è la fonte principale,
14
+ * in mancanza resta l'allineamento posizionale tra selectMIDs e colonne del risultato.
15
+ */
16
+ export declare const getColumnMid: (column: DataColumnDescriptor | undefined, selectMIDs: number[] | undefined, columnIndex: number) => number;
@@ -0,0 +1,31 @@
1
+ import { DataColumnTypes, SDK_Globals } from '@topconsultnpm/sdk-ts';
2
+ import { formatDateTimeByMetadataFormat } from '../helper';
3
+ /**
4
+ * Funzioni condivise dalle due sorgenti di TMDistinctValues (valori distinti e ricerca rapida):
5
+ * stanno fuori dagli hook perché non dipendono da alcuno stato.
6
+ */
7
+ // rowIndex è la chiave delle griglie di TMDistinctValues: va riallineato all'ordine finale delle righe
8
+ export const withRowIndex = (rows) => {
9
+ rows.forEach((row, index) => { row.rowIndex = index; });
10
+ return rows;
11
+ };
12
+ export const toGridDataType = (dataType) => {
13
+ switch (dataType) {
14
+ case DataColumnTypes.DateTime: return 'datetime';
15
+ case DataColumnTypes.Bool: return 'boolean';
16
+ case DataColumnTypes.Number: return 'number';
17
+ default: return 'string';
18
+ }
19
+ };
20
+ // Nome del metadato con cui viene intestata la colonna, nella lingua scelta dall'utente
21
+ export const getMetadataName = (columnMd) => (SDK_Globals.useLocalizedName ? columnMd?.nameLoc : columnMd?.name) ?? columnMd?.name ?? columnMd?.nameLoc ?? undefined;
22
+ // Le date vanno mostrate con il formato definito sul metadato, come nel risultato di ricerca
23
+ export const getDateDisplayFormat = (format, formatCulture) => ({
24
+ // La griglia passa al formatter un oggetto Date già istanziato, ma il valore può arrivare anche come stringa
25
+ formatter: (value) => formatDateTimeByMetadataFormat(value instanceof Date ? value : new Date(value), format, formatCulture)
26
+ });
27
+ /**
28
+ * Risolve il MID della colonna di un risultato di ricerca: la proprietà estesa è la fonte principale,
29
+ * in mancanza resta l'allineamento posizionale tra selectMIDs e colonne del risultato.
30
+ */
31
+ export const getColumnMid = (column, selectMIDs, columnIndex) => Number(column?.extendedProperties?.['MID'] ?? 0) || (selectMIDs?.[columnIndex] ?? 0);
@@ -0,0 +1,39 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { MetadataValueDescriptorEx } from '../ts';
3
+ /** Modalità "aggiungi a elenco": il form non archivia a sistema, restituisce i metadati al chiamante (TMMultiMasterDetailDcmts). */
4
+ export interface ArchiveListMode {
5
+ /** true quando si modifica una riga già presente nell'elenco ("Modifica" al posto di "Aggiungi"). */
6
+ isEditingRow: boolean;
7
+ /** Restituisce metadati e file al chiamante, che aggiunge o aggiorna la riga nell'elenco (senza archiviare). */
8
+ onUpsertRow: (metadataValues: Array<MetadataValueDescriptorEx>, file: File | undefined, tid?: number) => void;
9
+ }
10
+ interface UseArchiveListFormParams {
11
+ /** Assente = modalità "aggiungi a elenco" spenta. */
12
+ mode?: ArchiveListMode;
13
+ /** Valori della riga in modifica, con cui pre-compilare il form. */
14
+ editingRowValues?: Array<{
15
+ mid: number;
16
+ value: string;
17
+ }>;
18
+ /** Template vuoto del form. */
19
+ formDataOrig: Array<MetadataValueDescriptorEx>;
20
+ /** Ref ai valori correnti del form (per leggerli al submit senza stale closure). */
21
+ formDataRef: MutableRefObject<Array<MetadataValueDescriptorEx>>;
22
+ /** Ref al file caricato. */
23
+ dcmtFileRef: MutableRefObject<File | null>;
24
+ tid?: number;
25
+ isModal?: boolean;
26
+ /** Id del form, usato come parentId del message box quando è in modale. */
27
+ id?: string;
28
+ /** Svuota il form dopo aver restituito i valori. */
29
+ clearForm: () => void;
30
+ }
31
+ /** Isola la logica della modalità "aggiungi a elenco": valori di riferimento, submit e chiusura del form. */
32
+ export declare const useArchiveListForm: ({ mode, editingRowValues, formDataOrig, formDataRef, dcmtFileRef, tid, isModal, id, clearForm, }: UseArchiveListFormParams) => {
33
+ enabled: boolean;
34
+ isEditingRow: boolean;
35
+ referenceValues: MetadataValueDescriptorEx[];
36
+ submit: () => void;
37
+ requestClose: (isModified: boolean, onClose?: () => void) => boolean;
38
+ };
39
+ export {};
@@ -0,0 +1,46 @@
1
+ import { useCallback, useMemo } from 'react';
2
+ import { ButtonNames, TMMessageBoxManager } from '../components';
3
+ /** Isola la logica della modalità "aggiungi a elenco": valori di riferimento, submit e chiusura del form. */
4
+ export const useArchiveListForm = ({ mode, editingRowValues, formDataOrig, formDataRef, dcmtFileRef, tid, isModal, id, clearForm, }) => {
5
+ const enabled = !!mode;
6
+ const isEditingRow = !!mode?.isEditingRow;
7
+ // Valori con cui si confronta il form per capire cosa è cambiato (flag "modificato" ed evidenza gialla).
8
+ // Modificando una riga si parte dai suoi valori, così i campi pre-compilati non risultano subito modificati.
9
+ const referenceValues = useMemo(() => {
10
+ if (!isEditingRow || !editingRowValues || editingRowValues.length === 0)
11
+ return formDataOrig;
12
+ return formDataOrig.map(md => {
13
+ const rowValue = editingRowValues.find(rv => rv.mid === md.mid);
14
+ return rowValue ? { ...md, value: rowValue.value } : md;
15
+ });
16
+ }, [isEditingRow, editingRowValues, formDataOrig]);
17
+ // Restituisce metadati e file al chiamante, poi svuota il form.
18
+ const submit = useCallback(() => {
19
+ if (!mode)
20
+ return;
21
+ const values = formDataRef.current.filter(md => md.mid !== undefined && md.mid > 99);
22
+ mode.onUpsertRow(values, dcmtFileRef.current ?? undefined, tid);
23
+ clearForm();
24
+ }, [mode, formDataRef, dcmtFileRef, tid, clearForm]);
25
+ // Gestisce la chiusura del form
26
+ const requestClose = useCallback((isModified, onClose) => {
27
+ if (!mode)
28
+ return false;
29
+ if (!isModified) {
30
+ onClose?.();
31
+ return true;
32
+ }
33
+ TMMessageBoxManager.show({
34
+ parentId: isModal ? "TMDcmtFormShowConfirmForClose-" + id : undefined,
35
+ message: "Chiudendo, le modifiche andranno perse. Proseguire?",
36
+ buttons: [ButtonNames.YES, ButtonNames.NO],
37
+ onButtonClick: (e) => {
38
+ // Sì: scarta le modifiche e chiude senza aggiungere all'elenco. No: resta sul form.
39
+ if (e == ButtonNames.YES)
40
+ onClose?.();
41
+ }
42
+ });
43
+ return true;
44
+ }, [mode, isModal, id]);
45
+ return { enabled, isEditingRow, referenceValues, submit, requestClose };
46
+ };
@@ -0,0 +1,56 @@
1
+ import { CaseFlowInstanceDescriptor, CaseFlowWorkItem } from '@topconsultnpm/sdk-ts';
2
+ /**
3
+ * Attività (workitem) delle PRATICHE assegnate all'utente, con il documento su
4
+ * cui lavorano già risolto.
5
+ *
6
+ * Gemello di `useWorkflowApprove` per il modulo CaseFlow: i dati stanno in una
7
+ * cache di modulo e le istanze del hook si sincronizzano con un evento, così il
8
+ * form del documento — da qualunque punto venga aperto — sa che su quel TID/DID
9
+ * c'è una firma da fare o un'approvazione da dare, senza che il chiamante debba
10
+ * passargli nulla.
11
+ */
12
+ /** Workitem di pratica già risolto sul documento cui si riferisce. */
13
+ export interface CaseFlowDcmtWorkItem {
14
+ caseflow: CaseFlowInstanceDescriptor;
15
+ workItem: CaseFlowWorkItem;
16
+ tid: number;
17
+ did: number;
18
+ }
19
+ /**
20
+ * Ricarica i workitem di pratica dell'utente. Con `force` ignora la finestra
21
+ * anti-raffica (da usare dopo un'operazione che li ha modificati).
22
+ */
23
+ export declare const refreshCaseFlowApproveData: (force?: boolean) => Promise<void>;
24
+ /**
25
+ * Workitem di pratica pendenti su quel documento (lettura sincrona dalla cache).
26
+ *
27
+ * TID/DID vanno NORMALIZZATI: pur essendo tipati `number`, arrivano come stringhe
28
+ * quando il documento è aperto da una griglia (righe di datagrid) — per lo stesso
29
+ * motivo il resto della libreria fa `Number(TID)`/`Number(DID)` in ogni confronto.
30
+ * Senza normalizzazione il confronto stretto falliva, e l'attività risultava
31
+ * assente aprendo il documento dalla ricerca mentre compariva dal widget "Per te".
32
+ */
33
+ export declare const getCaseFlowWorkItemsByDcmt: (tid?: number | string, did?: number | string) => CaseFlowDcmtWorkItem[];
34
+ /** Svuota la cache (logout / cambio archivio). */
35
+ export declare const clearCaseFlowApproveData: () => void;
36
+ /** Completa il workitem di pratica e ricarica la cache. */
37
+ export declare const completeCaseFlowWorkItem: (item: CaseFlowDcmtWorkItem, comment?: string) => Promise<void>;
38
+ /** Rifiuta il workitem di pratica (motivo obbligatorio) e ricarica la cache. */
39
+ export declare const rejectCaseFlowWorkItem: (item: CaseFlowDcmtWorkItem, reason: string) => Promise<void>;
40
+ /**
41
+ * Completa l'attività di FIRMA di una pratica sul documento indicato, se esiste.
42
+ * La chiama il viewer di firma quando la firma è riuscita: è il gemello di quanto
43
+ * già avviene per i workitem del workflow legacy.
44
+ * @returns true se un'attività è stata completata.
45
+ */
46
+ export declare const completeCaseFlowSignatureForDcmt: (tid: number | string, did: number | string, comment?: string) => Promise<boolean>;
47
+ /**
48
+ * Attività di pratica sul documento indicato. Senza sessione o senza attività
49
+ * l'elenco è vuoto e nulla cambia nella UI.
50
+ */
51
+ export declare const useCaseFlowApprove: (tid?: number | string, did?: number | string) => {
52
+ caseFlowWorkItems: CaseFlowDcmtWorkItem[];
53
+ refreshCaseFlowApprove: (force?: boolean) => Promise<void>;
54
+ completeCaseFlowWorkItem: (item: CaseFlowDcmtWorkItem, comment?: string) => Promise<void>;
55
+ rejectCaseFlowWorkItem: (item: CaseFlowDcmtWorkItem, reason: string) => Promise<void>;
56
+ };