@topconsultnpm/sdkui-react 6.21.0-dev2.9 → 6.21.0-dev3.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.
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +4 -4
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +2 -2
- package/lib/components/base/TMAccordionNew.js +1 -0
- package/lib/components/base/TMAreaManager.js +19 -3
- package/lib/components/base/TMDataGrid.js +2 -2
- package/lib/components/base/TMFileManagerDataGridView.js +4 -4
- package/lib/components/base/TMFileManagerThumbnailItems.js +3 -3
- package/lib/components/base/TMFileManagerUtils.d.ts +7 -0
- package/lib/components/base/TMFileManagerUtils.js +14 -1
- package/lib/components/base/TMModal.d.ts +1 -0
- package/lib/components/base/TMModal.js +2 -2
- package/lib/components/base/TMPanel.d.ts +7 -4
- package/lib/components/base/TMPanel.js +58 -26
- package/lib/components/base/TMTreeView.js +24 -17
- package/lib/components/base/TMWaitPanel.d.ts +3 -1
- package/lib/components/base/TMWaitPanel.js +14 -9
- package/lib/components/choosers/TMDistinctValues.js +35 -21
- package/lib/components/choosers/TMDynDataListItemChooser.js +6 -1
- package/lib/components/choosers/TMUserChooser.d.ts +4 -0
- package/lib/components/choosers/TMUserChooser.js +7 -5
- package/lib/components/editors/TMEditorStyled.d.ts +6 -6
- package/lib/components/editors/TMFormulaEditor.d.ts +2 -0
- package/lib/components/editors/TMFormulaEditor.js +75 -21
- package/lib/components/editors/TMMetadataEditor.js +6 -2
- package/lib/components/editors/TMMetadataValues.js +2 -1
- package/lib/components/editors/TMRadioButton.js +7 -5
- package/lib/components/editors/TMTextBox.d.ts +2 -0
- package/lib/components/editors/TMTextBox.js +3 -3
- package/lib/components/features/archive/TMArchive.js +1 -1
- package/lib/components/features/blog/TMBlogCommentForm.js +5 -2
- package/lib/components/features/documents/TMCopyToFolderForm.d.ts +24 -0
- package/lib/components/features/documents/TMCopyToFolderForm.js +401 -0
- package/lib/components/features/documents/TMDcmtForm.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtForm.js +126 -38
- package/lib/components/features/documents/TMDcmtIcon.js +1 -1
- package/lib/components/features/documents/TMDcmtPreview.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtPreview.js +2 -2
- package/lib/components/features/documents/TMDcmtTasks.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtTasks.js +2 -2
- package/lib/components/features/documents/TMDownloadRelationViewerSection.d.ts +23 -0
- package/lib/components/features/documents/TMDownloadRelationViewerSection.js +173 -0
- package/lib/components/features/documents/TMFileUploader.js +1 -1
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +28 -9
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +24 -0
- package/lib/components/features/documents/TMMergeToPdfForm.js +309 -0
- package/lib/components/features/documents/TMRelationViewer.d.ts +13 -0
- package/lib/components/features/documents/TMRelationViewer.js +80 -6
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +58 -0
- package/lib/components/features/documents/copyAndMergeDcmtsShared.js +266 -0
- package/lib/components/features/search/SignatureParamsManager.d.ts +70 -0
- package/lib/components/features/search/SignatureParamsManager.js +145 -0
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSavedQuerySelector.js +3 -2
- package/lib/components/features/search/TMSearch.d.ts +4 -1
- package/lib/components/features/search/TMSearch.js +16 -10
- package/lib/components/features/search/TMSearchQueryEditor.js +14 -8
- package/lib/components/features/search/TMSearchQueryPanel.js +1 -1
- package/lib/components/features/search/TMSearchResult.d.ts +2 -0
- package/lib/components/features/search/TMSearchResult.js +118 -23
- package/lib/components/features/search/TMViewHistoryDcmt.js +1 -1
- package/lib/components/features/workflow/diagram/queryDescriptorParser.js +3 -6
- package/lib/components/forms/Login/TMLoginForm.d.ts +9 -0
- package/lib/components/forms/Login/TMLoginForm.js +61 -0
- package/lib/components/forms/TMResultDialog.d.ts +1 -1
- package/lib/components/forms/TMResultDialog.js +4 -2
- package/lib/components/grids/TMBlogAttachments.js +2 -2
- package/lib/components/grids/TMBlogsPost.js +5 -3
- package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
- package/lib/components/grids/TMBlogsPostUtils.js +3 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/pages/TMPage.js +3 -1
- package/lib/components/query/TMQueryEditor.js +1 -1
- package/lib/components/viewers/TMTidViewer.js +1 -1
- package/lib/helper/MergePdfManager.d.ts +45 -0
- package/lib/helper/MergePdfManager.js +148 -0
- package/lib/helper/SDKUI_Globals.d.ts +15 -0
- package/lib/helper/SDKUI_Globals.js +16 -1
- package/lib/helper/SDKUI_Localizator.d.ts +108 -2
- package/lib/helper/SDKUI_Localizator.js +1080 -12
- package/lib/helper/TMPdfViewer.js +25 -24
- package/lib/helper/TMUtils.d.ts +24 -0
- package/lib/helper/TMUtils.js +72 -0
- package/lib/helper/ZipManager.d.ts +56 -0
- package/lib/helper/ZipManager.js +127 -0
- package/lib/helper/checkinCheckoutManager.d.ts +4 -3
- package/lib/helper/checkinCheckoutManager.js +29 -11
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +4 -3
- package/lib/hooks/useDataUserIdItem.js +6 -4
- package/lib/hooks/useDcmtOperations.d.ts +26 -2
- package/lib/hooks/useDcmtOperations.js +123 -34
- package/lib/hooks/useDocumentOperations.d.ts +3 -0
- package/lib/hooks/useDocumentOperations.js +235 -26
- package/lib/hooks/useForm.js +5 -2
- package/lib/hooks/useRelatedDocuments.js +4 -4
- package/lib/hooks/useResizeObserver.d.ts +1 -1
- package/lib/hooks/useResizeObserver.js +16 -15
- package/lib/services/platform_services.d.ts +4 -4
- package/package.json +4 -2
|
@@ -82,6 +82,7 @@ export declare const getAttachmentInfo: (attachment: BlogPostAttachment, treeFs:
|
|
|
82
82
|
fileExt: string;
|
|
83
83
|
draftExist: boolean;
|
|
84
84
|
archivedDocumentsExist: boolean;
|
|
85
|
+
isSigned: number;
|
|
85
86
|
};
|
|
86
87
|
export declare const getDcmtTypeDescriptor: (blogPosts: Array<BlogPost>) => Promise<Map<number, DcmtTypeDescriptor>>;
|
|
87
88
|
export declare const BlogPostHomeHeader: (header: string | undefined, classId: string | undefined, isSelected: boolean, searchText: string, headerClickCallback: () => void) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -86,6 +86,7 @@ export const getAttachmentInfo = (attachment, treeFs, draftLatestInfoMap, archiv
|
|
|
86
86
|
let archivedDocumentsExist = false;
|
|
87
87
|
let name = '';
|
|
88
88
|
let tooltipContent = _jsx(_Fragment, {});
|
|
89
|
+
let isSigned = 0;
|
|
89
90
|
if (attachment.tid === DRAFT_TYPE_TID && treeFs) {
|
|
90
91
|
const draftfileItem = findFileItemByDraftID(treeFs, attachment.draftID);
|
|
91
92
|
if (draftfileItem) {
|
|
@@ -94,6 +95,7 @@ export const getAttachmentInfo = (attachment, treeFs, draftLatestInfoMap, archiv
|
|
|
94
95
|
draftExist = true;
|
|
95
96
|
let fileSize = '0';
|
|
96
97
|
name = draftfileItem.name;
|
|
98
|
+
isSigned = draftfileItem.isSigned ? 1 : 0;
|
|
97
99
|
if (draftLatestInfoMap && attachment.draftID && attachment.version) {
|
|
98
100
|
const draftInfo = draftLatestInfoMap.get(attachment.draftID);
|
|
99
101
|
if (draftInfo) {
|
|
@@ -139,7 +141,7 @@ export const getAttachmentInfo = (attachment, treeFs, draftLatestInfoMap, archiv
|
|
|
139
141
|
nameElement = (_jsx("span", { children: highlightText(`${name} (DID: ${attachment.did})`, searchText, isSelected) }));
|
|
140
142
|
}
|
|
141
143
|
}
|
|
142
|
-
return { name, nameElement, tooltipContent, folderId, fileExt, draftExist, archivedDocumentsExist };
|
|
144
|
+
return { name, nameElement, tooltipContent, folderId, fileExt, draftExist, archivedDocumentsExist, isSigned };
|
|
143
145
|
};
|
|
144
146
|
export const getDcmtTypeDescriptor = async (blogPosts) => {
|
|
145
147
|
const dcmtTypeMap = new Map();
|
|
@@ -71,6 +71,7 @@ export * from './features/documents/TMRelationViewer';
|
|
|
71
71
|
export * from './features/archive/TMArchive';
|
|
72
72
|
export * from './features/search/TMSearch';
|
|
73
73
|
export * from './features/search/TMSearchResult';
|
|
74
|
+
export * from './features/search/SignatureParamsManager';
|
|
74
75
|
export { default as TMTaskForm } from './features/tasks/TMTaskForm';
|
|
75
76
|
export { default as TMTasksAgenda } from './features/tasks/TMTasksAgenda';
|
|
76
77
|
export { default as TMTasksCalendar } from './features/tasks/TMTasksCalendar';
|
package/lib/components/index.js
CHANGED
|
@@ -81,6 +81,7 @@ export * from './features/archive/TMArchive';
|
|
|
81
81
|
//search
|
|
82
82
|
export * from './features/search/TMSearch';
|
|
83
83
|
export * from './features/search/TMSearchResult';
|
|
84
|
+
export * from './features/search/SignatureParamsManager';
|
|
84
85
|
// tasks
|
|
85
86
|
export { default as TMTaskForm } from './features/tasks/TMTaskForm';
|
|
86
87
|
export { default as TMTasksAgenda } from './features/tasks/TMTasksAgenda';
|
|
@@ -188,8 +188,10 @@ const TMPage = ({ id, objClass = ObjectClasses.None, listDisabled = false, lastR
|
|
|
188
188
|
onStatusChanged: (isModified) => { setSelectionListDisabled((formMode == FormModes.Create || formMode == FormModes.Duplicate) ? true : isModified); },
|
|
189
189
|
onSaved: async (newItem) => {
|
|
190
190
|
try {
|
|
191
|
+
console.log('Saved item', newItem);
|
|
191
192
|
const currentItems = items.map((job) => job);
|
|
192
193
|
const index = currentItems.findIndex((o) => o.id == newItem.id);
|
|
194
|
+
console.log('index', index);
|
|
193
195
|
if (index >= 0)
|
|
194
196
|
currentItems[index] = newItem;
|
|
195
197
|
else
|
|
@@ -221,6 +223,6 @@ const TMPage = ({ id, objClass = ObjectClasses.None, listDisabled = false, lastR
|
|
|
221
223
|
_jsx(TMLayoutItem, { children: selectedItems.length == 1 || formMode == FormModes.Create || formMode == FormModes.Duplicate ?
|
|
222
224
|
_jsx(TMToolbarCard, { onBack: deviceType === DeviceType.MOBILE ? () => setShowList(true) : undefined, title: calcSaveFormTitle(objName, formMode, selectedItems.length == 0 ? -1 : selectedItems[0].id, detailTitlePathKeys), children: getDetailFormWithProps() })
|
|
223
225
|
:
|
|
224
|
-
_jsx(MultipleSelectionManager, {}) })] }) }));
|
|
226
|
+
selectedItems.length > 0 ? _jsx(MultipleSelectionManager, {}) : _jsx(_Fragment, {}) })] }) }));
|
|
225
227
|
};
|
|
226
228
|
export default TMPage;
|
|
@@ -733,7 +733,7 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDis
|
|
|
733
733
|
}
|
|
734
734
|
};
|
|
735
735
|
// #endregion
|
|
736
|
-
return (_jsxs(_Fragment, { children: [_jsxs(TMApplyForm, { isModal: false, formMode: formMode, isModified: calcIsModified(formData, formDataOrig), exception: exception, validationItems: validationItems, hasNavigation: false, customToolbarElements: _jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Search, color: 'tertiary', icon: _jsx(IconSearch, {}), disabled: errorsCount > 0, onClick: async () => await onSearchAsync(formData) }), _jsx(TMQueryCountButton, { qd: { ...formData }, lastparams: lastQdParams, onLastQueryParamsChanged: (params) => { setLastQdParams(params); }, disabled: errorsCount > 0, showSpinner: true }), SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.SURFER && _jsx(TMButton, { caption:
|
|
736
|
+
return (_jsxs(_Fragment, { children: [_jsxs(TMApplyForm, { isModal: false, formMode: formMode, isModified: calcIsModified(formData, formDataOrig), exception: exception, validationItems: validationItems, hasNavigation: false, customToolbarElements: _jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Search, color: 'tertiary', icon: _jsx(IconSearch, {}), disabled: errorsCount > 0, onClick: async () => await onSearchAsync(formData) }), _jsx(TMQueryCountButton, { qd: { ...formData }, lastparams: lastQdParams, onLastQueryParamsChanged: (params) => { setLastQdParams(params); }, disabled: errorsCount > 0, showSpinner: true }), SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.SURFER && _jsx(TMButton, { caption: SDKUI_Localizator.PassToArchive, icon: _jsx(IconArchiveDoc, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO Passa ad archiviazione", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } }), SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.SURFER && _jsx(TMButton, { caption: "Vai a risultato", icon: _jsx(IconArrowRight, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO Vai a risultato", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } })] }), showToolbar: showToolbar, showApply: showApply, showUndo: showUndo, showBack: showBack, onApply: () => applyData(), onClose: () => onClose?.(), onUndo: () => setFormData(formDataOrig), children: [_jsxs(Accordion, { elementAttr: { class: 'tm-query-dx-accordion' }, height: height, multiple: true, collapsible: true, repaintChangesOnly: true, deferRendering: false, animationDuration: 0, onContentReady: (e) => {
|
|
737
737
|
let items = e.component.option("items");
|
|
738
738
|
if (items && items.length > 0) {
|
|
739
739
|
for (let i = 0; i < items.length; i++) {
|
|
@@ -332,7 +332,7 @@ export const renderDTDTooltipContent = (dtd) => {
|
|
|
332
332
|
: _jsxs(StyledTooltipContainer, { children: [_jsx(StyledTooltipItem, { children: `${SDK_Globals.useLocalizedName ? dtd.nameLoc : dtd.name} (${dtd.isView ? 'VID' : 'TID'}: ${dtd.id}, RootTID: ${dtd.rootTID ?? 0})` }), dtd.description && _jsx(StyledTooltipItem, { children: dtd.description }), _jsx(StyledTooltipSeparatorItem, {}), dtd.customData2 === "NOTGRANTED"
|
|
333
333
|
? _jsx(StyledTooltipItem, { style: { fontWeight: 600 }, children: 'Tipo documento NON autorizzato' })
|
|
334
334
|
:
|
|
335
|
-
_jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ArchiveConstraint}: ${LocalizeArchiveConstraints(dtd.archiveConstraint)}` }), dtd.isView && dtd.parametricFilterType != ParametricFilterTypes.None && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ParametricFilter}: ${LocalizeParametricFilterTypes(dtd.parametricFilterType)}` }), dtd.isView && dtd.withCheckOption && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ViewWithCheckOption}: ${SDKUI_Localizator.Yes}` }), dtd.isLexProt && dtd.isLexProt > 0 && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LexProt}: ${SDKUI_Localizator.Yes}` }), dtd.isFreeSearchable && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search_Free}: ${SDKUI_Localizator.Yes}` }), dtd.templateTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Template}: ${dtd.templateTID}` }), dtd.traceTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Tracing}: ${SDKUI_Localizator.Yes} - ${dtd.templateTID == TemplateTIDs.Trace_DcmtType ? SDKUI_Localizator.Destination : SDKUI_Localizator.Source} ${dtd.traceTID < 0 ? SDKUI_Localizator.Disabled : ''}` }), dtd.wfAppr && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.WorkflowApproval}: ${SDKUI_Localizator.Yes}` }),
|
|
335
|
+
_jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ArchiveConstraint}: ${LocalizeArchiveConstraints(dtd.archiveConstraint)}` }), dtd.isView && dtd.parametricFilterType != ParametricFilterTypes.None && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ParametricFilter}: ${LocalizeParametricFilterTypes(dtd.parametricFilterType)}` }), dtd.isView && dtd.withCheckOption && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ViewWithCheckOption}: ${SDKUI_Localizator.Yes}` }), dtd.isLexProt && dtd.isLexProt > 0 && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LexProt}: ${SDKUI_Localizator.Yes}` }), dtd.isFreeSearchable && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search_Free}: ${SDKUI_Localizator.Yes}` }), dtd.templateTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Template}: ${dtd.templateTID}` }), dtd.traceTID && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Tracing}: ${SDKUI_Localizator.Yes} - ${dtd.templateTID == TemplateTIDs.Trace_DcmtType ? SDKUI_Localizator.Destination : SDKUI_Localizator.Source} ${dtd.traceTID < 0 ? SDKUI_Localizator.Disabled : ''}` }), dtd.wfAppr && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.WorkflowApproval}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.BlogCase}: ${dtd.hasBlog ? SDKUI_Localizator.Yes : SDKUI_Localizator.No}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${dtd.cico ? SDKUI_Localizator.Yes : SDKUI_Localizator.No}` }), dtd.perm ?
|
|
336
336
|
_jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${mapAccessLevelToLocalizedString(dtd.perm.canArchive)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${mapAccessLevelToLocalizedString(dtd.perm.canView)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${mapAccessLevelToLocalizedString(dtd.perm.canSearch)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${mapAccessLevelToLocalizedString(dtd.perm.canUpdate)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.RetrieveFile}: ${mapAccessLevelToLocalizedString(dtd.perm.canRetrieveFile)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.AddOrSubstFile}: ${mapAccessLevelToLocalizedString(dtd.perm.canSubstFile)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LogDelete}: ${mapAccessLevelToLocalizedString(dtd.perm.canLogicalDelete)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.PhysDelete}: ${mapAccessLevelToLocalizedString(dtd.perm.canPhysicalDelete)}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Read}: ${mapAccessLevelToLocalizedString(dtd.perm.canReadBlog)}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Write}: ${mapAccessLevelToLocalizedString(dtd.perm.canWriteBlog)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${mapAccessLevelToLocalizedString(dtd.perm.canCICO)}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ChronologyDelete}: ${mapAccessLevelToLocalizedString(dtd.perm.canDelChron)}` })] })
|
|
337
337
|
: dtd.ownershipLevel == OwnershipLevels.DirectOwner || dtd.ownershipLevel == OwnershipLevels.IndirectOwner ?
|
|
338
338
|
_jsxs(_Fragment, { children: [_jsx(StyledTooltipItem, { "$color": 'primary', "$marginTop": '5px', children: SDKUI_Localizator.Perms }), _jsx(StyledTooltipSeparatorItem, {}), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Archive}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.View_Metadato}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Search}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Update}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.RetrieveFile}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.AddOrSubstFile}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.LogDelete}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.PhysDelete}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Read}: ${SDKUI_Localizator.Yes}` }), dtd.hasBlog && _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.Blog_Write}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.CheckIn}: ${SDKUI_Localizator.Yes}` }), _jsx(StyledTooltipItem, { children: `${SDKUI_Localizator.ChronologyDelete}: ${SDKUI_Localizator.Yes}` })] })
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Risultato del merge PDF */
|
|
2
|
+
export interface MergePdfResult {
|
|
3
|
+
bytes: Uint8Array;
|
|
4
|
+
blob: Blob;
|
|
5
|
+
pageCount: number;
|
|
6
|
+
}
|
|
7
|
+
/** Risultato con Base64 incluso */
|
|
8
|
+
export interface MergePdfResultWithBase64 extends MergePdfResult {
|
|
9
|
+
base64: string;
|
|
10
|
+
}
|
|
11
|
+
/** Opzioni per il merge */
|
|
12
|
+
export interface MergePdfOptions {
|
|
13
|
+
fileName?: string;
|
|
14
|
+
onProgress?: (current: number, total: number, file: File) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare class MergePdfManager {
|
|
17
|
+
/**
|
|
18
|
+
* Merge principale - Unisce array di File PDF in uno solo
|
|
19
|
+
*/
|
|
20
|
+
static merge(files: File[], options?: MergePdfOptions): Promise<MergePdfResult>;
|
|
21
|
+
/**
|
|
22
|
+
* Merge -> File - Restituisce un oggetto File
|
|
23
|
+
*/
|
|
24
|
+
static mergeToFile(files: File[], fileName?: string, options?: MergePdfOptions): Promise<File>;
|
|
25
|
+
/**
|
|
26
|
+
* Merge + Download - Unisce e scarica automaticamente
|
|
27
|
+
*/
|
|
28
|
+
static mergeAndDownload(files: File[], fileName?: string, options?: MergePdfOptions): Promise<MergePdfResult>;
|
|
29
|
+
/**
|
|
30
|
+
* Blob -> Base64 - Converte un Blob in stringa Base64
|
|
31
|
+
*/
|
|
32
|
+
static blobToBase64(blob: Blob): Promise<string>;
|
|
33
|
+
/**
|
|
34
|
+
* Merge -> Base64 - Unisce e restituisce anche la stringa Base64
|
|
35
|
+
*/
|
|
36
|
+
static mergeToBase64(files: File[], options?: MergePdfOptions): Promise<MergePdfResultWithBase64>;
|
|
37
|
+
/**
|
|
38
|
+
* Merge per Preview - Restituisce solo base64 e pageCount per anteprima
|
|
39
|
+
*/
|
|
40
|
+
static mergeForPreview(files: File[], options?: MergePdfOptions): Promise<{
|
|
41
|
+
base64: string;
|
|
42
|
+
pageCount: number;
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
export default MergePdfManager;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { SDKUI_Localizator } from './SDKUI_Localizator';
|
|
2
|
+
// ============================================================================
|
|
3
|
+
// LAZY LOADING - Carica pdf-lib solo quando necessario
|
|
4
|
+
// ============================================================================
|
|
5
|
+
let pdfLibLoaded = false;
|
|
6
|
+
const loadPdfLib = async () => {
|
|
7
|
+
const module = await import('pdf-lib');
|
|
8
|
+
pdfLibLoaded = true;
|
|
9
|
+
return module;
|
|
10
|
+
};
|
|
11
|
+
// ============================================================================
|
|
12
|
+
// MERGE PDF MANAGER - Utility per unire PDF lato client
|
|
13
|
+
// ============================================================================
|
|
14
|
+
export class MergePdfManager {
|
|
15
|
+
/**
|
|
16
|
+
* Merge principale - Unisce array di File PDF in uno solo
|
|
17
|
+
*/
|
|
18
|
+
static async merge(files, options = {}) {
|
|
19
|
+
if (!files?.length) {
|
|
20
|
+
throw new Error('MergePdfManager.merge: nessun file fornito.');
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
// Carica pdf-lib on-demand
|
|
24
|
+
const { PDFDocument } = await loadPdfLib();
|
|
25
|
+
const mergedPdf = await PDFDocument.create();
|
|
26
|
+
let totalPages = 0;
|
|
27
|
+
// Itera su ogni file e copia le pagine nel documento finale
|
|
28
|
+
for (let i = 0; i < files.length; i++) {
|
|
29
|
+
const file = files[i];
|
|
30
|
+
try {
|
|
31
|
+
const buffer = await file.arrayBuffer();
|
|
32
|
+
const pdf = await PDFDocument.load(buffer);
|
|
33
|
+
// Copia tutte le pagine dal PDF sorgente
|
|
34
|
+
const pages = await mergedPdf.copyPages(pdf, pdf.getPageIndices());
|
|
35
|
+
pages.forEach(page => mergedPdf.addPage(page));
|
|
36
|
+
totalPages += pages.length;
|
|
37
|
+
// Notifica progresso
|
|
38
|
+
options.onProgress?.(i + 1, files.length, file);
|
|
39
|
+
}
|
|
40
|
+
catch (fileError) {
|
|
41
|
+
const errorMessage = fileError instanceof Error ? fileError.message : String(fileError);
|
|
42
|
+
throw new Error(`Errore processamento file "${file.name}" (${i}): ${errorMessage}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (totalPages === 0) {
|
|
46
|
+
throw new Error('Nessuna pagina valida trovata.');
|
|
47
|
+
}
|
|
48
|
+
// Salva il PDF unito
|
|
49
|
+
const outBytes = await mergedPdf.save();
|
|
50
|
+
// Converte Uint8Array in ArrayBuffer per il Blob
|
|
51
|
+
const pdfBuffer = outBytes.buffer.slice(outBytes.byteOffset, outBytes.byteOffset + outBytes.byteLength);
|
|
52
|
+
const blob = new Blob([pdfBuffer], { type: 'application/pdf' });
|
|
53
|
+
return { bytes: outBytes, blob, pageCount: totalPages };
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
57
|
+
throw new Error(`MergePdfManager.merge: ${errorMessage}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Merge -> File - Restituisce un oggetto File
|
|
62
|
+
*/
|
|
63
|
+
static async mergeToFile(files, fileName, options = {}) {
|
|
64
|
+
try {
|
|
65
|
+
const { blob } = await this.merge(files, options);
|
|
66
|
+
const finalFileName = fileName || `${SDKUI_Localizator.Result.toLowerCase()}.pdf`;
|
|
67
|
+
return new File([blob], finalFileName, { type: 'application/pdf' });
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
71
|
+
throw new Error(`MergePdfManager.mergeToFile: ${errorMessage}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Merge + Download - Unisce e scarica automaticamente
|
|
76
|
+
*/
|
|
77
|
+
static async mergeAndDownload(files, fileName, options = {}) {
|
|
78
|
+
let url = null;
|
|
79
|
+
const finalFileName = fileName || `${SDKUI_Localizator.Result.toLowerCase()}.pdf`;
|
|
80
|
+
try {
|
|
81
|
+
const result = await this.merge(files, options);
|
|
82
|
+
url = URL.createObjectURL(result.blob);
|
|
83
|
+
// Crea link temporaneo per download
|
|
84
|
+
const a = document.createElement('a');
|
|
85
|
+
a.href = url;
|
|
86
|
+
a.download = finalFileName;
|
|
87
|
+
document.body.appendChild(a);
|
|
88
|
+
a.click();
|
|
89
|
+
a.remove();
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
94
|
+
throw new Error(`MergePdfManager.mergeAndDownload: ${errorMessage}`);
|
|
95
|
+
}
|
|
96
|
+
finally {
|
|
97
|
+
// Rilascia URL dopo un breve delay
|
|
98
|
+
if (url)
|
|
99
|
+
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Blob -> Base64 - Converte un Blob in stringa Base64
|
|
104
|
+
*/
|
|
105
|
+
static blobToBase64(blob) {
|
|
106
|
+
return new Promise((resolve, reject) => {
|
|
107
|
+
const reader = new FileReader();
|
|
108
|
+
reader.onloadend = () => {
|
|
109
|
+
if (typeof reader.result === 'string') {
|
|
110
|
+
resolve(reader.result);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
reject(new Error('Impossibile convertire il blob in base64.'));
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
reader.onerror = () => reject(new Error('Errore durante la lettura del blob.'));
|
|
117
|
+
reader.readAsDataURL(blob);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Merge -> Base64 - Unisce e restituisce anche la stringa Base64
|
|
122
|
+
*/
|
|
123
|
+
static async mergeToBase64(files, options = {}) {
|
|
124
|
+
try {
|
|
125
|
+
const result = await this.merge(files, options);
|
|
126
|
+
const base64 = await this.blobToBase64(result.blob);
|
|
127
|
+
return { ...result, base64 };
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
131
|
+
throw new Error(`MergePdfManager.mergeToBase64: ${errorMessage}`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Merge per Preview - Restituisce solo base64 e pageCount per anteprima
|
|
136
|
+
*/
|
|
137
|
+
static async mergeForPreview(files, options = {}) {
|
|
138
|
+
try {
|
|
139
|
+
const result = await this.mergeToBase64(files, options);
|
|
140
|
+
return { base64: result.base64, pageCount: result.pageCount };
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
144
|
+
throw new Error(`MergePdfManager.mergeForPreview: ${errorMessage}`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
export default MergePdfManager;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { InvoiceRetrieveFormats, ObjectClasses, OrderRetrieveFormats } from "@topconsultnpm/sdk-ts";
|
|
2
2
|
import { CheckoutInfo } from "./checkinCheckoutManager";
|
|
3
|
+
export type FileNamingMode = 'onlyDid' | 'documentTypeAndDid' | 'documentTypeAndCustomMetadata' | 'onlyCustomMetadata';
|
|
4
|
+
export type FileExistsMode = 'overwrite' | 'skip' | 'rename';
|
|
5
|
+
export declare class DocumentDownloadSettings {
|
|
6
|
+
exportMode: 'copy' | 'zip';
|
|
7
|
+
destinationFolder: string;
|
|
8
|
+
zipFileName: string;
|
|
9
|
+
zipPassword: string;
|
|
10
|
+
fileNamingMode: FileNamingMode;
|
|
11
|
+
separatorChar: string;
|
|
12
|
+
invoiceFormat: InvoiceRetrieveFormats;
|
|
13
|
+
orderFormat: OrderRetrieveFormats;
|
|
14
|
+
fileExistsMode: FileExistsMode;
|
|
15
|
+
removeSignature: boolean;
|
|
16
|
+
}
|
|
3
17
|
export declare const dcmtsFileCacheDownload: Map<string, File>;
|
|
4
18
|
export declare const dcmtsFileCachePreview: Map<string, File>;
|
|
5
19
|
export declare const CACHE_SIZE_LIMIT = 10;
|
|
@@ -22,6 +36,7 @@ export declare class UserSettings {
|
|
|
22
36
|
wgDraftCheckoutInfo: CheckoutInfo[];
|
|
23
37
|
dcmtCheckoutInfo: CheckoutInfo[];
|
|
24
38
|
defaultCheckInOutFolder: string;
|
|
39
|
+
documentDownloadSettings: DocumentDownloadSettings;
|
|
25
40
|
constructor(skipCssUpdate?: boolean);
|
|
26
41
|
/** Load settings from local storage or other sources */
|
|
27
42
|
static LoadSettings(userID: number | undefined, archiveID: string | undefined): UserSettings;
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { InvoiceRetrieveFormats, LocalStorageService, OrderRetrieveFormats } from "@topconsultnpm/sdk-ts";
|
|
2
2
|
import { FontSize } from "../utils/theme";
|
|
3
|
-
|
|
3
|
+
import { SDKUI_Localizator } from "./SDKUI_Localizator";
|
|
4
|
+
export class DocumentDownloadSettings {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.exportMode = 'copy';
|
|
7
|
+
this.destinationFolder = 'Download';
|
|
8
|
+
this.zipFileName = SDKUI_Localizator.Result.toLowerCase() + '.zip';
|
|
9
|
+
this.zipPassword = '';
|
|
10
|
+
this.fileNamingMode = 'documentTypeAndDid';
|
|
11
|
+
this.separatorChar = '_';
|
|
12
|
+
this.invoiceFormat = InvoiceRetrieveFormats.ASW_HTML;
|
|
13
|
+
this.orderFormat = OrderRetrieveFormats.NSO_HTML;
|
|
14
|
+
this.fileExistsMode = 'overwrite';
|
|
15
|
+
this.removeSignature = false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
4
18
|
export const dcmtsFileCacheDownload = new Map();
|
|
5
19
|
export const dcmtsFileCachePreview = new Map();
|
|
6
20
|
export const CACHE_SIZE_LIMIT = 10;
|
|
@@ -24,6 +38,7 @@ export class UserSettings {
|
|
|
24
38
|
this.wgDraftCheckoutInfo = [];
|
|
25
39
|
this.dcmtCheckoutInfo = [];
|
|
26
40
|
this.defaultCheckInOutFolder = DEFAULT_CHECK_IN_OUT_FOLDER;
|
|
41
|
+
this.documentDownloadSettings = new DocumentDownloadSettings();
|
|
27
42
|
this.themeSettings = new ThemeSettings(skipCssUpdate);
|
|
28
43
|
}
|
|
29
44
|
/** Load settings from local storage or other sources */
|