@topconsultnpm/sdkui-react 6.22.0-dev3.9 → 6.22.0-dev4.10

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 (186) hide show
  1. package/lib/components/NewComponents/ContextMenu/styles.d.ts +43 -45
  2. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +60 -67
  3. package/lib/components/base/Styled.d.ts +77 -93
  4. package/lib/components/base/TMAlert.js +6 -8
  5. package/lib/components/base/TMAreaManager.js +53 -55
  6. package/lib/components/base/TMButton.js +4 -2
  7. package/lib/components/base/TMCounterBar.d.ts +2 -2
  8. package/lib/components/base/TMCounterContainer.d.ts +4 -3
  9. package/lib/components/base/TMCounterContainer.js +16 -1
  10. package/lib/components/base/TMCustomButton.d.ts +1 -1
  11. package/lib/components/base/TMCustomButton.js +40 -48
  12. package/lib/components/base/TMDataGrid.js +243 -223
  13. package/lib/components/base/TMDataGridExportForm.d.ts +1 -2
  14. package/lib/components/base/TMFileManager.d.ts +1 -2
  15. package/lib/components/base/TMFileManagerDataGridView.d.ts +1 -2
  16. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
  17. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
  18. package/lib/components/base/TMFileManagerUtils.d.ts +6 -4
  19. package/lib/components/base/TMLayout.d.ts +4 -4
  20. package/lib/components/base/TMList.d.ts +1 -2
  21. package/lib/components/base/TMListView.d.ts +1 -1
  22. package/lib/components/base/TMPanel.js +173 -170
  23. package/lib/components/base/TMSpinner.d.ts +3 -3
  24. package/lib/components/base/TMSpinner.js +9 -7
  25. package/lib/components/base/TMTab.d.ts +3 -4
  26. package/lib/components/base/TMTabControl.d.ts +5 -0
  27. package/lib/components/base/TMTabControl.js +219 -208
  28. package/lib/components/base/TMTooltip.d.ts +1 -1
  29. package/lib/components/base/TMTreeView.d.ts +8 -14
  30. package/lib/components/base/TMTreeView.js +20 -0
  31. package/lib/components/base/TMUserAvatar.d.ts +1 -2
  32. package/lib/components/base/TMVilViewer.d.ts +1 -2
  33. package/lib/components/base/TMWaitPanel.d.ts +2 -3
  34. package/lib/components/base/TMWaitPanel.js +1 -1
  35. package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
  36. package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
  37. package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +179 -0
  38. package/lib/components/base/waitPanel/TMWaitPanelManager.js +373 -0
  39. package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +57 -0
  40. package/lib/components/base/waitPanel/TMWaitPanelView.js +346 -0
  41. package/lib/components/base/waitPanel/index.d.ts +1 -0
  42. package/lib/components/base/waitPanel/index.js +1 -0
  43. package/lib/components/choosers/TMDistinctValues.js +3 -3
  44. package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
  45. package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +1 -2
  46. package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +1 -2
  47. package/lib/components/choosers/TMPathChooser.js +17 -34
  48. package/lib/components/choosers/TMQuickSearchInfo.d.ts +1 -2
  49. package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
  50. package/lib/components/choosers/TMUserChooser.d.ts +2 -2
  51. package/lib/components/editors/TMEditorStyled.d.ts +42 -20
  52. package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
  53. package/lib/components/editors/TMHtmlContentDisplay.d.ts +1 -2
  54. package/lib/components/editors/TMHtmlEditor.d.ts +1 -2
  55. package/lib/components/editors/TMTextBox.d.ts +4 -0
  56. package/lib/components/editors/TMTextBox.js +99 -11
  57. package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
  58. package/lib/components/features/archive/TMArchive.js +7 -2
  59. package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +28 -0
  60. package/lib/components/features/assistant/TMHelpOnLineChat.js +1231 -0
  61. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
  62. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
  63. package/lib/components/features/blog/TMBlogCommentForm.d.ts +1 -2
  64. package/lib/components/features/documents/TMBatchUpdateForm.js +3 -4
  65. package/lib/components/features/documents/TMCopyToFolderForm.js +53 -84
  66. package/lib/components/features/documents/TMDcmtForm.js +50 -61
  67. package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
  68. package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -4
  69. package/lib/components/features/documents/TMDcmtIcon.js +3 -5
  70. package/lib/components/features/documents/TMDcmtPreview.d.ts +6 -8
  71. package/lib/components/features/documents/TMDcmtPreview.js +5 -3
  72. package/lib/components/features/documents/TMDcmtTasks.d.ts +1 -2
  73. package/lib/components/features/documents/TMDcmtTasks.js +2 -9
  74. package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
  75. package/lib/components/features/documents/TMFileUploader.js +5 -5
  76. package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
  77. package/lib/components/features/documents/TMMasterDetailDcmts.js +53 -148
  78. package/lib/components/features/documents/TMMasterInfoFields.d.ts +1 -2
  79. package/lib/components/features/documents/TMMasterInfoFields.js +3 -2
  80. package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
  81. package/lib/components/features/documents/TMMergeToPdfForm.js +52 -56
  82. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +1 -2
  83. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +14 -15
  84. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +5 -5
  85. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +3 -3
  86. package/lib/components/features/documents/TMRelationViewer.d.ts +13 -14
  87. package/lib/components/features/documents/TMRelationViewer.js +206 -143
  88. package/lib/components/features/documents/relationTreeState.d.ts +32 -0
  89. package/lib/components/features/documents/relationTreeState.js +89 -0
  90. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +1 -2
  91. package/lib/components/features/search/TMMetadataOutputForm.d.ts +1 -2
  92. package/lib/components/features/search/TMMetadataSorterForm.d.ts +1 -2
  93. package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
  94. package/lib/components/features/search/TMSearch.d.ts +1 -2
  95. package/lib/components/features/search/TMSearch.js +3 -4
  96. package/lib/components/features/search/TMSearchQueryPanel.d.ts +3 -9
  97. package/lib/components/features/search/TMSearchQueryPanel.js +0 -4
  98. package/lib/components/features/search/TMSearchResult.d.ts +5 -0
  99. package/lib/components/features/search/TMSearchResult.js +129 -102
  100. package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
  101. package/lib/components/features/search/TMSignatureInfoContent.d.ts +1 -2
  102. package/lib/components/features/search/TMTreeSelector.js +23 -27
  103. package/lib/components/features/search/TMViewHistoryDcmt.d.ts +1 -2
  104. package/lib/components/features/search/TMViewHistoryDcmt.js +15 -26
  105. package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
  106. package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
  107. package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
  108. package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
  109. package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
  110. package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
  111. package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
  112. package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
  113. package/lib/components/features/tasks/TMTasksView.js +97 -90
  114. package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +2 -3
  115. package/lib/components/features/wg/TMWGsCopyMoveForm.js +95 -91
  116. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +7 -8
  117. package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +1 -3
  118. package/lib/components/forms/Login/ChangePasswordInputs.d.ts +1 -3
  119. package/lib/components/forms/Login/Chooser.d.ts +2 -2
  120. package/lib/components/forms/TMChooserForm.d.ts +1 -2
  121. package/lib/components/forms/TMResultDialog.js +1 -1
  122. package/lib/components/forms/TMSaveForm.d.ts +4 -4
  123. package/lib/components/grids/TMBlogAttachments.d.ts +1 -2
  124. package/lib/components/grids/TMBlogHeader.d.ts +1 -1
  125. package/lib/components/grids/TMBlogsPost.d.ts +1 -1
  126. package/lib/components/grids/TMBlogsPost.js +93 -97
  127. package/lib/components/grids/TMBlogsPostUtils.d.ts +9 -9
  128. package/lib/components/grids/TMValidationItemsList.d.ts +1 -2
  129. package/lib/components/index.d.ts +5 -1
  130. package/lib/components/index.js +4 -1
  131. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -2
  132. package/lib/components/layout/panelManager/TMPanelManagerContainer.js +4 -3
  133. package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +3 -2
  134. package/lib/components/layout/panelManager/TMPanelManagerContext.js +5 -1
  135. package/lib/components/layout/panelManager/TMPanelManagerLoader.d.ts +5 -0
  136. package/lib/components/layout/panelManager/TMPanelManagerLoader.js +18 -0
  137. package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +6 -5
  138. package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +4 -8
  139. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
  140. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.js +2 -1
  141. package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
  142. package/lib/components/pages/TMPage.d.ts +1 -1
  143. package/lib/components/pages/TMPage.js +32 -31
  144. package/lib/components/query/TMQueryEditor.d.ts +13 -14
  145. package/lib/components/query/TMQueryEditor.js +2 -1
  146. package/lib/components/settings/SettingsAppearance.d.ts +1 -2
  147. package/lib/components/sidebar/TMAboutApp.d.ts +1 -2
  148. package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
  149. package/lib/components/sidebar/TMHeader.d.ts +4 -3
  150. package/lib/components/sidebar/TMHeader.js +2 -2
  151. package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -3
  152. package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +2 -3
  153. package/lib/components/viewers/TMMidViewer.d.ts +2 -2
  154. package/lib/components/viewers/TMTidViewer.d.ts +2 -2
  155. package/lib/helper/Enum_Localizator.js +1 -0
  156. package/lib/helper/SDKUI_Globals.d.ts +7 -2
  157. package/lib/helper/SDKUI_Globals.js +7 -2
  158. package/lib/helper/SDKUI_Localizator.d.ts +31 -6
  159. package/lib/helper/SDKUI_Localizator.js +301 -51
  160. package/lib/helper/TMAppUpdatedModal.d.ts +1 -2
  161. package/lib/helper/TMAppUpdatedModal.js +93 -93
  162. package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
  163. package/lib/helper/TMIcons.d.ts +280 -280
  164. package/lib/helper/TMPdfViewer.d.ts +1 -2
  165. package/lib/helper/TMToppyMessage.d.ts +2 -2
  166. package/lib/helper/TMUtils.d.ts +4 -10
  167. package/lib/helper/ZipManager.d.ts +1 -1
  168. package/lib/helper/ZipManager.js +2 -1
  169. package/lib/helper/dcmtsHelper.d.ts +2 -0
  170. package/lib/helper/dcmtsHelper.js +3 -1
  171. package/lib/helper/helpers.d.ts +1 -1
  172. package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
  173. package/lib/hooks/useCheckInOutOperations.js +14 -34
  174. package/lib/hooks/useDcmtOperations.d.ts +3 -19
  175. package/lib/hooks/useDcmtOperations.js +174 -227
  176. package/lib/hooks/useDocumentOperations.d.ts +1 -0
  177. package/lib/hooks/useDocumentOperations.js +14 -25
  178. package/lib/hooks/useInputDialog.d.ts +1 -2
  179. package/lib/hooks/useMultiMasterDetailDcmts.d.ts +0 -15
  180. package/lib/hooks/useMultiMasterDetailDcmts.js +70 -68
  181. package/lib/hooks/usePreventFileDrop.js +9 -0
  182. package/lib/hooks/useWorkflowApprove.js +33 -17
  183. package/lib/services/caseflow/CaseFlowService.d.ts +69 -9
  184. package/lib/services/caseflow/CaseFlowService.js +126 -58
  185. package/lib/services/platform_services.d.ts +2 -3
  186. package/package.json +2 -2
@@ -1,9 +1,8 @@
1
- import React from "react";
2
1
  interface TMPdfViewerProps {
3
2
  pdfBlob: Blob;
4
3
  title?: string;
5
4
  isResizingActive?: boolean;
6
5
  enableFitToWidth?: boolean;
7
6
  }
8
- declare const TMPdfViewer: (props: TMPdfViewerProps) => React.JSX.Element;
7
+ declare const TMPdfViewer: (props: TMPdfViewerProps) => import("react/jsx-runtime").JSX.Element;
9
8
  export default TMPdfViewer;
@@ -1,8 +1,8 @@
1
- import React, { ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  interface TMToppyMessageProps {
3
3
  message: ReactNode;
4
4
  titleTooltip?: string;
5
5
  maxWidth?: string;
6
6
  }
7
- declare const TMToppyMessage: (props: TMToppyMessageProps) => React.JSX.Element;
7
+ declare const TMToppyMessage: (props: TMToppyMessageProps) => import("react/jsx-runtime").JSX.Element;
8
8
  export default TMToppyMessage;
@@ -24,7 +24,7 @@ export declare const getFullFileExtension: (fileName: string, depth?: number) =>
24
24
  * Es: pdf.p7m.tsd → pdf, pdf.p7m → pdf, pdf → pdf
25
25
  */
26
26
  export declare const getBaseExtension: (ext: string) => string;
27
- export declare const getFileIcon: (fileExtension: string | undefined, fileCount: number | undefined, tooltipContent?: JSX.Element | string) => React.JSX.Element;
27
+ export declare const getFileIcon: (fileExtension: string | undefined, fileCount: number | undefined, tooltipContent?: JSX.Element | string) => import("react/jsx-runtime").JSX.Element;
28
28
  export declare function formatBytes(bytes: number | undefined, decimalPlaces?: number): string;
29
29
  export interface RowData {
30
30
  [key: string]: string | number | null;
@@ -52,15 +52,9 @@ interface TabItemProps {
52
52
  $isSelected: boolean;
53
53
  $activeGradient?: string;
54
54
  }
55
- export declare const StyledTabItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
56
- style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
57
- }, TabItemProps>> & string;
58
- export declare const StyledTabIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "style"> & {
59
- style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
60
- }, TabItemProps>> & string;
61
- export declare const TMCountBadge: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
62
- style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
63
- }> & string;
55
+ export declare const StyledTabItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof TabItemProps> & TabItemProps, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof TabItemProps> & TabItemProps, never>>> & string;
56
+ export declare const StyledTabIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, keyof TabItemProps> & TabItemProps, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, keyof TabItemProps> & TabItemProps, never>>> & string;
57
+ export declare const TMCountBadge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
64
58
  export declare const PDGS_COLORS: {
65
59
  DOSSIER: string;
66
60
  DOCUMENT: string;
@@ -19,7 +19,7 @@ export interface ZipCreateOptions {
19
19
  encryptionStrength?: 1 | 2 | 3;
20
20
  /** Commento globale ZIP */
21
21
  comment?: string;
22
- /** Callback progresso: (indice, totale, nomeFile) */
22
+ /** Callback progresso, invocata a voce conclusa: (voci completate, totale, nomeFile appena aggiunto) */
23
23
  onProgress?: (index: number, total: number, filename: string) => void;
24
24
  /** Callback progresso singolo file: (bytesElaborati, bytesTotali) */
25
25
  onEntryProgress?: (progress: number, total: number) => void;
@@ -50,7 +50,6 @@ export class ZipManager {
50
50
  throw new DOMException("Operazione annullata", "AbortError");
51
51
  }
52
52
  const file = files[i];
53
- onProgress?.(i + 1, total, file.filename);
54
53
  const reader = this.createReader(file.data, { BlobReader, TextReader, Uint8ArrayReader });
55
54
  await zipWriter.add(file.filename, reader, {
56
55
  comment: file.comment,
@@ -60,6 +59,8 @@ export class ZipManager {
60
59
  encryptionStrength,
61
60
  onprogress: onEntryProgress ? (progress, total) => onEntryProgress(progress, total) : undefined
62
61
  });
62
+ // A voce conclusa, non prima: con un solo file la barra partirebbe gia' al 100%.
63
+ onProgress?.(i + 1, total, file.filename);
63
64
  }
64
65
  const commentBytes = comment ? new TextEncoder().encode(comment) : undefined;
65
66
  return await zipWriter.close(commentBytes);
@@ -2,6 +2,8 @@ import { DcmtTypeDescriptor, MetadataDataTypes, MetadataDescriptor, MetadataForm
2
2
  import { MetadataValueDescriptorEx } from "../ts";
3
3
  /** Metadati utente (esclusi quelli di sistema) del tipo documento, in ordine di visualizzazione */
4
4
  export declare const getUserMetadataSorted: (dtd: DcmtTypeDescriptor | undefined) => Array<MetadataDescriptor>;
5
+ /** Metadato visibile all'utente: stessa regola del risultato di ricerca (vedi getQD), serve almeno la visualizzazione o la modifica */
6
+ export declare const canViewMetadata: (md: MetadataDescriptor) => boolean;
5
7
  /** Formatta un valore scalare (non lista dati): date e numeri rispettano Format e FormatCulture del metadato */
6
8
  export declare const formatScalarValue: (value: any, dataType: MetadataDataTypes | undefined, format: MetadataFormats | undefined, formatCulture: string | undefined) => string;
7
9
  /** Check if dcmtType (mTID) has configured Detail or Many-to-Many relations */
@@ -1,4 +1,4 @@
1
- import { MetadataDataTypes, RelationCacheService, RelationTypes, SDK_Globals } from "@topconsultnpm/sdk-ts";
1
+ import { AccessLevels, MetadataDataTypes, RelationCacheService, RelationTypes, SDK_Globals } from "@topconsultnpm/sdk-ts";
2
2
  import { formatDateTimeByMetadataFormat, formatNumberByMetadataFormat } from "./TMUtils";
3
3
  /** Metadati utente (esclusi quelli di sistema) del tipo documento, in ordine di visualizzazione */
4
4
  export const getUserMetadataSorted = (dtd) => {
@@ -6,6 +6,8 @@ export const getUserMetadataSorted = (dtd) => {
6
6
  .filter(md => md.id !== undefined && md.id > 100 && md.isSystem !== 1)
7
7
  .sort((a, b) => (a.ordinalPosition ?? 0) - (b.ordinalPosition ?? 0));
8
8
  };
9
+ /** Metadato visibile all'utente: stessa regola del risultato di ricerca (vedi getQD), serve almeno la visualizzazione o la modifica */
10
+ export const canViewMetadata = (md) => !(md.perm?.canView == AccessLevels.No && md.perm?.canUpdate == AccessLevels.No);
9
11
  /** Formatta un valore scalare (non lista dati): date e numeri rispettano Format e FormatCulture del metadato */
10
12
  export const formatScalarValue = (value, dataType, format, formatCulture) => {
11
13
  if (value === undefined || value === null || value === '')
@@ -77,7 +77,7 @@ export { openApps, calcResponsiveDirection, calcResponsiveSizes, taskModalSizes,
77
77
  export declare function moduleVersion(module: moduleTypes): string;
78
78
  export declare function buildtype(module: moduleTypes): string;
79
79
  export declare const highlightText: (text: string, searchValue: string) => JSX.Element;
80
- export declare const renderHighlightedText: (text: string, searchText: string, isSelected: boolean) => string | (string | React.JSX.Element)[];
80
+ export declare const renderHighlightedText: (text: string, searchText: string, isSelected: boolean) => string | (string | import("react/jsx-runtime").JSX.Element)[];
81
81
  export declare function versionAndBuildtypeInfo(module: moduleTypes): string;
82
82
  export declare const getListMaxItems: (deviceType: DeviceType | undefined) => number;
83
83
  export declare const svgToString: (icon: React.ReactElement) => string;
@@ -20,11 +20,5 @@ export interface UseCheckInOutOperationsReturn {
20
20
  copyCheckoutPathToClipboardCallback: (dcmt: DcmtInfo, filename: string) => void;
21
21
  handleCheckOutCallback: (dcmt: DcmtInfo, checkout: boolean, filename: string, downloadDcmtsAsync: (params: DownloadDcmtsAsyncParams) => Promise<void>, onRefreshAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>) => Promise<void>;
22
22
  handleCheckInCallback: (dcmt: DcmtInfo, checkoutDate?: string | null, onRefreshAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>) => Promise<void>;
23
- showCicoWaitPanel: boolean;
24
- cicoWaitPanelTitle: string;
25
- showCicoPrimaryProgress: boolean;
26
- cicoPrimaryProgressText: string;
27
- cicoPrimaryProgressValue: number;
28
- cicoPrimaryProgressMax: number;
29
23
  }
30
24
  export declare const useCheckInOutOperations: (props: UseCheckInOutOperationsProps) => UseCheckInOutOperationsReturn;
@@ -1,6 +1,6 @@
1
1
  import { useCallback, useMemo, useState } from 'react';
2
2
  import { cicoDownloadFilesCallback, dcmtsFileCachePreview, getCicoDownloadFileName, getExceptionMessage, removeDcmtsFileCache, renderCicoCheckInContent, SDKUI_Globals, SDKUI_Localizator, updateCicoCheckoutStorageItem, validateCicoFileName } from '../helper';
3
- import { ButtonNames, DeviceType, ShowAlert, TMMessageBoxManager, TMResultManager, useDeviceType } from '../components';
3
+ import { ButtonNames, DeviceType, ShowAlert, TMMessageBoxManager, TMResultManager, TMWaitPanelManager, useDeviceType } from '../components';
4
4
  import { ResultTypes, SDK_Globals } from '@topconsultnpm/sdk-ts';
5
5
  let abortController = new AbortController();
6
6
  export const useCheckInOutOperations = (props) => {
@@ -18,18 +18,13 @@ export const useCheckInOutOperations = (props) => {
18
18
  const deviceType = useDeviceType();
19
19
  // This avoids unnecessary re-renders by only recalculating when deviceType changes.
20
20
  let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
21
- // State variable to control the visibility of the wait panel
22
- const [showCicoWaitPanel, setShowCicoWaitPanel] = useState(false);
23
- // State variable to store the title of the wait panel
24
- const [cicoWaitPanelTitle, setCicoWaitPanelTitle] = useState('');
25
- // State variable to control the visibility of the primary section of the wait panel
26
- const [showCicoPrimaryProgress, setShowCicoPrimaryProgress] = useState(false);
27
- // State variable to store the primary text of the wait panel
28
- const [cicoPrimaryProgressText, setCicoPrimaryProgressText] = useState('');
29
- // State variable to track the current value of the primary progress indicator in the wait panel
30
- const [cicoPrimaryProgressValue, setCicoPrimaryProgressValue] = useState(0);
31
- // State variable to define the maximum value for the primary progress indicator in the wait panel
32
- const [cicoPrimaryProgressMax, setCicoPrimaryProgressMax] = useState(0);
21
+ // Check in e check out non riportano avanzamento: il pannello e' solo il "sto lavorando".
22
+ const showCicoWaitPanel = (title) => TMWaitPanelManager.show({
23
+ title,
24
+ showCounters: false,
25
+ cancelable: true,
26
+ onAbort: () => abortController.abort(),
27
+ });
33
28
  const showHistoryCallback = useCallback(() => {
34
29
  setShowHistory(true);
35
30
  }, []);
@@ -73,11 +68,9 @@ export const useCheckInOutOperations = (props) => {
73
68
  if (e !== ButtonNames.YES)
74
69
  return;
75
70
  let result = [];
71
+ abortController = new AbortController();
72
+ const panel = showCicoWaitPanel(title);
76
73
  try {
77
- setCicoWaitPanelTitle(title);
78
- setShowCicoWaitPanel(true);
79
- setShowCicoPrimaryProgress(true);
80
- abortController = new AbortController();
81
74
  const ue = SDK_Globals.tmSession?.NewUpdateEngineByID();
82
75
  if (!ue)
83
76
  throw new Error("Update Engine not available");
@@ -113,10 +106,7 @@ export const useCheckInOutOperations = (props) => {
113
106
  result.push({ rowIndex: 1, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
114
107
  }
115
108
  finally {
116
- setCicoPrimaryProgressText('');
117
- setCicoPrimaryProgressMax(0);
118
- setCicoPrimaryProgressValue(0);
119
- setShowCicoWaitPanel(false);
109
+ panel.close();
120
110
  TMResultManager.show(result, title, "ID", undefined);
121
111
  }
122
112
  }
@@ -158,13 +148,12 @@ export const useCheckInOutOperations = (props) => {
158
148
  onButtonClick: async (e) => {
159
149
  if (e !== ButtonNames.YES)
160
150
  return;
161
- setCicoWaitPanelTitle('Check in');
162
- setShowCicoWaitPanel(true);
163
- setShowCicoPrimaryProgress(true);
164
151
  abortController = new AbortController();
165
152
  let result = [];
166
153
  let i = 0;
167
154
  if (dcmt.TID && dcmt.DID) {
155
+ // Aperto qui e non prima: fuori da questo ramo nessuno lo chiuderebbe.
156
+ const panel = showCicoWaitPanel('Check in');
168
157
  try {
169
158
  const ue = SDK_Globals.tmSession?.NewUpdateEngineByID();
170
159
  if (ue) {
@@ -187,10 +176,7 @@ export const useCheckInOutOperations = (props) => {
187
176
  result.push({ rowIndex: i, id1: i, id2: i, resultType: ResultTypes.ERROR, description: getExceptionMessage(err) });
188
177
  }
189
178
  finally {
190
- setCicoPrimaryProgressText('');
191
- setCicoPrimaryProgressMax(0);
192
- setCicoPrimaryProgressValue(0);
193
- setShowCicoWaitPanel(false);
179
+ panel.close();
194
180
  TMResultManager.show(result, 'Check in', "ID", undefined, SDKUI_Localizator.CheckInSuccessMessage, 6000);
195
181
  }
196
182
  }
@@ -211,11 +197,5 @@ export const useCheckInOutOperations = (props) => {
211
197
  copyCheckoutPathToClipboardCallback,
212
198
  handleCheckOutCallback,
213
199
  handleCheckInCallback,
214
- showCicoWaitPanel,
215
- cicoWaitPanelTitle,
216
- showCicoPrimaryProgress,
217
- cicoPrimaryProgressText,
218
- cicoPrimaryProgressValue,
219
- cicoPrimaryProgressMax,
220
200
  };
221
201
  };
@@ -24,28 +24,12 @@ export interface DownloadDcmtsAsyncParams {
24
24
  * - false (default): usa il nome file recuperato dal backend (file.name) come priorità
25
25
  */
26
26
  useInputFileName?: boolean;
27
- /**
28
- * Numero di download eseguiti in parallelo (default 1 = sequenziale, comportamento preesistente).
29
- * Valori > 1 vanno usati solo quando il chiamante consuma i file via
30
- * `onFileDownloaded`: nel percorso senza callback ogni file genera un click su un
31
- * tag <a download>, e più click ravvicinati vengono bloccati dal browser.
32
- */
33
- downloadConcurrency?: number;
34
27
  }
35
28
  export interface UseDcmtOperationsReturn {
36
- abortController: AbortController;
37
- showWaitPanel: boolean;
38
- showPrimary: boolean;
39
- waitPanelTitle: string;
40
- waitPanelTextPrimary: string;
41
- waitPanelValuePrimary: number;
42
- waitPanelMaxValuePrimary: number;
43
- showSecondary: boolean;
44
- waitPanelTextSecondary: string;
45
- waitPanelValueSecondary: number;
46
- waitPanelMaxValueSecondary: number;
47
29
  downloadDcmtsAsync: (params: DownloadDcmtsAsyncParams) => Promise<void>;
48
- getDcmtFileAsync: (inputDcmt: DcmtInfo | undefined, rfo: RetrieveFileOptions, operationTitle: string, keepWaitPanelPrimary: boolean, bypassCache?: boolean) => Promise<{
30
+ getDcmtFileAsync: (inputDcmt: DcmtInfo | undefined, rfo: RetrieveFileOptions, operationTitle: string,
31
+ /** Ignorato: con un file solo il pannello ha una barra sola, quella dei byte. */
32
+ keepWaitPanelPrimary: boolean, bypassCache?: boolean) => Promise<{
49
33
  file: File | undefined;
50
34
  isFromCache: boolean;
51
35
  } | undefined>;