@topconsultnpm/sdkui-react 6.17.0-test10
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/assets/IconsS4t/add.svg +12 -0
- package/lib/assets/IconsS4t/aggiorna.svg +18 -0
- package/lib/assets/IconsS4t/bookmark.svg +42 -0
- package/lib/assets/IconsS4t/cancella.svg +15 -0
- package/lib/assets/IconsS4t/check-box.svg +19 -0
- package/lib/assets/IconsS4t/down-arrow-signBook.svg +40 -0
- package/lib/assets/IconsS4t/down.svg +28 -0
- package/lib/assets/IconsS4t/edit-file.svg +19 -0
- package/lib/assets/IconsS4t/edita.svg +32 -0
- package/lib/assets/IconsS4t/firma.svg +19 -0
- package/lib/assets/IconsS4t/icona_download.svg +16 -0
- package/lib/assets/IconsS4t/info.svg +51 -0
- package/lib/assets/IconsS4t/left.svg +20 -0
- package/lib/assets/IconsS4t/line.svg +40 -0
- package/lib/assets/IconsS4t/more.svg +19 -0
- package/lib/assets/IconsS4t/new-signature.svg +1 -0
- package/lib/assets/IconsS4t/plus.svg +23 -0
- package/lib/assets/IconsS4t/printer.svg +49 -0
- package/lib/assets/IconsS4t/radio-on-button.svg +25 -0
- package/lib/assets/IconsS4t/rectangle.svg +41 -0
- package/lib/assets/IconsS4t/redo.svg +19 -0
- package/lib/assets/IconsS4t/right-arrow-signBook-finish.svg +40 -0
- package/lib/assets/IconsS4t/right-arrow-signBook.svg +40 -0
- package/lib/assets/IconsS4t/right.svg +22 -0
- package/lib/assets/IconsS4t/searchbar.svg +21 -0
- package/lib/assets/IconsS4t/text-box.svg +36 -0
- package/lib/assets/IconsS4t/tick.svg +8 -0
- package/lib/assets/IconsS4t/trash-white.svg +11 -0
- package/lib/assets/IconsS4t/trash.svg +1 -0
- package/lib/assets/IconsS4t/undo.svg +19 -0
- package/lib/assets/IconsS4t/up.svg +32 -0
- package/lib/assets/IconsS4t/video-streaming.svg +2 -0
- package/lib/assets/IconsS4t/zoom-in.svg +58 -0
- package/lib/assets/IconsS4t/zoom-out.svg +56 -0
- package/lib/assets/ImageLibrary/arrow_001.png +0 -0
- package/lib/assets/ImageLibrary/arrow_002.png +0 -0
- package/lib/assets/ImageLibrary/arrow_003.png +0 -0
- package/lib/assets/ImageLibrary/arrow_004.png +0 -0
- package/lib/assets/ImageLibrary/arrow_005.png +0 -0
- package/lib/assets/ImageLibrary/arrow_006.png +0 -0
- package/lib/assets/ImageLibrary/arrow_007.png +0 -0
- package/lib/assets/ImageLibrary/arrow_008.png +0 -0
- package/lib/assets/ImageLibrary/arrow_009.png +0 -0
- package/lib/assets/ImageLibrary/arrow_010.png +0 -0
- package/lib/assets/ImageLibrary/arrow_011.png +0 -0
- package/lib/assets/ImageLibrary/arrow_012.png +0 -0
- package/lib/assets/ImageLibrary/book_001.png +0 -0
- package/lib/assets/ImageLibrary/book_002.png +0 -0
- package/lib/assets/ImageLibrary/book_003.png +0 -0
- package/lib/assets/ImageLibrary/book_004.png +0 -0
- package/lib/assets/ImageLibrary/book_005.png +0 -0
- package/lib/assets/ImageLibrary/book_006.png +0 -0
- package/lib/assets/ImageLibrary/book_007.png +0 -0
- package/lib/assets/ImageLibrary/clock_001.png +0 -0
- package/lib/assets/ImageLibrary/clock_002.png +0 -0
- package/lib/assets/ImageLibrary/clock_003.png +0 -0
- package/lib/assets/ImageLibrary/cube_001.png +0 -0
- package/lib/assets/ImageLibrary/cube_002.png +0 -0
- package/lib/assets/ImageLibrary/cube_003.png +0 -0
- package/lib/assets/ImageLibrary/dcmt_001.png +0 -0
- package/lib/assets/ImageLibrary/dcmt_002.png +0 -0
- package/lib/assets/ImageLibrary/dcmt_003.png +0 -0
- package/lib/assets/ImageLibrary/dcmt_004.png +0 -0
- package/lib/assets/ImageLibrary/dcmt_005.png +0 -0
- package/lib/assets/ImageLibrary/dcmt_006.png +0 -0
- package/lib/assets/ImageLibrary/dcmt_007.png +0 -0
- package/lib/assets/ImageLibrary/dcmt_008.png +0 -0
- package/lib/assets/ImageLibrary/emoticon_001.png +0 -0
- package/lib/assets/ImageLibrary/emoticon_002.png +0 -0
- package/lib/assets/ImageLibrary/emoticon_003.png +0 -0
- package/lib/assets/ImageLibrary/emoticon_004.png +0 -0
- package/lib/assets/ImageLibrary/fld_001.png +0 -0
- package/lib/assets/ImageLibrary/fld_002.png +0 -0
- package/lib/assets/ImageLibrary/fld_003.png +0 -0
- package/lib/assets/ImageLibrary/fld_004.png +0 -0
- package/lib/assets/ImageLibrary/fld_005.png +0 -0
- package/lib/assets/ImageLibrary/fld_006.png +0 -0
- package/lib/assets/ImageLibrary/fld_007.png +0 -0
- package/lib/assets/ImageLibrary/fld_008.png +0 -0
- package/lib/assets/ImageLibrary/fld_009.png +0 -0
- package/lib/assets/ImageLibrary/fld_010.png +0 -0
- package/lib/assets/ImageLibrary/fld_011.png +0 -0
- package/lib/assets/ImageLibrary/fld_012.png +0 -0
- package/lib/assets/ImageLibrary/fld_013.png +0 -0
- package/lib/assets/ImageLibrary/fld_014.png +0 -0
- package/lib/assets/ImageLibrary/fld_015.png +0 -0
- package/lib/assets/ImageLibrary/fld_016.png +0 -0
- package/lib/assets/ImageLibrary/fld_017.png +0 -0
- package/lib/assets/ImageLibrary/fld_018.png +0 -0
- package/lib/assets/ImageLibrary/fld_019.png +0 -0
- package/lib/assets/ImageLibrary/fld_020.png +0 -0
- package/lib/assets/ImageLibrary/fld_021.png +0 -0
- package/lib/assets/ImageLibrary/fld_022.png +0 -0
- package/lib/assets/ImageLibrary/fld_023.png +0 -0
- package/lib/assets/ImageLibrary/fld_024.png +0 -0
- package/lib/assets/ImageLibrary/fld_025.png +0 -0
- package/lib/assets/ImageLibrary/fld_026.png +0 -0
- package/lib/assets/ImageLibrary/fld_027.png +0 -0
- package/lib/assets/ImageLibrary/fld_028.png +0 -0
- package/lib/assets/ImageLibrary/fld_029.png +0 -0
- package/lib/assets/ImageLibrary/fld_030.png +0 -0
- package/lib/assets/ImageLibrary/fld_031.png +0 -0
- package/lib/assets/ImageLibrary/fld_032.png +0 -0
- package/lib/assets/ImageLibrary/fld_033.png +0 -0
- package/lib/assets/ImageLibrary/gen_001.png +0 -0
- package/lib/assets/ImageLibrary/gen_002.png +0 -0
- package/lib/assets/ImageLibrary/gen_003.png +0 -0
- package/lib/assets/ImageLibrary/gen_004.png +0 -0
- package/lib/assets/ImageLibrary/gen_005.png +0 -0
- package/lib/assets/ImageLibrary/gen_006.png +0 -0
- package/lib/assets/ImageLibrary/gen_007.png +0 -0
- package/lib/assets/ImageLibrary/gen_008.png +0 -0
- package/lib/assets/ImageLibrary/gen_009.png +0 -0
- package/lib/assets/ImageLibrary/gen_010.png +0 -0
- package/lib/assets/ImageLibrary/gen_011.png +0 -0
- package/lib/assets/ImageLibrary/gen_012.png +0 -0
- package/lib/assets/ImageLibrary/gen_013.png +0 -0
- package/lib/assets/ImageLibrary/gen_014.png +0 -0
- package/lib/assets/ImageLibrary/gen_015.png +0 -0
- package/lib/assets/ImageLibrary/gen_016.png +0 -0
- package/lib/assets/ImageLibrary/gen_017.png +0 -0
- package/lib/assets/ImageLibrary/gen_018.png +0 -0
- package/lib/assets/ImageLibrary/gen_019.png +0 -0
- package/lib/assets/ImageLibrary/gen_020.png +0 -0
- package/lib/assets/ImageLibrary/gen_021.png +0 -0
- package/lib/assets/ImageLibrary/gen_022.png +0 -0
- package/lib/assets/ImageLibrary/gen_023.png +0 -0
- package/lib/assets/ImageLibrary/gen_024.png +0 -0
- package/lib/assets/ImageLibrary/gen_025.png +0 -0
- package/lib/assets/ImageLibrary/gen_026.png +0 -0
- package/lib/assets/ImageLibrary/gen_027.png +0 -0
- package/lib/assets/ImageLibrary/gen_028.png +0 -0
- package/lib/assets/ImageLibrary/gen_029.png +0 -0
- package/lib/assets/ImageLibrary/gen_030.png +0 -0
- package/lib/assets/ImageLibrary/gen_031.png +0 -0
- package/lib/assets/ImageLibrary/gen_032.png +0 -0
- package/lib/assets/ImageLibrary/gen_033.png +0 -0
- package/lib/assets/ImageLibrary/gen_034.png +0 -0
- package/lib/assets/ImageLibrary/gen_035.png +0 -0
- package/lib/assets/ImageLibrary/gen_036.png +0 -0
- package/lib/assets/ImageLibrary/gen_037.png +0 -0
- package/lib/assets/ImageLibrary/gen_038.png +0 -0
- package/lib/assets/ImageLibrary/gen_039.png +0 -0
- package/lib/assets/ImageLibrary/gen_040.png +0 -0
- package/lib/assets/ImageLibrary/gen_041.png +0 -0
- package/lib/assets/ImageLibrary/gen_042.png +0 -0
- package/lib/assets/ImageLibrary/gen_043.png +0 -0
- package/lib/assets/ImageLibrary/gen_044.png +0 -0
- package/lib/assets/ImageLibrary/gen_045.png +0 -0
- package/lib/assets/ImageLibrary/gen_046.png +0 -0
- package/lib/assets/ImageLibrary/gen_047.png +0 -0
- package/lib/assets/ImageLibrary/gen_048.png +0 -0
- package/lib/assets/ImageLibrary/gen_049.png +0 -0
- package/lib/assets/ImageLibrary/gen_050.png +0 -0
- package/lib/assets/ImageLibrary/gen_051.png +0 -0
- package/lib/assets/ImageLibrary/gen_052.png +0 -0
- package/lib/assets/ImageLibrary/hand_001.png +0 -0
- package/lib/assets/ImageLibrary/hand_002.png +0 -0
- package/lib/assets/ImageLibrary/hand_003.png +0 -0
- package/lib/assets/ImageLibrary/hand_004.png +0 -0
- package/lib/assets/ImageLibrary/hand_005.png +0 -0
- package/lib/assets/ImageLibrary/hand_006.png +0 -0
- package/lib/assets/ImageLibrary/law_001.png +0 -0
- package/lib/assets/ImageLibrary/law_002.png +0 -0
- package/lib/assets/ImageLibrary/law_003.png +0 -0
- package/lib/assets/ImageLibrary/lock_001.png +0 -0
- package/lib/assets/ImageLibrary/lock_002.png +0 -0
- package/lib/assets/ImageLibrary/lock_003.png +0 -0
- package/lib/assets/ImageLibrary/mail_001.png +0 -0
- package/lib/assets/ImageLibrary/mail_002.png +0 -0
- package/lib/assets/ImageLibrary/mail_003.png +0 -0
- package/lib/assets/ImageLibrary/mail_004.png +0 -0
- package/lib/assets/ImageLibrary/mail_005.png +0 -0
- package/lib/assets/ImageLibrary/mail_006.png +0 -0
- package/lib/assets/ImageLibrary/mail_007.png +0 -0
- package/lib/assets/ImageLibrary/mail_008.png +0 -0
- package/lib/assets/ImageLibrary/mail_009.png +0 -0
- package/lib/assets/ImageLibrary/mail_010.png +0 -0
- package/lib/assets/ImageLibrary/mail_011.png +0 -0
- package/lib/assets/ImageLibrary/mail_012.png +0 -0
- package/lib/assets/ImageLibrary/mail_013.png +0 -0
- package/lib/assets/ImageLibrary/mail_014.png +0 -0
- package/lib/assets/ImageLibrary/mail_015.png +0 -0
- package/lib/assets/ImageLibrary/net_001.png +0 -0
- package/lib/assets/ImageLibrary/net_002.png +0 -0
- package/lib/assets/ImageLibrary/net_003.png +0 -0
- package/lib/assets/ImageLibrary/net_004.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_001.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_002.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_003.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_004.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_005.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_006.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_007.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_008.png +0 -0
- package/lib/assets/ImageLibrary/nmbr_009.png +0 -0
- package/lib/assets/ImageLibrary/note_001.png +0 -0
- package/lib/assets/ImageLibrary/note_002.png +0 -0
- package/lib/assets/ImageLibrary/note_003.png +0 -0
- package/lib/assets/ImageLibrary/note_004.png +0 -0
- package/lib/assets/ImageLibrary/note_005.png +0 -0
- package/lib/assets/ImageLibrary/note_006.png +0 -0
- package/lib/assets/ImageLibrary/note_007.png +0 -0
- package/lib/assets/ImageLibrary/note_008.png +0 -0
- package/lib/assets/ImageLibrary/note_009.png +0 -0
- package/lib/assets/ImageLibrary/note_010.png +0 -0
- package/lib/assets/ImageLibrary/note_011.png +0 -0
- package/lib/assets/ImageLibrary/note_012.png +0 -0
- package/lib/assets/ImageLibrary/note_013.png +0 -0
- package/lib/assets/ImageLibrary/note_014.png +0 -0
- package/lib/assets/ImageLibrary/note_015.png +0 -0
- package/lib/assets/ImageLibrary/note_016.png +0 -0
- package/lib/assets/ImageLibrary/run_001.png +0 -0
- package/lib/assets/ImageLibrary/run_002.png +0 -0
- package/lib/assets/ImageLibrary/run_003.png +0 -0
- package/lib/assets/ImageLibrary/sem_001.png +0 -0
- package/lib/assets/ImageLibrary/sem_002.png +0 -0
- package/lib/assets/ImageLibrary/sem_003.png +0 -0
- package/lib/assets/ImageLibrary/sem_004.png +0 -0
- package/lib/assets/ImageLibrary/sem_005.png +0 -0
- package/lib/assets/ImageLibrary/star_001.png +0 -0
- package/lib/assets/ImageLibrary/star_002.png +0 -0
- package/lib/assets/ImageLibrary/star_003.png +0 -0
- package/lib/assets/ImageLibrary/star_004.png +0 -0
- package/lib/assets/ImageLibrary/star_005.png +0 -0
- package/lib/assets/ImageLibrary/star_006.png +0 -0
- package/lib/assets/ImageLibrary/state_001.png +0 -0
- package/lib/assets/ImageLibrary/state_002.png +0 -0
- package/lib/assets/ImageLibrary/state_003.png +0 -0
- package/lib/assets/ImageLibrary/state_004.png +0 -0
- package/lib/assets/ImageLibrary/state_005.png +0 -0
- package/lib/assets/ImageLibrary/study_001.png +0 -0
- package/lib/assets/ImageLibrary/study_002.png +0 -0
- package/lib/assets/ImageLibrary/user_001.png +0 -0
- package/lib/assets/ImageLibrary/user_002.png +0 -0
- package/lib/assets/ImageLibrary/user_003.png +0 -0
- package/lib/assets/ImageLibrary/user_004.png +0 -0
- package/lib/assets/ImageLibrary/user_005.png +0 -0
- package/lib/assets/ImageLibrary/user_006.png +0 -0
- package/lib/assets/ImageLibrary/user_007.png +0 -0
- package/lib/assets/ImageLibrary/user_008.png +0 -0
- package/lib/assets/ImageLibrary/user_009.png +0 -0
- package/lib/assets/ImageLibrary/user_010.png +0 -0
- package/lib/assets/ImageLibrary/user_011.png +0 -0
- package/lib/assets/ImageLibrary/user_012.png +0 -0
- package/lib/assets/ImageLibrary/user_013.png +0 -0
- package/lib/assets/ImageLibrary/user_014.png +0 -0
- package/lib/assets/ImageLibrary/user_015.png +0 -0
- package/lib/assets/ImageLibrary/user_016.png +0 -0
- package/lib/assets/ImageLibrary/user_017.png +0 -0
- package/lib/assets/ImageLibrary/user_018.png +0 -0
- package/lib/assets/ImageLibrary/user_019.png +0 -0
- package/lib/assets/ImageLibrary/user_020.png +0 -0
- package/lib/assets/ImageLibrary/user_021.png +0 -0
- package/lib/assets/ImageLibrary/user_022.png +0 -0
- package/lib/assets/ImageLibrary/user_023.png +0 -0
- package/lib/assets/ImageLibrary/vehicle_001.png +0 -0
- package/lib/assets/ImageLibrary/vehicle_002.png +0 -0
- package/lib/assets/ImageLibrary/vehicle_003.png +0 -0
- package/lib/assets/ImageLibrary/vehicle_004.png +0 -0
- package/lib/assets/ImageLibrary/vehicle_005.png +0 -0
- package/lib/assets/ImageLibrary/vehicle_006.png +0 -0
- package/lib/assets/ImageLibrary/vehicle_007.png +0 -0
- package/lib/assets/ImageLibrary/vehicle_008.png +0 -0
- package/lib/assets/Toppy-generico.png +0 -0
- package/lib/assets/france.svg +1 -0
- package/lib/assets/german.svg +1 -0
- package/lib/assets/icomoon.eot +0 -0
- package/lib/assets/icomoon.svg +97 -0
- package/lib/assets/icomoon.ttf +0 -0
- package/lib/assets/icomoon.woff +0 -0
- package/lib/assets/italy.svg +16 -0
- package/lib/assets/loading.png +0 -0
- package/lib/assets/login-bg.png +0 -0
- package/lib/assets/multipleSelectionManager.jpg +0 -0
- package/lib/assets/portugal.svg +1 -0
- package/lib/assets/six.png +0 -0
- package/lib/assets/six.svg +4 -0
- package/lib/assets/spain.svg +1 -0
- package/lib/assets/thumbnails/dicom.png +0 -0
- package/lib/assets/thumbnails/doc.png +0 -0
- package/lib/assets/thumbnails/docx.png +0 -0
- package/lib/assets/thumbnails/dwg.png +0 -0
- package/lib/assets/thumbnails/email.png +0 -0
- package/lib/assets/thumbnails/exe.png +0 -0
- package/lib/assets/thumbnails/folder.png +0 -0
- package/lib/assets/thumbnails/html.png +0 -0
- package/lib/assets/thumbnails/image.png +0 -0
- package/lib/assets/thumbnails/index.d.ts +19 -0
- package/lib/assets/thumbnails/index.js +19 -0
- package/lib/assets/thumbnails/index.ts +39 -0
- package/lib/assets/thumbnails/mp4.png +0 -0
- package/lib/assets/thumbnails/other.png +0 -0
- package/lib/assets/thumbnails/p7m.png +0 -0
- package/lib/assets/thumbnails/pdf.png +0 -0
- package/lib/assets/thumbnails/ppt.png +0 -0
- package/lib/assets/thumbnails/slddrw.png +0 -0
- package/lib/assets/thumbnails/txt.png +0 -0
- package/lib/assets/thumbnails/xls.png +0 -0
- package/lib/assets/thumbnails/xml.png +0 -0
- package/lib/assets/thumbnails/zip.png +0 -0
- package/lib/assets/topmedia-six.svg +66 -0
- package/lib/assets/topmeida-six-bianco.svg +66 -0
- package/lib/assets/united-kingdom.svg +1 -0
- package/lib/components/base/Styled.d.ts +63 -0
- package/lib/components/base/Styled.js +337 -0
- package/lib/components/base/TMAccordion.d.ts +12 -0
- package/lib/components/base/TMAccordion.js +62 -0
- package/lib/components/base/TMAlert.d.ts +73 -0
- package/lib/components/base/TMAlert.js +77 -0
- package/lib/components/base/TMAreaManager.d.ts +25 -0
- package/lib/components/base/TMAreaManager.js +733 -0
- package/lib/components/base/TMButton.d.ts +21 -0
- package/lib/components/base/TMButton.js +174 -0
- package/lib/components/base/TMClosableList.d.ts +10 -0
- package/lib/components/base/TMClosableList.js +70 -0
- package/lib/components/base/TMConfirm.d.ts +13 -0
- package/lib/components/base/TMConfirm.js +119 -0
- package/lib/components/base/TMContextMenu.d.ts +25 -0
- package/lib/components/base/TMContextMenu.js +109 -0
- package/lib/components/base/TMContextMenuOLD.d.ts +26 -0
- package/lib/components/base/TMContextMenuOLD.js +56 -0
- package/lib/components/base/TMCounterBar.d.ts +10 -0
- package/lib/components/base/TMCounterBar.js +43 -0
- package/lib/components/base/TMCounterContainer.d.ts +23 -0
- package/lib/components/base/TMCounterContainer.js +58 -0
- package/lib/components/base/TMCustomButton.d.ts +11 -0
- package/lib/components/base/TMCustomButton.js +116 -0
- package/lib/components/base/TMDataGrid.d.ts +56 -0
- package/lib/components/base/TMDataGrid.js +237 -0
- package/lib/components/base/TMDataGridExportForm.d.ts +15 -0
- package/lib/components/base/TMDataGridExportForm.js +215 -0
- package/lib/components/base/TMDeviceProvider.d.ts +15 -0
- package/lib/components/base/TMDeviceProvider.js +41 -0
- package/lib/components/base/TMDropDownMenu.d.ts +23 -0
- package/lib/components/base/TMDropDownMenu.js +45 -0
- package/lib/components/base/TMEditorBase.d.ts +39 -0
- package/lib/components/base/TMEditorBase.js +1 -0
- package/lib/components/base/TMFileManager.d.ts +45 -0
- package/lib/components/base/TMFileManager.js +233 -0
- package/lib/components/base/TMFileManagerDataGridView.d.ts +16 -0
- package/lib/components/base/TMFileManagerDataGridView.js +101 -0
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +18 -0
- package/lib/components/base/TMFileManagerThumbnailItems.js +148 -0
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +19 -0
- package/lib/components/base/TMFileManagerThumbnailsView.js +46 -0
- package/lib/components/base/TMFileManagerUtils.d.ts +78 -0
- package/lib/components/base/TMFileManagerUtils.js +207 -0
- package/lib/components/base/TMFloatingToolbar.d.ts +9 -0
- package/lib/components/base/TMFloatingToolbar.js +101 -0
- package/lib/components/base/TMLayout.d.ts +55 -0
- package/lib/components/base/TMLayout.js +201 -0
- package/lib/components/base/TMList.d.ts +9 -0
- package/lib/components/base/TMList.js +54 -0
- package/lib/components/base/TMListView.d.ts +42 -0
- package/lib/components/base/TMListView.js +387 -0
- package/lib/components/base/TMModal.d.ts +16 -0
- package/lib/components/base/TMModal.js +70 -0
- package/lib/components/base/TMPanel.d.ts +32 -0
- package/lib/components/base/TMPanel.js +181 -0
- package/lib/components/base/TMPopUp.d.ts +33 -0
- package/lib/components/base/TMPopUp.js +267 -0
- package/lib/components/base/TMProgressBar.d.ts +11 -0
- package/lib/components/base/TMProgressBar.js +32 -0
- package/lib/components/base/TMResizableMenu.d.ts +20 -0
- package/lib/components/base/TMResizableMenu.js +98 -0
- package/lib/components/base/TMRightSidebar.d.ts +19 -0
- package/lib/components/base/TMRightSidebar.js +80 -0
- package/lib/components/base/TMShowAllOrMaxItemsButton.d.ts +8 -0
- package/lib/components/base/TMShowAllOrMaxItemsButton.js +20 -0
- package/lib/components/base/TMSpinner.d.ts +14 -0
- package/lib/components/base/TMSpinner.js +160 -0
- package/lib/components/base/TMTab.d.ts +20 -0
- package/lib/components/base/TMTab.js +42 -0
- package/lib/components/base/TMToggleButton.d.ts +10 -0
- package/lib/components/base/TMToggleButton.js +58 -0
- package/lib/components/base/TMToolbarCard.d.ts +19 -0
- package/lib/components/base/TMToolbarCard.js +51 -0
- package/lib/components/base/TMTooltip.d.ts +14 -0
- package/lib/components/base/TMTooltip.js +20 -0
- package/lib/components/base/TMTreeView.d.ts +32 -0
- package/lib/components/base/TMTreeView.js +356 -0
- package/lib/components/base/TMUserAvatar.d.ts +8 -0
- package/lib/components/base/TMUserAvatar.js +34 -0
- package/lib/components/base/TMVilViewer.d.ts +5 -0
- package/lib/components/base/TMVilViewer.js +22 -0
- package/lib/components/base/TMWaitPanel.d.ts +32 -0
- package/lib/components/base/TMWaitPanel.js +44 -0
- package/lib/components/choosers/TMCultureIDPicker.d.ts +9 -0
- package/lib/components/choosers/TMCultureIDPicker.js +72 -0
- package/lib/components/choosers/TMDataListItemChooser.d.ts +17 -0
- package/lib/components/choosers/TMDataListItemChooser.js +49 -0
- package/lib/components/choosers/TMDataListItemPicker.d.ts +9 -0
- package/lib/components/choosers/TMDataListItemPicker.js +96 -0
- package/lib/components/choosers/TMDcmtTypeChooser.d.ts +25 -0
- package/lib/components/choosers/TMDcmtTypeChooser.js +61 -0
- package/lib/components/choosers/TMDiskChooser.d.ts +10 -0
- package/lib/components/choosers/TMDiskChooser.js +41 -0
- package/lib/components/choosers/TMDistinctValues.d.ts +21 -0
- package/lib/components/choosers/TMDistinctValues.js +140 -0
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +40 -0
- package/lib/components/choosers/TMDynDataListItemChooser.js +159 -0
- package/lib/components/choosers/TMGroupChooser.d.ts +7 -0
- package/lib/components/choosers/TMGroupChooser.js +37 -0
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +4 -0
- package/lib/components/choosers/TMInvoiceRetrieveFormats.js +22 -0
- package/lib/components/choosers/TMMetadataChooser.d.ts +54 -0
- package/lib/components/choosers/TMMetadataChooser.js +155 -0
- package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +4 -0
- package/lib/components/choosers/TMOrderRetrieveFormats.js +22 -0
- package/lib/components/choosers/TMPathChooser.d.ts +12 -0
- package/lib/components/choosers/TMPathChooser.js +147 -0
- package/lib/components/choosers/TMRelationChooser.d.ts +31 -0
- package/lib/components/choosers/TMRelationChooser.js +94 -0
- package/lib/components/choosers/TMUserChooser.d.ts +40 -0
- package/lib/components/choosers/TMUserChooser.js +141 -0
- package/lib/components/editors/TMCheckBox.d.ts +9 -0
- package/lib/components/editors/TMCheckBox.js +90 -0
- package/lib/components/editors/TMDateBox.d.ts +17 -0
- package/lib/components/editors/TMDateBox.js +75 -0
- package/lib/components/editors/TMDropDown.d.ts +10 -0
- package/lib/components/editors/TMDropDown.js +62 -0
- package/lib/components/editors/TMEditorStyled.d.ts +41 -0
- package/lib/components/editors/TMEditorStyled.js +90 -0
- package/lib/components/editors/TMFormulaEditor.d.ts +49 -0
- package/lib/components/editors/TMFormulaEditor.js +727 -0
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +7 -0
- package/lib/components/editors/TMHtmlContentDisplay.js +78 -0
- package/lib/components/editors/TMHtmlEditor.d.ts +38 -0
- package/lib/components/editors/TMHtmlEditor.js +203 -0
- package/lib/components/editors/TMLocalizedTextBox.d.ts +19 -0
- package/lib/components/editors/TMLocalizedTextBox.js +125 -0
- package/lib/components/editors/TMMetadataEditor.d.ts +29 -0
- package/lib/components/editors/TMMetadataEditor.js +140 -0
- package/lib/components/editors/TMMetadataValues.d.ts +46 -0
- package/lib/components/editors/TMMetadataValues.js +530 -0
- package/lib/components/editors/TMRadioButton.d.ts +10 -0
- package/lib/components/editors/TMRadioButton.js +57 -0
- package/lib/components/editors/TMSummary.d.ts +20 -0
- package/lib/components/editors/TMSummary.js +92 -0
- package/lib/components/editors/TMTextArea.d.ts +17 -0
- package/lib/components/editors/TMTextArea.js +155 -0
- package/lib/components/editors/TMTextBox.d.ts +20 -0
- package/lib/components/editors/TMTextBox.js +249 -0
- package/lib/components/editors/TMTextExpression.d.ts +25 -0
- package/lib/components/editors/TMTextExpression.js +174 -0
- package/lib/components/editors/TMTreeDropDown.d.ts +18 -0
- package/lib/components/editors/TMTreeDropDown.js +66 -0
- package/lib/components/features/archive/TMArchive.d.ts +29 -0
- package/lib/components/features/archive/TMArchive.js +193 -0
- package/lib/components/features/assistant/ToppyHelpCenter.d.ts +12 -0
- package/lib/components/features/assistant/ToppyHelpCenter.js +173 -0
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +17 -0
- package/lib/components/features/blog/TMBlogCommentForm.js +333 -0
- package/lib/components/features/documents/TMBatchUpdateForm.d.ts +17 -0
- package/lib/components/features/documents/TMBatchUpdateForm.js +159 -0
- package/lib/components/features/documents/TMDcmtBlog.d.ts +23 -0
- package/lib/components/features/documents/TMDcmtBlog.js +65 -0
- package/lib/components/features/documents/TMDcmtForm.d.ts +64 -0
- package/lib/components/features/documents/TMDcmtForm.js +1498 -0
- package/lib/components/features/documents/TMDcmtIcon.d.ts +18 -0
- package/lib/components/features/documents/TMDcmtIcon.js +93 -0
- package/lib/components/features/documents/TMDcmtPreview.d.ts +31 -0
- package/lib/components/features/documents/TMDcmtPreview.js +446 -0
- package/lib/components/features/documents/TMDcmtTasks.d.ts +13 -0
- package/lib/components/features/documents/TMDcmtTasks.js +24 -0
- package/lib/components/features/documents/TMDragDropOverlay.d.ts +6 -0
- package/lib/components/features/documents/TMDragDropOverlay.js +97 -0
- package/lib/components/features/documents/TMFileUploader.d.ts +14 -0
- package/lib/components/features/documents/TMFileUploader.js +115 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +26 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +288 -0
- package/lib/components/features/documents/TMRelationViewer.d.ts +121 -0
- package/lib/components/features/documents/TMRelationViewer.js +753 -0
- package/lib/components/features/search/TMSavedQueryForm.d.ts +9 -0
- package/lib/components/features/search/TMSavedQueryForm.js +41 -0
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +16 -0
- package/lib/components/features/search/TMSavedQuerySelector.js +226 -0
- package/lib/components/features/search/TMSearch.d.ts +40 -0
- package/lib/components/features/search/TMSearch.js +253 -0
- package/lib/components/features/search/TMSearchQueryEditor.d.ts +15 -0
- package/lib/components/features/search/TMSearchQueryEditor.js +367 -0
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +29 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +438 -0
- package/lib/components/features/search/TMSearchResult.d.ts +53 -0
- package/lib/components/features/search/TMSearchResult.js +1092 -0
- package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +16 -0
- package/lib/components/features/search/TMSearchResultFloatingActionButton.js +50 -0
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +11 -0
- package/lib/components/features/search/TMSearchResultsMenuItems.js +725 -0
- package/lib/components/features/search/TMTreeSelector.d.ts +12 -0
- package/lib/components/features/search/TMTreeSelector.js +270 -0
- package/lib/components/features/tasks/TMTaskForm.d.ts +38 -0
- package/lib/components/features/tasks/TMTaskForm.js +392 -0
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +17 -0
- package/lib/components/features/tasks/TMTasksAgenda.js +107 -0
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +21 -0
- package/lib/components/features/tasks/TMTasksCalendar.js +240 -0
- package/lib/components/features/tasks/TMTasksHeader.d.ts +14 -0
- package/lib/components/features/tasks/TMTasksHeader.js +37 -0
- package/lib/components/features/tasks/TMTasksPanelContent.d.ts +20 -0
- package/lib/components/features/tasks/TMTasksPanelContent.js +65 -0
- package/lib/components/features/tasks/TMTasksUtils.d.ts +133 -0
- package/lib/components/features/tasks/TMTasksUtils.js +649 -0
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +39 -0
- package/lib/components/features/tasks/TMTasksUtilsView.js +140 -0
- package/lib/components/features/tasks/TMTasksView.d.ts +40 -0
- package/lib/components/features/tasks/TMTasksView.js +566 -0
- package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +39 -0
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +439 -0
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +42 -0
- package/lib/components/features/workflow/TMWorkflowPopup.js +286 -0
- package/lib/components/features/workflow/diagram/ConnectionComponent.d.ts +14 -0
- package/lib/components/features/workflow/diagram/ConnectionComponent.js +90 -0
- package/lib/components/features/workflow/diagram/ConnectionForm.d.ts +9 -0
- package/lib/components/features/workflow/diagram/ConnectionForm.js +73 -0
- package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +18 -0
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +264 -0
- package/lib/components/features/workflow/diagram/DiagramItemForm.d.ts +10 -0
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +686 -0
- package/lib/components/features/workflow/diagram/DiagramItemSvgContent.d.ts +12 -0
- package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +97 -0
- package/lib/components/features/workflow/diagram/RecipientList.d.ts +27 -0
- package/lib/components/features/workflow/diagram/RecipientList.js +204 -0
- package/lib/components/features/workflow/diagram/WFDiagram.d.ts +9 -0
- package/lib/components/features/workflow/diagram/WFDiagram.js +1680 -0
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +18 -0
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.js +97 -0
- package/lib/components/features/workflow/diagram/interfaces.d.ts +126 -0
- package/lib/components/features/workflow/diagram/interfaces.js +26 -0
- package/lib/components/features/workflow/diagram/metadataParser.d.ts +14 -0
- package/lib/components/features/workflow/diagram/metadataParser.js +54 -0
- package/lib/components/features/workflow/diagram/queryDescriptorParser.d.ts +3 -0
- package/lib/components/features/workflow/diagram/queryDescriptorParser.js +188 -0
- package/lib/components/features/workflow/diagram/workflowHelpers.d.ts +122 -0
- package/lib/components/features/workflow/diagram/workflowHelpers.js +488 -0
- package/lib/components/features/workflow/diagram/xmlParser.d.ts +10 -0
- package/lib/components/features/workflow/diagram/xmlParser.js +490 -0
- package/lib/components/filesystem/ProgressBar.d.ts +7 -0
- package/lib/components/filesystem/ProgressBar.js +25 -0
- package/lib/components/forms/Login/ChangePassword.d.ts +9 -0
- package/lib/components/forms/Login/ChangePassword.js +22 -0
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +14 -0
- package/lib/components/forms/Login/ChangePasswordInputs.js +80 -0
- package/lib/components/forms/Login/Chooser.d.ts +28 -0
- package/lib/components/forms/Login/Chooser.js +145 -0
- package/lib/components/forms/Login/LOGINLocalizator.d.ts +29 -0
- package/lib/components/forms/Login/LOGINLocalizator.js +247 -0
- package/lib/components/forms/Login/LoginValidatorService.d.ts +50 -0
- package/lib/components/forms/Login/LoginValidatorService.js +162 -0
- package/lib/components/forms/Login/Menu.d.ts +10 -0
- package/lib/components/forms/Login/Menu.js +48 -0
- package/lib/components/forms/Login/OTPReader.d.ts +14 -0
- package/lib/components/forms/Login/OTPReader.js +90 -0
- package/lib/components/forms/Login/PasswordStrengthChecker.d.ts +7 -0
- package/lib/components/forms/Login/PasswordStrengthChecker.js +45 -0
- package/lib/components/forms/Login/RapidAccessLogin.d.ts +25 -0
- package/lib/components/forms/Login/RapidAccessLogin.js +310 -0
- package/lib/components/forms/Login/RecoverPasswordFlow.d.ts +11 -0
- package/lib/components/forms/Login/RecoverPasswordFlow.js +111 -0
- package/lib/components/forms/Login/SelectBox.d.ts +23 -0
- package/lib/components/forms/Login/SelectBox.js +96 -0
- package/lib/components/forms/Login/StepIndicator.d.ts +7 -0
- package/lib/components/forms/Login/StepIndicator.js +19 -0
- package/lib/components/forms/Login/TMLoginForm.d.ts +44 -0
- package/lib/components/forms/Login/TMLoginForm.js +737 -0
- package/lib/components/forms/Login/TextBox.d.ts +27 -0
- package/lib/components/forms/Login/TextBox.js +111 -0
- package/lib/components/forms/TMApplyForm.d.ts +4 -0
- package/lib/components/forms/TMApplyForm.js +105 -0
- package/lib/components/forms/TMChooserForm.d.ts +3 -0
- package/lib/components/forms/TMChooserForm.js +94 -0
- package/lib/components/forms/TMResultDialog.d.ts +20 -0
- package/lib/components/forms/TMResultDialog.js +44 -0
- package/lib/components/forms/TMSaveForm.d.ts +31 -0
- package/lib/components/forms/TMSaveForm.js +176 -0
- package/lib/components/grids/TMBlogAttachments.d.ts +42 -0
- package/lib/components/grids/TMBlogAttachments.js +43 -0
- package/lib/components/grids/TMBlogHeader.d.ts +31 -0
- package/lib/components/grids/TMBlogHeader.js +41 -0
- package/lib/components/grids/TMBlogsPost.d.ts +89 -0
- package/lib/components/grids/TMBlogsPost.js +644 -0
- package/lib/components/grids/TMBlogsPostUtils.d.ts +113 -0
- package/lib/components/grids/TMBlogsPostUtils.js +250 -0
- package/lib/components/grids/TMRecentsManager.d.ts +13 -0
- package/lib/components/grids/TMRecentsManager.js +155 -0
- package/lib/components/grids/TMValidationItemsList.d.ts +6 -0
- package/lib/components/grids/TMValidationItemsList.js +82 -0
- package/lib/components/index.d.ts +115 -0
- package/lib/components/index.js +137 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +10 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +215 -0
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +39 -0
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +257 -0
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +11 -0
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +83 -0
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +21 -0
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.js +64 -0
- package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +8 -0
- package/lib/components/layout/panelManager/TMPanelWrapper.js +59 -0
- package/lib/components/layout/panelManager/types.d.ts +42 -0
- package/lib/components/layout/panelManager/types.js +1 -0
- package/lib/components/layout/panelManager/utils.d.ts +21 -0
- package/lib/components/layout/panelManager/utils.js +208 -0
- package/lib/components/pages/TMPage.d.ts +38 -0
- package/lib/components/pages/TMPage.js +220 -0
- package/lib/components/query/TMQueryEditor.d.ts +58 -0
- package/lib/components/query/TMQueryEditor.js +1001 -0
- package/lib/components/query/TMQuerySummary.d.ts +16 -0
- package/lib/components/query/TMQuerySummary.js +35 -0
- package/lib/components/settings/SettingsAppearance.d.ts +14 -0
- package/lib/components/settings/SettingsAppearance.js +73 -0
- package/lib/components/sidebar/TMAboutApp.d.ts +8 -0
- package/lib/components/sidebar/TMAboutApp.js +14 -0
- package/lib/components/sidebar/TMCommandsPanel.d.ts +16 -0
- package/lib/components/sidebar/TMCommandsPanel.js +27 -0
- package/lib/components/sidebar/TMHeader.d.ts +43 -0
- package/lib/components/sidebar/TMHeader.js +616 -0
- package/lib/components/sidebar/TMSidebar.d.ts +21 -0
- package/lib/components/sidebar/TMSidebar.js +61 -0
- package/lib/components/sidebar/TMSidebarItem.d.ts +15 -0
- package/lib/components/sidebar/TMSidebarItem.js +39 -0
- package/lib/components/viewers/TMDataListItemViewer.d.ts +10 -0
- package/lib/components/viewers/TMDataListItemViewer.js +80 -0
- package/lib/components/viewers/TMMidViewer.d.ts +36 -0
- package/lib/components/viewers/TMMidViewer.js +128 -0
- package/lib/components/viewers/TMTidViewer.d.ts +256 -0
- package/lib/components/viewers/TMTidViewer.js +343 -0
- package/lib/components/wizard/TMStepIndicator.d.ts +11 -0
- package/lib/components/wizard/TMStepIndicator.js +165 -0
- package/lib/components/wizard/TMWizard.d.ts +18 -0
- package/lib/components/wizard/TMWizard.js +93 -0
- package/lib/css/tm-sdkui.css +1 -0
- package/lib/helper/DeepCompareHelper.d.ts +7 -0
- package/lib/helper/DeepCompareHelper.js +106 -0
- package/lib/helper/Enum_Localizator.d.ts +18 -0
- package/lib/helper/Enum_Localizator.js +247 -0
- package/lib/helper/GlobalStyles.d.ts +2 -0
- package/lib/helper/GlobalStyles.js +10 -0
- package/lib/helper/Globalization.d.ts +15 -0
- package/lib/helper/Globalization.js +110 -0
- package/lib/helper/SDKUI_Globals.d.ts +96 -0
- package/lib/helper/SDKUI_Globals.js +174 -0
- package/lib/helper/SDKUI_Localizator.d.ts +739 -0
- package/lib/helper/SDKUI_Localizator.js +7298 -0
- package/lib/helper/TMCommandsContextMenu.d.ts +14 -0
- package/lib/helper/TMCommandsContextMenu.js +6 -0
- package/lib/helper/TMConditionalWrapper.d.ts +8 -0
- package/lib/helper/TMConditionalWrapper.js +4 -0
- package/lib/helper/TMCustomSearchBar.d.ts +8 -0
- package/lib/helper/TMCustomSearchBar.js +54 -0
- package/lib/helper/TMIcons.d.ts +274 -0
- package/lib/helper/TMIcons.js +673 -0
- package/lib/helper/TMImageLibrary.d.ts +4 -0
- package/lib/helper/TMImageLibrary.js +466 -0
- package/lib/helper/TMToppyMessage.d.ts +7 -0
- package/lib/helper/TMToppyMessage.js +42 -0
- package/lib/helper/TMUtils.d.ts +26 -0
- package/lib/helper/TMUtils.js +212 -0
- package/lib/helper/dcmtsHelper.d.ts +8 -0
- package/lib/helper/dcmtsHelper.js +53 -0
- package/lib/helper/helpers.d.ts +84 -0
- package/lib/helper/helpers.js +826 -0
- package/lib/helper/index.d.ts +13 -0
- package/lib/helper/index.js +13 -0
- package/lib/helper/queryHelper.d.ts +19 -0
- package/lib/helper/queryHelper.js +336 -0
- package/lib/hooks/useDcmtOperations.d.ts +24 -0
- package/lib/hooks/useDcmtOperations.js +482 -0
- package/lib/hooks/useForm.d.ts +24 -0
- package/lib/hooks/useForm.js +157 -0
- package/lib/hooks/useInputDialog.d.ts +9 -0
- package/lib/hooks/useInputDialog.js +105 -0
- package/lib/hooks/useOutsideClick.d.ts +2 -0
- package/lib/hooks/useOutsideClick.js +38 -0
- package/lib/hooks/usePreventFileDrop.d.ts +3 -0
- package/lib/hooks/usePreventFileDrop.js +37 -0
- package/lib/hooks/useQueryParametersDialog.d.ts +2 -0
- package/lib/hooks/useQueryParametersDialog.js +71 -0
- package/lib/hooks/useRelatedDocuments.d.ts +72 -0
- package/lib/hooks/useRelatedDocuments.js +664 -0
- package/lib/hooks/useResizeObserver.d.ts +4 -0
- package/lib/hooks/useResizeObserver.js +22 -0
- package/lib/hooks/useWorkflowApprove.d.ts +11 -0
- package/lib/hooks/useWorkflowApprove.js +57 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.js +15 -0
- package/lib/services/index.d.ts +1 -0
- package/lib/services/index.js +1 -0
- package/lib/services/platform_services.d.ts +18 -0
- package/lib/services/platform_services.js +492 -0
- package/lib/ts/index.d.ts +1 -0
- package/lib/ts/index.js +1 -0
- package/lib/ts/types.d.ts +310 -0
- package/lib/ts/types.js +100 -0
- package/lib/utils/theme.d.ts +69 -0
- package/lib/utils/theme.js +81 -0
- package/package.json +54 -0
|
@@ -0,0 +1,1498 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import TMDcmtPreview from './TMDcmtPreview';
|
|
4
|
+
import { AccessLevels, ArchiveConstraints, ArchiveEngineByID, DcmtTypeListCacheService, LayoutCacheService, LayoutModes, MetadataDataTypes, ObjectClasses, ResultTypes, SDK_Globals, SDK_Localizator, SystemMIDsAsNumber, SystemTIDs, Task_States, TemplateTIDs, TID_DID, UpdateEngineByID, ValidationItem, WorkflowCacheService, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
|
|
5
|
+
import { ContextMenu } from 'devextreme-react';
|
|
6
|
+
import { WorkFlowApproveRejectPopUp, WorkFlowMoreInfoPopUp, WorkFlowOperationButtons, WorkFlowReAssignPopUp } from '../workflow/TMWorkflowPopup';
|
|
7
|
+
import { DownloadTypes, FormModes, DcmtOperationTypes } from '../../../ts';
|
|
8
|
+
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
|
9
|
+
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
10
|
+
import { useRelatedDocuments } from '../../../hooks/useRelatedDocuments';
|
|
11
|
+
import { getWorkItemSetIDAsync, handleArchiveVisibility, searchResultToMetadataValues } from '../../../helper/queryHelper';
|
|
12
|
+
import { genUniqueId, IconShow, SDKUI_Localizator, updateMruTids, IconBoard, IconDcmtTypeSys, IconDetailDcmts, svgToString, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconPreview, isTaskMoreInfo, IconWorkflow, IconSearch, deepCompare, IconCheck, IconActivity, TMImageLibrary, IconStar, IconRelation, IconInfo, IconArchiveDoc, IconDelete, IconPair, IconUnpair, IconArchiveMaster, IconArchiveDetail } from '../../../helper';
|
|
13
|
+
import { hasDetailRelations, hasMasterRelations, isXMLFileExt } from '../../../helper/dcmtsHelper';
|
|
14
|
+
import { Gutters, TMColors } from '../../../utils/theme';
|
|
15
|
+
import { StyledFormButtonsContainer, StyledLoadingContainer, StyledModalContainer, StyledReferenceButton, StyledSpinner, StyledToolbarCardContainer } from '../../base/Styled';
|
|
16
|
+
import ShowAlert from '../../base/TMAlert';
|
|
17
|
+
import TMButton from '../../base/TMButton';
|
|
18
|
+
import { TMExceptionBoxManager, TMMessageBoxManager, ButtonNames } from '../../base/TMPopUp';
|
|
19
|
+
import TMSpinner, { Spinner } from '../../base/TMSpinner';
|
|
20
|
+
import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
|
21
|
+
import TMDistinctValues from '../../choosers/TMDistinctValues';
|
|
22
|
+
import TMFormulaEditor, { FormulaDescriptor, FormulaHelper, FormulaTargets } from '../../editors/TMFormulaEditor';
|
|
23
|
+
import TMMetadataValues, { AdvancedMenuButtons } from '../../editors/TMMetadataValues';
|
|
24
|
+
import { TMSaveFormButtonPrevious, TMSaveFormButtonNext, TMSaveFormButtonSave, TMSaveFormButtonUndo } from '../../forms/TMSaveForm';
|
|
25
|
+
import TMShowAllOrMaxItemsButton from '../../base/TMShowAllOrMaxItemsButton';
|
|
26
|
+
import TMFileUploader from '../../features/documents/TMFileUploader';
|
|
27
|
+
import TMMasterDetailDcmts from './TMMasterDetailDcmts';
|
|
28
|
+
import TMDcmtBlog from './TMDcmtBlog';
|
|
29
|
+
import { useInputAttachmentsDialog } from '../../../hooks/useInputDialog';
|
|
30
|
+
import TMModal from '../../base/TMModal';
|
|
31
|
+
import TMChooserForm from '../../forms/TMChooserForm';
|
|
32
|
+
import TMSearchResult from '../search/TMSearchResult';
|
|
33
|
+
import { useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
|
|
34
|
+
import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
|
|
35
|
+
import { TMPanelManagerWithPersistenceProvider } from '../../layout/panelManager/TMPanelManagerWithPersistenceProvider';
|
|
36
|
+
import { useWorkflowApprove } from '../../../hooks/useWorkflowApprove';
|
|
37
|
+
import ToppyHelpCenter from '../assistant/ToppyHelpCenter';
|
|
38
|
+
import TMBlogCommentForm from '../blog/TMBlogCommentForm';
|
|
39
|
+
import WFDiagram from '../workflow/diagram/WFDiagram';
|
|
40
|
+
import TMTooltip from '../../base/TMTooltip';
|
|
41
|
+
import TMDcmtTasks from './TMDcmtTasks';
|
|
42
|
+
import TMToppyMessage from '../../../helper/TMToppyMessage';
|
|
43
|
+
import { getTaskAssignedToMe } from '../tasks/TMTasksUtils';
|
|
44
|
+
import TMCustomButton from '../../base/TMCustomButton';
|
|
45
|
+
let abortControllerLocal = new AbortController();
|
|
46
|
+
//#endregion
|
|
47
|
+
const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, showHeader = true, onSaveRecents, layoutMode = LayoutModes.Update, showBackButton = true, onClose, onSavedAsyncCallback, TID, DID, formMode = FormModes.Update, canNext, canPrev, count, itemIndex, onNext, onPrev, allowNavigation = true, allowRelations = true, isClosable = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, showDcmtFormSidebar = true, invokedByTodo = false, titleModal, isModal = false, widthModal = "100%", heightModal = "100%", groupId, onWFOperationCompleted, onTaskCompleted, onTaskCreateRequest, inputFile = null, taskFormDialogComponent, taskMoreInfo, connectorFileSave = undefined, inputMids = [], onOpenS4TViewerRequest, s4TViewerDialogComponent, enableDragDropOverlay = false, passToSearch, isSharedDcmt = false, sharedSourceTID, sharedSourceDID, allowButtonsRefs = false, onReferenceClick, }) => {
|
|
48
|
+
const [id, setID] = useState('');
|
|
49
|
+
const [showWaitPanelLocal, setShowWaitPanelLocal] = useState(false);
|
|
50
|
+
const [waitPanelTitleLocal, setWaitPanelTitleLocal] = useState('');
|
|
51
|
+
const [showPrimaryLocal, setShowPrimaryLocal] = useState(false);
|
|
52
|
+
const [waitPanelTextPrimaryLocal, setWaitPanelTextPrimaryLocal] = useState('');
|
|
53
|
+
const [waitPanelValuePrimaryLocal, setWaitPanelValuePrimaryLocal] = useState(0);
|
|
54
|
+
const [waitPanelMaxValuePrimaryLocal, setWaitPanelMaxValuePrimaryLocal] = useState(0);
|
|
55
|
+
const [showSecondaryLocal, setShowSecondaryLocal] = useState(false);
|
|
56
|
+
const [waitPanelTextSecondaryLocal, setWaitPanelTextSecondaryLocal] = useState('');
|
|
57
|
+
const [waitPanelValueSecondaryLocal, setWaitPanelValueSecondaryLocal] = useState(0);
|
|
58
|
+
const [waitPanelMaxValueSecondaryLocal, setWaitPanelMaxValueSecondaryLocal] = useState(0);
|
|
59
|
+
const [useWaitPanelLocalState, setUseWaitPanelLocalState] = useState(false);
|
|
60
|
+
const [formData, setFormData] = useState([]);
|
|
61
|
+
const [formDataOrig, setFormDataOrig] = useState([]);
|
|
62
|
+
const [validationItems, setValidationItems] = useState([]);
|
|
63
|
+
const [fromDTD, setFromDTD] = useState();
|
|
64
|
+
const [showApprovePopup, setShowApprovePopup] = useState(false);
|
|
65
|
+
const [showRejectPopup, setShowRejectPopup] = useState(false);
|
|
66
|
+
const [showReAssignPopup, setShowReAssignPopup] = useState(false);
|
|
67
|
+
const [showMoreInfoPopup, setShowMoreInfoPopup] = useState(false);
|
|
68
|
+
const [layout, setLayout] = useState();
|
|
69
|
+
const [customButtonsLayout, setCustomButtonsLayout] = useState();
|
|
70
|
+
const [customButton, setCustomButton] = useState();
|
|
71
|
+
const appliedInputMidsRef = useRef(null);
|
|
72
|
+
// Refs per evitare stale closure nei callback
|
|
73
|
+
// I useCallback catturano i valori delle dipendenze al momento della creazione.
|
|
74
|
+
// Questi ref vengono sincronizzati tramite useEffect e permettono di accedere
|
|
75
|
+
// sempre ai valori correnti senza dover ricreare i callback ad ogni cambio di stato.
|
|
76
|
+
const formDataOrigRef = useRef([]);
|
|
77
|
+
const formDataRef = useRef([]);
|
|
78
|
+
const fromDTDRef = useRef();
|
|
79
|
+
const dcmtFileRef = useRef(null);
|
|
80
|
+
const [isOpenDetails, setIsOpenDetails] = useState(false);
|
|
81
|
+
const [isOpenMaster, setIsOpenMaster] = useState(false);
|
|
82
|
+
const [secondaryMasterDcmts, setSecondaryMasterDcmts] = useState([]);
|
|
83
|
+
const [isOpenDistinctValues, setIsOpenDistinctValues] = useState(false);
|
|
84
|
+
const [isOpenFormulaEditor, setIsOpenFormulaEditor] = useState(false);
|
|
85
|
+
const [currentTIDHasDetailRelations, setCurrentTIDHasDetailRelations] = useState();
|
|
86
|
+
const [currentTIDHasMasterRelations, setCurrentTIDHasMasterRelations] = useState();
|
|
87
|
+
const [currentDcmt, setCurrentDcmt] = useState();
|
|
88
|
+
const [dcmtFile, setDcmtFile] = useState(null);
|
|
89
|
+
const [focusedMetadataValue, setFocusedMetadataValue] = useState();
|
|
90
|
+
const [showAll, setShowAll] = useState(layoutMode === LayoutModes.Ark);
|
|
91
|
+
const [fetchError, setFetchError] = useState(false);
|
|
92
|
+
const [isWFDataLoading, setIsWFDataLoading] = useState(false);
|
|
93
|
+
const [workItems, setWorkItems] = useState([]);
|
|
94
|
+
const [workflows, setWorkflows] = useState([]);
|
|
95
|
+
const [showCommentForm, setShowCommentForm] = useState(false);
|
|
96
|
+
const [isInitialLoading, setIsInitialLoading] = useState(true);
|
|
97
|
+
const [isNavigating, setIsNavigating] = useState(false);
|
|
98
|
+
const [dcmtReferences, setDcmtReferences] = useState(undefined);
|
|
99
|
+
// Dcmt Blog states
|
|
100
|
+
const [blogsDatasource, setBlogsDatasource] = useState([]);
|
|
101
|
+
const [hasLoadedDataOnce, setHasLoadedDataOnce] = useState(false); //traccia se *qualsiasi* dato è stato caricato per la prima volta
|
|
102
|
+
const [lastLoadedDid, setLastLoadedDid] = useState(undefined); // `lastLoadedDid` tiene traccia dell'ultimo `did` per cui abbiamo caricato i dati
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
if (!allowButtonsRefs)
|
|
105
|
+
setDcmtReferences(undefined);
|
|
106
|
+
}, [allowButtonsRefs]);
|
|
107
|
+
const { openConfirmAttachmentsDialog, ConfirmAttachmentsDialog } = useInputAttachmentsDialog();
|
|
108
|
+
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync } = useDcmtOperations();
|
|
109
|
+
const { workflowApproveData } = useWorkflowApprove();
|
|
110
|
+
const currentSearchResults = useMemo(() => {
|
|
111
|
+
if (!formData || formData.length === 0 || !TID || !DID)
|
|
112
|
+
return [];
|
|
113
|
+
const selectMIDs = [];
|
|
114
|
+
const rowValues = [];
|
|
115
|
+
formData.forEach(md => {
|
|
116
|
+
if (md.mid !== undefined) {
|
|
117
|
+
selectMIDs.push(md.mid);
|
|
118
|
+
rowValues.push(md.value);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
const searchResult = {
|
|
122
|
+
fromTID: TID,
|
|
123
|
+
selectMIDs: selectMIDs,
|
|
124
|
+
dtdResult: {
|
|
125
|
+
rows: [rowValues],
|
|
126
|
+
columns: selectMIDs.map(mid => ({ name: `MID_${mid}` }))
|
|
127
|
+
},
|
|
128
|
+
dcmtsFound: 1,
|
|
129
|
+
dcmtsReturned: 1
|
|
130
|
+
};
|
|
131
|
+
return [searchResult];
|
|
132
|
+
}, [formData, TID, DID]);
|
|
133
|
+
const relatedDocuments = useRelatedDocuments({
|
|
134
|
+
selectedSearchResult: TID ? { fromTID: Number(TID) } : undefined,
|
|
135
|
+
focusedItem: currentDcmt ? { TID: currentDcmt.tid, DID: currentDcmt.did, rowIndex: 0 } : undefined,
|
|
136
|
+
currentSearchResults: currentSearchResults
|
|
137
|
+
});
|
|
138
|
+
const { relatedDcmts, showRelatedDcmtsChooser, archiveType, isOpenArchiveRelationForm, archiveRelatedDcmtFormTID, archiveRelatedDcmtFormMids, relatedDcmtsChooserDataSource, showManyToManyChooser, manyToManyChooserDataSource, manyToManyRelations, isPairingManyToMany, showPairDcmtsModal, pairedSearchResults, pairFloatingActionConfig, hasManyToManyRelation, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, archiveMasterDocuments, archiveDetailDocuments, checkRelatedDcmtsArchiveCapability, checkManyToManyCapability, setShowRelatedDcmtsChooser, setShowManyToManyChooser, setShowPairDcmtsModal, setIsOpenArchiveRelationForm, setArchiveType, setArchiveRelatedDcmtFormTID, setArchiveRelatedDcmtFormMids, archiveRelatedDcmtHandler, executeManyToManyPairing } = relatedDocuments;
|
|
139
|
+
const fetchErrorShownRef = useRef(false);
|
|
140
|
+
useEffect(() => {
|
|
141
|
+
if (!TID)
|
|
142
|
+
return;
|
|
143
|
+
checkRelatedDcmtsArchiveCapability();
|
|
144
|
+
checkManyToManyCapability();
|
|
145
|
+
}, [TID, checkRelatedDcmtsArchiveCapability, checkManyToManyCapability]);
|
|
146
|
+
const deviceType = useDeviceType();
|
|
147
|
+
const getDcmts = useCallback(() => {
|
|
148
|
+
return [{ TID: currentDcmt?.tid, DID: currentDcmt?.did, FILEEXT: currentDcmt?.fileExt }];
|
|
149
|
+
}, [currentDcmt?.tid, currentDcmt?.did, currentDcmt?.fileExt]);
|
|
150
|
+
const handleReset = useCallback(() => {
|
|
151
|
+
setDcmtFile(null);
|
|
152
|
+
}, []);
|
|
153
|
+
const setMetadataList = useCallback(async (mdList, getMetadataResult = undefined, archived = false, currentDID) => {
|
|
154
|
+
try {
|
|
155
|
+
let did = currentDID ?? DID;
|
|
156
|
+
if (!did)
|
|
157
|
+
return;
|
|
158
|
+
TMSpinner.show({ description: 'Loading Metadata...' });
|
|
159
|
+
let res = getMetadataResult ?? await SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(TID, did, true);
|
|
160
|
+
let dtd = res?.dtdResult;
|
|
161
|
+
let rows = dtd.rows ? dtd.rows[0] : [];
|
|
162
|
+
let mids = res?.selectMIDs;
|
|
163
|
+
let metadataList = searchResultToMetadataValues(TID, dtd, rows, mids, mdList, layoutMode);
|
|
164
|
+
if (archived) {
|
|
165
|
+
// Usa setFormData con funzione callback per accedere allo stato precedente
|
|
166
|
+
// invece di dipendere da formDataOrig nell'array di dipendenze
|
|
167
|
+
setFormData(prevFormDataOrig => {
|
|
168
|
+
let tempMetadataList = [];
|
|
169
|
+
for (let md of metadataList) {
|
|
170
|
+
if (md.value === null) {
|
|
171
|
+
if (prevFormDataOrig.find(metadata => metadata.mid === md.mid)?.value === '') {
|
|
172
|
+
tempMetadataList.push({ ...md, value: '' });
|
|
173
|
+
}
|
|
174
|
+
if (prevFormDataOrig.find(metadata => metadata.mid === md.mid)?.value === undefined) {
|
|
175
|
+
tempMetadataList.push({ ...md, value: undefined });
|
|
176
|
+
}
|
|
177
|
+
if (prevFormDataOrig.find(metadata => metadata.mid === md.mid)?.value === null) {
|
|
178
|
+
tempMetadataList.push(md);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
tempMetadataList.push(md);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return tempMetadataList;
|
|
186
|
+
});
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
setFormDataOrig(structuredClone(metadataList));
|
|
190
|
+
setFormData(structuredClone(metadataList));
|
|
191
|
+
// Sincronizza il ref con i dati caricati per evitare stale closure in handleSave
|
|
192
|
+
formDataOrigRef.current = structuredClone(metadataList);
|
|
193
|
+
}
|
|
194
|
+
catch (e) {
|
|
195
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
196
|
+
}
|
|
197
|
+
finally {
|
|
198
|
+
TMSpinner.hide();
|
|
199
|
+
}
|
|
200
|
+
}, [TID, DID, layoutMode]);
|
|
201
|
+
const fetchData = useCallback(async () => {
|
|
202
|
+
try {
|
|
203
|
+
setFetchError(false);
|
|
204
|
+
if (!TID)
|
|
205
|
+
return;
|
|
206
|
+
if (!DID && layoutMode === LayoutModes.Update)
|
|
207
|
+
return;
|
|
208
|
+
// Esegui chiamate in parallelo per ottimizzare le performance
|
|
209
|
+
const parallelCalls = [
|
|
210
|
+
// 1. GetMetadataAsync - solo se layoutMode === Update
|
|
211
|
+
layoutMode === LayoutModes.Update
|
|
212
|
+
? SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(TID, DID, true) ?? Promise.resolve(undefined)
|
|
213
|
+
: Promise.resolve(undefined),
|
|
214
|
+
// 2. Layout per il layoutMode corrente
|
|
215
|
+
LayoutCacheService.GetAsync(TID, layoutMode),
|
|
216
|
+
// 3. CustomButtonsLayout - solo se layoutMode === Update
|
|
217
|
+
layoutMode === LayoutModes.Update
|
|
218
|
+
? LayoutCacheService.GetAsync(TID, LayoutModes.None)
|
|
219
|
+
: Promise.resolve(undefined),
|
|
220
|
+
// 4. Opcionalmente FindAllReferencesAsync se abilitato nelle impostazioni e se i bottoni sono richiesti
|
|
221
|
+
(() => {
|
|
222
|
+
const refs = SDKUI_Globals?.userSettings?.searchSettings?.autoFindReferences ?? [];
|
|
223
|
+
const hasRefs = allowButtonsRefs && Array.isArray(refs) && refs.length > 0;
|
|
224
|
+
return hasRefs
|
|
225
|
+
? SDK_Globals.tmSession?.NewSearchEngine().FindAllReferencesAsync(TID, DID, refs) ?? Promise.resolve(undefined)
|
|
226
|
+
: Promise.resolve(undefined);
|
|
227
|
+
})()
|
|
228
|
+
];
|
|
229
|
+
const results = await Promise.all(parallelCalls);
|
|
230
|
+
// Destructuring: first three are always the original ones, fourth is references (or undefined)
|
|
231
|
+
const getMetadataResult = results[0];
|
|
232
|
+
const resLayout = results[1];
|
|
233
|
+
const customButtonsLayoutResult = results[2];
|
|
234
|
+
const findRefsResult = results[3];
|
|
235
|
+
// Save references result into state (may be undefined)
|
|
236
|
+
setDcmtReferences(findRefsResult);
|
|
237
|
+
// Imposta il layout e customButtonsLayout immediatamente
|
|
238
|
+
setLayout(resLayout);
|
|
239
|
+
if (layoutMode === LayoutModes.Update && customButtonsLayoutResult) {
|
|
240
|
+
setCustomButtonsLayout(customButtonsLayoutResult);
|
|
241
|
+
}
|
|
242
|
+
// Carica DTD e metadata
|
|
243
|
+
let dtd = await DcmtTypeListCacheService.GetWithNotGrantedAsync(TID, DID, getMetadataResult);
|
|
244
|
+
setFromDTD(dtd);
|
|
245
|
+
if (layoutMode === LayoutModes.Update || (layoutMode === LayoutModes.Ark && DID)) {
|
|
246
|
+
await setMetadataList(dtd?.metadata ?? [], getMetadataResult);
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
const renderedMetadata = dtd?.metadata?.filter((metadata) => handleArchiveVisibility(metadata)) ?? [];
|
|
250
|
+
const metadataList = searchResultToMetadataValues(dtd?.id, undefined, [], [], renderedMetadata, layoutMode);
|
|
251
|
+
setFormDataOrig(structuredClone(metadataList));
|
|
252
|
+
setFormData(structuredClone(metadataList));
|
|
253
|
+
formDataOrigRef.current = structuredClone(metadataList);
|
|
254
|
+
}
|
|
255
|
+
(layoutMode === LayoutModes.Ark && !inputFile) && handleReset();
|
|
256
|
+
}
|
|
257
|
+
catch (e) {
|
|
258
|
+
setFetchError(true);
|
|
259
|
+
throw e;
|
|
260
|
+
}
|
|
261
|
+
finally {
|
|
262
|
+
setIsInitialLoading(false);
|
|
263
|
+
setIsNavigating(false);
|
|
264
|
+
}
|
|
265
|
+
}, [TID, DID, layoutMode, inputFile, setMetadataList, handleReset, allowButtonsRefs]);
|
|
266
|
+
const createChange = useCallback((mid, metadataType, modifiedValue) => {
|
|
267
|
+
return { mid, metadataType, modifiedValue };
|
|
268
|
+
}, []);
|
|
269
|
+
const getSpecificChangedKeysWithValues = useCallback((originalList, modifiedList) => {
|
|
270
|
+
const changes = [];
|
|
271
|
+
if (!originalList || !modifiedList)
|
|
272
|
+
return changes;
|
|
273
|
+
const originalMap = new Map(originalList.map(item => [item.mid, item]));
|
|
274
|
+
for (const modified of modifiedList) {
|
|
275
|
+
if (modified.mid === undefined)
|
|
276
|
+
continue;
|
|
277
|
+
const original = originalMap.get(modified.mid);
|
|
278
|
+
if (!original)
|
|
279
|
+
continue;
|
|
280
|
+
if (original.value !== modified.value) {
|
|
281
|
+
changes.push(createChange(modified.mid, modified.md?.dataType ?? MetadataDataTypes.Varchar, modified.value));
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return changes;
|
|
285
|
+
}, [createChange]);
|
|
286
|
+
useEffect(() => { setID(genUniqueId()); }, []);
|
|
287
|
+
// Sincronizza i ref con gli stati correnti per evitare stale closure nei callback.
|
|
288
|
+
// I useCallback catturano le variabili delle dipendenze al momento della loro creazione,
|
|
289
|
+
// quindi se uno stato cambia frequentemente, il callback avrebbe sempre valori vecchi.
|
|
290
|
+
// Usando i ref, possiamo accedere sempre ai valori più recenti senza dover ricreare i callback.
|
|
291
|
+
useEffect(() => {
|
|
292
|
+
formDataRef.current = formData;
|
|
293
|
+
}, [formData]);
|
|
294
|
+
useEffect(() => {
|
|
295
|
+
fromDTDRef.current = fromDTD;
|
|
296
|
+
}, [fromDTD]);
|
|
297
|
+
useEffect(() => {
|
|
298
|
+
dcmtFileRef.current = dcmtFile;
|
|
299
|
+
}, [dcmtFile]);
|
|
300
|
+
useEffect(() => {
|
|
301
|
+
if (!inputFile || inputFile === null)
|
|
302
|
+
return;
|
|
303
|
+
setDcmtFile(inputFile);
|
|
304
|
+
}, [inputFile]);
|
|
305
|
+
useEffect(() => {
|
|
306
|
+
const run = async () => {
|
|
307
|
+
try {
|
|
308
|
+
fetchErrorShownRef.current = false; // Reset flag all'inizio
|
|
309
|
+
// Distinguish between initial load and navigation
|
|
310
|
+
if (isInitialLoading) {
|
|
311
|
+
// First load - keep isInitialLoading true
|
|
312
|
+
await fetchData();
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
// Navigation - use isNavigating instead
|
|
316
|
+
setIsNavigating(true);
|
|
317
|
+
await fetchData();
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
catch (e) {
|
|
321
|
+
// Mostra l'errore solo se non è già stato mostrato (evita duplicati in StrictMode)
|
|
322
|
+
if (!fetchErrorShownRef.current) {
|
|
323
|
+
fetchErrorShownRef.current = true;
|
|
324
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
325
|
+
// Se il caricamento fallisce, chiudi il form
|
|
326
|
+
onClose?.();
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
run();
|
|
331
|
+
}, [TID, DID, fetchData]);
|
|
332
|
+
useEffect(() => {
|
|
333
|
+
if (formData.length > 0) {
|
|
334
|
+
setValidationItems(validateMetadataList(formData));
|
|
335
|
+
const newDcmt = {
|
|
336
|
+
tid: formData.find(o => o.mid == SystemMIDsAsNumber.TID)?.value,
|
|
337
|
+
did: formData.find(o => o.mid == SystemMIDsAsNumber.DID)?.value,
|
|
338
|
+
fileCount: formData.find(o => o.mid == SystemMIDsAsNumber.FileCount)?.value,
|
|
339
|
+
fileSize: formData.find(o => o.mid == SystemMIDsAsNumber.FileSize)?.value,
|
|
340
|
+
fileExt: formData.find(o => o.mid == SystemMIDsAsNumber.FileExt)?.value
|
|
341
|
+
};
|
|
342
|
+
if (!currentDcmt ||
|
|
343
|
+
currentDcmt.tid !== newDcmt.tid ||
|
|
344
|
+
currentDcmt.did !== newDcmt.did ||
|
|
345
|
+
currentDcmt.fileExt !== newDcmt.fileExt ||
|
|
346
|
+
currentDcmt.fileSize !== newDcmt.fileSize ||
|
|
347
|
+
currentDcmt.fileCount !== newDcmt.fileCount) {
|
|
348
|
+
setCurrentDcmt(newDcmt);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}, [formData, formDataOrig, getSpecificChangedKeysWithValues, currentDcmt]);
|
|
352
|
+
useEffect(() => {
|
|
353
|
+
hasDetailRelations(TID).then((value) => setCurrentTIDHasDetailRelations(value));
|
|
354
|
+
hasMasterRelations(TID).then((value) => setCurrentTIDHasMasterRelations(value));
|
|
355
|
+
}, [TID]);
|
|
356
|
+
useEffect(() => {
|
|
357
|
+
if (layoutMode !== LayoutModes.Ark)
|
|
358
|
+
return;
|
|
359
|
+
setFocusedMetadataValue(undefined);
|
|
360
|
+
appliedInputMidsRef.current = null;
|
|
361
|
+
}, [fromDTD, layoutMode]);
|
|
362
|
+
useEffect(() => {
|
|
363
|
+
if (!inputMids || inputMids.length === 0)
|
|
364
|
+
return;
|
|
365
|
+
if (layoutMode !== LayoutModes.Ark)
|
|
366
|
+
return;
|
|
367
|
+
if (!formData || formData.length === 0)
|
|
368
|
+
return;
|
|
369
|
+
if (!formDataOrig || formDataOrig.length === 0)
|
|
370
|
+
return;
|
|
371
|
+
const hasUserMetadata = formData.some(md => md.mid && md.mid > 99);
|
|
372
|
+
if (!hasUserMetadata)
|
|
373
|
+
return;
|
|
374
|
+
if (appliedInputMidsRef.current && deepCompare(appliedInputMidsRef.current, inputMids))
|
|
375
|
+
return;
|
|
376
|
+
let data = structuredClone(formData);
|
|
377
|
+
for (let md of data) {
|
|
378
|
+
if (!md.mid)
|
|
379
|
+
continue;
|
|
380
|
+
if (md.mid > 99) {
|
|
381
|
+
const defaultValue = md.md?.defaultValue;
|
|
382
|
+
if (defaultValue) {
|
|
383
|
+
if (FormulaHelper.isFormula(defaultValue)) {
|
|
384
|
+
md.value = undefined;
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
md.value = defaultValue;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
else if (formDataOrig.find(metadata => metadata.mid === md.mid)?.value === undefined) {
|
|
391
|
+
if (md.value)
|
|
392
|
+
md.value = undefined;
|
|
393
|
+
}
|
|
394
|
+
else if (md.value && md.value.length > 0) {
|
|
395
|
+
md.value = '';
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
inputMids.forEach(inputMid => {
|
|
400
|
+
const md = data.find(m => m.mid === inputMid.mid);
|
|
401
|
+
if (md) {
|
|
402
|
+
md.value = inputMid.value;
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
setFormData(data);
|
|
406
|
+
appliedInputMidsRef.current = inputMids;
|
|
407
|
+
}, [inputMids, layoutMode, formData, formDataOrig]);
|
|
408
|
+
// Memoizza solo il valore WI_SetID per evitare re-render quando altri metadata cambiano
|
|
409
|
+
const workItemSetIDValue = useMemo(() => formData.find(o => o.md?.name === WorkItemMetadataNames.WI_SetID)?.value, [formData]);
|
|
410
|
+
useEffect(() => {
|
|
411
|
+
const loadAllWfData = async () => {
|
|
412
|
+
if (layoutMode !== LayoutModes.Update || !DID) {
|
|
413
|
+
setWorkItems([]);
|
|
414
|
+
setWorkflows([]);
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
setIsWFDataLoading(true);
|
|
418
|
+
try {
|
|
419
|
+
// 1. item da processare in modo sincrono
|
|
420
|
+
const itemsToProcess = [];
|
|
421
|
+
for (const workflow of workflowApproveData) {
|
|
422
|
+
for (const dataRow of workflow.dtdResult?.rows ?? []) {
|
|
423
|
+
const did = Number(dataRow?.[1]);
|
|
424
|
+
if (did === Number(DID)) {
|
|
425
|
+
const tid = Number(dataRow?.[0]);
|
|
426
|
+
itemsToProcess.push({ tid, did });
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
if (itemsToProcess.length === 0) {
|
|
431
|
+
setWorkItems([]);
|
|
432
|
+
setWorkflows([]);
|
|
433
|
+
setIsWFDataLoading(false);
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
// promises per i setID in modo condizionale
|
|
437
|
+
let setIDPromises;
|
|
438
|
+
if (workItemSetIDValue !== undefined) {
|
|
439
|
+
// Se abbiamo il setID dal form, non facciamo chiamate di rete.
|
|
440
|
+
setIDPromises = itemsToProcess.map(() => Promise.resolve(workItemSetIDValue));
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
// Altrimenti, procediamo con le chiamate di rete come prima.
|
|
444
|
+
setIDPromises = itemsToProcess.map(item => getWorkItemSetIDAsync(item.tid, item.did));
|
|
445
|
+
}
|
|
446
|
+
// Crea un array di Promise per tutte le chiamate a GetWFInfoAsync
|
|
447
|
+
const workflowInfoPromises = itemsToProcess.map(item => WorkflowCacheService.GetWFInfoAsync(item.tid));
|
|
448
|
+
// Esegui tutte le chiamate in parallelo e attendi i risultati
|
|
449
|
+
const setIDResults = await Promise.all(setIDPromises);
|
|
450
|
+
const workflowInfoResults = await Promise.all(workflowInfoPromises);
|
|
451
|
+
// Combina i risultati
|
|
452
|
+
const finalWorkItems = itemsToProcess.map((item, index) => ({
|
|
453
|
+
...item,
|
|
454
|
+
setID: setIDResults[index],
|
|
455
|
+
}));
|
|
456
|
+
const validWorkflows = workflowInfoResults.filter(Boolean);
|
|
457
|
+
// Aggiorna lo stato una sola volta con i dati finali
|
|
458
|
+
setWorkItems(finalWorkItems);
|
|
459
|
+
setWorkflows(validWorkflows);
|
|
460
|
+
}
|
|
461
|
+
catch (error) {
|
|
462
|
+
console.error("Errore durante il caricamento dei dati del workflow:", error);
|
|
463
|
+
setWorkItems([]);
|
|
464
|
+
setWorkflows([]);
|
|
465
|
+
}
|
|
466
|
+
finally {
|
|
467
|
+
setIsWFDataLoading(false);
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
if (workItemSetIDValue !== undefined || workflowApproveData.length > 0)
|
|
471
|
+
loadAllWfData();
|
|
472
|
+
}, [workItemSetIDValue, workflowApproveData, DID, layoutMode]);
|
|
473
|
+
const getSelectionDcmtInfo = useCallback(() => {
|
|
474
|
+
let dcmts = [];
|
|
475
|
+
dcmts.push({ TID: TID ?? 0, DID: DID ?? 0 });
|
|
476
|
+
return dcmts;
|
|
477
|
+
}, [TID, DID]);
|
|
478
|
+
const handleAddItem = useCallback((tid, did) => {
|
|
479
|
+
let newItem = { TID: tid ?? 0, DID: did ?? 0 };
|
|
480
|
+
setSecondaryMasterDcmts((prevItems) => [...prevItems, newItem]);
|
|
481
|
+
}, []);
|
|
482
|
+
const handleRemoveItem = useCallback((tid, did) => {
|
|
483
|
+
setSecondaryMasterDcmts((prevItems) => prevItems.filter(item => item.TID !== tid && item.DID !== did));
|
|
484
|
+
}, []);
|
|
485
|
+
const handlePassToSearch = useCallback(() => {
|
|
486
|
+
if (!passToSearch)
|
|
487
|
+
return;
|
|
488
|
+
const outputMids = formData
|
|
489
|
+
.filter(md => md.mid && md.mid > 100 && md.value && md.value.length > 0)
|
|
490
|
+
.map(md => ({ mid: md.mid, value: md.value }));
|
|
491
|
+
passToSearch(outputMids, TID);
|
|
492
|
+
}, [passToSearch, formData, TID]);
|
|
493
|
+
const isPreviewDisabled = useMemo(() => layoutMode === LayoutModes.Ark && fromDTD?.archiveConstraint === ArchiveConstraints.OnlyMetadata, [layoutMode, fromDTD?.archiveConstraint]);
|
|
494
|
+
const isBoardDisabled = useMemo(() => layoutMode !== LayoutModes.Update || fromDTD?.hasBlog !== 1, [layoutMode, fromDTD?.hasBlog]);
|
|
495
|
+
const isSysMetadataDisabled = useMemo(() => layoutMode !== LayoutModes.Update, [layoutMode]);
|
|
496
|
+
const isDetailsDisabled = useMemo(() => layoutMode !== LayoutModes.Update || !DID, [layoutMode, DID]);
|
|
497
|
+
const isMasterDisabled = useMemo(() => layoutMode !== LayoutModes.Update || !DID, [layoutMode, DID]);
|
|
498
|
+
const isWFDisabled = useMemo(() => layoutMode !== LayoutModes.Update || fetchError || workItems.length <= 0, [layoutMode, fetchError, workItems.length]);
|
|
499
|
+
const showToppyForApprove = useMemo(() => layoutMode === LayoutModes.Update && !fetchError && workItems.length > 0 && !isOpenDetails && !isOpenMaster, [layoutMode, fetchError, workItems.length, isOpenDetails, isOpenMaster]);
|
|
500
|
+
const showToppyForCompleteMoreInfo = useMemo(() => layoutMode === LayoutModes.Update && isTaskMoreInfo(taskMoreInfo?.name) && taskMoreInfo?.state !== Task_States.Completed, [layoutMode, taskMoreInfo?.name, taskMoreInfo?.state]);
|
|
501
|
+
const showToppyForReferences = useMemo(() => allowButtonsRefs && layoutMode === LayoutModes.Update && dcmtReferences && dcmtReferences.length > 0 && !isOpenDetails && !isOpenMaster, [allowButtonsRefs, layoutMode, dcmtReferences, isOpenDetails, isOpenMaster]);
|
|
502
|
+
const isMobile = useMemo(() => deviceType === DeviceType.MOBILE, [deviceType]);
|
|
503
|
+
const isApprView = useMemo(() => fromDTD?.templateTID === TemplateTIDs.WF_WIApprView, [fromDTD?.templateTID]);
|
|
504
|
+
const workitemSetID = useMemo(() => workItems.find(o => o.did === Number(DID))?.setID || formData.find(o => o.md?.name === WorkItemMetadataNames.WI_SetID)?.value, [workItems, DID, formData]);
|
|
505
|
+
const approvalVID = useMemo(() => workItems.length > 0 ? Number(workItems[0].tid) : -1, [workItems]);
|
|
506
|
+
//here
|
|
507
|
+
const commandsMenuItems = useMemo(() => {
|
|
508
|
+
const items = [];
|
|
509
|
+
const operationsItems = [];
|
|
510
|
+
operationsItems.push({
|
|
511
|
+
icon: svgToString(_jsx(IconDownload, {})),
|
|
512
|
+
operationType: 'singleRow',
|
|
513
|
+
disabled: fromDTD?.perm?.canRetrieveFile !== AccessLevels.Yes,
|
|
514
|
+
text: SDKUI_Localizator.DownloadFile,
|
|
515
|
+
onClick: async () => await downloadDcmtsAsync(getDcmts(), DownloadTypes.Dcmt, "download")
|
|
516
|
+
}, {
|
|
517
|
+
icon: svgToString(_jsx(IconDownload, {})),
|
|
518
|
+
operationType: 'singleRow',
|
|
519
|
+
disabled: !isXMLFileExt(currentDcmt?.fileExt),
|
|
520
|
+
text: SDKUI_Localizator.DownloadXMLAttachments,
|
|
521
|
+
onClick: async () => await downloadDcmtsAsync(getDcmts(), DownloadTypes.Attachment, "download", undefined, openConfirmAttachmentsDialog)
|
|
522
|
+
});
|
|
523
|
+
if (layoutMode === LayoutModes.Update && DID) {
|
|
524
|
+
operationsItems.push({
|
|
525
|
+
icon: svgToString(_jsx(IconStar, {})),
|
|
526
|
+
text: SDKUI_Localizator.AddTo + ' ' + SDKUI_Localizator.Favorites,
|
|
527
|
+
operationType: 'singleRow',
|
|
528
|
+
disabled: false,
|
|
529
|
+
onClick: async () => {
|
|
530
|
+
await runOperationAsync(getDcmts(), DcmtOperationTypes.AddToFavs);
|
|
531
|
+
},
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
if (onTaskCreateRequest && layoutMode === LayoutModes.Update && DID) {
|
|
535
|
+
operationsItems.push({
|
|
536
|
+
icon: svgToString(_jsx(IconActivity, {})),
|
|
537
|
+
text: SDKUI_Localizator.CreateContextualTask,
|
|
538
|
+
operationType: 'singleRow',
|
|
539
|
+
disabled: false,
|
|
540
|
+
onClick: () => {
|
|
541
|
+
const dcmt = getDcmts()[0];
|
|
542
|
+
const taskContext = {
|
|
543
|
+
document: {
|
|
544
|
+
tid: dcmt.TID,
|
|
545
|
+
did: dcmt.DID,
|
|
546
|
+
name: fromDTD?.description || ''
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
onTaskCreateRequest(taskContext);
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
if (operationsItems.length > 0) {
|
|
554
|
+
items.push({
|
|
555
|
+
icon: svgToString(_jsx(IconCheck, {})),
|
|
556
|
+
text: SDKUI_Localizator.DocumentOperations,
|
|
557
|
+
items: operationsItems
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
if (allowRelations && layoutMode === LayoutModes.Update && DID) {
|
|
561
|
+
const relationsItems = [
|
|
562
|
+
{
|
|
563
|
+
icon: svgToString(_jsx(IconPair, {})),
|
|
564
|
+
text: SDKUI_Localizator.MatchManyDocumentsManyToMany,
|
|
565
|
+
operationType: 'singleRow',
|
|
566
|
+
disabled: !hasManyToManyRelation,
|
|
567
|
+
onClick: async () => await pairManyToMany?.(true)
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
icon: svgToString(_jsx(IconUnpair, {})),
|
|
571
|
+
text: SDKUI_Localizator.UnmatchManyDocumentsManyToMany,
|
|
572
|
+
operationType: 'singleRow',
|
|
573
|
+
disabled: !hasManyToManyRelation,
|
|
574
|
+
onClick: async () => await pairManyToMany?.(false)
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
icon: svgToString(_jsx(IconArchiveMaster, {})),
|
|
578
|
+
text: SDKUI_Localizator.ArchiveMasterDocument,
|
|
579
|
+
operationType: 'singleRow',
|
|
580
|
+
beginGroup: true,
|
|
581
|
+
disabled: canArchiveMasterRelation !== true,
|
|
582
|
+
onClick: async () => { if (TID)
|
|
583
|
+
await archiveMasterDocuments?.(TID); }
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
icon: svgToString(_jsx(IconArchiveDetail, {})),
|
|
587
|
+
text: SDKUI_Localizator.ArchiveDetailDocument,
|
|
588
|
+
operationType: 'singleRow',
|
|
589
|
+
disabled: canArchiveDetailRelation !== true,
|
|
590
|
+
onClick: async () => { if (TID)
|
|
591
|
+
await archiveDetailDocuments?.(TID); }
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
icon: svgToString(_jsx(IconDetailDcmts, { transform: 'scale(-1, 1)' })),
|
|
595
|
+
text: SDKUI_Localizator.DcmtsMaster,
|
|
596
|
+
operationType: 'singleRow',
|
|
597
|
+
visible: true,
|
|
598
|
+
beginGroup: true,
|
|
599
|
+
disabled: !currentTIDHasMasterRelations || isMasterDisabled,
|
|
600
|
+
onClick: () => { if (!isMasterDisabled)
|
|
601
|
+
setIsOpenMaster(!isOpenMaster); }
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
icon: svgToString(_jsx(IconDetailDcmts, {})),
|
|
605
|
+
text: SDKUI_Localizator.DcmtsDetail,
|
|
606
|
+
operationType: 'singleRow',
|
|
607
|
+
disabled: !currentTIDHasDetailRelations || isDetailsDisabled,
|
|
608
|
+
visible: true,
|
|
609
|
+
onClick: () => { if (!isDetailsDisabled)
|
|
610
|
+
setIsOpenDetails(!isOpenDetails); }
|
|
611
|
+
}
|
|
612
|
+
];
|
|
613
|
+
items.push({
|
|
614
|
+
icon: svgToString(_jsx(IconRelation, {})),
|
|
615
|
+
text: SDKUI_Localizator.Relations,
|
|
616
|
+
items: relationsItems
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
if (layoutMode === LayoutModes.Update && DID) {
|
|
620
|
+
const fullTextItems = [
|
|
621
|
+
{
|
|
622
|
+
icon: svgToString(_jsx(IconInfo, {})),
|
|
623
|
+
text: SDKUI_Localizator.IndexingInformation,
|
|
624
|
+
operationType: 'singleRow',
|
|
625
|
+
disabled: false,
|
|
626
|
+
onClick: async () => {
|
|
627
|
+
try {
|
|
628
|
+
TMSpinner.show({ description: `${SDKUI_Localizator.Loading}...` });
|
|
629
|
+
const dcmts = getDcmts();
|
|
630
|
+
const msg = await SDK_Globals.tmSession?.NewSearchEngine().FreeSearchGetDcmtInfoAsync(dcmts[0].TID, dcmts[0].DID);
|
|
631
|
+
TMMessageBoxManager.show({ buttons: [ButtonNames.OK], message: msg, title: SDKUI_Localizator.IndexingInformation });
|
|
632
|
+
}
|
|
633
|
+
catch (e) {
|
|
634
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
635
|
+
}
|
|
636
|
+
finally {
|
|
637
|
+
TMSpinner.hide();
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
icon: svgToString(_jsx(IconArchiveDoc, {})),
|
|
643
|
+
text: SDKUI_Localizator.IndexOrReindex,
|
|
644
|
+
operationType: 'singleRow',
|
|
645
|
+
disabled: false,
|
|
646
|
+
onClick: async () => {
|
|
647
|
+
await runOperationAsync(getDcmts(), DcmtOperationTypes.FreeSearchReindex);
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
icon: svgToString(_jsx(IconDelete, {})),
|
|
652
|
+
text: SDKUI_Localizator.IndexingDelete,
|
|
653
|
+
operationType: 'singleRow',
|
|
654
|
+
disabled: false,
|
|
655
|
+
onClick: async () => {
|
|
656
|
+
await runOperationAsync(getDcmts(), DcmtOperationTypes.FreeSearchPurge);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
];
|
|
660
|
+
items.push({
|
|
661
|
+
icon: svgToString(_jsx(IconSearch, {})),
|
|
662
|
+
text: SDKUI_Localizator.FullTextSearch,
|
|
663
|
+
items: fullTextItems
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
// Aggiungi submenu "Bottoni personalizzati" se esistono customButtons
|
|
667
|
+
if (customButtonsLayout?.customButtons && Array.isArray(customButtonsLayout.customButtons) && customButtonsLayout.customButtons.length > 0) {
|
|
668
|
+
const customButtonsItems = customButtonsLayout.customButtons
|
|
669
|
+
.filter((customButton) => customButton.isForUpdate && customButton.isForUpdate > 0)
|
|
670
|
+
.map((customButton) => ({
|
|
671
|
+
icon: svgToString(TMImageLibrary({ imageID: customButton.glyphID, showPath: true })),
|
|
672
|
+
text: customButton.title || 'Bottone personalizzato',
|
|
673
|
+
onClick: () => setCustomButton(customButton)
|
|
674
|
+
}));
|
|
675
|
+
items.push({
|
|
676
|
+
icon: svgToString(_jsx(IconCheck, {})),
|
|
677
|
+
text: SDKUI_Localizator.CustomButtons,
|
|
678
|
+
items: customButtonsItems
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
return items;
|
|
682
|
+
}, [
|
|
683
|
+
fromDTD?.perm?.canRetrieveFile,
|
|
684
|
+
fromDTD?.description,
|
|
685
|
+
currentDcmt?.fileExt,
|
|
686
|
+
allowRelations,
|
|
687
|
+
currentTIDHasMasterRelations,
|
|
688
|
+
isMasterDisabled,
|
|
689
|
+
currentTIDHasDetailRelations,
|
|
690
|
+
isDetailsDisabled,
|
|
691
|
+
customButtonsLayout,
|
|
692
|
+
layoutMode,
|
|
693
|
+
TID,
|
|
694
|
+
DID,
|
|
695
|
+
onTaskCreateRequest,
|
|
696
|
+
hasManyToManyRelation,
|
|
697
|
+
canArchiveMasterRelation,
|
|
698
|
+
canArchiveDetailRelation,
|
|
699
|
+
pairManyToMany,
|
|
700
|
+
archiveMasterDocuments,
|
|
701
|
+
archiveDetailDocuments,
|
|
702
|
+
getDcmts,
|
|
703
|
+
downloadDcmtsAsync,
|
|
704
|
+
runOperationAsync,
|
|
705
|
+
openConfirmAttachmentsDialog
|
|
706
|
+
]);
|
|
707
|
+
const isModified = useMemo(() => calcIsModified(formData, formDataOrig), [formData, formDataOrig]);
|
|
708
|
+
const formToolbar = useMemo(() => _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [allowNavigation && canPrev != undefined && _jsx("p", { style: { textAlign: 'center', padding: '1px 4px', display: 'flex' }, children: `${itemIndex}/${count}` }), allowNavigation && canPrev != undefined && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', iconColor: 'white', isModified: isModified, formMode: formMode, canPrev: canPrev, onPrev: onPrev }), allowNavigation && canNext != undefined && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', iconColor: 'white', isModified: isModified, formMode: formMode, canNext: canNext, onNext: onNext }), layoutMode === LayoutModes.Update && _jsx(IconMenuVertical, { id: `commands-detail-${id}`, color: 'white', cursor: 'pointer' }), layoutMode === LayoutModes.Update && _jsx(ContextMenu, { showEvent: 'click', dataSource: commandsMenuItems, target: `#commands-detail-${id}` }), layoutMode === LayoutModes.Ark &&
|
|
709
|
+
_jsx(TMTooltip, { content: SDKUI_Localizator.PassToSearch, position: 'bottom', children: _jsx(IconSearch, { style: { cursor: 'pointer' }, onClick: handlePassToSearch }) })] }), [allowNavigation, canPrev, canNext, itemIndex, count, isModified, formMode, onPrev, onNext, layoutMode, id, commandsMenuItems, handlePassToSearch]);
|
|
710
|
+
const handleUndo = useCallback(() => {
|
|
711
|
+
setFormData(structuredClone(formDataOrig));
|
|
712
|
+
}, [formDataOrig]);
|
|
713
|
+
const handleConfirmAction = useCallback(async () => {
|
|
714
|
+
TMMessageBoxManager.show({
|
|
715
|
+
parentId: isModal ? "TMDcmtFormShowConfirmForClose-" + id : undefined,
|
|
716
|
+
buttons: [ButtonNames.YES, ButtonNames.NO],
|
|
717
|
+
message: layoutMode === LayoutModes.Update ? SDKUI_Localizator.SaveQuestion : 'Sei sicuro di voler archiviare questo documento?',
|
|
718
|
+
onButtonClick(e) {
|
|
719
|
+
if (e !== ButtonNames.YES)
|
|
720
|
+
return;
|
|
721
|
+
layoutMode === LayoutModes.Update ? handleSave() : handleArchiveCompleted();
|
|
722
|
+
},
|
|
723
|
+
});
|
|
724
|
+
}, [isModal, id, layoutMode]);
|
|
725
|
+
const handleSave = useCallback(async () => {
|
|
726
|
+
const ue = new UpdateEngineByID(SDK_Globals.tmSession);
|
|
727
|
+
ue.DID = DID;
|
|
728
|
+
ue.TID = TID;
|
|
729
|
+
ue.Metadata_ClearAll();
|
|
730
|
+
try {
|
|
731
|
+
TMSpinner.show({ description: 'Aggiornamento in corso...' });
|
|
732
|
+
// Usa i ref invece degli stati per evitare stale closure.
|
|
733
|
+
// handleSave è un useCallback che verrebbe ricreato ogni volta che formData/formDataOrig cambiano,
|
|
734
|
+
// causando problemi di performance. Usando i ref, possiamo mantenere lo stesso callback
|
|
735
|
+
// ma accedere sempre ai valori correnti tramite formDataRef.current e formDataOrigRef.current.
|
|
736
|
+
const changes = getSpecificChangedKeysWithValues(formDataOrigRef.current, formDataRef.current);
|
|
737
|
+
for (let metadata of changes) {
|
|
738
|
+
if (!metadata.modifiedValue)
|
|
739
|
+
ue.Metadata_AddNull(metadata.mid);
|
|
740
|
+
else {
|
|
741
|
+
switch (metadata.metadataType) {
|
|
742
|
+
case MetadataDataTypes.DateTime:
|
|
743
|
+
ue.Metadata_AddDateTime(metadata.mid, new Date(metadata.modifiedValue));
|
|
744
|
+
break;
|
|
745
|
+
case MetadataDataTypes.Number:
|
|
746
|
+
ue.Metadata_AddNumber(metadata.mid, metadata.modifiedValue);
|
|
747
|
+
break;
|
|
748
|
+
case MetadataDataTypes.Varchar:
|
|
749
|
+
ue.Metadata_AddString(metadata.mid, metadata.modifiedValue);
|
|
750
|
+
break;
|
|
751
|
+
default: ue.Metadata_AddNull(metadata.mid);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
await ue.UpdateAsync();
|
|
756
|
+
// Aggiorna lo stato locale immediatamente dopo il salvataggio riuscito
|
|
757
|
+
// Questo garantisce che isModified diventi false anche se il reload fallisce
|
|
758
|
+
const savedFormData = structuredClone(formDataRef.current);
|
|
759
|
+
setFormDataOrig(savedFormData);
|
|
760
|
+
formDataOrigRef.current = savedFormData;
|
|
761
|
+
// Tenta di ottenere i metadati aggiornati
|
|
762
|
+
let metadataResult = undefined;
|
|
763
|
+
let hasGetMetadataError = false;
|
|
764
|
+
try {
|
|
765
|
+
metadataResult = await SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(TID, DID, true);
|
|
766
|
+
}
|
|
767
|
+
catch (metadataError) {
|
|
768
|
+
hasGetMetadataError = true;
|
|
769
|
+
// Estrai ErrorCode dal campo detail se disponibile
|
|
770
|
+
let errorCode = undefined;
|
|
771
|
+
if (metadataError?.isApiException && metadataError?.response?.detail) {
|
|
772
|
+
try {
|
|
773
|
+
const detailObj = JSON.parse(metadataError.response.detail);
|
|
774
|
+
errorCode = detailObj?.ErrorCode;
|
|
775
|
+
}
|
|
776
|
+
catch (parseError) {
|
|
777
|
+
console.log("Impossibile parsare il detail dell'eccezione:", parseError);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
// Se ErrorCode è -5, mostra messaggio personalizzato, altrimenti mostra l'eccezione originale
|
|
781
|
+
if (errorCode === -5) {
|
|
782
|
+
TMMessageBoxManager.show({
|
|
783
|
+
message: SDKUI_Localizator.DcmtOutOfView,
|
|
784
|
+
buttons: [ButtonNames.OK],
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
else {
|
|
788
|
+
TMExceptionBoxManager.show({ exception: metadataError });
|
|
789
|
+
}
|
|
790
|
+
// Usa null per indicare al callback che c'è stato un errore e non deve ritentare
|
|
791
|
+
metadataResult = null;
|
|
792
|
+
}
|
|
793
|
+
// Esegui sempre il callback:
|
|
794
|
+
// - Se metadataResult è un oggetto: refresh normale
|
|
795
|
+
// - Se metadataResult è null: GetMetadataAsync fallito, rimuove il documento dalla griglia senza ritentare
|
|
796
|
+
// - Se metadataResult è undefined: nessun parametro passato, il callback può decidere cosa fare
|
|
797
|
+
await onSavedAsyncCallback?.(TID, DID, metadataResult === null ? null : metadataResult);
|
|
798
|
+
// Mostra messaggio di successo solo se non ci sono stati errori critici
|
|
799
|
+
if (!hasGetMetadataError) {
|
|
800
|
+
if (metadataResult && metadataResult !== null) {
|
|
801
|
+
// Usa fromDTDRef.current invece di fromDTD per evitare stale closure.
|
|
802
|
+
// fromDTD potrebbe essere undefined/vuoto nel callback se lo stato è cambiato,
|
|
803
|
+
// mentre fromDTDRef.current contiene sempre il valore corrente sincronizzato tramite useEffect.
|
|
804
|
+
await setMetadataList(fromDTDRef.current?.metadata ?? [], metadataResult);
|
|
805
|
+
}
|
|
806
|
+
ShowAlert({ mode: 'success', title: 'Form di documento', message: 'Le modifiche sono state salvate con successo', duration: 3000 });
|
|
807
|
+
}
|
|
808
|
+
else
|
|
809
|
+
onClose?.();
|
|
810
|
+
}
|
|
811
|
+
catch (e) {
|
|
812
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
813
|
+
}
|
|
814
|
+
finally {
|
|
815
|
+
TMSpinner.hide();
|
|
816
|
+
}
|
|
817
|
+
}, [DID, TID, getSpecificChangedKeysWithValues, onSavedAsyncCallback, onClose, setMetadataList]);
|
|
818
|
+
const handleArchiveCompleted = useCallback(async () => {
|
|
819
|
+
let firstBlock = true;
|
|
820
|
+
let maxFileSize = 0;
|
|
821
|
+
let operationTitle = 'Archiviazione';
|
|
822
|
+
setUseWaitPanelLocalState(true);
|
|
823
|
+
setShowWaitPanelLocal(true);
|
|
824
|
+
setShowPrimaryLocal(false);
|
|
825
|
+
setShowSecondaryLocal(true);
|
|
826
|
+
setWaitPanelTitleLocal(operationTitle);
|
|
827
|
+
abortControllerLocal = new AbortController();
|
|
828
|
+
const ae = new ArchiveEngineByID(SDK_Globals.tmSession);
|
|
829
|
+
ae.TID = TID;
|
|
830
|
+
ae.Metadata_ClearAll();
|
|
831
|
+
try {
|
|
832
|
+
// Usa formDataRef.current invece di formData per evitare stale closure.
|
|
833
|
+
// Questo garantisce di avere sempre i valori più recenti dei metadati da archiviare.
|
|
834
|
+
for (let metadata of formDataRef.current) {
|
|
835
|
+
if (!metadata.value)
|
|
836
|
+
continue;
|
|
837
|
+
switch (metadata.md?.dataType) {
|
|
838
|
+
case MetadataDataTypes.DateTime:
|
|
839
|
+
ae.Metadata_AddDateTime(metadata.mid, new Date(metadata.value));
|
|
840
|
+
break;
|
|
841
|
+
case MetadataDataTypes.Number:
|
|
842
|
+
ae.Metadata_AddNumber(metadata.mid, parseFloat(metadata.value));
|
|
843
|
+
break;
|
|
844
|
+
case MetadataDataTypes.Varchar:
|
|
845
|
+
ae.Metadata_AddString(metadata.mid, metadata.value);
|
|
846
|
+
break;
|
|
847
|
+
default: ae.Metadata_AddNull(metadata.mid);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
if (connectorFileSave) {
|
|
851
|
+
let file = await connectorFileSave();
|
|
852
|
+
ae.ArchivingFile = file;
|
|
853
|
+
}
|
|
854
|
+
else {
|
|
855
|
+
ae.ArchivingFile = dcmtFileRef.current;
|
|
856
|
+
}
|
|
857
|
+
if (isSharedDcmt && sharedSourceTID && sharedSourceDID) {
|
|
858
|
+
const sharedDcmt = new TID_DID();
|
|
859
|
+
sharedDcmt.tid = sharedSourceTID;
|
|
860
|
+
sharedDcmt.did = sharedSourceDID;
|
|
861
|
+
ae.SharedDcmt = sharedDcmt;
|
|
862
|
+
}
|
|
863
|
+
let newDID = await ae.ArchiveAsync(abortControllerLocal.signal, (pd) => {
|
|
864
|
+
if (firstBlock) {
|
|
865
|
+
maxFileSize = pd.ProgressBarMaximum ?? 0;
|
|
866
|
+
setWaitPanelMaxValueSecondaryLocal(maxFileSize);
|
|
867
|
+
firstBlock = false;
|
|
868
|
+
}
|
|
869
|
+
setWaitPanelValueSecondaryLocal(pd.ProgressBarValue);
|
|
870
|
+
setWaitPanelTextSecondaryLocal(`Archiviazione... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(maxFileSize, true)}`);
|
|
871
|
+
if (pd.ProgressBarValue === pd.ProgressBarMaximum) {
|
|
872
|
+
setWaitPanelMaxValueSecondaryLocal(0);
|
|
873
|
+
setWaitPanelValueSecondaryLocal(0);
|
|
874
|
+
setWaitPanelTextSecondaryLocal('');
|
|
875
|
+
firstBlock = true;
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
// Aggiorna lo stato locale immediatamente dopo il salvataggio riuscito
|
|
879
|
+
// Questo garantisce che isModified diventi false anche se il reload fallisce
|
|
880
|
+
const savedFormData = structuredClone(formDataRef.current);
|
|
881
|
+
setFormDataOrig(savedFormData);
|
|
882
|
+
formDataOrigRef.current = savedFormData;
|
|
883
|
+
await onSavedAsyncCallback?.(ae.TID, newDID);
|
|
884
|
+
// Usa fromDTDRef.current invece di fromDTD per evitare stale closure,
|
|
885
|
+
// garantendo di avere il descrittore del tipo documento corrente.
|
|
886
|
+
await setMetadataList(fromDTDRef.current?.metadata ?? [], undefined, true, newDID);
|
|
887
|
+
handleReset();
|
|
888
|
+
let newMruTIDS = updateMruTids(SDKUI_Globals.userSettings.archivingSettings.mruTIDs, TID);
|
|
889
|
+
SDKUI_Globals.userSettings.archivingSettings.mruTIDs = newMruTIDS;
|
|
890
|
+
onSaveRecents?.(newMruTIDS);
|
|
891
|
+
ShowAlert({ mode: 'success', title: 'Archiviazione', message: 'Il documento è stato archiviato con successo', duration: 3000 });
|
|
892
|
+
const isDuplication = layoutMode === LayoutModes.Ark && DID;
|
|
893
|
+
if (isDuplication)
|
|
894
|
+
onClose?.();
|
|
895
|
+
}
|
|
896
|
+
catch (err) {
|
|
897
|
+
TMExceptionBoxManager.show({ exception: err });
|
|
898
|
+
}
|
|
899
|
+
finally {
|
|
900
|
+
setWaitPanelTextPrimaryLocal('');
|
|
901
|
+
setWaitPanelMaxValuePrimaryLocal(0);
|
|
902
|
+
setWaitPanelValuePrimaryLocal(0);
|
|
903
|
+
setWaitPanelTextSecondaryLocal('');
|
|
904
|
+
setWaitPanelMaxValueSecondaryLocal(0);
|
|
905
|
+
setWaitPanelValueSecondaryLocal(0);
|
|
906
|
+
setShowWaitPanelLocal(false);
|
|
907
|
+
setUseWaitPanelLocalState(false);
|
|
908
|
+
}
|
|
909
|
+
}, [TID, connectorFileSave, onSavedAsyncCallback, onSaveRecents, onClose, DID, setMetadataList, handleReset, layoutMode, isSharedDcmt]);
|
|
910
|
+
const handleClearForm = useCallback(() => {
|
|
911
|
+
let data = structuredClone(formData);
|
|
912
|
+
if (!data || data.length === 0)
|
|
913
|
+
return;
|
|
914
|
+
for (let md of data) {
|
|
915
|
+
if (!md.mid)
|
|
916
|
+
continue;
|
|
917
|
+
if (md.mid > 99) {
|
|
918
|
+
const defaultValue = md.md?.defaultValue;
|
|
919
|
+
if (defaultValue) {
|
|
920
|
+
if (FormulaHelper.isFormula(defaultValue)) {
|
|
921
|
+
md.value = undefined;
|
|
922
|
+
}
|
|
923
|
+
else {
|
|
924
|
+
md.value = defaultValue;
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
else if (formDataOrig.find(metadata => metadata.mid === md.mid)?.value === undefined) {
|
|
928
|
+
if (md.value)
|
|
929
|
+
md.value = undefined;
|
|
930
|
+
}
|
|
931
|
+
else if (md.value && md.value.length > 0) {
|
|
932
|
+
md.value = '';
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
setFormData(data);
|
|
937
|
+
}, [formData, formDataOrig]);
|
|
938
|
+
const clearFormBtnDisabled = useMemo(() => formData.filter(md => md.mid && md.value && md.mid > 99 && md.value.length > 0).length > 0, [formData]);
|
|
939
|
+
const archiveBtnDisabled = useMemo(() => layoutMode === LayoutModes.Update || (fromDTD?.archiveConstraint === ArchiveConstraints.ContentCompulsory && !dcmtFile) || validationItems.length > 0, [layoutMode, fromDTD?.archiveConstraint, dcmtFile, validationItems.length]);
|
|
940
|
+
const undoBtnDisabled = useMemo(() => layoutMode === LayoutModes.Update || !isModified, [layoutMode, isModified]);
|
|
941
|
+
const listMaxItems = useMemo(() => getListMaxItems(deviceType ?? DeviceType.DESKTOP), [deviceType]);
|
|
942
|
+
const totalItems = useMemo(() => formData.filter(o => o.mid && o.mid > 100).length, [formData]);
|
|
943
|
+
const metadataValuesSource = useMemo(() => {
|
|
944
|
+
return applyMetadataFilter(formData, showAll, listMaxItems, TID);
|
|
945
|
+
}, [showAll, formData, listMaxItems, TID]);
|
|
946
|
+
const metadataValuesSourceOrig = useMemo(() => {
|
|
947
|
+
return applyMetadataFilter(formDataOrig, showAll, listMaxItems, TID);
|
|
948
|
+
}, [showAll, formDataOrig, listMaxItems, TID]);
|
|
949
|
+
const handleClose = useCallback(() => {
|
|
950
|
+
if (!isModified) {
|
|
951
|
+
onClose?.();
|
|
952
|
+
return;
|
|
953
|
+
}
|
|
954
|
+
TMMessageBoxManager.show({
|
|
955
|
+
parentId: isModal ? "TMDcmtFormShowConfirmForClose-" + id : undefined,
|
|
956
|
+
message: SDKUI_Localizator.SaveQuestion, buttons: [ButtonNames.YES, ButtonNames.NO, ButtonNames.CANCEL],
|
|
957
|
+
onButtonClick: async (e) => {
|
|
958
|
+
try {
|
|
959
|
+
if (e == ButtonNames.CANCEL)
|
|
960
|
+
return;
|
|
961
|
+
if (e == ButtonNames.YES)
|
|
962
|
+
await handleSave();
|
|
963
|
+
onClose?.();
|
|
964
|
+
}
|
|
965
|
+
catch (ex) {
|
|
966
|
+
TMExceptionBoxManager.show({ exception: ex });
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
});
|
|
970
|
+
}, [isModified, onClose, isModal, id, handleSave]);
|
|
971
|
+
const getFormula = useCallback(() => {
|
|
972
|
+
let fd = new FormulaDescriptor();
|
|
973
|
+
fd.expression = FormulaHelper.isFormula(focusedMetadataValue?.value) ? FormulaHelper.removeFormulaTag(focusedMetadataValue?.value) : undefined;
|
|
974
|
+
fd.formulaTarget = FormulaTargets.BatchUpdate;
|
|
975
|
+
fd.items = FormulaHelper.TreeViewList(TID ?? 0, getSystemMetadata(true), undefined, FormulaTargets.BatchUpdate, SDK_Globals.dbBrand);
|
|
976
|
+
fd.mid = focusedMetadataValue?.mid ?? 0;
|
|
977
|
+
fd.tid = TID;
|
|
978
|
+
return fd;
|
|
979
|
+
}, [focusedMetadataValue?.value, focusedMetadataValue?.mid, TID]);
|
|
980
|
+
const handleWFOperationCompleted = useCallback(async () => {
|
|
981
|
+
await onWFOperationCompleted?.();
|
|
982
|
+
onClose?.();
|
|
983
|
+
}, [onWFOperationCompleted, onClose]);
|
|
984
|
+
// Determina se showAll deve essere automaticamente true
|
|
985
|
+
// Best practice: usa useMemo per calcolare valori derivati invece di useEffect con setState
|
|
986
|
+
const shouldShowAll = useMemo(() => {
|
|
987
|
+
// Mostra sempre tutti i metadati se:
|
|
988
|
+
// 1. È presente un layout personalizzato (per renderizzare correttamente la gerarchia)
|
|
989
|
+
// 2. È una vista di approvazione workflow
|
|
990
|
+
// 3. È il tipo documento Drafts
|
|
991
|
+
const hasCustomLayout = layout && layout.items && layout.items.length > 0;
|
|
992
|
+
return hasCustomLayout || isApprView || TID === SystemTIDs.Drafts;
|
|
993
|
+
}, [layout, isApprView, TID]);
|
|
994
|
+
// Aggiorna showAll quando shouldShowAll cambia
|
|
995
|
+
useEffect(() => {
|
|
996
|
+
if (shouldShowAll && !showAll) {
|
|
997
|
+
setShowAll(true);
|
|
998
|
+
}
|
|
999
|
+
}, [shouldShowAll, showAll]);
|
|
1000
|
+
const fetchBlogDataAsync = useCallback(async (tid, did) => {
|
|
1001
|
+
try {
|
|
1002
|
+
TMSpinner.show({ description: 'Caricamento - Bacheca...' });
|
|
1003
|
+
const res = await SDK_Globals.tmSession?.NewSearchEngine().BlogRetrieveAsync(tid, did);
|
|
1004
|
+
setBlogsDatasource(res ?? []);
|
|
1005
|
+
setHasLoadedDataOnce(true);
|
|
1006
|
+
setLastLoadedDid(did);
|
|
1007
|
+
}
|
|
1008
|
+
catch (e) {
|
|
1009
|
+
let err = e;
|
|
1010
|
+
TMExceptionBoxManager.show({ exception: err });
|
|
1011
|
+
}
|
|
1012
|
+
finally {
|
|
1013
|
+
TMSpinner.hide();
|
|
1014
|
+
}
|
|
1015
|
+
}, []);
|
|
1016
|
+
const afterTaskSaved = useCallback(async (task, formMode, forceRefresh = false) => {
|
|
1017
|
+
const shouldRefresh = forceRefresh || (task && task.state === Task_States.Completed) || formMode === FormModes.Create || formMode === FormModes.Duplicate;
|
|
1018
|
+
if (TID && DID && shouldRefresh) {
|
|
1019
|
+
await fetchBlogDataAsync(TID, DID);
|
|
1020
|
+
}
|
|
1021
|
+
}, [TID, DID]);
|
|
1022
|
+
const tmDcmtForm = useMemo(() => {
|
|
1023
|
+
return _jsx(_Fragment, { children: metadataValuesSource.length > 0 &&
|
|
1024
|
+
_jsxs(StyledToolbarCardContainer, { children: [_jsx(TMMetadataValues, { TID: TID, metadataValues: metadataValuesSource, metadataValuesOrig: metadataValuesSourceOrig, isExpertMode: isExpertMode, isOpenDistinctValues: isOpenDistinctValues, openChooserBySingleClick: !isOpenDistinctValues, selectedMID: focusedMetadataValue?.mid, isReadOnly: formMode === FormModes.ReadOnly, layoutMode: layoutMode, deviceType: deviceType, validationItems: validationItems, inputMids: inputMids, layout: layout, onFocusedItemChanged: (item) => { (item?.mid !== focusedMetadataValue?.mid) && setFocusedMetadataValue(item); }, onValueChanged: (newItems) => {
|
|
1025
|
+
setFormData((prevItems) => prevItems.map((item) => {
|
|
1026
|
+
const newItem = newItems.find((newItem) => newItem.tid === item.tid && newItem.mid === item.mid);
|
|
1027
|
+
return newItem ? { ...item, ...newItem } : item;
|
|
1028
|
+
}));
|
|
1029
|
+
}, onAdvancedMenuClick: (e) => {
|
|
1030
|
+
switch (e.button) {
|
|
1031
|
+
case AdvancedMenuButtons.DistinctValues:
|
|
1032
|
+
setIsOpenDistinctValues(!isOpenDistinctValues);
|
|
1033
|
+
break;
|
|
1034
|
+
case AdvancedMenuButtons.FormulaEditor:
|
|
1035
|
+
setIsOpenFormulaEditor(!isOpenFormulaEditor);
|
|
1036
|
+
break;
|
|
1037
|
+
}
|
|
1038
|
+
} }), _jsxs(StyledFormButtonsContainer, { children: [_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: 10 }, children: _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: layoutMode === LayoutModes.Update ? _jsxs(_Fragment, { children: [_jsx(TMSaveFormButtonSave, { showTooltip: false, btnStyle: 'advanced', advancedColor: '#f09c0a', isModified: isModified, formMode: formMode, errorsCount: validationItems.filter(o => o.ResultType == ResultTypes.ERROR).length, onSaveAsync: handleConfirmAction }), _jsx(TMSaveFormButtonUndo, { btnStyle: 'toolbar', showTooltip: true, color: 'primary', isModified: isModified, formMode: formMode, onUndo: handleUndo })] }) :
|
|
1039
|
+
_jsxs(_Fragment, { children: [_jsx(TMButton, { disabled: archiveBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconBoxArchiveIn, {}), width: 'auto', showTooltip: false, caption: SDKUI_Localizator.Archive, advancedColor: TMColors.success, onClick: handleConfirmAction }), _jsx(TMButton, { disabled: !clearFormBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconClear, {}), width: 'auto', showTooltip: false, caption: SDKUI_Localizator.Clear, advancedColor: TMColors.tertiary, onClick: handleClearForm }), DID && _jsx(TMButton, { disabled: undoBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconUndo, {}), width: '150px', showTooltip: false, caption: SDKUI_Localizator.Undo, advancedColor: TMColors.tertiary, onClick: handleUndo })] }) }) }), customButton && _jsx(TMCustomButton, { button: customButton, formData: formData, selectedItems: [], onClose: () => setCustomButton(undefined) }), totalItems > listMaxItems &&
|
|
1040
|
+
!isApprView &&
|
|
1041
|
+
TID !== SystemTIDs.Drafts &&
|
|
1042
|
+
!shouldShowAll &&
|
|
1043
|
+
_jsx(TMShowAllOrMaxItemsButton, { showAll: showAll, dataSourceLength: totalItems, onClick: () => { setShowAll(!showAll); } })] }), _jsx(ConfirmAttachmentsDialog, {})] }) });
|
|
1044
|
+
}, [
|
|
1045
|
+
TID,
|
|
1046
|
+
DID,
|
|
1047
|
+
metadataValuesSource,
|
|
1048
|
+
metadataValuesSourceOrig,
|
|
1049
|
+
isExpertMode,
|
|
1050
|
+
isOpenDistinctValues,
|
|
1051
|
+
focusedMetadataValue?.mid,
|
|
1052
|
+
formMode,
|
|
1053
|
+
layoutMode,
|
|
1054
|
+
deviceType,
|
|
1055
|
+
validationItems,
|
|
1056
|
+
inputMids,
|
|
1057
|
+
layout,
|
|
1058
|
+
isModified,
|
|
1059
|
+
archiveBtnDisabled,
|
|
1060
|
+
clearFormBtnDisabled,
|
|
1061
|
+
undoBtnDisabled,
|
|
1062
|
+
totalItems,
|
|
1063
|
+
listMaxItems,
|
|
1064
|
+
isApprView,
|
|
1065
|
+
shouldShowAll,
|
|
1066
|
+
showAll,
|
|
1067
|
+
handleConfirmAction,
|
|
1068
|
+
handleUndo,
|
|
1069
|
+
handleClearForm
|
|
1070
|
+
]);
|
|
1071
|
+
const tmBlog = useMemo(() => _jsx(TMDcmtBlog, { blogsDatasource: blogsDatasource, hasLoadedDataOnce: hasLoadedDataOnce, lastLoadedDid: lastLoadedDid, setBlogsDatasource: setBlogsDatasource, setHasLoadedDataOnce: setHasLoadedDataOnce, setLastLoadedDid: setLastLoadedDid, fetchBlogDataAsync: fetchBlogDataAsync, tid: TID, did: DID, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), [blogsDatasource, hasLoadedDataOnce, lastLoadedDid, TID, DID, allTasks]);
|
|
1072
|
+
const tmSysMetadata = useMemo(() => _jsx(TMMetadataValues, { layoutMode: layoutMode, openChooserBySingleClick: !isOpenDistinctValues, TID: TID, isReadOnly: true, deviceType: deviceType, metadataValues: formData.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: formData.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [], inputMids: inputMids }), [TID, layoutMode, formData, deviceType, inputMids]);
|
|
1073
|
+
const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { currentDcmt: currentDcmt, dcmtFile: dcmtFile ?? inputFile, deviceType: deviceType, fromDTD: fromDTD, layoutMode: layoutMode, onFileUpload: (file) => {
|
|
1074
|
+
setDcmtFile(file);
|
|
1075
|
+
}, enableDragDropOverlay: enableDragDropOverlay }), [currentDcmt, dcmtFile, deviceType, fromDTD, layoutMode, inputFile, enableDragDropOverlay, setDcmtFile]);
|
|
1076
|
+
const tmWF = useMemo(() => {
|
|
1077
|
+
if (isWFDataLoading) {
|
|
1078
|
+
return (_jsx("div", { style: {
|
|
1079
|
+
display: 'flex',
|
|
1080
|
+
alignItems: 'center',
|
|
1081
|
+
justifyContent: 'center',
|
|
1082
|
+
width: '100%',
|
|
1083
|
+
height: '100%',
|
|
1084
|
+
minHeight: '200px'
|
|
1085
|
+
}, children: _jsxs(StyledLoadingContainer, { children: [_jsx(StyledSpinner, {}), _jsx("span", { children: `${'Caricamento dati workflow'}...` })] }) }));
|
|
1086
|
+
}
|
|
1087
|
+
const isAuthorized = !!workflows?.[0]?.diagram;
|
|
1088
|
+
return (_jsxs("div", { style: { position: 'relative', width: '100%', height: '100%', display: 'flex', flexDirection: 'column', gap: 3 }, children: [workItems.length > 0
|
|
1089
|
+
? (isAuthorized
|
|
1090
|
+
? _jsx(WFDiagram, { xmlDiagramString: workflows?.[0]?.diagram || '', allowEdit: false, currentSetID: workitemSetID })
|
|
1091
|
+
: _jsx("div", { style: {
|
|
1092
|
+
position: 'absolute',
|
|
1093
|
+
top: '50%',
|
|
1094
|
+
left: '50%',
|
|
1095
|
+
transform: 'translate(-50%, -50%)',
|
|
1096
|
+
fontSize: '1.1rem',
|
|
1097
|
+
color: TMColors.primaryColor,
|
|
1098
|
+
textAlign: 'center',
|
|
1099
|
+
}, children: SDKUI_Localizator.WorkflowDiagramNotAuthorized }))
|
|
1100
|
+
: _jsx("div", { style: {
|
|
1101
|
+
position: 'absolute',
|
|
1102
|
+
top: '50%',
|
|
1103
|
+
left: '50%',
|
|
1104
|
+
transform: 'translate(-50%, -50%)',
|
|
1105
|
+
fontSize: '1.1rem',
|
|
1106
|
+
color: TMColors.primaryColor,
|
|
1107
|
+
textAlign: 'center',
|
|
1108
|
+
}, children: SDKUI_Localizator.WorkitemsToApproveNone }), isAuthorized && !workitemSetID && workItems.length > 0 &&
|
|
1109
|
+
_jsx("div", { style: {
|
|
1110
|
+
padding: 5,
|
|
1111
|
+
backgroundColor: 'khaki',
|
|
1112
|
+
borderRadius: 8
|
|
1113
|
+
}, children: SDKUI_Localizator.WorkItemTechnicalNote_SetID })] }));
|
|
1114
|
+
}, [workflows, formData, workitemSetID, workItems, isWFDataLoading]);
|
|
1115
|
+
const tmDcmtTasks = useMemo(() => {
|
|
1116
|
+
const isReady = TID && DID && getAllTasks && deleteTaskByIdsCallback && addTaskCallback && editTaskCallback;
|
|
1117
|
+
if (!isReady) {
|
|
1118
|
+
return _jsx(TMToppyMessage, { message: SDKUI_Localizator.TasksEmpty });
|
|
1119
|
+
}
|
|
1120
|
+
return (_jsx(TMDcmtTasks, { taskContext: {
|
|
1121
|
+
document: {
|
|
1122
|
+
tid: Number(TID),
|
|
1123
|
+
did: Number(DID),
|
|
1124
|
+
name: fromDTD?.nameLoc ?? SDKUI_Localizator.Widget_Activities,
|
|
1125
|
+
},
|
|
1126
|
+
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, afterTaskSaved: afterTaskSaved }));
|
|
1127
|
+
}, [allTasks, TID, DID, fromDTD]);
|
|
1128
|
+
const normalizedTID = TID !== undefined ? Number(TID) : undefined;
|
|
1129
|
+
const defaultPanelDimensions = {
|
|
1130
|
+
'tmDcmtForm': { width: '16.66%', height: '100%' },
|
|
1131
|
+
'tmBlog': { width: '16.66%', height: '100%' },
|
|
1132
|
+
'tmSysMetadata': { width: '16.66%', height: '100%' },
|
|
1133
|
+
'tmDcmtPreview': { width: '16.66%', height: '100%' },
|
|
1134
|
+
'tmWF': { width: '16.66%', height: '100%' },
|
|
1135
|
+
'tmDcmtTasks': { width: '16.66%', height: '100%' },
|
|
1136
|
+
};
|
|
1137
|
+
const allInitialPanelVisibility = {
|
|
1138
|
+
'tmDcmtForm': true,
|
|
1139
|
+
'tmBlog': false,
|
|
1140
|
+
'tmSysMetadata': false,
|
|
1141
|
+
'tmDcmtPreview': true,
|
|
1142
|
+
'tmWF': false,
|
|
1143
|
+
'tmDcmtTasks': false,
|
|
1144
|
+
};
|
|
1145
|
+
const initialPanels = useMemo(() => [
|
|
1146
|
+
{
|
|
1147
|
+
id: 'tmDcmtForm',
|
|
1148
|
+
name: SDK_Localizator.Metadatas,
|
|
1149
|
+
contentOptions: {
|
|
1150
|
+
component: tmDcmtForm,
|
|
1151
|
+
isClosable: isClosable,
|
|
1152
|
+
panelContainer: {
|
|
1153
|
+
showHeader: showHeader,
|
|
1154
|
+
title: fromDTD?.nameLoc,
|
|
1155
|
+
allowMaximize: !isMobile,
|
|
1156
|
+
onBack: showBackButton ? (isClosable && deviceType !== DeviceType.MOBILE) ? undefined : handleClose : undefined,
|
|
1157
|
+
onClose: isClosable ? () => { } : undefined,
|
|
1158
|
+
toolbar: allowNavigation ? formToolbar : _jsx(_Fragment, {})
|
|
1159
|
+
},
|
|
1160
|
+
},
|
|
1161
|
+
toolbarOptions: {
|
|
1162
|
+
icon: _jsx(IconPreview, { fontSize: 24 }),
|
|
1163
|
+
visible: true,
|
|
1164
|
+
orderNumber: 1,
|
|
1165
|
+
isActive: allInitialPanelVisibility['tmDcmtForm']
|
|
1166
|
+
}
|
|
1167
|
+
},
|
|
1168
|
+
{
|
|
1169
|
+
id: 'tmBlog',
|
|
1170
|
+
name: SDKUI_Localizator.BlogCase,
|
|
1171
|
+
contentOptions: { component: tmBlog, panelContainer: { title: SDKUI_Localizator.BlogCase, allowMaximize: !isMobile } },
|
|
1172
|
+
toolbarOptions: {
|
|
1173
|
+
icon: _jsx(IconBoard, { fontSize: 24 }),
|
|
1174
|
+
visible: true,
|
|
1175
|
+
disabled: isBoardDisabled,
|
|
1176
|
+
orderNumber: 2,
|
|
1177
|
+
isActive: allInitialPanelVisibility['tmBlog']
|
|
1178
|
+
}
|
|
1179
|
+
},
|
|
1180
|
+
{
|
|
1181
|
+
id: 'tmSysMetadata',
|
|
1182
|
+
name: SDKUI_Localizator.MetadataSystem,
|
|
1183
|
+
contentOptions: { component: tmSysMetadata, panelContainer: { title: SDKUI_Localizator.MetadataSystem, allowMaximize: !isMobile } },
|
|
1184
|
+
toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: true, disabled: isSysMetadataDisabled, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
|
|
1185
|
+
},
|
|
1186
|
+
{
|
|
1187
|
+
id: 'tmDcmtPreview',
|
|
1188
|
+
name: SDKUI_Localizator.PreviewDocument,
|
|
1189
|
+
contentOptions: { component: tmDcmtPreview },
|
|
1190
|
+
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), disabled: isPreviewDisabled, visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
id: 'tmWF',
|
|
1194
|
+
name: "Workflow",
|
|
1195
|
+
contentOptions: {
|
|
1196
|
+
component: tmWF,
|
|
1197
|
+
panelContainer: {
|
|
1198
|
+
title: "Workflow", allowMaximize: !isMobile
|
|
1199
|
+
}
|
|
1200
|
+
},
|
|
1201
|
+
toolbarOptions: {
|
|
1202
|
+
icon: _jsx(IconWorkflow, { fontSize: 24 }),
|
|
1203
|
+
visible: true,
|
|
1204
|
+
disabled: isWFDisabled,
|
|
1205
|
+
orderNumber: 5,
|
|
1206
|
+
isActive: allInitialPanelVisibility['tmWF']
|
|
1207
|
+
}
|
|
1208
|
+
},
|
|
1209
|
+
{
|
|
1210
|
+
id: 'tmDcmtTasks',
|
|
1211
|
+
name: SDKUI_Localizator.Widget_Activities,
|
|
1212
|
+
contentOptions: {
|
|
1213
|
+
component: tmDcmtTasks,
|
|
1214
|
+
},
|
|
1215
|
+
toolbarOptions: {
|
|
1216
|
+
icon: _jsx(IconActivity, { fontSize: 24 }),
|
|
1217
|
+
visible: layoutMode !== LayoutModes.Ark,
|
|
1218
|
+
orderNumber: 6,
|
|
1219
|
+
isActive: allInitialPanelVisibility['tmDcmtTasks'],
|
|
1220
|
+
count: (TID && DID && allTasks && allTasks.length > 0) ?
|
|
1221
|
+
getTaskAssignedToMe(allTasks).filter(task => task.iD1?.toString() === TID.toString()
|
|
1222
|
+
&& task.iD2?.toString() === DID.toString()
|
|
1223
|
+
&& task.state !== Task_States.Completed).length ?? 0
|
|
1224
|
+
: 0
|
|
1225
|
+
}
|
|
1226
|
+
},
|
|
1227
|
+
], [fromDTD, showBackButton, tmDcmtForm, tmBlog, tmSysMetadata, tmDcmtPreview, tmWF, tmDcmtTasks, isPreviewDisabled, isSysMetadataDisabled, isBoardDisabled, isWFDisabled, inputFile, isClosable, allTasks, DID, TID]);
|
|
1228
|
+
// Retrieves the current document form setting based on the normalized TID
|
|
1229
|
+
const getCurrentDcmtFormSetting = () => {
|
|
1230
|
+
const settings = SDKUI_Globals.userSettings.dcmtFormSettings;
|
|
1231
|
+
// Find the index of the setting that matches the normalized TID
|
|
1232
|
+
const idx = settings.findIndex(s => Number(s.TID) === normalizedTID);
|
|
1233
|
+
// Return both the index and the corresponding setting (or empty object if not found)
|
|
1234
|
+
return { idx, setting: settings[idx] ?? {} };
|
|
1235
|
+
};
|
|
1236
|
+
// Checks if there's a saved panel layout for the current context (ToDo or general)
|
|
1237
|
+
const hasSavedLayout = () => {
|
|
1238
|
+
const { setting } = getCurrentDcmtFormSetting();
|
|
1239
|
+
if (invokedByTodo) {
|
|
1240
|
+
// If invoked by ToDo, check for existence of layoutToDo and that it has keys
|
|
1241
|
+
return setting.layoutToDo !== undefined && Object.keys(setting.layoutToDo).length > 0;
|
|
1242
|
+
}
|
|
1243
|
+
else {
|
|
1244
|
+
// Otherwise, check for general layout
|
|
1245
|
+
return setting.layout !== undefined && Object.keys(setting.layout).length > 0;
|
|
1246
|
+
}
|
|
1247
|
+
};
|
|
1248
|
+
// Persists the current panel states (layout) into user settings
|
|
1249
|
+
const persistPanelStates = (state) => {
|
|
1250
|
+
// If no valid TID or empty state, skip saving
|
|
1251
|
+
if (normalizedTID === undefined || Object.keys(state).length === 0)
|
|
1252
|
+
return;
|
|
1253
|
+
const settings = SDKUI_Globals.userSettings.dcmtFormSettings;
|
|
1254
|
+
const { idx, setting: existingSetting } = getCurrentDcmtFormSetting();
|
|
1255
|
+
// Prepare the new setting object with updated layout depending on context
|
|
1256
|
+
const newSetting = {
|
|
1257
|
+
TID: normalizedTID,
|
|
1258
|
+
layout: invokedByTodo ? (existingSetting.layout ?? {}) : state,
|
|
1259
|
+
layoutToDo: invokedByTodo ? state : (existingSetting.layoutToDo ?? {}),
|
|
1260
|
+
};
|
|
1261
|
+
// Replace existing setting if found, otherwise push a new one
|
|
1262
|
+
if (idx >= 0) {
|
|
1263
|
+
settings[idx] = newSetting;
|
|
1264
|
+
}
|
|
1265
|
+
else {
|
|
1266
|
+
settings.push(newSetting);
|
|
1267
|
+
}
|
|
1268
|
+
// Assign the updated settings array back to the global settings
|
|
1269
|
+
SDKUI_Globals.userSettings.dcmtFormSettings = [...settings];
|
|
1270
|
+
};
|
|
1271
|
+
// Retrieves the persisted panel states (layout) for the current context
|
|
1272
|
+
const getPersistedPanelStates = () => {
|
|
1273
|
+
// Do not return layout on mobile devices
|
|
1274
|
+
if (isMobile)
|
|
1275
|
+
return undefined;
|
|
1276
|
+
const settings = getCurrentDcmtFormSetting()?.setting;
|
|
1277
|
+
// Return the appropriate layout based on context
|
|
1278
|
+
return invokedByTodo ? settings?.layoutToDo : settings?.layout;
|
|
1279
|
+
};
|
|
1280
|
+
const handleCompleteMoreInfo = useCallback(async () => {
|
|
1281
|
+
try {
|
|
1282
|
+
TMSpinner.show();
|
|
1283
|
+
let newTask = { ...taskMoreInfo, state: Task_States.Completed };
|
|
1284
|
+
await SDK_Globals.tmSession?.NewTaskEngine().UpdateAsync(newTask);
|
|
1285
|
+
onTaskCompleted?.(newTask);
|
|
1286
|
+
onClose?.();
|
|
1287
|
+
ShowAlert({ mode: 'success', title: SDKUI_Localizator.MoreInformation, message: SDKUI_Localizator.MoreInfoCompleted, duration: 3000 });
|
|
1288
|
+
}
|
|
1289
|
+
catch (e) {
|
|
1290
|
+
TMSpinner.hide();
|
|
1291
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
1292
|
+
}
|
|
1293
|
+
finally {
|
|
1294
|
+
TMSpinner.hide();
|
|
1295
|
+
}
|
|
1296
|
+
}, [taskMoreInfo, onTaskCompleted, onClose]);
|
|
1297
|
+
const handleSignApprove = useCallback(() => {
|
|
1298
|
+
if (onOpenS4TViewerRequest && TID && DID) {
|
|
1299
|
+
onOpenS4TViewerRequest([{ TID, DID }]);
|
|
1300
|
+
return;
|
|
1301
|
+
}
|
|
1302
|
+
ShowAlert({
|
|
1303
|
+
message: "TODO",
|
|
1304
|
+
mode: "info",
|
|
1305
|
+
duration: 3000,
|
|
1306
|
+
title: SDKUI_Localizator.SignatureAndApprove,
|
|
1307
|
+
});
|
|
1308
|
+
}, [onOpenS4TViewerRequest, TID, DID]);
|
|
1309
|
+
const handleNavigateToReference = useCallback((ref) => {
|
|
1310
|
+
if (onReferenceClick) {
|
|
1311
|
+
try {
|
|
1312
|
+
onReferenceClick(ref);
|
|
1313
|
+
}
|
|
1314
|
+
catch (e) {
|
|
1315
|
+
console.error('onReferenceClick handler failed', e);
|
|
1316
|
+
}
|
|
1317
|
+
return;
|
|
1318
|
+
}
|
|
1319
|
+
}, [onReferenceClick]);
|
|
1320
|
+
// Mapping for objClass specific label/action. Easy to extend for future objClass types.
|
|
1321
|
+
const referenceActionMap = useMemo(() => ({
|
|
1322
|
+
[ObjectClasses.Dossier]: { label: 'Vai a pratica' },
|
|
1323
|
+
[ObjectClasses.WorkingGroup]: { label: 'Vai a gruppo di lavoro' },
|
|
1324
|
+
// add other ObjectClasses here as needed
|
|
1325
|
+
}), []);
|
|
1326
|
+
const renderDcmtForm = () => {
|
|
1327
|
+
// Show flat spinner during initial load (before component is mounted)
|
|
1328
|
+
if (isInitialLoading) {
|
|
1329
|
+
return _jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: true });
|
|
1330
|
+
}
|
|
1331
|
+
return (_jsxs("div", { style: {
|
|
1332
|
+
display: 'flex',
|
|
1333
|
+
flexDirection: deviceType === DeviceType.MOBILE ? 'column' : 'row',
|
|
1334
|
+
justifyContent: 'space-between',
|
|
1335
|
+
gap: Gutters.getGutters(),
|
|
1336
|
+
width: '100%',
|
|
1337
|
+
height: '100%',
|
|
1338
|
+
position: 'relative',
|
|
1339
|
+
overflow: 'hidden'
|
|
1340
|
+
}, children: [_jsxs("div", { style: { width: '100%', height: '100%', display: isOpenDetails || isOpenMaster ? 'none' : 'flex' }, children: [isNavigating && _jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: false }), (fromDTD) && _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: useWaitPanelLocalState ? showWaitPanelLocal : showWaitPanel, showWaitPanelPrimary: useWaitPanelLocalState ? showPrimaryLocal : showPrimary, showWaitPanelSecondary: useWaitPanelLocalState ? showSecondaryLocal : showSecondary, waitPanelTitle: useWaitPanelLocalState ? waitPanelTitleLocal : waitPanelTitle, waitPanelTextPrimary: useWaitPanelLocalState ? waitPanelTextPrimaryLocal : waitPanelTextPrimary, waitPanelValuePrimary: useWaitPanelLocalState ? waitPanelValuePrimaryLocal : waitPanelValuePrimary, waitPanelMaxValuePrimary: useWaitPanelLocalState ? waitPanelMaxValuePrimaryLocal : waitPanelMaxValuePrimary, waitPanelTextSecondary: useWaitPanelLocalState ? waitPanelTextSecondaryLocal : waitPanelTextSecondary, waitPanelValueSecondary: useWaitPanelLocalState ? waitPanelValueSecondaryLocal : waitPanelValueSecondary, waitPanelMaxValueSecondary: useWaitPanelLocalState ? waitPanelMaxValueSecondaryLocal : waitPanelMaxValueSecondary, isCancelable: useWaitPanelLocalState ? dcmtFile ? dcmtFile.size >= 1000000 : false : true, abortController: useWaitPanelLocalState ? abortControllerLocal : abortController, children: [(groupId && groupId.length > 0)
|
|
1341
|
+
? _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })
|
|
1342
|
+
: _jsxs(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: defaultPanelDimensions, initialDimensions: defaultPanelDimensions, initialMobilePanelId: 'tmDcmtForm', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: [_jsx(WfButtonStateHandler, { isWFDisabled: isWFDisabled }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })] }), isOpenDistinctValues &&
|
|
1343
|
+
_jsx(TMDistinctValues, { tid: TID, mid: focusedMetadataValue?.mid, isModal: true, showHeader: false, layoutMode: layoutMode, onSelectionChanged: (e) => {
|
|
1344
|
+
if (!e)
|
|
1345
|
+
return;
|
|
1346
|
+
setFormData((prevItems) => prevItems.map((item) => item.tid == e.tid && item.mid === e.mid ? { ...item, value: e.newValue } : item));
|
|
1347
|
+
} }), isOpenFormulaEditor &&
|
|
1348
|
+
_jsx(TMFormulaEditor, { isModal: true, formMode: FormModes.Update, inputData: getFormula(), showBack: false, onClose: () => setIsOpenFormulaEditor(false), onApplied: (newFormula) => {
|
|
1349
|
+
setFormData((prevItems) => prevItems.map((item) => item.tid == newFormula.tid && item.mid === newFormula.mid ? { ...item, value: FormulaHelper.addFormulaTag(newFormula.expression), isSelected: true, isEditable: true } : item));
|
|
1350
|
+
setFocusedMetadataValue(prevState => ({
|
|
1351
|
+
...prevState,
|
|
1352
|
+
isSelected: true,
|
|
1353
|
+
isEditable: true,
|
|
1354
|
+
value: FormulaHelper.addFormulaTag(newFormula.expression)
|
|
1355
|
+
}));
|
|
1356
|
+
} }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowMoreInfoPopup(false) }), (isModal && onClose) && _jsx("div", { id: "TMDcmtFormShowConfirmForClose-" + id })] }), (showToppyForApprove || showToppyForCompleteMoreInfo || showToppyForReferences) && (_jsx(ToppyHelpCenter, { deviceType: deviceType, usePortal: false, content: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [showToppyForApprove && (workItems.length === 1 ?
|
|
1357
|
+
_jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), dtd: fromDTD })
|
|
1358
|
+
:
|
|
1359
|
+
_jsxs("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: [`Devi approvare ${workItems.length} workitem(s) per questo documento.`, `Vai alla sezione di approvazione.`] })), showToppyForCompleteMoreInfo && (_jsxs(_Fragment, { children: [_jsx("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: `${SDKUI_Localizator.MoreInfoCompleteRequestSentBy} ${taskMoreInfo?.fromName}!` }), _jsx(TMButton, { caption: SDKUI_Localizator.CommentAndComplete, color: 'success', showTooltip: false, onClick: () => {
|
|
1360
|
+
setShowCommentForm(true);
|
|
1361
|
+
} })] })), showToppyForReferences && dcmtReferences && dcmtReferences
|
|
1362
|
+
.filter(ref => ref.objClass === ObjectClasses.Dossier || ref.objClass === ObjectClasses.WorkingGroup) // keep only known objClass types
|
|
1363
|
+
.map((ref, index, arr) => {
|
|
1364
|
+
const mapEntry = referenceActionMap[String(ref.objClass)];
|
|
1365
|
+
const label = mapEntry?.label ?? 'Vai a riferimento';
|
|
1366
|
+
return (_jsxs(React.Fragment, { children: [index === 0 && (showToppyForApprove || showToppyForCompleteMoreInfo) && (_jsx("div", { style: {
|
|
1367
|
+
height: 1,
|
|
1368
|
+
backgroundColor: 'rgba(255,255,255,0.2)',
|
|
1369
|
+
margin: '6px 0'
|
|
1370
|
+
} })), _jsxs(StyledReferenceButton, { onClick: () => handleNavigateToReference(ref), children: [_jsx("span", { children: label }), _jsx("span", { children: `"${ref.objName}"` })] }, `ref-${index}-${ref.objID}`)] }, `ref-frag-${index}-${ref.objID}`));
|
|
1371
|
+
})] }) }))] }), (showCommentForm && TID && DID) &&
|
|
1372
|
+
_jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: TID, did: DID } }, onClose: () => setShowCommentForm(false), refreshCallback: handleCompleteMoreInfo, participants: [], showAttachmentsSection: false, allArchivedDocumentsFileItems: [] }), isOpenDetails &&
|
|
1373
|
+
_jsx(StyledModalContainer, { children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, isForMaster: false, inputDcmts: getSelectionDcmtInfo(), allowNavigation: allowNavigation, canNext: canNext, canPrev: canPrev, onNext: onNext, onPrev: onPrev, onBack: () => setIsOpenDetails(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), isOpenMaster &&
|
|
1374
|
+
_jsxs(StyledModalContainer, { children: [_jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: getSelectionDcmtInfo(), isForMaster: true, allowNavigation: allowNavigation, canNext: canNext, canPrev: canPrev, onNext: onNext, onPrev: onPrev, onBack: () => setIsOpenMaster(false), appendMasterDcmts: handleAddItem, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), secondaryMasterDcmts.length > 0 && secondaryMasterDcmts.map((dcmt, index) => {
|
|
1375
|
+
return (_jsx(StyledModalContainer, { children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: [dcmt], isForMaster: true, allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID), appendMasterDcmts: handleAddItem, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }, `${index}-${dcmt.DID}`));
|
|
1376
|
+
})] }), taskFormDialogComponent, s4TViewerDialogComponent] }));
|
|
1377
|
+
};
|
|
1378
|
+
return (_jsxs(_Fragment, { children: [(isModal && onClose)
|
|
1379
|
+
? _jsx(TMModal, { title: titleModal, onClose: handleClose, width: widthModal ?? '100%', height: heightModal ?? '100%', hidePopup: false, askClosingConfirm: true, children: _jsx("div", { style: { width: "100%", height: "100%", display: 'block', padding: "4px", position: 'relative' }, children: renderDcmtForm() }) })
|
|
1380
|
+
: renderDcmtForm(), showRelatedDcmtsChooser && (_jsx(TMChooserForm, { dataSource: relatedDcmtsChooserDataSource, onChoose: async (selectedRelation) => {
|
|
1381
|
+
try {
|
|
1382
|
+
setShowRelatedDcmtsChooser(false);
|
|
1383
|
+
TMSpinner.show({ description: SDKUI_Localizator.Loading });
|
|
1384
|
+
const relation = relatedDcmts?.find(r => r.id === selectedRelation[0]);
|
|
1385
|
+
if (!relation || !archiveType)
|
|
1386
|
+
return;
|
|
1387
|
+
await archiveRelatedDcmtHandler(relation, archiveType);
|
|
1388
|
+
}
|
|
1389
|
+
catch (error) {
|
|
1390
|
+
TMExceptionBoxManager.show({ exception: error });
|
|
1391
|
+
}
|
|
1392
|
+
finally {
|
|
1393
|
+
TMSpinner.hide();
|
|
1394
|
+
}
|
|
1395
|
+
}, onClose: () => setShowRelatedDcmtsChooser(false), manageUseLocalizedName: false })), showManyToManyChooser && (_jsx(TMChooserForm, { dataSource: manyToManyChooserDataSource, onChoose: async (selectedRelation) => {
|
|
1396
|
+
try {
|
|
1397
|
+
setShowManyToManyChooser(false);
|
|
1398
|
+
TMSpinner.show({ description: SDKUI_Localizator.Loading });
|
|
1399
|
+
const relation = manyToManyRelations?.find(r => r.id === selectedRelation[0]);
|
|
1400
|
+
if (!relation)
|
|
1401
|
+
return;
|
|
1402
|
+
await executeManyToManyPairing(relation, isPairingManyToMany);
|
|
1403
|
+
}
|
|
1404
|
+
catch (error) {
|
|
1405
|
+
TMExceptionBoxManager.show({ exception: error });
|
|
1406
|
+
}
|
|
1407
|
+
finally {
|
|
1408
|
+
TMSpinner.hide();
|
|
1409
|
+
}
|
|
1410
|
+
}, onClose: () => setShowManyToManyChooser(false), manageUseLocalizedName: false })), isOpenArchiveRelationForm && (_jsx(TMDcmtForm, { isModal: true, titleModal: SDKUI_Localizator.Archive + ' - ' + (archiveType === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster), TID: archiveRelatedDcmtFormTID, layoutMode: LayoutModes.Ark, inputMids: archiveRelatedDcmtFormMids, showBackButton: false, allowButtonsRefs: false, onClose: () => {
|
|
1411
|
+
setIsOpenArchiveRelationForm(false);
|
|
1412
|
+
setArchiveType(undefined);
|
|
1413
|
+
setArchiveRelatedDcmtFormTID(undefined);
|
|
1414
|
+
setArchiveRelatedDcmtFormMids([]);
|
|
1415
|
+
}, onSavedAsyncCallback: async (tid, did) => {
|
|
1416
|
+
setIsOpenArchiveRelationForm(false);
|
|
1417
|
+
setArchiveType(undefined);
|
|
1418
|
+
setArchiveRelatedDcmtFormTID(undefined);
|
|
1419
|
+
setArchiveRelatedDcmtFormMids([]);
|
|
1420
|
+
await fetchData();
|
|
1421
|
+
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers })), showPairDcmtsModal && (_jsx(TMModal, { title: (isPairingManyToMany ? "Abbina" : "Disabbina") + " documenti", onClose: () => setShowPairDcmtsModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearchResult, { searchResults: pairedSearchResults, onRefreshSearchAsync: async () => await fetchData(), onTaskCreateRequest: onTaskCreateRequest, allowFloatingBar: false, floatingActionConfig: pairFloatingActionConfig, showBackButton: false, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }))] }));
|
|
1422
|
+
};
|
|
1423
|
+
export default TMDcmtForm;
|
|
1424
|
+
/**
|
|
1425
|
+
* Utility function to apply metadata filtering logic
|
|
1426
|
+
* @param data - Array of metadata values to filter
|
|
1427
|
+
* @param showAll - Whether to show all items or limit to maxItems
|
|
1428
|
+
* @param listMaxItems - Maximum number of items to show when showAll is false
|
|
1429
|
+
* @param TID - Document type ID to determine specific filtering rules
|
|
1430
|
+
* @returns Filtered array of metadata values
|
|
1431
|
+
*/
|
|
1432
|
+
const applyMetadataFilter = (data, showAll, listMaxItems, TID) => {
|
|
1433
|
+
// Early return for empty data
|
|
1434
|
+
if (!data || data.length === 0)
|
|
1435
|
+
return [];
|
|
1436
|
+
// Base filter: include only metadata with mid > 100
|
|
1437
|
+
const baseFilter = (o) => Boolean(o.mid && o.mid > 100);
|
|
1438
|
+
// Special filter for Draft document type: includes base filter + system fields
|
|
1439
|
+
const draftFilter = (o) => baseFilter(o) ||
|
|
1440
|
+
o.mid === SystemMIDsAsNumber.FileExt ||
|
|
1441
|
+
o.mid === SystemMIDsAsNumber.FileSize ||
|
|
1442
|
+
o.mid === SystemMIDsAsNumber.LastUpdateTime ||
|
|
1443
|
+
o.mid === SystemMIDsAsNumber.CreationTime;
|
|
1444
|
+
// Select the appropriate filter based on document type
|
|
1445
|
+
const currentFilter = TID === SystemTIDs.Drafts ? draftFilter : baseFilter;
|
|
1446
|
+
// Apply filter once
|
|
1447
|
+
const filteredData = data.filter(currentFilter);
|
|
1448
|
+
// Return all filtered data or slice to max items
|
|
1449
|
+
return showAll ? filteredData : filteredData.slice(0, listMaxItems);
|
|
1450
|
+
};
|
|
1451
|
+
//#region Validaion
|
|
1452
|
+
export const validateMetadataList = (mvdList = []) => {
|
|
1453
|
+
if (!Array.isArray(mvdList)) {
|
|
1454
|
+
throw new TypeError("metadataList must be an array of ITMMetadataProps.");
|
|
1455
|
+
}
|
|
1456
|
+
return mvdList.reduce((validationItems, mvd) => {
|
|
1457
|
+
const value = mvd.value?.toString() ?? "";
|
|
1458
|
+
if (isValidForValidation(mvd)) {
|
|
1459
|
+
validateRequiredField(mvd, value, validationItems);
|
|
1460
|
+
validateMaxLength(mvd, value, validationItems);
|
|
1461
|
+
}
|
|
1462
|
+
return validationItems;
|
|
1463
|
+
}, []);
|
|
1464
|
+
};
|
|
1465
|
+
const isValidForValidation = (mvd) => { return mvd.mid > 99; };
|
|
1466
|
+
const validateRequiredField = (mvd, value, validationItems) => {
|
|
1467
|
+
if (mvd.isRequired === '1' && !value.trim()) {
|
|
1468
|
+
const message = SDKUI_Localizator.RequiredField;
|
|
1469
|
+
validationItems.push(new ValidationItem(ResultTypes.ERROR, mvd.md?.nameLoc ?? "", message));
|
|
1470
|
+
}
|
|
1471
|
+
};
|
|
1472
|
+
const validateMaxLength = (mvd, value, validationItems) => {
|
|
1473
|
+
const regex = /[!?[\],./*-+'<>:";]/g;
|
|
1474
|
+
const maxLength = mvd.md?.length ?? 0;
|
|
1475
|
+
const isTextOrNumber = mvd.md?.dataType === MetadataDataTypes.Varchar || mvd.md?.dataType === MetadataDataTypes.Number;
|
|
1476
|
+
const isFormula = FormulaHelper.isFormula(value);
|
|
1477
|
+
if (isTextOrNumber && !isFormula && mvd.md?.length && value.replace(regex, '').length > maxLength) {
|
|
1478
|
+
const message = `"${mvd.md.nameLoc ?? "no-name"}" ha superata massimo lunghezza di ${maxLength} caratteri.`;
|
|
1479
|
+
validationItems.push(new ValidationItem(ResultTypes.ERROR, mvd.md.nameLoc ?? "", message));
|
|
1480
|
+
}
|
|
1481
|
+
};
|
|
1482
|
+
//#endregion Validation
|
|
1483
|
+
// Questo componente non renderizza nulla (return null)
|
|
1484
|
+
// ma viene utilizzato come child del Provider per disabilitare il bottone
|
|
1485
|
+
const WfButtonStateHandler = ({ isWFDisabled }) => {
|
|
1486
|
+
const { setToolbarButtonDisabled } = useTMPanelManagerContext();
|
|
1487
|
+
useEffect(() => {
|
|
1488
|
+
setToolbarButtonDisabled('tmWF', isWFDisabled);
|
|
1489
|
+
}, [isWFDisabled, setToolbarButtonDisabled]);
|
|
1490
|
+
return null; // Non renderizza elementi nel DOM
|
|
1491
|
+
};
|
|
1492
|
+
const TMDcmtPreviewWrapper = ({ currentDcmt, layoutMode, fromDTD, dcmtFile, deviceType, isVisible, onFileUpload, enableDragDropOverlay = false }) => {
|
|
1493
|
+
const { setPanelVisibilityById, toggleMaximize, isResizingActive, countVisibleLeafPanels, panelVisibility } = useTMPanelManagerContext();
|
|
1494
|
+
const isMobile = deviceType === DeviceType.MOBILE;
|
|
1495
|
+
return (layoutMode === LayoutModes.Update ?
|
|
1496
|
+
_jsx(TMDcmtPreview, { isVisible: isVisible, onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("tmDcmtPreview") : undefined, dcmtData: currentDcmt, isResizingActive: isResizingActive }) :
|
|
1497
|
+
_jsx(TMFileUploader, { onFileUpload: onFileUpload, onClose: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, isRequired: fromDTD?.archiveConstraint === ArchiveConstraints.ContentCompulsory && dcmtFile === null, defaultBlob: dcmtFile, deviceType: deviceType, isResizingActive: isResizingActive, enableDragDropOverlay: panelVisibility['tmDcmtPreview'] && enableDragDropOverlay }));
|
|
1498
|
+
};
|