@topconsultnpm/sdkui-react 6.20.0-dev1.3 → 6.20.0-dev1.30

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 (64) hide show
  1. package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +3 -3
  2. package/lib/components/NewComponents/ContextMenu/hooks.d.ts +1 -0
  3. package/lib/components/NewComponents/ContextMenu/hooks.js +8 -4
  4. package/lib/components/NewComponents/ContextMenu/styles.d.ts +4 -1
  5. package/lib/components/NewComponents/ContextMenu/styles.js +41 -8
  6. package/lib/components/NewComponents/ContextMenu/types.d.ts +1 -0
  7. package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +38 -30
  8. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +8 -0
  9. package/lib/components/NewComponents/FloatingMenuBar/styles.js +30 -19
  10. package/lib/components/base/TMAccordion.js +2 -2
  11. package/lib/components/base/TMCustomButton.js +41 -5
  12. package/lib/components/base/TMDataGrid.d.ts +2 -2
  13. package/lib/components/base/TMDataGrid.js +16 -5
  14. package/lib/components/editors/TMHtmlEditor.js +1 -1
  15. package/lib/components/editors/TMMetadataValues.js +20 -2
  16. package/lib/components/features/documents/TMDcmtBlog.d.ts +1 -7
  17. package/lib/components/features/documents/TMDcmtBlog.js +29 -2
  18. package/lib/components/features/documents/TMDcmtForm.js +268 -168
  19. package/lib/components/features/documents/TMDcmtPreview.js +37 -66
  20. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
  21. package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +6 -11
  22. package/lib/components/features/search/TMSearchQueryPanel.js +13 -12
  23. package/lib/components/features/search/TMSearchResult.js +74 -111
  24. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +1 -1
  25. package/lib/components/features/search/TMSearchResultsMenuItems.js +26 -43
  26. package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
  27. package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
  28. package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
  29. package/lib/components/forms/Login/LoginValidatorService.js +7 -2
  30. package/lib/components/forms/Login/TMLoginForm.js +34 -6
  31. package/lib/css/tm-sdkui.css +1 -1
  32. package/lib/helper/SDKUI_Globals.d.ts +13 -14
  33. package/lib/helper/SDKUI_Globals.js +9 -0
  34. package/lib/helper/SDKUI_Localizator.d.ts +8 -0
  35. package/lib/helper/SDKUI_Localizator.js +98 -0
  36. package/lib/helper/TMPdfViewer.d.ts +8 -0
  37. package/lib/helper/TMPdfViewer.js +187 -0
  38. package/lib/helper/TMUtils.d.ts +3 -1
  39. package/lib/helper/TMUtils.js +51 -0
  40. package/lib/helper/checkinCheckoutManager.d.ts +85 -0
  41. package/lib/helper/checkinCheckoutManager.js +348 -0
  42. package/lib/helper/devextremeCustomMessages.d.ts +30 -0
  43. package/lib/helper/devextremeCustomMessages.js +30 -0
  44. package/lib/helper/helpers.js +7 -1
  45. package/lib/helper/index.d.ts +2 -0
  46. package/lib/helper/index.js +2 -0
  47. package/lib/helper/queryHelper.js +29 -0
  48. package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
  49. package/lib/hooks/useCheckInOutOperations.js +223 -0
  50. package/lib/services/platform_services.d.ts +1 -1
  51. package/package.json +5 -2
  52. package/lib/components/NewComponents/Notification/Notification.d.ts +0 -4
  53. package/lib/components/NewComponents/Notification/Notification.js +0 -60
  54. package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +0 -8
  55. package/lib/components/NewComponents/Notification/NotificationContainer.js +0 -33
  56. package/lib/components/NewComponents/Notification/index.d.ts +0 -2
  57. package/lib/components/NewComponents/Notification/index.js +0 -2
  58. package/lib/components/NewComponents/Notification/styles.d.ts +0 -21
  59. package/lib/components/NewComponents/Notification/styles.js +0 -180
  60. package/lib/components/NewComponents/Notification/types.d.ts +0 -18
  61. package/lib/components/NewComponents/Notification/types.js +0 -1
  62. package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
  63. package/lib/helper/cicoHelper.d.ts +0 -31
  64. package/lib/helper/cicoHelper.js +0 -155
@@ -0,0 +1,223 @@
1
+ import { useCallback, useState } from 'react';
2
+ import { cicoDownloadFilesCallback, dcmtsFileCachePreview, getCicoDownloadFileName, getExceptionMessage, removeDcmtsFileCache, renderCicoCheckInContent, SDKUI_Globals, SDKUI_Localizator, updateCicoCheckoutStorageItem, validateCicoFileName } from '../helper';
3
+ import { ButtonNames, ShowAlert, TMMessageBoxManager, TMResultManager } from '../components';
4
+ import { ResultTypes, SDK_Globals } from '@topconsultnpm/sdk-ts';
5
+ let abortController = new AbortController();
6
+ export const useCheckInOutOperations = () => {
7
+ const [showHistory, setShowHistory] = useState(false);
8
+ // State to manage show history selected file
9
+ const [showCheckoutInformationForm, setShowCheckoutInformationForm] = useState(false);
10
+ // Stato per triggerare il refresh della preview dall'esterno
11
+ const [refreshPreviewTrigger, setRefreshPreviewTrigger] = useState(0);
12
+ // State to manage comment form
13
+ const [commentFormState, setCommentFormState] = useState({
14
+ removeAndEditAttachment: true,
15
+ show: false,
16
+ isRequired: false
17
+ });
18
+ // State variable to control the visibility of the wait panel
19
+ const [showCicoWaitPanel, setShowCicoWaitPanel] = useState(false);
20
+ // State variable to store the title of the wait panel
21
+ const [cicoWaitPanelTitle, setCicoWaitPanelTitle] = useState('');
22
+ // State variable to control the visibility of the primary section of the wait panel
23
+ const [showCicoPrimaryProgress, setShowCicoPrimaryProgress] = useState(false);
24
+ // State variable to store the primary text of the wait panel
25
+ const [cicoPrimaryProgressText, setCicoPrimaryProgressText] = useState('');
26
+ // State variable to track the current value of the primary progress indicator in the wait panel
27
+ const [cicoPrimaryProgressValue, setCicoPrimaryProgressValue] = useState(0);
28
+ // State variable to define the maximum value for the primary progress indicator in the wait panel
29
+ const [cicoPrimaryProgressMax, setCicoPrimaryProgressMax] = useState(0);
30
+ const showHistoryCallback = useCallback(() => {
31
+ setShowHistory(true);
32
+ }, []);
33
+ const hideHistoryCallback = useCallback(() => {
34
+ setShowHistory(false);
35
+ }, []);
36
+ const showCheckoutInformationFormCallback = useCallback(() => {
37
+ setShowCheckoutInformationForm(true);
38
+ }, []);
39
+ const hideCheckoutInformationFormCallback = useCallback(() => {
40
+ setShowCheckoutInformationForm(false);
41
+ }, []);
42
+ const triggerPreviewRefresh = useCallback(() => {
43
+ setRefreshPreviewTrigger(prev => prev + 1);
44
+ }, []);
45
+ const hideCommentFormCallback = useCallback(() => {
46
+ setCommentFormState(prev => ({ ...prev, show: false }));
47
+ }, []);
48
+ const copyCheckoutPathToClipboardCallback = (dcmt, filename) => {
49
+ const defaultCheckInOutFolder = SDKUI_Globals.userSettings.defaultCheckInOutFolder ?? "Download";
50
+ const wGSDraftCheckoutItemCurrentItems = [...SDKUI_Globals.userSettings.dcmtCheckoutInfo];
51
+ const existingItem = wGSDraftCheckoutItemCurrentItems.find((item) => item.TID === dcmt.TID.toString() && item.DID === dcmt.DID.toString());
52
+ const folder = existingItem && existingItem.checkoutFolder && existingItem.checkoutFolder !== "" ? existingItem.checkoutFolder : defaultCheckInOutFolder;
53
+ const name = existingItem?.checkoutName ?? getCicoDownloadFileName({ type: 'dcmtInfo', dcmtInfo: dcmt, originalFileName: filename }, true, false);
54
+ const textToCopy = folder ? `${folder}\\${name}` : name;
55
+ navigator.clipboard.writeText(textToCopy)
56
+ .then(() => {
57
+ ShowAlert({ message: SDKUI_Localizator.OperationSuccess, mode: 'success', duration: 5000, title: SDKUI_Localizator.CopyToClipboard });
58
+ })
59
+ .catch(err => {
60
+ ShowAlert({ message: err, mode: 'error', duration: 5000, title: SDKUI_Localizator.OperationResult });
61
+ });
62
+ };
63
+ const handleCheckOutCallback = async (dcmt, checkout, filename, downloadDcmtsAsync, refreshMetadataAsync, refreshFocusedDataRowAsync) => {
64
+ if (!dcmt)
65
+ throw new Error("Document info is required");
66
+ const title = checkout ? 'Check out' : SDKUI_Localizator.CancelCheckOut;
67
+ const msg = checkout ? SDKUI_Localizator.ExecuteCheckOutQuestion : SDKUI_Localizator.ExecuteCancelCheckOutQuestion;
68
+ TMMessageBoxManager.show({
69
+ title: title,
70
+ message: msg,
71
+ buttons: [ButtonNames.YES, ButtonNames.NO],
72
+ onButtonClick: async (e) => {
73
+ if (e !== ButtonNames.YES)
74
+ return;
75
+ let result = [];
76
+ try {
77
+ setCicoWaitPanelTitle(title);
78
+ setShowCicoWaitPanel(true);
79
+ setShowCicoPrimaryProgress(true);
80
+ abortController = new AbortController();
81
+ const ue = SDK_Globals.tmSession?.NewUpdateEngineByID();
82
+ if (!ue)
83
+ throw new Error("Update Engine not available");
84
+ ue.TID = dcmt.TID;
85
+ ue.DID = dcmt.DID;
86
+ if (checkout) {
87
+ await ue.CheckOutAsync()
88
+ .then(async () => {
89
+ await cicoDownloadFilesCallback([{ type: 'dcmtInfo', dcmtInfo: dcmt, originalFileName: filename }], true, downloadDcmtsAsync);
90
+ result.push({ rowIndex: 1, id1: dcmt.TID, id2: dcmt.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
91
+ await refreshMetadataAsync?.();
92
+ await refreshFocusedDataRowAsync?.(dcmt.TID, dcmt.DID, true);
93
+ })
94
+ .catch((error) => {
95
+ result.push({ rowIndex: 1, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
96
+ throw error;
97
+ });
98
+ }
99
+ else {
100
+ await ue.UndoCheckOutAsync()
101
+ .then(async () => {
102
+ result.push({ rowIndex: 1, id1: dcmt.TID, id2: dcmt.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
103
+ // Remove the corresponding draft checkout item
104
+ updateCicoCheckoutStorageItem({ TID: dcmt.TID.toString(), DID: dcmt.DID.toString(), checkoutFolder: "", checkoutName: "" }, "dcmtInfo", "remove");
105
+ await refreshMetadataAsync?.();
106
+ await refreshFocusedDataRowAsync?.(dcmt.TID, dcmt.DID, true);
107
+ })
108
+ .catch((error) => {
109
+ result.push({ rowIndex: 0, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
110
+ throw error;
111
+ });
112
+ }
113
+ }
114
+ catch (error) {
115
+ result.push({ rowIndex: 1, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
116
+ }
117
+ finally {
118
+ setCicoPrimaryProgressText('');
119
+ setCicoPrimaryProgressMax(0);
120
+ setCicoPrimaryProgressValue(0);
121
+ setShowCicoWaitPanel(false);
122
+ TMResultManager.show(result, title, "ID", undefined);
123
+ }
124
+ }
125
+ });
126
+ };
127
+ const triggerCommentOnFileAdd = (addedFiles) => {
128
+ if (addedFiles.length > 0) {
129
+ setCommentFormState({
130
+ show: true,
131
+ isRequired: true,
132
+ removeAndEditAttachment: false
133
+ });
134
+ }
135
+ };
136
+ const handleCheckInCallback = async (dcmt, refreshMetadataAsync, refreshFocusedDataRowAsync) => {
137
+ if (!dcmt)
138
+ throw new Error("Document info is required");
139
+ // Create a new file input element
140
+ const input = document.createElement("input");
141
+ // Set the input type to "file" to allow file selection
142
+ input.type = "file";
143
+ // Set the accepted file types (e.g., images, PDFs, etc.)
144
+ input.accept = "*/*";
145
+ // Enable the input to accept one file at once
146
+ input.multiple = false;
147
+ // Add an event listener for when the file selection changes
148
+ input.addEventListener('change', async (event) => {
149
+ const fileInput = event.target;
150
+ if (!fileInput.files || fileInput.files.length === 0)
151
+ return;
152
+ const file = fileInput.files[0];
153
+ const validateFileName = validateCicoFileName({ type: 'dcmtInfo', dcmtInfo: dcmt, originalFileName: dcmt.fileName ?? SDKUI_Localizator.SearchResult }, file.name);
154
+ TMMessageBoxManager.show({
155
+ resizable: true,
156
+ buttons: [ButtonNames.YES, ButtonNames.NO],
157
+ message: renderCicoCheckInContent({ type: 'dcmtInfo', dcmtInfo: dcmt, originalFileName: dcmt.fileName ?? SDKUI_Localizator.SearchResult }, file, validateFileName.isValid, validateFileName.validationResults),
158
+ title: "Check in",
159
+ onButtonClick: async (e) => {
160
+ if (e !== ButtonNames.YES)
161
+ return;
162
+ setCicoWaitPanelTitle('Check in');
163
+ setShowCicoWaitPanel(true);
164
+ setShowCicoPrimaryProgress(true);
165
+ abortController = new AbortController();
166
+ let result = [];
167
+ let i = 0;
168
+ if (dcmt.TID && dcmt.DID) {
169
+ try {
170
+ const ue = SDK_Globals.tmSession?.NewUpdateEngineByID();
171
+ if (ue) {
172
+ ue.TID = dcmt.TID;
173
+ ue.DID = dcmt.DID;
174
+ await ue.CheckInAsync(file, "", abortController.signal);
175
+ // Remove the corresponding draft checkout item
176
+ updateCicoCheckoutStorageItem({ TID: dcmt.TID.toString(), DID: dcmt.DID.toString(), checkoutFolder: "", checkoutName: "" }, "dcmtInfo", "remove");
177
+ result.push({ rowIndex: i, id1: dcmt.DID, id2: dcmt.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
178
+ await refreshMetadataAsync?.();
179
+ await refreshFocusedDataRowAsync?.(dcmt.TID, dcmt.DID, true);
180
+ const cacheKey = `${dcmt.TID}-${dcmt.DID}`;
181
+ if (dcmtsFileCachePreview.has(cacheKey))
182
+ removeDcmtsFileCache(cacheKey);
183
+ triggerPreviewRefresh();
184
+ triggerCommentOnFileAdd([dcmt.DID]);
185
+ }
186
+ }
187
+ catch (err) {
188
+ result.push({ rowIndex: i, id1: i, id2: i, resultType: ResultTypes.ERROR, description: getExceptionMessage(err) });
189
+ }
190
+ finally {
191
+ setCicoPrimaryProgressText('');
192
+ setCicoPrimaryProgressMax(0);
193
+ setCicoPrimaryProgressValue(0);
194
+ setShowCicoWaitPanel(false);
195
+ TMResultManager.show(result, 'Check in', "ID", undefined, SDKUI_Localizator.CheckInSuccessMessage, 6000);
196
+ }
197
+ }
198
+ },
199
+ });
200
+ });
201
+ input.click();
202
+ };
203
+ return {
204
+ showHistory,
205
+ showHistoryCallback,
206
+ hideHistoryCallback,
207
+ showCheckoutInformationForm,
208
+ showCheckoutInformationFormCallback,
209
+ hideCheckoutInformationFormCallback,
210
+ commentFormState,
211
+ hideCommentFormCallback,
212
+ copyCheckoutPathToClipboardCallback,
213
+ handleCheckOutCallback,
214
+ handleCheckInCallback,
215
+ refreshPreviewTrigger,
216
+ showCicoWaitPanel,
217
+ cicoWaitPanelTitle,
218
+ showCicoPrimaryProgress,
219
+ cicoPrimaryProgressText,
220
+ cicoPrimaryProgressValue,
221
+ cicoPrimaryProgressMax,
222
+ };
223
+ };
@@ -6,7 +6,7 @@ export declare class PlatformObjectService {
6
6
  static readonly retrieveAllAdminAsync: (objClass: ObjectClasses, jobType?: JobTypes) => Promise<import("@topconsultnpm/sdk-ts").UserDescriptor[] | DcmtTypeDescriptor[] | import("@topconsultnpm/sdk-ts").AreaDescriptor[] | import("@topconsultnpm/sdk-ts").RelationDescriptor[] | import("@topconsultnpm/sdk-ts").FEDistillerJobDescriptor[] | import("@topconsultnpm/sdk-ts").DataListDescriptor[] | import("@topconsultnpm/sdk-ts").DiskDescriptor[] | import("@topconsultnpm/sdk-ts").GroupDescriptor[] | import("@topconsultnpm/sdk-ts").LDAPDescriptor[] | import("@topconsultnpm/sdk-ts").NumeratorDescriptor[] | ProcessDescriptor[] | import("@topconsultnpm/sdk-ts").SAPLoginDescriptor[] | import("@topconsultnpm/sdk-ts").SignCertDescriptor[] | import("@topconsultnpm/sdk-ts").SignServerDescriptor[] | import("@topconsultnpm/sdk-ts").TreeDescriptor[] | import("@topconsultnpm/sdk-ts").TSADescriptor[] | import("@topconsultnpm/sdk-ts").WFDescriptor[] | undefined>;
7
7
  private static readonly loadCacheForJobAsync;
8
8
  private static readonly retrieveAdminJobAsync;
9
- static readonly retrieveAdminAsync: (objClass: ObjectClasses, jobType: JobTypes, id: number) => Promise<import("@topconsultnpm/sdk-ts").UserDescriptor | import("@topconsultnpm/sdk-ts").MailSenderJobDescriptor | DcmtTypeDescriptor | import("@topconsultnpm/sdk-ts").SavedQueryDescriptor | import("@topconsultnpm/sdk-ts").DataListDescriptor | import("@topconsultnpm/sdk-ts").AreaDescriptor | import("@topconsultnpm/sdk-ts").BasketTypeDescriptor | import("@topconsultnpm/sdk-ts").RelationDescriptor | import("@topconsultnpm/sdk-ts").TaskDescriptor | import("@topconsultnpm/sdk-ts").WorkingGroupDescriptor | import("@topconsultnpm/sdk-ts").BarcodeArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").BatchUpdaterJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoDoganaleJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoDoganalePlusJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoFiscaleQueryJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoFiscaleSenderJobDescriptor | import("@topconsultnpm/sdk-ts").CheckSequenceJobDescriptor | import("@topconsultnpm/sdk-ts").COSCheckerJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtConverterJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtDeleterJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtNoteJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtPrinterJobDescriptor | import("@topconsultnpm/sdk-ts").FEAttacherJobDescriptor | import("@topconsultnpm/sdk-ts").FECreatorTxtJobDescriptor | import("@topconsultnpm/sdk-ts").FEDetacherJobDescriptor | import("@topconsultnpm/sdk-ts").FEDistillerJobDescriptor | import("@topconsultnpm/sdk-ts").FESenderWsJobDescriptor | import("@topconsultnpm/sdk-ts").FESplitterJobDescriptor | import("@topconsultnpm/sdk-ts").FEValidatorJobDescriptor | import("@topconsultnpm/sdk-ts").FileArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").FileCheckerJobDescriptor | import("@topconsultnpm/sdk-ts").FileExecJobDescriptor | import("@topconsultnpm/sdk-ts").FileExportJobDescriptor | import("@topconsultnpm/sdk-ts").FileMoverJobDescriptor | import("@topconsultnpm/sdk-ts").LexJobDescriptor | import("@topconsultnpm/sdk-ts").LinkerJobDescriptor | import("@topconsultnpm/sdk-ts").MailArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").MailQueryJobDescriptor | import("@topconsultnpm/sdk-ts").MigrationJobDescriptor | import("@topconsultnpm/sdk-ts").PdDCreatorJobDescriptor | import("@topconsultnpm/sdk-ts").PDFArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").PdVArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").PdVQueryJobDescriptor | import("@topconsultnpm/sdk-ts").PdVSenderJobDescriptor | import("@topconsultnpm/sdk-ts").PeppolQueryJobDescriptor | import("@topconsultnpm/sdk-ts").PeppolSenderJobDescriptor | import("@topconsultnpm/sdk-ts").PostelQueryJobDescriptor | import("@topconsultnpm/sdk-ts").PostelSenderJobDescriptor | import("@topconsultnpm/sdk-ts").ReplicatorJobDescriptor | import("@topconsultnpm/sdk-ts").SAPAlignerJobDescriptor | import("@topconsultnpm/sdk-ts").SAPBarcodeJobDescriptor | import("@topconsultnpm/sdk-ts").SAPDataReaderJobDescriptor | import("@topconsultnpm/sdk-ts").SAPDataWriterJobDescriptor | import("@topconsultnpm/sdk-ts").SignerJobDescriptor | import("@topconsultnpm/sdk-ts").SpoolArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").UpdaterJobDescriptor | import("@topconsultnpm/sdk-ts").DiskDescriptor | import("@topconsultnpm/sdk-ts").GroupDescriptor | import("@topconsultnpm/sdk-ts").LDAPDescriptor | import("@topconsultnpm/sdk-ts").NumeratorDescriptor | ProcessDescriptor | import("@topconsultnpm/sdk-ts").SAPLoginDescriptor | import("@topconsultnpm/sdk-ts").SignCertDescriptor | import("@topconsultnpm/sdk-ts").SignServerDescriptor | import("@topconsultnpm/sdk-ts").TreeDescriptor | import("@topconsultnpm/sdk-ts").TSADescriptor | import("@topconsultnpm/sdk-ts").WFDescriptor | undefined>;
9
+ static readonly retrieveAdminAsync: (objClass: ObjectClasses, jobType: JobTypes, id: number) => Promise<import("@topconsultnpm/sdk-ts").UserDescriptor | DcmtTypeDescriptor | import("@topconsultnpm/sdk-ts").MailSenderJobDescriptor | import("@topconsultnpm/sdk-ts").SavedQueryDescriptor | import("@topconsultnpm/sdk-ts").DataListDescriptor | import("@topconsultnpm/sdk-ts").AreaDescriptor | import("@topconsultnpm/sdk-ts").BasketTypeDescriptor | import("@topconsultnpm/sdk-ts").RelationDescriptor | import("@topconsultnpm/sdk-ts").TaskDescriptor | import("@topconsultnpm/sdk-ts").WorkingGroupDescriptor | import("@topconsultnpm/sdk-ts").BarcodeArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").BatchUpdaterJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoDoganaleJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoDoganalePlusJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoFiscaleQueryJobDescriptor | import("@topconsultnpm/sdk-ts").CassettoFiscaleSenderJobDescriptor | import("@topconsultnpm/sdk-ts").CheckSequenceJobDescriptor | import("@topconsultnpm/sdk-ts").COSCheckerJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtConverterJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtDeleterJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtNoteJobDescriptor | import("@topconsultnpm/sdk-ts").DcmtPrinterJobDescriptor | import("@topconsultnpm/sdk-ts").FEAttacherJobDescriptor | import("@topconsultnpm/sdk-ts").FECreatorTxtJobDescriptor | import("@topconsultnpm/sdk-ts").FEDetacherJobDescriptor | import("@topconsultnpm/sdk-ts").FEDistillerJobDescriptor | import("@topconsultnpm/sdk-ts").FESenderWsJobDescriptor | import("@topconsultnpm/sdk-ts").FESplitterJobDescriptor | import("@topconsultnpm/sdk-ts").FEValidatorJobDescriptor | import("@topconsultnpm/sdk-ts").FileArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").FileCheckerJobDescriptor | import("@topconsultnpm/sdk-ts").FileExecJobDescriptor | import("@topconsultnpm/sdk-ts").FileExportJobDescriptor | import("@topconsultnpm/sdk-ts").FileMoverJobDescriptor | import("@topconsultnpm/sdk-ts").LexJobDescriptor | import("@topconsultnpm/sdk-ts").LinkerJobDescriptor | import("@topconsultnpm/sdk-ts").MailArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").MailQueryJobDescriptor | import("@topconsultnpm/sdk-ts").MigrationJobDescriptor | import("@topconsultnpm/sdk-ts").PdDCreatorJobDescriptor | import("@topconsultnpm/sdk-ts").PDFArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").PdVArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").PdVQueryJobDescriptor | import("@topconsultnpm/sdk-ts").PdVSenderJobDescriptor | import("@topconsultnpm/sdk-ts").PeppolQueryJobDescriptor | import("@topconsultnpm/sdk-ts").PeppolSenderJobDescriptor | import("@topconsultnpm/sdk-ts").PostelQueryJobDescriptor | import("@topconsultnpm/sdk-ts").PostelSenderJobDescriptor | import("@topconsultnpm/sdk-ts").ReplicatorJobDescriptor | import("@topconsultnpm/sdk-ts").SAPAlignerJobDescriptor | import("@topconsultnpm/sdk-ts").SAPBarcodeJobDescriptor | import("@topconsultnpm/sdk-ts").SAPDataReaderJobDescriptor | import("@topconsultnpm/sdk-ts").SAPDataWriterJobDescriptor | import("@topconsultnpm/sdk-ts").SignerJobDescriptor | import("@topconsultnpm/sdk-ts").SpoolArchiverJobDescriptor | import("@topconsultnpm/sdk-ts").UpdaterJobDescriptor | import("@topconsultnpm/sdk-ts").DiskDescriptor | import("@topconsultnpm/sdk-ts").GroupDescriptor | import("@topconsultnpm/sdk-ts").LDAPDescriptor | import("@topconsultnpm/sdk-ts").NumeratorDescriptor | ProcessDescriptor | import("@topconsultnpm/sdk-ts").SAPLoginDescriptor | import("@topconsultnpm/sdk-ts").SignCertDescriptor | import("@topconsultnpm/sdk-ts").SignServerDescriptor | import("@topconsultnpm/sdk-ts").TreeDescriptor | import("@topconsultnpm/sdk-ts").TSADescriptor | import("@topconsultnpm/sdk-ts").WFDescriptor | undefined>;
10
10
  private static readonly updateJobAsync;
11
11
  static readonly updateAsync: (objClass: ObjectClasses, jobType: JobTypes, d: any, ...args: any[]) => Promise<number | undefined>;
12
12
  private static readonly createJobAsync;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.20.0-dev1.3",
3
+ "version": "6.20.0-dev1.30",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -9,6 +9,7 @@
9
9
  "tm-build": "npm run clean && tsc && npm run copy-files",
10
10
  "tm-watch": "tsc -w",
11
11
  "tm-publish": "npm publish --tag latest",
12
+ "tm-publish_wl": "npm publish",
12
13
  "storybook": "storybook dev -p 6006",
13
14
  "build-storybook": "storybook build"
14
15
  },
@@ -39,12 +40,14 @@
39
40
  "lib"
40
41
  ],
41
42
  "dependencies": {
42
- "@topconsultnpm/sdk-ts": "6.19.0",
43
+ "@topconsultnpm/sdk-ts": "6.20.0-dev1.2",
43
44
  "buffer": "^6.0.3",
44
45
  "devextreme": "25.1.7",
45
46
  "devextreme-react": "25.1.7",
46
47
  "exceljs": "^4.4.0",
47
48
  "htmlparser2": "^10.0.0",
49
+ "pdfjs-dist": "5.4.296",
50
+ "react-pdf": "^10.3.0",
48
51
  "react-router-dom": "^6.15.0",
49
52
  "styled-components": "^6.1.1"
50
53
  },
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import type { NotificationProps } from './types';
3
- declare const Notification: React.FC<NotificationProps>;
4
- export default Notification;
@@ -1,60 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState, useEffect, useRef } from 'react';
3
- import * as S from './styles';
4
- const Notification = ({ title, message, mode = 'info', position = 'top-right', duration = 3000, closable = false, stopOnMouseEnter = true, hasProgress = true, onClose, }) => {
5
- const [state, setState] = useState({
6
- visible: true,
7
- isPaused: false,
8
- progress: 100,
9
- });
10
- const timeoutRef = useRef(undefined);
11
- const remainingTimeRef = useRef(duration);
12
- const pauseTimeRef = useRef(0);
13
- const closeNotification = () => {
14
- setState(prev => ({ ...prev, visible: false }));
15
- setTimeout(() => {
16
- onClose?.();
17
- }, 300);
18
- };
19
- useEffect(() => {
20
- // Set up auto-close timer
21
- timeoutRef.current = setTimeout(() => {
22
- closeNotification();
23
- }, duration);
24
- return () => {
25
- if (timeoutRef.current) {
26
- clearTimeout(timeoutRef.current);
27
- }
28
- };
29
- }, [duration]);
30
- const handleMouseEnter = () => {
31
- if (!stopOnMouseEnter)
32
- return;
33
- // Pause the timer
34
- if (timeoutRef.current) {
35
- clearTimeout(timeoutRef.current);
36
- pauseTimeRef.current = Date.now();
37
- }
38
- setState(prev => ({ ...prev, isPaused: true }));
39
- };
40
- const handleMouseLeave = () => {
41
- if (!stopOnMouseEnter)
42
- return;
43
- // Resume the timer with remaining time
44
- const pauseDuration = Date.now() - pauseTimeRef.current;
45
- remainingTimeRef.current = Math.max(0, remainingTimeRef.current - pauseDuration);
46
- timeoutRef.current = setTimeout(() => {
47
- closeNotification();
48
- }, remainingTimeRef.current);
49
- setState(prev => ({ ...prev, isPaused: false }));
50
- };
51
- const handleClose = (e) => {
52
- e.stopPropagation();
53
- if (timeoutRef.current) {
54
- clearTimeout(timeoutRef.current);
55
- }
56
- closeNotification();
57
- };
58
- return (_jsxs(S.NotificationContainer, { "$position": position, "$mode": mode, "$visible": state.visible, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, role: "alert", "aria-live": "assertive", children: [_jsxs(S.NotificationContent, { children: [_jsx(S.NotificationTitle, { children: title }), _jsx(S.NotificationMessage, { children: message })] }), closable && (_jsx(S.CloseButton, { onClick: handleClose, "aria-label": "Close notification", children: "\u00D7" })), hasProgress && (_jsx(S.ProgressBar, { "$duration": duration, "$mode": mode, "$isPaused": state.isPaused }))] }));
59
- };
60
- export default Notification;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import type { NotificationPosition } from './types';
3
- interface NotificationContainerProps {
4
- position: NotificationPosition;
5
- children: React.ReactNode;
6
- }
7
- declare const NotificationContainer: React.FC<NotificationContainerProps>;
8
- export default NotificationContainer;
@@ -1,33 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import styled from 'styled-components';
3
- const Container = styled.div `
4
- position: fixed;
5
- z-index: 10002;
6
- display: flex;
7
- flex-direction: column;
8
- gap: 12px;
9
- pointer-events: none;
10
-
11
- ${props => {
12
- const isTop = props.$position.startsWith('top');
13
- const isBottom = props.$position.startsWith('bottom');
14
- const isLeft = props.$position.endsWith('left');
15
- const isRight = props.$position.endsWith('right');
16
- const isCenter = props.$position.endsWith('center');
17
- return `
18
- ${isTop ? 'top: 24px;' : ''}
19
- ${isBottom ? 'bottom: 24px;' : ''}
20
- ${isLeft ? 'left: 24px;' : ''}
21
- ${isRight ? 'right: 24px;' : ''}
22
- ${isCenter ? 'left: 50%; transform: translateX(-50%);' : ''}
23
- `;
24
- }}
25
-
26
- & > * {
27
- pointer-events: auto;
28
- }
29
- `;
30
- const NotificationContainer = ({ position, children }) => {
31
- return _jsx(Container, { "$position": position, children: children });
32
- };
33
- export default NotificationContainer;
@@ -1,2 +0,0 @@
1
- export { default } from './Notification';
2
- export * from './types';
@@ -1,2 +0,0 @@
1
- export { default } from './Notification';
2
- export * from './types';
@@ -1,21 +0,0 @@
1
- import type { NotificationMode, NotificationPosition } from './types';
2
- export declare const NotificationContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
3
- $position: NotificationPosition;
4
- $mode: NotificationMode;
5
- $visible: boolean;
6
- }>> & string;
7
- export declare const NotificationContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
8
- export declare const NotificationTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
9
- export declare const NotificationMessage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
10
- export declare const CloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
11
- export declare const ProgressBar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
12
- ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
13
- }>, {
14
- $duration: number;
15
- $mode: NotificationMode;
16
- $isPaused: boolean;
17
- }>, {
18
- $duration: number;
19
- $mode: NotificationMode;
20
- $isPaused: boolean;
21
- }>> & string;
@@ -1,180 +0,0 @@
1
- import styled, { keyframes } from 'styled-components';
2
- const slideInFromTop = keyframes `
3
- from {
4
- opacity: 0;
5
- transform: translateY(-100%);
6
- }
7
- to {
8
- opacity: 1;
9
- transform: translateY(0);
10
- }
11
- `;
12
- const slideInFromBottom = keyframes `
13
- from {
14
- opacity: 0;
15
- transform: translateY(100%);
16
- }
17
- to {
18
- opacity: 1;
19
- transform: translateY(0);
20
- }
21
- `;
22
- const slideOut = keyframes `
23
- from {
24
- opacity: 1;
25
- transform: scale(1);
26
- }
27
- to {
28
- opacity: 0;
29
- transform: scale(0.9);
30
- }
31
- `;
32
- const getModeColors = (mode) => {
33
- const colors = {
34
- success: {
35
- bg: '#10b981',
36
- bgDark: '#059669',
37
- border: '#34d399',
38
- text: '#ffffff',
39
- },
40
- error: {
41
- bg: '#ef4444',
42
- bgDark: '#dc2626',
43
- border: '#f87171',
44
- text: '#ffffff',
45
- },
46
- warning: {
47
- bg: '#f59e0b',
48
- bgDark: '#d97706',
49
- border: '#fbbf24',
50
- text: '#ffffff',
51
- },
52
- info: {
53
- bg: '#3b82f6',
54
- bgDark: '#2563eb',
55
- border: '#60a5fa',
56
- text: '#ffffff',
57
- },
58
- };
59
- return colors[mode];
60
- };
61
- export const NotificationContainer = styled.div `
62
- position: relative;
63
- z-index: 1;
64
- min-width: 320px;
65
- max-width: 420px;
66
- background: ${props => getModeColors(props.$mode).bg};
67
- border-radius: 12px;
68
- box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2),
69
- 0 4px 12px rgba(0, 0, 0, 0.15);
70
- padding: 16px 20px;
71
- animation: ${props => {
72
- if (!props.$visible)
73
- return slideOut;
74
- return props.$position.startsWith('top') ? slideInFromTop : slideInFromBottom;
75
- }} 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
76
- backdrop-filter: blur(10px);
77
- border: 2px solid ${props => getModeColors(props.$mode).border};
78
- color: ${props => getModeColors(props.$mode).text};
79
- overflow: hidden;
80
-
81
- [data-theme='dark'] & {
82
- background: ${props => getModeColors(props.$mode).bgDark};
83
- box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
84
- 0 4px 12px rgba(0, 0, 0, 0.3);
85
- }
86
-
87
- @media (max-width: 768px) {
88
- min-width: 280px;
89
- max-width: calc(100vw - 48px);
90
- }
91
- `;
92
- export const NotificationContent = styled.div `
93
- display: flex;
94
- flex-direction: column;
95
- gap: 6px;
96
- padding-right: 24px;
97
- `;
98
- export const NotificationTitle = styled.div `
99
- font-size: 16px;
100
- font-weight: 600;
101
- line-height: 1.4;
102
- letter-spacing: -0.01em;
103
- `;
104
- export const NotificationMessage = styled.div `
105
- font-size: 14px;
106
- font-weight: 400;
107
- line-height: 1.5;
108
- opacity: 0.95;
109
- `;
110
- export const CloseButton = styled.button `
111
- position: absolute;
112
- top: 12px;
113
- right: 12px;
114
- background: transparent;
115
- border: none;
116
- color: inherit;
117
- cursor: pointer;
118
- width: 24px;
119
- height: 24px;
120
- display: flex;
121
- align-items: center;
122
- justify-content: center;
123
- border-radius: 6px;
124
- transition: all 0.15s ease;
125
- font-size: 18px;
126
- line-height: 1;
127
- padding: 0;
128
- opacity: 0.8;
129
-
130
- &:hover {
131
- opacity: 1;
132
- background: rgba(255, 255, 255, 0.2);
133
- transform: scale(1.1);
134
- }
135
-
136
- &:active {
137
- transform: scale(0.95);
138
- }
139
-
140
- &:focus {
141
- outline: 2px solid rgba(255, 255, 255, 0.5);
142
- outline-offset: 2px;
143
- }
144
- `;
145
- export const ProgressBar = styled.div.attrs(props => ({
146
- style: {
147
- animationDuration: `${props.$duration}ms`,
148
- },
149
- })) `
150
- position: absolute;
151
- bottom: 0;
152
- left: 0;
153
- height: 4px;
154
- width: 100%;
155
- background: ${props => getModeColors(props.$mode).border};
156
- border-radius: 0 0 0 10px;
157
- box-shadow: 0 0 8px ${props => getModeColors(props.$mode).border};
158
- transform-origin: left;
159
- animation: progress-shrink linear forwards;
160
- animation-play-state: ${props => props.$isPaused ? 'paused' : 'running'};
161
-
162
- @keyframes progress-shrink {
163
- from {
164
- transform: scaleX(1);
165
- }
166
- to {
167
- transform: scaleX(0);
168
- }
169
- }
170
-
171
- &::after {
172
- content: '';
173
- position: absolute;
174
- top: 0;
175
- right: 0;
176
- width: 20px;
177
- height: 100%;
178
- background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
179
- }
180
- `;
@@ -1,18 +0,0 @@
1
- export type NotificationMode = 'warning' | 'info' | 'error' | 'success';
2
- export type NotificationPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
3
- export interface NotificationProps {
4
- title: string;
5
- message: string;
6
- mode?: NotificationMode;
7
- position?: NotificationPosition;
8
- duration?: number;
9
- closable?: boolean;
10
- stopOnMouseEnter?: boolean;
11
- hasProgress?: boolean;
12
- onClose?: () => void;
13
- }
14
- export interface NotificationState {
15
- visible: boolean;
16
- isPaused: boolean;
17
- progress: number;
18
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import { DcmtInfo } from "../../../ts";
2
- interface TMSearchResultCheckoutInfoFormProps {
3
- dtdName: string;
4
- selectedDcmtOrFocused: DcmtInfo;
5
- onClose: () => void;
6
- }
7
- declare const TMSearchResultCheckoutInfoForm: (props: TMSearchResultCheckoutInfoFormProps) => import("react/jsx-runtime").JSX.Element;
8
- export default TMSearchResultCheckoutInfoForm;