@topconsultnpm/sdkui-react 6.19.0-dev1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/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 +62 -0
- package/lib/components/base/Styled.js +297 -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/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 +209 -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 +224 -0
- package/lib/components/base/TMFileManagerDataGridView.d.ts +14 -0
- package/lib/components/base/TMFileManagerDataGridView.js +89 -0
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +16 -0
- package/lib/components/base/TMFileManagerThumbnailItems.js +138 -0
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +17 -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 +54 -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 +280 -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 +355 -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 +51 -0
- package/lib/components/choosers/TMMetadataChooser.js +134 -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 +33 -0
- package/lib/components/editors/TMHtmlEditor.js +143 -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 +480 -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 +19 -0
- package/lib/components/features/archive/TMArchive.js +162 -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 +308 -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 +8 -0
- package/lib/components/features/documents/TMDcmtBlog.js +77 -0
- package/lib/components/features/documents/TMDcmtForm.d.ts +50 -0
- package/lib/components/features/documents/TMDcmtForm.js +1083 -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/TMDragDropOverlay.d.ts +6 -0
- package/lib/components/features/documents/TMDragDropOverlay.js +96 -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 +19 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +288 -0
- package/lib/components/features/documents/TMRelationViewer.d.ts +71 -0
- package/lib/components/features/documents/TMRelationViewer.js +573 -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 +31 -0
- package/lib/components/features/search/TMSearch.js +244 -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 +426 -0
- package/lib/components/features/search/TMSearchResult.d.ts +44 -0
- package/lib/components/features/search/TMSearchResult.js +1293 -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 +10 -0
- package/lib/components/features/search/TMSearchResultsMenuItems.js +654 -0
- package/lib/components/features/search/TMTreeSelector.d.ts +12 -0
- package/lib/components/features/search/TMTreeSelector.js +270 -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 +40 -0
- package/lib/components/features/workflow/TMWorkflowPopup.js +273 -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 +681 -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 +203 -0
- package/lib/components/features/workflow/diagram/WFDiagram.d.ts +9 -0
- package/lib/components/features/workflow/diagram/WFDiagram.js +1666 -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 +38 -0
- package/lib/components/forms/TMSaveForm.d.ts +31 -0
- package/lib/components/forms/TMSaveForm.js +176 -0
- package/lib/components/grids/TMBlogs.d.ts +102 -0
- package/lib/components/grids/TMBlogs.js +721 -0
- package/lib/components/grids/TMBlogsUtils.d.ts +99 -0
- package/lib/components/grids/TMBlogsUtils.js +226 -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 +102 -0
- package/lib/components/index.js +123 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +9 -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 +251 -0
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +11 -0
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +82 -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 +41 -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 +15 -0
- package/lib/components/query/TMQuerySummary.js +35 -0
- package/lib/components/settings/SettingsAppearance.d.ts +14 -0
- package/lib/components/settings/SettingsAppearance.js +65 -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 +341 -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/Globalization.d.ts +14 -0
- package/lib/helper/Globalization.js +80 -0
- package/lib/helper/SDKUI_Globals.d.ts +93 -0
- package/lib/helper/SDKUI_Globals.js +165 -0
- package/lib/helper/SDKUI_Localizator.d.ts +649 -0
- package/lib/helper/SDKUI_Localizator.js +6385 -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/TMIcons.d.ts +271 -0
- package/lib/helper/TMIcons.js +664 -0
- package/lib/helper/TMImageLibrary.d.ts +3 -0
- package/lib/helper/TMImageLibrary.js +466 -0
- package/lib/helper/TMUtils.d.ts +20 -0
- package/lib/helper/TMUtils.js +176 -0
- package/lib/helper/dcmtsHelper.d.ts +5 -0
- package/lib/helper/dcmtsHelper.js +25 -0
- package/lib/helper/helpers.d.ts +84 -0
- package/lib/helper/helpers.js +824 -0
- package/lib/helper/index.d.ts +11 -0
- package/lib/helper/index.js +11 -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/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 +11 -0
- package/lib/index.js +14 -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/stories/TMButton.stories.d.ts +4 -0
- package/lib/stories/TMButton.stories.js +29 -0
- package/lib/stories/TMDataGrid.stories.d.ts +9 -0
- package/lib/stories/TMDataGrid.stories.js +310 -0
- package/lib/stories/TMHtmlContentDisplay.stories.d.ts +6 -0
- package/lib/stories/TMHtmlContentDisplay.stories.js +45 -0
- package/lib/stories/TMHtmlEditor.stories.d.ts +6 -0
- package/lib/stories/TMHtmlEditor.stories.js +49 -0
- package/lib/stories/TMIcons.stories.d.ts +4 -0
- package/lib/stories/TMIcons.stories.js +13 -0
- package/lib/stories/TMSDKUI_Localizator.stories.d.ts +4 -0
- package/lib/stories/TMSDKUI_Localizator.stories.js +123 -0
- package/lib/stories/TMStoriesUtils.d.ts +1 -0
- package/lib/stories/TMStoriesUtils.js +10 -0
- package/lib/stories/TMUserAvatar.stories.d.ts +6 -0
- package/lib/stories/TMUserAvatar.stories.js +20 -0
- package/lib/ts/index.d.ts +1 -0
- package/lib/ts/index.js +1 -0
- package/lib/ts/types.d.ts +296 -0
- package/lib/ts/types.js +85 -0
- package/lib/utils/theme.d.ts +68 -0
- package/lib/utils/theme.js +80 -0
- package/package.json +54 -0
|
@@ -0,0 +1,1293 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes, TemplateTIDs, DcmtTypeListCacheService, AccessLevels, SystemMIDsAsNumber, RelationCacheService, RelationTypes } from '@topconsultnpm/sdk-ts';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { getCommandsMenuItems, getSelectedDcmtsOrFocused } from './TMSearchResultsMenuItems';
|
|
6
|
+
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, IconDownload, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, IconSearchCheck, TMCommandsContextMenu, IconRelation } from '../../../helper';
|
|
7
|
+
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
8
|
+
import { useInputAttachmentsDialog, useInputCvtFormatDialog } from '../../../hooks/useInputDialog';
|
|
9
|
+
import { DcmtOperationTypes, FormModes, SearchResultContext, DownloadTypes } from '../../../ts';
|
|
10
|
+
import { Gutters, TMColors } from '../../../utils/theme';
|
|
11
|
+
import { StyledModalContainer, StyledBadge, StyledMultiViewPanel } from '../../base/Styled';
|
|
12
|
+
import TMButton from '../../base/TMButton';
|
|
13
|
+
import TMDataGrid, { TMDataGridPageSize } from '../../base/TMDataGrid';
|
|
14
|
+
import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
|
15
|
+
import { TMSplitterLayout, TMLayoutItem } from '../../base/TMLayout';
|
|
16
|
+
import { TMMessageBoxManager, ButtonNames, TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
17
|
+
import TMTooltip from '../../base/TMTooltip';
|
|
18
|
+
import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
|
19
|
+
import { TMUserIdViewer } from '../../choosers/TMUserChooser';
|
|
20
|
+
import TMMetadataValues from '../../editors/TMMetadataValues';
|
|
21
|
+
import { TMSaveFormButtonPrevious, TMSaveFormButtonNext } from '../../forms/TMSaveForm';
|
|
22
|
+
import TMDataListItemViewer from '../../viewers/TMDataListItemViewer';
|
|
23
|
+
import TMTidViewer from '../../viewers/TMTidViewer';
|
|
24
|
+
import { hasDetailRelations, hasMasterRelations } from '../../../helper/dcmtsHelper';
|
|
25
|
+
import TMDcmtPreview from '../documents/TMDcmtPreview';
|
|
26
|
+
import TMFloatingToolbar from '../../base/TMFloatingToolbar';
|
|
27
|
+
import { WorkFlowApproveRejectPopUp, WorkFlowMoreInfoPopUp, WorkFlowOperationButtons, WorkFlowReAssignPopUp } from '../workflow/TMWorkflowPopup';
|
|
28
|
+
import TMMasterDetailDcmts from '../documents/TMMasterDetailDcmts';
|
|
29
|
+
import TMBatchUpdateForm from '../../features/documents/TMBatchUpdateForm';
|
|
30
|
+
import TMDcmtForm from '../documents/TMDcmtForm';
|
|
31
|
+
import TMDcmtBlog from '../documents/TMDcmtBlog';
|
|
32
|
+
import TMDcmtIcon from '../documents/TMDcmtIcon';
|
|
33
|
+
import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
|
|
34
|
+
import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
|
|
35
|
+
import ToppyHelpCenter from '../assistant/ToppyHelpCenter';
|
|
36
|
+
import TMAccordion from '../../base/TMAccordion';
|
|
37
|
+
import TMDataGridExportForm from '../../base/TMDataGridExportForm';
|
|
38
|
+
import TMSearchResultFloatingActionButton from './TMSearchResultFloatingActionButton';
|
|
39
|
+
import ShowAlert from '../../base/TMAlert';
|
|
40
|
+
import TMSpinner from '../../base/TMSpinner';
|
|
41
|
+
import TMChooserForm from '../../forms/TMChooserForm';
|
|
42
|
+
import TMModal from '../../base/TMModal';
|
|
43
|
+
//#region Helper Methods
|
|
44
|
+
export const getSearchResultCountersSingleCategory = (searchResults) => {
|
|
45
|
+
// let totDcmtTypes = searchResults.length;
|
|
46
|
+
let totDcmts = 0;
|
|
47
|
+
for (let dcmt of searchResults) {
|
|
48
|
+
totDcmts += dcmt.dcmtsFound ?? 0;
|
|
49
|
+
}
|
|
50
|
+
return ` (${totDcmts})`;
|
|
51
|
+
};
|
|
52
|
+
const orderByName = (array) => {
|
|
53
|
+
let arr = [...array];
|
|
54
|
+
return arr.sort((a, b) => { if (a['fromName'] < b['fromName']) {
|
|
55
|
+
return -1;
|
|
56
|
+
} if (a['fromName'] > b['fromName']) {
|
|
57
|
+
return 1;
|
|
58
|
+
} return 0; });
|
|
59
|
+
};
|
|
60
|
+
const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showSelector = false, groupId, title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, selectedSearchResultTID, workingGroupContext = undefined, disableAccordionIfSingleCategory = false, floatingActionConfig, openInOffice, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onTaskCreateRequest, openWGsCopyMoveForm, openEditPdf, openCommentFormCallback, openAddDocumentForm, openS4TViewer = false, onOpenS4TViewerRequest, passToArchiveCallback, showTodoDcmtForm = false }) => {
|
|
61
|
+
const [id, setID] = useState('');
|
|
62
|
+
const [showApprovePopup, setShowApprovePopup] = useState(false);
|
|
63
|
+
const [showRejectPopup, setShowRejectPopup] = useState(false);
|
|
64
|
+
const [showReAssignPopup, setShowReAssignPopup] = useState(false);
|
|
65
|
+
const [showMoreInfoPopup, setShowMoreInfoPopup] = useState(false);
|
|
66
|
+
const [splitterSize, setSplitterSize] = useState(['100%', '0']);
|
|
67
|
+
const [showFloatingBar, setShowFloatingBar] = useState(true);
|
|
68
|
+
const [lastUpdateSearchTime, setLastUpdateSearchTime] = useState();
|
|
69
|
+
const [fromDTD, setFromDTD] = useState();
|
|
70
|
+
const [selectedSearchResult, setSelectedSearchResult] = useState();
|
|
71
|
+
const [currentSearchResults, setCurrentSearchResults] = useState(searchResults || []);
|
|
72
|
+
const [showSearch, setShowSearch] = useState(false);
|
|
73
|
+
// States for Related Documents
|
|
74
|
+
const [relatedDcmts, setRelatedDcmts] = useState(undefined);
|
|
75
|
+
const [showRelatedDcmtsChooser, setShowRelatedDcmtsChooser] = useState(false);
|
|
76
|
+
const [archiveType, setArchiveType] = useState(undefined);
|
|
77
|
+
const [isOpenDetails, setIsOpenDetails] = useState(false);
|
|
78
|
+
const [isOpenMaster, setIsOpenMaster] = useState(false);
|
|
79
|
+
const [isOpenArchiveRelationForm, setIsOpenArchiveRelationForm] = useState(false);
|
|
80
|
+
const [archiveRelatedDcmtFormTID, setArchiveRelatedDcmtFormTID] = useState(undefined);
|
|
81
|
+
const [archiveRelatedDcmtFormMids, setArchiveRelatedDcmtFormMids] = useState([]);
|
|
82
|
+
const [relatedDcmtsChooserDataSource, setRelatedDcmtsChooserDataSource] = useState(undefined);
|
|
83
|
+
const [showPairDcmtsModal, setShowPairDcmtsModal] = useState(false);
|
|
84
|
+
const [isPairingManyToMany, setIsPairingManyToMany] = useState(false);
|
|
85
|
+
const [pairedSearchResults, setPairedSearchResults] = useState([]);
|
|
86
|
+
const [manyToManyRelations, setManyToManyRelations] = useState(undefined);
|
|
87
|
+
const [showManyToManyChooser, setShowManyToManyChooser] = useState(false);
|
|
88
|
+
const [manyToManyChooserDataSource, setManyToManyChooserDataSource] = useState(undefined);
|
|
89
|
+
const [secondaryMasterDcmts, setSecondaryMasterDcmts] = useState([]);
|
|
90
|
+
const [isOpenDcmtForm, setIsOpenDcmtForm] = useState(false);
|
|
91
|
+
const [currentTIDHasDetailRelations, setCurrentTIDHasDetailRelations] = useState();
|
|
92
|
+
const [currentTIDHasMasterRelations, setCurrentTIDHasMasterRelations] = useState();
|
|
93
|
+
const [canArchiveMasterRelation, setCanArchiveMasterRelation] = useState(false);
|
|
94
|
+
const [canArchiveDetailRelation, setCanArchiveDetailRelation] = useState(false);
|
|
95
|
+
const [isOpenBatchUpdate, setIsOpenBatchUpdate] = useState(false);
|
|
96
|
+
const [visibleItems, setVisibleItems] = useState([]);
|
|
97
|
+
const [focusedItem, setFocusedItem] = useState();
|
|
98
|
+
const [selectedItems, setSelectedItems] = useState([]);
|
|
99
|
+
const [currentDcmt, setCurrentDcmt] = useState();
|
|
100
|
+
const [currentMetadataValues, setCurrentMetadataValues] = useState([]);
|
|
101
|
+
const [dcmtFormLayoutMode, setDcmtFormLayoutMode] = useState(LayoutModes.Update);
|
|
102
|
+
const [isModifiedBatchUpdate, setIsModifiedBatchUpdate] = useState(false);
|
|
103
|
+
// State to control whether the export form (for exporting to Excel/CSV/txt and others) should be shown
|
|
104
|
+
const [showExportForm, setShowExportForm] = useState(false);
|
|
105
|
+
const [confirmFormat, ConfirmFormatDialog] = useInputCvtFormatDialog();
|
|
106
|
+
const { openConfirmAttachmentsDialog, ConfirmAttachmentsDialog } = useInputAttachmentsDialog();
|
|
107
|
+
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync } = useDcmtOperations();
|
|
108
|
+
const deviceType = useDeviceType();
|
|
109
|
+
const isMobile = deviceType === DeviceType.MOBILE;
|
|
110
|
+
const disable = getSelectedDcmtsOrFocused(selectedItems, focusedItem).length === 0;
|
|
111
|
+
// Disable the "Sign/Approve" button if:
|
|
112
|
+
// 1. No document or multiple documents are selected, OR
|
|
113
|
+
// 2. Exactly one document is selected but its FILEEXT property is null
|
|
114
|
+
const disableSignApproveDisable = getSelectedDcmtsOrFocused(selectedItems, focusedItem).length !== 1 || (getSelectedDcmtsOrFocused(selectedItems, focusedItem).length === 1 && getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].FILEEXT === null);
|
|
115
|
+
const dcmtsReturned = (searchResults?.length > 1 ? selectedSearchResult?.dcmtsReturned : searchResults[0]?.dcmtsReturned ?? 0);
|
|
116
|
+
const dcmtsFound = (searchResults?.length > 1 ? selectedSearchResult?.dcmtsFound : searchResults[0]?.dcmtsFound ?? 0);
|
|
117
|
+
useEffect(() => { setID(genUniqueId()); }, []);
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
setSelectedItems([]);
|
|
120
|
+
setFocusedItem(undefined);
|
|
121
|
+
setIsOpenBatchUpdate(false);
|
|
122
|
+
setCurrentSearchResults(searchResults);
|
|
123
|
+
if (searchResults.length <= 0)
|
|
124
|
+
return;
|
|
125
|
+
if (searchResults.length === 1) {
|
|
126
|
+
setSelectedSearchResult(searchResults[0]);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
setSelectedSearchResult(orderByName(searchResults)[0]);
|
|
130
|
+
}, [searchResults]);
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
setFocusedItem(undefined);
|
|
133
|
+
setSelectedItems([]);
|
|
134
|
+
DcmtTypeListCacheService.GetWithNotGrantedAsync(selectedSearchResult?.fromTID, Number(selectedSearchResult?.dtdResult?.rows?.[0]?.[1])).then((dtd) => {
|
|
135
|
+
setFromDTD(dtd);
|
|
136
|
+
});
|
|
137
|
+
hasDetailRelations(selectedSearchResult?.fromTID).then((value) => setCurrentTIDHasDetailRelations(value));
|
|
138
|
+
hasMasterRelations(selectedSearchResult?.fromTID).then((value) => setCurrentTIDHasMasterRelations(value));
|
|
139
|
+
checkRelatedDcmtsArchiveCapability();
|
|
140
|
+
// Ricava il nuovo dataSource
|
|
141
|
+
const newDataSource = searchResultDescriptorToSimpleArray(selectedSearchResult);
|
|
142
|
+
// Se esiste almeno una riga, seleziona la prima
|
|
143
|
+
setFocusedItem(newDataSource && newDataSource.length > 0 ? newDataSource[0] : undefined);
|
|
144
|
+
}, [selectedSearchResult]);
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
if (!focusedItem)
|
|
147
|
+
return;
|
|
148
|
+
if (!fromDTD)
|
|
149
|
+
return;
|
|
150
|
+
let dtd = searchResults.length > 1 ? searchResults.find(res => res.fromTID == focusedItem?.TID)?.dtdResult : searchResults[0]?.dtdResult;
|
|
151
|
+
if (!dtd)
|
|
152
|
+
return;
|
|
153
|
+
let rows = dtd.rows ? dtd.rows[focusedItem.rowIndex] : [];
|
|
154
|
+
let mids = searchResults.length > 1 ? searchResults.find(res => res.fromTID == focusedItem?.TID)?.selectMIDs : searchResults[0]?.selectMIDs;
|
|
155
|
+
let metadataList = searchResultToMetadataValues(focusedItem?.TID, dtd, rows, mids, fromDTD?.metadata, LayoutModes.Update);
|
|
156
|
+
setCurrentMetadataValues(metadataList);
|
|
157
|
+
}, [focusedItem]);
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
setCurrentDcmt({
|
|
160
|
+
tid: currentMetadataValues.find(o => o.mid == SystemMIDsAsNumber.TID)?.value,
|
|
161
|
+
did: currentMetadataValues.find(o => o.mid == SystemMIDsAsNumber.DID)?.value,
|
|
162
|
+
fileCount: currentMetadataValues.find(o => o.mid == SystemMIDsAsNumber.FileCount)?.value,
|
|
163
|
+
fileSize: currentMetadataValues.find(o => o.mid == SystemMIDsAsNumber.FileSize)?.value,
|
|
164
|
+
fileExt: currentMetadataValues.find(o => o.mid == SystemMIDsAsNumber.FileExt)?.value
|
|
165
|
+
});
|
|
166
|
+
}, [currentMetadataValues]);
|
|
167
|
+
const openFormHandler = (layoutMode) => { setIsOpenDcmtForm(true); setDcmtFormLayoutMode(layoutMode); };
|
|
168
|
+
const openTaskFormHandler = (onTaskCreated) => {
|
|
169
|
+
if (selectedItems.length > 1)
|
|
170
|
+
return;
|
|
171
|
+
const item = selectedItems.length === 1 ? selectedItems[0] : focusedItem;
|
|
172
|
+
if (item?.TID && item?.DID) {
|
|
173
|
+
const fetchData = async () => {
|
|
174
|
+
try {
|
|
175
|
+
const dtd = await DcmtTypeListCacheService.GetWithNotGrantedAsync(item.TID, item?.DID);
|
|
176
|
+
if (dtd) {
|
|
177
|
+
const isWorkItem = dtd?.templateTID === TemplateTIDs.WF_WIApprView;
|
|
178
|
+
const name = `${dtd.name ?? '-'} (DID: ${item.DID})`;
|
|
179
|
+
onTaskCreateRequest?.(isWorkItem
|
|
180
|
+
? { workItem: { tid: item.TID, did: item.DID, name } }
|
|
181
|
+
: { document: { tid: item.TID, did: item.DID, name } }, onTaskCreated);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
console.error("Error fetching data:", error);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
fetchData();
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
const openDetailDcmtsFormHandler = (value) => { setIsOpenDetails(value); };
|
|
192
|
+
const openMasterDcmtsFormHandler = (value) => { setIsOpenMaster(value); };
|
|
193
|
+
const openBatchUpdateFormHandler = (value) => { setIsOpenBatchUpdate(value); };
|
|
194
|
+
const openExportForm = useCallback(() => {
|
|
195
|
+
setShowExportForm(true);
|
|
196
|
+
}, []);
|
|
197
|
+
const onCloseExportForm = useCallback(() => {
|
|
198
|
+
setShowExportForm(false);
|
|
199
|
+
}, []);
|
|
200
|
+
const handleToggleSearch = () => {
|
|
201
|
+
setShowSearch(prev => !prev);
|
|
202
|
+
};
|
|
203
|
+
const getTitleHeader = () => {
|
|
204
|
+
let counters = (showSelector && disableAccordionIfSingleCategory && searchResults.length > 1) ? getSearchResultCountersSingleCategory(searchResults) : "";
|
|
205
|
+
if (title)
|
|
206
|
+
return title + counters;
|
|
207
|
+
let titleHeader = 'Ricerca per metadati';
|
|
208
|
+
switch (context) {
|
|
209
|
+
case SearchResultContext.MASTER_DETAIL:
|
|
210
|
+
case SearchResultContext.METADATA_SEARCH:
|
|
211
|
+
titleHeader = `${searchResults?.length > 1 ? selectedSearchResult?.fromName ?? 'Ricerca per metadati' : searchResults[0]?.fromName ?? 'Ricerca per metadati'}`;
|
|
212
|
+
break;
|
|
213
|
+
case SearchResultContext.FAVORITES_AND_RECENTS:
|
|
214
|
+
titleHeader = SDKUI_Localizator.FavoritesAndRecentDcmts;
|
|
215
|
+
break;
|
|
216
|
+
case SearchResultContext.WORKFLOW_APPROVE:
|
|
217
|
+
titleHeader = SDKUI_Localizator.WorkflowApproval;
|
|
218
|
+
break;
|
|
219
|
+
case SearchResultContext.FREE_SEARCH:
|
|
220
|
+
titleHeader = `Risultato della ricerca full text`;
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
return titleHeader + counters;
|
|
224
|
+
};
|
|
225
|
+
const handleSignApprove = () => {
|
|
226
|
+
if (onOpenS4TViewerRequest) {
|
|
227
|
+
onOpenS4TViewerRequest(getSelectedDcmtsOrFocused(selectedItems, focusedItem), onRefreshSearchAsync);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
ShowAlert({
|
|
231
|
+
message: "Non è stato possibile proseguire con la firma e l'approvazione.",
|
|
232
|
+
mode: "warning",
|
|
233
|
+
duration: 3000,
|
|
234
|
+
title: SDKUI_Localizator.SignatureAndApprove,
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
const onBack = () => {
|
|
238
|
+
if (isOpenBatchUpdate && isModifiedBatchUpdate) {
|
|
239
|
+
TMMessageBoxManager.show({
|
|
240
|
+
title: SDKUI_Localizator.Cancel, message: SDKUI_Localizator.ConfirmOnCancel, buttons: [ButtonNames.YES, ButtonNames.NO],
|
|
241
|
+
onButtonClick: (e) => {
|
|
242
|
+
if (e !== ButtonNames.YES)
|
|
243
|
+
return;
|
|
244
|
+
setSplitterSize(['100%', '0']);
|
|
245
|
+
onClose?.();
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
else if (isOpenDcmtForm) {
|
|
250
|
+
setIsOpenDcmtForm(false);
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
setSplitterSize(['100%', '0']);
|
|
254
|
+
onClose?.();
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
const onContextMenuPreparing = (e) => {
|
|
258
|
+
if (e === undefined)
|
|
259
|
+
return;
|
|
260
|
+
if (e.target === 'content') {
|
|
261
|
+
e.items = e.items || [];
|
|
262
|
+
const menuItems = getCommandsMenuItems(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany);
|
|
263
|
+
e.items.push(...menuItems);
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
const refreshDataGridAfterRemoveAsync = async () => {
|
|
267
|
+
let index = selectedSearchResult?.dtdResult?.columns?.findIndex(col => col.caption === 'DID');
|
|
268
|
+
let selectedRows = [];
|
|
269
|
+
if (!index)
|
|
270
|
+
return;
|
|
271
|
+
for (let data of getSelectedDcmtsOrFocused(selectedItems, focusedItem)) {
|
|
272
|
+
selectedRows.push(selectedSearchResult?.dtdResult?.rows?.findIndex(row => row[index] === data.DID.toString()));
|
|
273
|
+
}
|
|
274
|
+
if (!selectedSearchResult?.dtdResult?.rows)
|
|
275
|
+
return;
|
|
276
|
+
let newRows = [];
|
|
277
|
+
for (let i = 0; i < selectedSearchResult.dtdResult.rows.length; i++) {
|
|
278
|
+
if (!selectedRows.includes(i))
|
|
279
|
+
newRows.push(selectedSearchResult.dtdResult.rows[i]);
|
|
280
|
+
}
|
|
281
|
+
let newSearchresult = structuredClone(selectedSearchResult);
|
|
282
|
+
let newDtd = structuredClone(selectedSearchResult.dtdResult);
|
|
283
|
+
newDtd.rows = newRows;
|
|
284
|
+
newSearchresult.dtdResult = newDtd;
|
|
285
|
+
newSearchresult.dcmtsReturned = newRows.length;
|
|
286
|
+
newSearchresult.dcmtsFound = newRows.length;
|
|
287
|
+
setSelectedSearchResult(newSearchresult);
|
|
288
|
+
setCurrentSearchResults((prev) => {
|
|
289
|
+
let newResults = [...prev];
|
|
290
|
+
let index = newResults.findIndex((res) => res.fromTID === selectedSearchResult?.fromTID);
|
|
291
|
+
if (index >= 0) {
|
|
292
|
+
newResults[index] = newSearchresult;
|
|
293
|
+
}
|
|
294
|
+
return newResults;
|
|
295
|
+
});
|
|
296
|
+
};
|
|
297
|
+
const removeDcmtFromFavsOrRecents = async () => {
|
|
298
|
+
switch (selectedSearchResult?.category) {
|
|
299
|
+
case "Favorites":
|
|
300
|
+
await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.RemoveFromFavs, refreshDataGridAfterRemoveAsync);
|
|
301
|
+
break;
|
|
302
|
+
case "RecentArchive":
|
|
303
|
+
await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.RemoveFromRecentsArk, refreshDataGridAfterRemoveAsync);
|
|
304
|
+
break;
|
|
305
|
+
case "RecentView":
|
|
306
|
+
await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.RemoveFromRecentsView, refreshDataGridAfterRemoveAsync);
|
|
307
|
+
break;
|
|
308
|
+
default: break;
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
const onSearchResultSelectionChanged = (e) => {
|
|
312
|
+
setSelectedSearchResult(e);
|
|
313
|
+
if (deviceType === DeviceType.MOBILE) {
|
|
314
|
+
setSplitterSize(['0', '100%']);
|
|
315
|
+
}
|
|
316
|
+
onSelectedTIDChanged?.(e.fromTID);
|
|
317
|
+
};
|
|
318
|
+
const refreshFocusedDataRowAsync = async (tid, did, refreshUI, metadataResult) => {
|
|
319
|
+
if (!tid || !did)
|
|
320
|
+
return;
|
|
321
|
+
let currentResult = searchResults.length > 1 ? selectedSearchResult : searchResults[0];
|
|
322
|
+
let currentResultColIndexTID = currentResult?.dtdResult?.columns?.findIndex(o => o.caption == "TID");
|
|
323
|
+
if (currentResultColIndexTID == undefined)
|
|
324
|
+
return;
|
|
325
|
+
let currentResultColIndexDID = currentResult?.dtdResult?.columns?.findIndex(o => o.caption == "DID");
|
|
326
|
+
if (currentResultColIndexDID == undefined)
|
|
327
|
+
return;
|
|
328
|
+
let newDcmt;
|
|
329
|
+
// Se metadataResult è null (non undefined!), significa che GetMetadataAsync è già fallito
|
|
330
|
+
// nel form e l'errore è già stato mostrato all'utente, quindi non ritentiamo
|
|
331
|
+
if (metadataResult === null) {
|
|
332
|
+
newDcmt = undefined;
|
|
333
|
+
}
|
|
334
|
+
// Se metadataResult è un oggetto valido, usiamolo
|
|
335
|
+
else if (metadataResult !== undefined) {
|
|
336
|
+
newDcmt = metadataResult;
|
|
337
|
+
}
|
|
338
|
+
// Altrimenti (metadataResult === undefined), tentiamo di ottenerlo
|
|
339
|
+
else {
|
|
340
|
+
try {
|
|
341
|
+
newDcmt = await SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(tid, did, true);
|
|
342
|
+
}
|
|
343
|
+
catch (error) {
|
|
344
|
+
newDcmt = undefined;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
// Se newDcmt è undefined o non ha righe, significa che il documento non esiste più
|
|
348
|
+
// o non è più accessibile. Rimuovi la riga dal risultato della ricerca
|
|
349
|
+
if (!newDcmt || !newDcmt.dtdResult?.rows?.[0]) {
|
|
350
|
+
if (currentResult?.dtdResult?.rows) {
|
|
351
|
+
// IMPORTANTE: Modifica direttamente l'oggetto originale per mantenere la sincronizzazione
|
|
352
|
+
currentResult.dtdResult.rows = currentResult.dtdResult.rows.filter((row) => !(row[currentResultColIndexTID] == tid?.toString() && row[currentResultColIndexDID] == did?.toString()));
|
|
353
|
+
currentResult.dcmtsReturned = currentResult.dtdResult.rows.length;
|
|
354
|
+
currentResult.dcmtsFound = Math.max(0, (currentResult.dcmtsFound ?? 0) - 1);
|
|
355
|
+
// Se il documento rimosso era quello focalizzato, resetta il focus
|
|
356
|
+
if (focusedItem?.TID === tid && focusedItem?.DID === did) {
|
|
357
|
+
setFocusedItem(undefined);
|
|
358
|
+
setSelectedItems([]);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
// IMPORTANTE: forza l'aggiornamento della griglia
|
|
362
|
+
if (refreshUI)
|
|
363
|
+
setLastUpdateSearchTime(new Date(Date.now()));
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
// Se il documento esiste, aggiorna i valori come prima
|
|
367
|
+
let newDcmtRow = newDcmt.dtdResult.rows[0];
|
|
368
|
+
let currentDcmtRow = currentResult?.dtdResult?.rows?.filter((row) => row[currentResultColIndexTID] == tid?.toString() && row[currentResultColIndexDID] == did?.toString()) ?? [];
|
|
369
|
+
for (const row of currentDcmtRow) {
|
|
370
|
+
let mids = currentResult?.selectMIDs ?? [];
|
|
371
|
+
for (let i = 0; i < mids.length; i++) {
|
|
372
|
+
const mid = mids[i];
|
|
373
|
+
let newDcmtMidIndex = newDcmt?.selectMIDs?.findIndex(o => o == mid) ?? -1;
|
|
374
|
+
if (newDcmtMidIndex >= 0 && row[i] != newDcmtRow[newDcmtMidIndex]) {
|
|
375
|
+
row[i] = newDcmtRow[newDcmtMidIndex];
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
if (refreshUI)
|
|
380
|
+
setLastUpdateSearchTime(new Date(Date.now()));
|
|
381
|
+
};
|
|
382
|
+
const refreshSelectionDataRowsAsync = async () => {
|
|
383
|
+
let dcmts = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
384
|
+
for (const dcmt of dcmts) {
|
|
385
|
+
await refreshFocusedDataRowAsync(dcmt.TID, dcmt.DID);
|
|
386
|
+
}
|
|
387
|
+
setLastUpdateSearchTime(new Date(Date.now()));
|
|
388
|
+
};
|
|
389
|
+
const getSelectionDcmtInfo = () => { return getSelectedDcmtsOrFocused(selectedItems, focusedItem); };
|
|
390
|
+
const canNavigateHandler = (dir) => {
|
|
391
|
+
if (!focusedItem)
|
|
392
|
+
return false;
|
|
393
|
+
let index = -1;
|
|
394
|
+
if (visibleItems) {
|
|
395
|
+
index = visibleItems.findIndex(item => item.rowIndex === focusedItem.rowIndex);
|
|
396
|
+
}
|
|
397
|
+
switch (dir) {
|
|
398
|
+
case 'next': if (visibleItems && index < visibleItems.length - 1) {
|
|
399
|
+
return true;
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
return false;
|
|
403
|
+
}
|
|
404
|
+
default: if (visibleItems && index > 0) {
|
|
405
|
+
return true;
|
|
406
|
+
}
|
|
407
|
+
else {
|
|
408
|
+
return false;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
const onNavigateHandler = (dir) => {
|
|
413
|
+
let index = -1;
|
|
414
|
+
if (visibleItems && focusedItem) {
|
|
415
|
+
index = visibleItems.findIndex(item => item.rowIndex === focusedItem.rowIndex);
|
|
416
|
+
}
|
|
417
|
+
switch (dir) {
|
|
418
|
+
case 'next':
|
|
419
|
+
setFocusedItem(visibleItems[index + 1]);
|
|
420
|
+
break;
|
|
421
|
+
default:
|
|
422
|
+
setFocusedItem(visibleItems[index - 1]);
|
|
423
|
+
break;
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
//#region Related Documents Archive Section
|
|
427
|
+
const pairFloatingActionConfig = useMemo(() => ({
|
|
428
|
+
isVisible: true,
|
|
429
|
+
type: 'multi',
|
|
430
|
+
onClick: (selected) => { console.log(selected); },
|
|
431
|
+
iconElement: _jsx(IconRelation, { fontSize: 26 }),
|
|
432
|
+
tooltip: isPairingManyToMany ? 'Abbina' : 'Disabbina',
|
|
433
|
+
}), [isPairingManyToMany, pairedSearchResults]);
|
|
434
|
+
const getAllRelationsAsync = async () => {
|
|
435
|
+
const tmSession = SDK_Globals.tmSession;
|
|
436
|
+
try {
|
|
437
|
+
TMSpinner.show({ description: SDKUI_Localizator.Loading });
|
|
438
|
+
let relations = await RelationCacheService.GetAllAsync(tmSession);
|
|
439
|
+
if (!relations)
|
|
440
|
+
throw new Error("Impossibile caricare le relazioni.");
|
|
441
|
+
return relations;
|
|
442
|
+
}
|
|
443
|
+
catch (error) {
|
|
444
|
+
TMExceptionBoxManager.show({ exception: error });
|
|
445
|
+
return undefined;
|
|
446
|
+
}
|
|
447
|
+
finally {
|
|
448
|
+
TMSpinner.hide();
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
const checkRelatedDcmtsArchiveCapability = async () => {
|
|
452
|
+
const tid = selectedSearchResult?.fromTID;
|
|
453
|
+
if (!tid) {
|
|
454
|
+
setCanArchiveMasterRelation(false);
|
|
455
|
+
setCanArchiveDetailRelation(false);
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
try {
|
|
459
|
+
const relations = await getAllRelationsAsync();
|
|
460
|
+
if (!relations) {
|
|
461
|
+
setCanArchiveMasterRelation(false);
|
|
462
|
+
setCanArchiveDetailRelation(false);
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
const detailRelations = relations.filter(r => r.detailTID === tid);
|
|
466
|
+
const hasMasterWithAssociations = detailRelations.some(rel => rel.associations && rel.associations.length > 0);
|
|
467
|
+
setCanArchiveMasterRelation(hasMasterWithAssociations);
|
|
468
|
+
const masterRelations = relations.filter(r => r.masterTID === tid);
|
|
469
|
+
const hasDetailWithAssociations = masterRelations.some(rel => rel.associations && rel.associations.length > 0);
|
|
470
|
+
setCanArchiveDetailRelation(hasDetailWithAssociations);
|
|
471
|
+
}
|
|
472
|
+
catch (error) {
|
|
473
|
+
console.error("Error checking archive capability:", error);
|
|
474
|
+
setCanArchiveMasterRelation(false);
|
|
475
|
+
setCanArchiveDetailRelation(false);
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
const getFocusedItem = () => {
|
|
479
|
+
if (!focusedItem || currentSearchResults.length !== 1)
|
|
480
|
+
return undefined;
|
|
481
|
+
return { mdList: currentSearchResults[0].dtdResult?.rows?.[focusedItem?.rowIndex ?? 0], mids: currentSearchResults[0].selectMIDs ?? [] };
|
|
482
|
+
};
|
|
483
|
+
const fetchAssociatedValues = (mid) => {
|
|
484
|
+
let mdList = getFocusedItem();
|
|
485
|
+
if (!mdList)
|
|
486
|
+
return;
|
|
487
|
+
let index = mdList.mids.findIndex(m => m == mid);
|
|
488
|
+
if (index === -1)
|
|
489
|
+
return;
|
|
490
|
+
return mdList.mdList?.[index];
|
|
491
|
+
};
|
|
492
|
+
const filterRelationsByType = (relations, tid, type) => {
|
|
493
|
+
return type === 'detail'
|
|
494
|
+
? relations.filter(r => r.masterTID == tid)
|
|
495
|
+
: relations.filter(r => r.detailTID == tid);
|
|
496
|
+
};
|
|
497
|
+
const filterRelationsWithAssociations = (relations) => {
|
|
498
|
+
return relations.filter(rel => rel.associations && rel.associations.length > 0);
|
|
499
|
+
};
|
|
500
|
+
const getRelatedDcmt = async (relation, type) => {
|
|
501
|
+
return await DcmtTypeListCacheService.GetAsync(type === 'detail' ? relation.detailTID : relation.masterTID);
|
|
502
|
+
};
|
|
503
|
+
const showNoRelationsAlert = (type) => {
|
|
504
|
+
ShowAlert({
|
|
505
|
+
message: type === 'detail'
|
|
506
|
+
? "Nessun documento di dettaglio trovato per l'archiviazione."
|
|
507
|
+
: "Nessun documento di master trovato per l'archiviazione.",
|
|
508
|
+
mode: 'info',
|
|
509
|
+
title: type === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster,
|
|
510
|
+
duration: 5000
|
|
511
|
+
});
|
|
512
|
+
};
|
|
513
|
+
const showNoAssociationsAlert = (type) => {
|
|
514
|
+
ShowAlert({
|
|
515
|
+
message: type === 'detail'
|
|
516
|
+
? "Nessuna associazione trovata per i documenti di dettaglio."
|
|
517
|
+
: "Nessuna associazione trovata per i documenti di master.",
|
|
518
|
+
mode: 'info',
|
|
519
|
+
title: type === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster,
|
|
520
|
+
duration: 5000
|
|
521
|
+
});
|
|
522
|
+
};
|
|
523
|
+
const mapAssociationsToMids = (relation, type) => {
|
|
524
|
+
return relation.associations?.map(assoc => ({
|
|
525
|
+
mid: type === 'detail' ? (assoc.item2 ?? 0) : (assoc.item1 ?? 0),
|
|
526
|
+
value: fetchAssociatedValues(type === 'detail' ? (assoc.item1 ?? 0) : (assoc.item2 ?? 0)) ?? ''
|
|
527
|
+
})) ?? [];
|
|
528
|
+
};
|
|
529
|
+
const archiveRelatedDcmtHandler = (relation, type) => {
|
|
530
|
+
const targetTID = type === 'detail' ? relation.detailTID : relation.masterTID;
|
|
531
|
+
if (!targetTID)
|
|
532
|
+
return;
|
|
533
|
+
const mids = mapAssociationsToMids(relation, type);
|
|
534
|
+
setArchiveType(type);
|
|
535
|
+
setArchiveRelatedDcmtFormTID(targetTID);
|
|
536
|
+
setArchiveRelatedDcmtFormMids(mids);
|
|
537
|
+
setIsOpenArchiveRelationForm(true);
|
|
538
|
+
};
|
|
539
|
+
const archiveRelatedDocuments = async (tid, type) => {
|
|
540
|
+
try {
|
|
541
|
+
TMSpinner.show({ description: SDKUI_Localizator.Loading });
|
|
542
|
+
const relations = await getAllRelationsAsync();
|
|
543
|
+
if (!relations || !tid)
|
|
544
|
+
return;
|
|
545
|
+
const filteredRelations = filterRelationsByType(relations, tid, type);
|
|
546
|
+
if (!filteredRelations || filteredRelations.length === 0) {
|
|
547
|
+
showNoRelationsAlert(type);
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
const withAssociations = filterRelationsWithAssociations(filteredRelations);
|
|
551
|
+
if (withAssociations.length === 0) {
|
|
552
|
+
showNoAssociationsAlert(type);
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
setRelatedDcmts(withAssociations);
|
|
556
|
+
if (withAssociations.length > 1) {
|
|
557
|
+
const dataSourcePromises = withAssociations.map(async (rel) => {
|
|
558
|
+
const relatedDcmt = await getRelatedDcmt(rel, type);
|
|
559
|
+
return { id: rel?.id, name: relatedDcmt?.name };
|
|
560
|
+
});
|
|
561
|
+
const dataSource = await Promise.all(dataSourcePromises);
|
|
562
|
+
setRelatedDcmtsChooserDataSource(dataSource);
|
|
563
|
+
setArchiveType(type);
|
|
564
|
+
setShowRelatedDcmtsChooser(true);
|
|
565
|
+
}
|
|
566
|
+
else {
|
|
567
|
+
archiveRelatedDcmtHandler(withAssociations[0], type);
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
catch (error) {
|
|
571
|
+
TMExceptionBoxManager.show({ exception: error });
|
|
572
|
+
}
|
|
573
|
+
finally {
|
|
574
|
+
TMSpinner.hide();
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
const archiveDetailDocuments = async (tid) => {
|
|
578
|
+
await archiveRelatedDocuments(tid, 'detail');
|
|
579
|
+
};
|
|
580
|
+
const archiveMasterDocuments = async (tid) => {
|
|
581
|
+
await archiveRelatedDocuments(tid, 'master');
|
|
582
|
+
};
|
|
583
|
+
const getAlreadyPairedDIDs = async (relation, currentTID, currentDID) => {
|
|
584
|
+
if (!relation || !currentDID)
|
|
585
|
+
return [];
|
|
586
|
+
try {
|
|
587
|
+
const tmSession = SDK_Globals.tmSession;
|
|
588
|
+
if (!tmSession)
|
|
589
|
+
return [];
|
|
590
|
+
const searchEngine = tmSession.NewSearchEngine();
|
|
591
|
+
if (!searchEngine)
|
|
592
|
+
return [];
|
|
593
|
+
const isMaster = currentTID === relation.masterTID;
|
|
594
|
+
const pairedResults = isMaster
|
|
595
|
+
? await searchEngine.GetAllDetailDcmtsAsync(currentTID, currentDID)
|
|
596
|
+
: await searchEngine.GetAllMasterDcmtsAsync(currentTID, currentDID);
|
|
597
|
+
if (!pairedResults || pairedResults.length === 0)
|
|
598
|
+
return [];
|
|
599
|
+
const relationResult = pairedResults.find(r => r.relationID === relation.id);
|
|
600
|
+
if (!relationResult?.dtdResult)
|
|
601
|
+
return [];
|
|
602
|
+
const pairedDIDs = [];
|
|
603
|
+
const rows = relationResult.dtdResult.rows ?? [];
|
|
604
|
+
const columns = relationResult.dtdResult.columns ?? [];
|
|
605
|
+
const didColumnIndex = columns.findIndex(col => {
|
|
606
|
+
const caption = col.caption?.toUpperCase();
|
|
607
|
+
const mid = col.extendedProperties?.["MID"];
|
|
608
|
+
const midNum = typeof mid === 'string' ? Number.parseInt(mid, 10) : mid;
|
|
609
|
+
return caption === 'DID' || midNum === 5;
|
|
610
|
+
});
|
|
611
|
+
if (didColumnIndex === -1)
|
|
612
|
+
return [];
|
|
613
|
+
for (const row of rows) {
|
|
614
|
+
const did = row[didColumnIndex];
|
|
615
|
+
if (did) {
|
|
616
|
+
const didNumber = typeof did === 'string' ? Number.parseInt(did, 10) : did;
|
|
617
|
+
if (!Number.isNaN(didNumber)) {
|
|
618
|
+
pairedDIDs.push(didNumber);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
return pairedDIDs;
|
|
623
|
+
}
|
|
624
|
+
catch (error) {
|
|
625
|
+
console.error('getAlreadyPairedDIDs - Error:', error);
|
|
626
|
+
return [];
|
|
627
|
+
}
|
|
628
|
+
};
|
|
629
|
+
const executeManyToManyPairing = async (relation, isPairing) => {
|
|
630
|
+
const searchEngine = SDK_Globals.tmSession?.NewSearchEngine();
|
|
631
|
+
if (!focusedItem?.TID || !focusedItem?.DID) {
|
|
632
|
+
alert("Seleziona un documento per eseguire la ricerca molti-a-molti.");
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
let qd;
|
|
636
|
+
if (relation.detailTID === selectedSearchResult?.fromTID) {
|
|
637
|
+
qd = relation.retrieveMastersQuery;
|
|
638
|
+
}
|
|
639
|
+
if (relation.masterTID === selectedSearchResult?.fromTID) {
|
|
640
|
+
qd = relation.retrieveDetailsQuery;
|
|
641
|
+
}
|
|
642
|
+
if (!qd) {
|
|
643
|
+
alert("La relazione molti-a-molti selezionata non ha una query di ricerca definita.");
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
qd = structuredClone(qd);
|
|
647
|
+
if (qd.select) {
|
|
648
|
+
for (const s of qd.select) {
|
|
649
|
+
s.visibility = 1;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
const qdRetrieveParamsValue = {
|
|
653
|
+
from: { tid: focusedItem.TID },
|
|
654
|
+
select: [],
|
|
655
|
+
where: [
|
|
656
|
+
{
|
|
657
|
+
tid: focusedItem.TID,
|
|
658
|
+
mid: 5,
|
|
659
|
+
leftBrackets: "(",
|
|
660
|
+
rightBrackets: ")",
|
|
661
|
+
operator: 0,
|
|
662
|
+
value1: focusedItem.DID.toString()
|
|
663
|
+
}
|
|
664
|
+
]
|
|
665
|
+
};
|
|
666
|
+
let notMappedMIDs = false;
|
|
667
|
+
if (qd.params && qd.params.length > 0) {
|
|
668
|
+
for (const param of qd.params) {
|
|
669
|
+
if (!param.mappedMID)
|
|
670
|
+
continue;
|
|
671
|
+
qdRetrieveParamsValue.select.push({
|
|
672
|
+
tid: param.mappedTID ?? focusedItem.TID,
|
|
673
|
+
mid: param.mappedMID,
|
|
674
|
+
visibility: 1
|
|
675
|
+
});
|
|
676
|
+
const currentRowValue = currentSearchResults[0]?.dtdResult?.rows?.[focusedItem.rowIndex];
|
|
677
|
+
const midIndex = currentSearchResults[0]?.selectMIDs?.indexOf(param.mappedMID);
|
|
678
|
+
if (currentRowValue && midIndex !== undefined && midIndex >= 0) {
|
|
679
|
+
const value = currentRowValue[midIndex];
|
|
680
|
+
param.value = value ?? '';
|
|
681
|
+
if (param.value === null || param.value === '')
|
|
682
|
+
notMappedMIDs = true;
|
|
683
|
+
}
|
|
684
|
+
else {
|
|
685
|
+
notMappedMIDs = true;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
if (notMappedMIDs && qdRetrieveParamsValue.select && qdRetrieveParamsValue.select.length > 0) {
|
|
689
|
+
const paramMetadata = await searchEngine.SearchByIDAsync(qdRetrieveParamsValue);
|
|
690
|
+
if (paramMetadata?.dtdResult?.rows?.[0]) {
|
|
691
|
+
for (const param of qd.params) {
|
|
692
|
+
if (!param.mappedMID)
|
|
693
|
+
continue;
|
|
694
|
+
const colIndex = paramMetadata.selectMIDs?.indexOf(param.mappedMID);
|
|
695
|
+
if (colIndex !== undefined && colIndex >= 0) {
|
|
696
|
+
const value = paramMetadata.dtdResult.rows[0][colIndex];
|
|
697
|
+
param.value = value ?? '';
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
if (qd.where && qd.where.length > 0) {
|
|
703
|
+
for (const whereItem of qd.where) {
|
|
704
|
+
for (const param of qd.params) {
|
|
705
|
+
if (!param.name)
|
|
706
|
+
continue;
|
|
707
|
+
param.value ??= '';
|
|
708
|
+
const paramValue = param.value.toString();
|
|
709
|
+
if (whereItem.value1) {
|
|
710
|
+
whereItem.value1 = whereItem.value1.replace(param.name, paramValue);
|
|
711
|
+
}
|
|
712
|
+
if (whereItem.value2) {
|
|
713
|
+
whereItem.value2 = whereItem.value2.replace(param.name, paramValue);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
const targetTID = relation.detailTID === selectedSearchResult?.fromTID
|
|
720
|
+
? relation.masterTID
|
|
721
|
+
: relation.detailTID;
|
|
722
|
+
const qdWithDID = structuredClone(qd);
|
|
723
|
+
const didSelect = { tid: targetTID, mid: 1, visibility: 1 };
|
|
724
|
+
const fileExtSelect = { tid: targetTID, mid: 5, visibility: 1 };
|
|
725
|
+
if (qdWithDID.select) {
|
|
726
|
+
qdWithDID.select = [didSelect, fileExtSelect, ...qdWithDID.select];
|
|
727
|
+
}
|
|
728
|
+
else {
|
|
729
|
+
qdWithDID.select = [didSelect, fileExtSelect];
|
|
730
|
+
}
|
|
731
|
+
const sq = await searchEngine.SearchByIDAsync(qdWithDID);
|
|
732
|
+
if (!sq?.dtdResult?.rows || sq.dtdResult.rows.length === 0) {
|
|
733
|
+
alert("Nessun documento trovato.");
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
736
|
+
const pairedDIDs = await getAlreadyPairedDIDs(relation, focusedItem.TID, focusedItem.DID);
|
|
737
|
+
const filteredRows = sq.dtdResult.rows.filter(row => {
|
|
738
|
+
const did = row[0];
|
|
739
|
+
const didNum = typeof did === 'string' ? parseInt(did, 10) : did;
|
|
740
|
+
if (isPairing) {
|
|
741
|
+
return !pairedDIDs.includes(didNum);
|
|
742
|
+
}
|
|
743
|
+
else {
|
|
744
|
+
return pairedDIDs.includes(didNum);
|
|
745
|
+
}
|
|
746
|
+
});
|
|
747
|
+
const filteredSq = {
|
|
748
|
+
...sq,
|
|
749
|
+
dtdResult: {
|
|
750
|
+
...sq.dtdResult,
|
|
751
|
+
rows: filteredRows
|
|
752
|
+
},
|
|
753
|
+
dcmtsReturned: filteredRows.length,
|
|
754
|
+
dcmtsFound: filteredRows.length
|
|
755
|
+
};
|
|
756
|
+
if (filteredRows.length === 0) {
|
|
757
|
+
alert(isPairing ? "Nessun documento da abbinare." : "Nessun documento abbinato trovato.");
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
760
|
+
setPairedSearchResults([filteredSq]);
|
|
761
|
+
setIsPairingManyToMany(isPairing);
|
|
762
|
+
setShowPairDcmtsModal(true);
|
|
763
|
+
};
|
|
764
|
+
const pairManyToMany = async (isPairing) => {
|
|
765
|
+
try {
|
|
766
|
+
TMSpinner.show({ description: SDKUI_Localizator.Loading });
|
|
767
|
+
const relations = await getAllRelationsAsync();
|
|
768
|
+
if (!relations)
|
|
769
|
+
return;
|
|
770
|
+
if (!relations.some(r => r.relationType === RelationTypes.ManyToMany)) {
|
|
771
|
+
alert("Nessuna relazione molti-a-molti definita nel sistema.");
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
const manyToManyRels = relations.filter(r => r.relationType === RelationTypes.ManyToMany);
|
|
775
|
+
if (!manyToManyRels.some(r => r.masterTID === selectedSearchResult?.fromTID || r.detailTID === selectedSearchResult?.fromTID)) {
|
|
776
|
+
alert("Nessuna relazione molti-a-molti definita per il tipo di documento selezionato.");
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
const relsManyToMany = manyToManyRels.filter(r => r.masterTID === selectedSearchResult?.fromTID || r.detailTID === selectedSearchResult?.fromTID);
|
|
780
|
+
setManyToManyRelations(relsManyToMany);
|
|
781
|
+
if (relsManyToMany.length > 1) {
|
|
782
|
+
const dataSourcePromises = relsManyToMany.map(async (rel) => {
|
|
783
|
+
const targetTID = rel.masterTID === selectedSearchResult?.fromTID ? rel.detailTID : rel.masterTID;
|
|
784
|
+
const relatedDcmt = await DcmtTypeListCacheService.GetAsync(targetTID);
|
|
785
|
+
return { id: rel?.id, name: relatedDcmt?.name };
|
|
786
|
+
});
|
|
787
|
+
const dataSource = await Promise.all(dataSourcePromises);
|
|
788
|
+
setManyToManyChooserDataSource(dataSource);
|
|
789
|
+
setIsPairingManyToMany(isPairing);
|
|
790
|
+
setShowManyToManyChooser(true);
|
|
791
|
+
}
|
|
792
|
+
else {
|
|
793
|
+
await executeManyToManyPairing(relsManyToMany[0], isPairing);
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
catch (error) {
|
|
797
|
+
TMExceptionBoxManager.show({ exception: error });
|
|
798
|
+
}
|
|
799
|
+
finally {
|
|
800
|
+
TMSpinner.hide();
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
//#endregion Related Documents Archive Section
|
|
804
|
+
const searchResutlToolbar = _jsxs(_Fragment, { children: [(dcmtsReturned != dcmtsFound) && _jsx("p", { style: { backgroundColor: `white`, color: TMColors.primaryColor, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${dcmtsReturned}/${dcmtsFound} restituiti` }), context === SearchResultContext.FAVORITES_AND_RECENTS &&
|
|
805
|
+
_jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconDelete, { color: 'white' }), caption: "Rimuovi da " + (selectedSearchResult?.category === "Favorites" ? '"Preferiti"' : '"Recenti"'), disabled: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length <= 0, onClick: removeDcmtFromFavsOrRecents }) }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconRefresh, { color: 'white' }), caption: SDKUI_Localizator.Refresh, onClick: onRefreshSearchAsync }), _jsx(IconMenuVertical, { id: `commands-header-${id}`, color: 'white', cursor: 'pointer' }), _jsx(TMCommandsContextMenu, { target: `#commands-header-${id}`, showEvent: "click", menuItems: getCommandsMenuItems(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany) })] });
|
|
806
|
+
const middlePanelToolbar = _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: '10px' }, children: [_jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', isModified: false, iconColor: TMColors.default_background, formMode: FormModes.ReadOnly, canPrev: canNavigateHandler('prev'), onPrev: () => onNavigateHandler('prev') }), _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', isModified: false, iconColor: TMColors.default_background, formMode: FormModes.ReadOnly, canNext: canNavigateHandler('next'), onNext: () => onNavigateHandler('next') })] });
|
|
807
|
+
const handleAddItem = (tid, did) => {
|
|
808
|
+
let newItem = { TID: tid ?? 0, DID: did ?? 0 };
|
|
809
|
+
setSecondaryMasterDcmts((prevItems) => [...prevItems, newItem]);
|
|
810
|
+
};
|
|
811
|
+
const handleRemoveItem = (tid, did) => {
|
|
812
|
+
setSecondaryMasterDcmts((prevItems) => prevItems.filter(item => item.TID !== tid && item.DID !== did));
|
|
813
|
+
};
|
|
814
|
+
const showToppyForApprove = (isVisible && fromDTD?.templateTID === TemplateTIDs.WF_WIApprView && !isOpenDcmtForm && !isOpenDetails && !isOpenMaster);
|
|
815
|
+
const tmSearchResult = useMemo(() => (!searchResults || searchResults.length <= 0)
|
|
816
|
+
? _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%' }, children: [_jsx(IconBoard, { fontSize: 96 }), _jsx("div", { style: { fontSize: "15px", marginTop: "10px" }, children: SDKUI_Localizator.NoDcmtFound }), openAddDocumentForm && _jsx("div", { style: { marginTop: "10px" }, children: _jsx(TMButton, { fontSize: "15px", icon: _jsx("i", { className: 'dx-icon-share' }), caption: SDKUI_Localizator.Share, onClick: openAddDocumentForm }) })] })
|
|
817
|
+
:
|
|
818
|
+
_jsxs(_Fragment, { children: [_jsxs(TMLayoutItem, { height: '100%', children: [_jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: Gutters.getGutters(), separatorActiveColor: 'transparent', separatorColor: 'transparent', min: ['0', '0'], showSeparator: showSelector && deviceType !== DeviceType.MOBILE, start: showSelector ? deviceType !== DeviceType.MOBILE ? ['30%', '70%'] : splitterSize : ['0%', '100%'], children: [showSelector ?
|
|
819
|
+
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
820
|
+
:
|
|
821
|
+
_jsx(_Fragment, {}), _jsxs(TMLayoutItem, { children: [_jsx(TMSearchResultGrid, { showSearch: showSearch, inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], lastUpdateSearchTime: lastUpdateSearchTime, openInOffice: openInOffice, onDblClick: () => openFormHandler(LayoutModes.Update), onContextMenuPreparing: onContextMenuPreparing, onSelectionChanged: (items) => { setSelectedItems(items); }, onVisibleItemChanged: setVisibleItems, onFocusedItemChanged: setFocusedItem, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync(inputDcmts, downloadType, downloadMode, onFileOpened, confirmAttachments), showExportForm: showExportForm, onCloseExportForm: onCloseExportForm }), allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE &&
|
|
822
|
+
_jsxs(TMFloatingToolbar, { backgroundColor: TMColors.primaryColor, initialLeft: '10px', initialTop: 'calc(100% - 75px)', children: [fromDTD?.perm?.canRetrieveFile === AccessLevels.Yes && _jsx(TMButton, { btnStyle: 'icon', caption: "Download file", disabled: fromDTD?.perm?.canRetrieveFile !== AccessLevels.Yes || !focusedItem?.DID, icon: _jsx(IconDownload, { color: 'white' }), onClick: () => { downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download"); } }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasDetailRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true) }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasMasterRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white', transform: 'scale(-1, 1)' }), caption: SDKUI_Localizator.DcmtsMaster, onClick: () => setIsOpenMaster(true) }), _jsx(IconMenuVertical, { id: `commands-floating-${id}`, color: 'white', cursor: 'pointer' }), _jsx(TMCommandsContextMenu, { target: `#commands-floating-${id}`, showEvent: "click", menuItems: getCommandsMenuItems(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany) })] })] })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { TID: focusedItem?.TID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: onWFOperationCompleted, onClose: () => setShowMoreInfoPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: `${SDKUI_Localizator.BatchUpdate} (${getSelectionDcmtInfo().length} documenti selezionati)`, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
|
|
823
|
+
setIsOpenBatchUpdate(false);
|
|
824
|
+
}, onSavedCallbackAsync: async () => {
|
|
825
|
+
setIsOpenBatchUpdate(false);
|
|
826
|
+
setIsModifiedBatchUpdate(false);
|
|
827
|
+
await refreshSelectionDataRowsAsync();
|
|
828
|
+
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), (showToppyForApprove && !showApprovePopup && !showRejectPopup && !showReAssignPopup && !showMoreInfoPopup && !openS4TViewer && !showTodoDcmtForm) &&
|
|
829
|
+
_jsx(ToppyHelpCenter, { deviceType: deviceType, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), approveDisable: disable, signApproveDisable: disableSignApproveDisable, rejectDisable: disable, reassignDisable: disable, infoDisable: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length !== 1 }) }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), showRelatedDcmtsChooser &&
|
|
830
|
+
_jsx(TMChooserForm, { dataSource: relatedDcmtsChooserDataSource, onChoose: async (selectedRelation) => {
|
|
831
|
+
try {
|
|
832
|
+
setShowRelatedDcmtsChooser(false);
|
|
833
|
+
TMSpinner.show({ description: SDKUI_Localizator.Loading });
|
|
834
|
+
const relation = relatedDcmts?.find(r => r.id === selectedRelation[0]);
|
|
835
|
+
if (!relation || !archiveType)
|
|
836
|
+
return;
|
|
837
|
+
archiveRelatedDcmtHandler(relation, archiveType);
|
|
838
|
+
}
|
|
839
|
+
catch (error) {
|
|
840
|
+
TMExceptionBoxManager.show({ exception: error });
|
|
841
|
+
}
|
|
842
|
+
finally {
|
|
843
|
+
TMSpinner.hide();
|
|
844
|
+
}
|
|
845
|
+
}, onClose: () => setShowRelatedDcmtsChooser(false), manageUseLocalizedName: false }), showManyToManyChooser &&
|
|
846
|
+
_jsx(TMChooserForm, { dataSource: manyToManyChooserDataSource, onChoose: async (selectedRelation) => {
|
|
847
|
+
try {
|
|
848
|
+
setShowManyToManyChooser(false);
|
|
849
|
+
TMSpinner.show({ description: SDKUI_Localizator.Loading });
|
|
850
|
+
const relation = manyToManyRelations?.find(r => r.id === selectedRelation[0]);
|
|
851
|
+
if (!relation)
|
|
852
|
+
return;
|
|
853
|
+
await executeManyToManyPairing(relation, isPairingManyToMany);
|
|
854
|
+
}
|
|
855
|
+
catch (error) {
|
|
856
|
+
TMExceptionBoxManager.show({ exception: error });
|
|
857
|
+
}
|
|
858
|
+
finally {
|
|
859
|
+
TMSpinner.hide();
|
|
860
|
+
}
|
|
861
|
+
}, onClose: () => setShowManyToManyChooser(false), manageUseLocalizedName: false }), showPairDcmtsModal &&
|
|
862
|
+
_jsx(TMModal, { title: (isPairingManyToMany ? "Abbina" : "Disabbina") + " documenti", onClose: () => setShowPairDcmtsModal(false), children: _jsx(TMSearchResult, { searchResults: pairedSearchResults, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync: onRefreshSearchAsync, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, openEditPdf: openEditPdf, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, passToArchiveCallback: passToArchiveCallback, showTodoDcmtForm: showTodoDcmtForm, floatingActionConfig: pairFloatingActionConfig }) }), (floatingActionConfig && floatingActionConfig.isVisible) && _jsx(TMSearchResultFloatingActionButton, { selectedDcmtsOrFocused: getSelectedDcmtsOrFocused(selectedItems, focusedItem), config: floatingActionConfig })] }), [
|
|
863
|
+
searchResults,
|
|
864
|
+
selectedSearchResult,
|
|
865
|
+
lastUpdateSearchTime,
|
|
866
|
+
focusedItem,
|
|
867
|
+
selectedItems,
|
|
868
|
+
fromDTD,
|
|
869
|
+
currentTIDHasDetailRelations,
|
|
870
|
+
currentTIDHasMasterRelations,
|
|
871
|
+
canArchiveMasterRelation,
|
|
872
|
+
canArchiveDetailRelation,
|
|
873
|
+
showApprovePopup,
|
|
874
|
+
showRejectPopup,
|
|
875
|
+
showReAssignPopup,
|
|
876
|
+
showFloatingBar,
|
|
877
|
+
isOpenBatchUpdate,
|
|
878
|
+
isOpenDetails,
|
|
879
|
+
isOpenMaster,
|
|
880
|
+
isOpenDcmtForm,
|
|
881
|
+
isOpenArchiveRelationForm,
|
|
882
|
+
showToppyForApprove,
|
|
883
|
+
floatingActionConfig,
|
|
884
|
+
disableAccordionIfSingleCategory,
|
|
885
|
+
getTitleHeader,
|
|
886
|
+
openS4TViewer,
|
|
887
|
+
showRelatedDcmtsChooser,
|
|
888
|
+
relatedDcmts,
|
|
889
|
+
setShowRelatedDcmtsChooser,
|
|
890
|
+
relatedDcmtsChooserDataSource,
|
|
891
|
+
showManyToManyChooser,
|
|
892
|
+
manyToManyRelations,
|
|
893
|
+
manyToManyChooserDataSource,
|
|
894
|
+
showPairDcmtsModal,
|
|
895
|
+
isPairingManyToMany,
|
|
896
|
+
pairedSearchResults,
|
|
897
|
+
]);
|
|
898
|
+
const tmBlog = useMemo(() => _jsx(TMDcmtBlog, { tid: focusedItem?.TID, did: focusedItem?.DID }), [focusedItem]);
|
|
899
|
+
const tmSysMetadata = useMemo(() => _jsx(TMMetadataValues, { layoutMode: LayoutModes.Update, openChooserBySingleClick: true, TID: focusedItem?.TID, isReadOnly: true, deviceType: deviceType, metadataValues: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [] }), [focusedItem, currentMetadataValues, deviceType]);
|
|
900
|
+
const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { currentDcmt: currentDcmt }), [currentDcmt]);
|
|
901
|
+
const allInitialPanelVisibility = {
|
|
902
|
+
'tmSearchResult': true,
|
|
903
|
+
'tmBlog': false,
|
|
904
|
+
'tmSysMetadata': false,
|
|
905
|
+
'tmDcmtPreview': false,
|
|
906
|
+
};
|
|
907
|
+
const initialPanelDimensions = {
|
|
908
|
+
'tmSearchResult': { width: '25%', height: '100%' },
|
|
909
|
+
'tmBlog': { width: '25%', height: '100%' },
|
|
910
|
+
'tmSysMetadata': { width: '25%', height: '100%' },
|
|
911
|
+
'tmDcmtPreview': { width: '25%', height: '100%' },
|
|
912
|
+
};
|
|
913
|
+
const initialPanels = useMemo(() => [
|
|
914
|
+
{
|
|
915
|
+
id: 'tmSearchResult',
|
|
916
|
+
name: getTitleHeader(),
|
|
917
|
+
contentOptions: {
|
|
918
|
+
component: tmSearchResult,
|
|
919
|
+
panelContainer: {
|
|
920
|
+
title: getTitleHeader(),
|
|
921
|
+
showHeader: showToolbarHeader,
|
|
922
|
+
allowMaximize: !isMobile,
|
|
923
|
+
onBack: (!isClosable && context === SearchResultContext.METADATA_SEARCH) || (isMobile && context !== SearchResultContext.METADATA_SEARCH && splitterSize[1] === '100%') ? onBack : undefined,
|
|
924
|
+
onClose: isClosable ? onBack : undefined,
|
|
925
|
+
toolbar: searchResutlToolbar
|
|
926
|
+
},
|
|
927
|
+
},
|
|
928
|
+
toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: true, orderNumber: 1, isActive: allInitialPanelVisibility['tmSearchResult'] }
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
id: 'tmBlog',
|
|
932
|
+
name: SDKUI_Localizator.BlogCase,
|
|
933
|
+
contentOptions: { component: tmBlog, panelContainer: { title: SDKUI_Localizator.BlogCase, allowMaximize: !isMobile } },
|
|
934
|
+
toolbarOptions: { icon: _jsx(IconBoard, { fontSize: 24 }), visible: true, orderNumber: 2, isActive: allInitialPanelVisibility['tmBlog'] }
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
id: 'tmSysMetadata',
|
|
938
|
+
name: SDKUI_Localizator.MetadataSystem,
|
|
939
|
+
contentOptions: { component: tmSysMetadata, panelContainer: { title: SDKUI_Localizator.MetadataSystem, allowMaximize: !isMobile } },
|
|
940
|
+
toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: true, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
id: 'tmDcmtPreview',
|
|
944
|
+
name: SDKUI_Localizator.PreviewDocument,
|
|
945
|
+
contentOptions: { component: tmDcmtPreview },
|
|
946
|
+
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
|
|
947
|
+
}
|
|
948
|
+
], [tmSearchResult, tmBlog, tmSysMetadata, tmDcmtPreview, showToolbarHeader]);
|
|
949
|
+
return (_jsxs(StyledMultiViewPanel, { "$isVisible": isVisible, children: [_jsx(StyledMultiViewPanel, { "$isVisible": !isOpenDcmtForm && !isOpenDetails && !isOpenMaster, style: {
|
|
950
|
+
display: 'flex',
|
|
951
|
+
flexDirection: isMobile ? 'column' : 'row',
|
|
952
|
+
justifyContent: 'space-between',
|
|
953
|
+
gap: Gutters.getGutters(),
|
|
954
|
+
width: '100%',
|
|
955
|
+
height: '100%',
|
|
956
|
+
}, children: _jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: (groupId && groupId.length > 0) ?
|
|
957
|
+
_jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showSearchResultSidebar })
|
|
958
|
+
:
|
|
959
|
+
_jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmSearchResult', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showSearchResultSidebar }) }) }) }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDetails, children: isOpenDetails && _jsx(TMMasterDetailDcmts, { deviceType: deviceType, isForMaster: false, inputDcmts: getSelectionDcmtInfo(), allowNavigation: focusedItem && selectedItems.length <= 0, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onBack: () => setIsOpenDetails(false) }) }), _jsxs(StyledMultiViewPanel, { "$isVisible": isOpenMaster, children: [isOpenMaster && _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: getSelectionDcmtInfo(), isForMaster: true, allowNavigation: focusedItem && selectedItems.length <= 0, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onBack: () => setIsOpenMaster(false), appendMasterDcmts: handleAddItem }), secondaryMasterDcmts.length > 0 && secondaryMasterDcmts.map((dcmt, index) => {
|
|
960
|
+
return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: [dcmt], isForMaster: true, allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID), appendMasterDcmts: handleAddItem }) }, `${index}-${dcmt.DID}`));
|
|
961
|
+
})] }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: isOpenDcmtForm && _jsx(TMDcmtForm, { isModal: openDcmtFormAsModal || (dcmtFormLayoutMode === LayoutModes.Ark && focusedItem?.DID), titleModal: fromDTD?.name ?? '', TID: focusedItem?.TID, DID: focusedItem?.DID, layoutMode: dcmtFormLayoutMode, count: visibleItems.length, itemIndex: visibleItems.findIndex(o => o.rowIndex === focusedItem?.rowIndex) + 1, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onClose: () => { setIsOpenDcmtForm(false); }, onWFOperationCompleted: onWFOperationCompleted, onTaskCreateRequest: onTaskCreateRequest, onSavedAsyncCallback: async (tid, did, metadataResult) => {
|
|
962
|
+
await refreshFocusedDataRowAsync(tid, did, true, metadataResult);
|
|
963
|
+
}, onOpenS4TViewerRequest: onOpenS4TViewerRequest }) }), isOpenArchiveRelationForm && _jsx(TMDcmtForm, { isModal: true, titleModal: SDKUI_Localizator.Archive + ' - ' + (archiveType === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster), TID: archiveRelatedDcmtFormTID, layoutMode: LayoutModes.Ark, inputMids: archiveRelatedDcmtFormMids, onClose: () => {
|
|
964
|
+
setIsOpenArchiveRelationForm(false);
|
|
965
|
+
setArchiveType(undefined);
|
|
966
|
+
setArchiveRelatedDcmtFormTID(undefined);
|
|
967
|
+
setArchiveRelatedDcmtFormMids([]);
|
|
968
|
+
}, onSavedAsyncCallback: async (tid, did, metadataResult) => {
|
|
969
|
+
setIsOpenArchiveRelationForm(false);
|
|
970
|
+
setArchiveType(undefined);
|
|
971
|
+
setArchiveRelatedDcmtFormTID(undefined);
|
|
972
|
+
setArchiveRelatedDcmtFormMids([]);
|
|
973
|
+
await onRefreshSearchAsync?.();
|
|
974
|
+
} })] }));
|
|
975
|
+
};
|
|
976
|
+
export default TMSearchResult;
|
|
977
|
+
const renderDcmtIcon = (cellData, onDownloadDcmtsAsync, openInOffice) => _jsx(TMDcmtIcon, { tid: cellData.data.TID, did: cellData.data.DID, fileExtension: cellData.data.FILEEXT, fileCount: cellData.data.FILECOUNT, isLexProt: cellData.data.IsLexProt, isMail: cellData.data.ISMAIL, isShared: cellData.data.ISSHARED, isSigned: cellData.data.ISSIGNED, downloadMode: 'openInNewWindow', onDownloadDcmtsAsync: onDownloadDcmtsAsync, openInOffice: openInOffice });
|
|
978
|
+
const TMSearchResultGrid = ({ openInOffice, inputFocusedItem, showSearch, allowMultipleSelection = true, showExportForm = false, onCloseExportForm, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, onContextMenuPreparing, onSelectionChanged, onDblClick }) => {
|
|
979
|
+
const [dataSource, setDataSource] = useState();
|
|
980
|
+
const [columns, setColumns] = useState([]);
|
|
981
|
+
// State to store selected row keys
|
|
982
|
+
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
|
983
|
+
const [focusedItem, setFocusedItem] = useState();
|
|
984
|
+
const [visibleItems, setVisibleItems] = useState([]);
|
|
985
|
+
useEffect(() => {
|
|
986
|
+
if (deepCompare(inputFocusedItem, focusedItem))
|
|
987
|
+
return;
|
|
988
|
+
setFocusedItem(inputFocusedItem);
|
|
989
|
+
}, [inputFocusedItem]);
|
|
990
|
+
useEffect(() => {
|
|
991
|
+
const inputSelectedItemsRowIndex = inputSelectedItems.map(e => e.rowIndex);
|
|
992
|
+
if (JSON.stringify(inputSelectedItemsRowIndex) === JSON.stringify(selectedRowKeys))
|
|
993
|
+
return;
|
|
994
|
+
setSelectedRowKeys(inputSelectedItemsRowIndex);
|
|
995
|
+
}, [inputSelectedItems]);
|
|
996
|
+
const onKeyDown = useCallback((e) => {
|
|
997
|
+
// Check if the pressed key is the "Delete" key.
|
|
998
|
+
if (e.event?.key === 'Delete' && !showExportForm) {
|
|
999
|
+
// Get the selected or focused documents/items from the grid.
|
|
1000
|
+
const dcmts = getSelectedDcmtsOrFocused(inputSelectedItems, inputFocusedItem);
|
|
1001
|
+
// If there are no selected or focused items, do nothing.
|
|
1002
|
+
if (dcmts === undefined || dcmts.length === 0)
|
|
1003
|
+
return;
|
|
1004
|
+
// --- CASE 1: Only one item selected ---
|
|
1005
|
+
if (dcmts.length === 1) {
|
|
1006
|
+
const current = dcmts[0];
|
|
1007
|
+
// If the selected item has a row index (valid entry)
|
|
1008
|
+
if (current.rowIndex !== undefined) {
|
|
1009
|
+
TMSpinner.show({ description: SDKUI_Localizator.RemovingFromList });
|
|
1010
|
+
const currentDataSource = dataSource ?? [];
|
|
1011
|
+
setTimeout(() => {
|
|
1012
|
+
// Remove the selected item from the data source by filtering it out.
|
|
1013
|
+
setDataSource(currentDataSource.filter((data) => data.rowIndex !== current.rowIndex));
|
|
1014
|
+
// Clear any selection, focused item, and update callbacks.
|
|
1015
|
+
onSelectionChanged?.([]);
|
|
1016
|
+
setSelectedRowKeys([]);
|
|
1017
|
+
onFocusedItemChanged?.(undefined);
|
|
1018
|
+
setFocusedItem(undefined);
|
|
1019
|
+
TMSpinner.hide();
|
|
1020
|
+
}, 500);
|
|
1021
|
+
}
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1024
|
+
// --- CASE 2: Multiple items selected ---
|
|
1025
|
+
if (dcmts.length > 1) {
|
|
1026
|
+
// Show a confirmation message box before deleting multiple items.
|
|
1027
|
+
TMMessageBoxManager.show({
|
|
1028
|
+
buttons: [ButtonNames.YES, ButtonNames.NO],
|
|
1029
|
+
title: SDKUI_Localizator.RemoveFromList,
|
|
1030
|
+
message: `${SDKUI_Localizator.ConfirmSelectedDocumentsMessage.replaceParams(dcmts.length)}`,
|
|
1031
|
+
confirmOnEnter: true,
|
|
1032
|
+
onButtonClick(e) {
|
|
1033
|
+
// Only proceed if user clicks "YES"
|
|
1034
|
+
if (e !== ButtonNames.YES)
|
|
1035
|
+
return;
|
|
1036
|
+
TMSpinner.show({ description: SDKUI_Localizator.RemovingFromList });
|
|
1037
|
+
const currentDataSource = dataSource ?? [];
|
|
1038
|
+
setTimeout(() => {
|
|
1039
|
+
// Remove all selected items from the data source.
|
|
1040
|
+
setDataSource(currentDataSource.filter((data) => !dcmts.some((d) => d.rowIndex === data.rowIndex)));
|
|
1041
|
+
// Clear selections and focus after deletion.
|
|
1042
|
+
onSelectionChanged?.([]);
|
|
1043
|
+
setSelectedRowKeys([]);
|
|
1044
|
+
onFocusedItemChanged?.(undefined);
|
|
1045
|
+
setFocusedItem(undefined);
|
|
1046
|
+
TMSpinner.hide();
|
|
1047
|
+
}, 500);
|
|
1048
|
+
},
|
|
1049
|
+
});
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
}, [inputSelectedItems, inputFocusedItem, dataSource]);
|
|
1053
|
+
const cellRender = useCallback((cellData, dataDomain, dataListID, dataListViewMode) => {
|
|
1054
|
+
if (!cellData || cellData.value === undefined)
|
|
1055
|
+
return null;
|
|
1056
|
+
const isLogDel = cellData.data.ISLOGDEL == 1;
|
|
1057
|
+
const isLexProt = cellData.data.IsLexProt == 1;
|
|
1058
|
+
let style = {};
|
|
1059
|
+
if (isLogDel) {
|
|
1060
|
+
style = { color: 'gray', textDecoration: 'line-through' };
|
|
1061
|
+
}
|
|
1062
|
+
else if (isLexProt)
|
|
1063
|
+
style = { color: 'blue' };
|
|
1064
|
+
let child = _jsx("div", { children: cellData.text });
|
|
1065
|
+
if (dataDomain === MetadataDataDomains.DataList) {
|
|
1066
|
+
child = _jsx(TMDataListItemViewer, { dataListId: dataListID, viewMode: dataListViewMode, value: cellData.value });
|
|
1067
|
+
}
|
|
1068
|
+
if (dataDomain === MetadataDataDomains.UserID) {
|
|
1069
|
+
child = _jsx(TMUserIdViewer, { userId: cellData.value, showIcon: true, noneSelectionText: '' });
|
|
1070
|
+
}
|
|
1071
|
+
return _jsx("div", { style: style, children: child });
|
|
1072
|
+
}, []);
|
|
1073
|
+
const dataType = useCallback((col) => {
|
|
1074
|
+
switch (col.dataType) {
|
|
1075
|
+
case DataColumnTypes.DateTime: return "datetime";
|
|
1076
|
+
case DataColumnTypes.Bool: return "boolean";
|
|
1077
|
+
case DataColumnTypes.Number: return "number";
|
|
1078
|
+
default: return "string";
|
|
1079
|
+
}
|
|
1080
|
+
}, []);
|
|
1081
|
+
const getDisplayFormat = useCallback((col) => {
|
|
1082
|
+
if (col.dataType === DataColumnTypes.Text)
|
|
1083
|
+
return undefined;
|
|
1084
|
+
const format = MetadataFormats[(col.extendedProperties?.["Format"] ?? "None")];
|
|
1085
|
+
const formatCulture = col.extendedProperties?.["FormatCulture"] ?? window.navigator.language;
|
|
1086
|
+
if (col.dataType === DataColumnTypes.DateTime) {
|
|
1087
|
+
return {
|
|
1088
|
+
formatter: function (value) {
|
|
1089
|
+
switch (format) {
|
|
1090
|
+
case MetadataFormats.ShortDate: return value.toLocaleString(formatCulture, formatCulture == "it-IT" ? { year: "numeric", month: "2-digit", day: "2-digit" } : { dateStyle: 'short' });
|
|
1091
|
+
case MetadataFormats.ShortTime: return value.toLocaleString(formatCulture, { timeStyle: 'short' });
|
|
1092
|
+
case MetadataFormats.ShortDateLongTime: return value.toLocaleString(formatCulture, formatCulture == "it-IT" ? { year: "numeric", month: "2-digit", day: "2-digit", hour: '2-digit', minute: '2-digit', second: '2-digit' } : { dateStyle: 'short', timeStyle: 'medium' }).replace(',', '');
|
|
1093
|
+
case MetadataFormats.ShortDateShortTime: return value.toLocaleString(formatCulture, formatCulture == "it-IT" ? { year: "numeric", month: "2-digit", day: "2-digit", hour: '2-digit', minute: '2-digit' } : { dateStyle: 'short', timeStyle: 'short' }).replace(',', '');
|
|
1094
|
+
case MetadataFormats.LongDate: return value.toLocaleString(formatCulture, { weekday: "long", year: "numeric", month: "long", day: "numeric" });
|
|
1095
|
+
case MetadataFormats.LongTime: return value.toLocaleString(formatCulture, { timeStyle: 'medium' });
|
|
1096
|
+
case MetadataFormats.LongDateLongTime: return value.toLocaleString(formatCulture, { weekday: "long", year: "numeric", month: "long", day: "numeric", hour: '2-digit', minute: '2-digit', second: '2-digit' });
|
|
1097
|
+
case MetadataFormats.LongDateShortTime: return value.toLocaleString(formatCulture, { weekday: "long", year: "numeric", month: "long", day: "numeric", hour: '2-digit', minute: '2-digit' });
|
|
1098
|
+
default: return value.toLocaleString(formatCulture, formatCulture == "it-IT" ? { year: "numeric", month: "2-digit", day: "2-digit" } : { dateStyle: 'short' });
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
};
|
|
1102
|
+
}
|
|
1103
|
+
if (col.dataType === DataColumnTypes.Number) {
|
|
1104
|
+
return {
|
|
1105
|
+
formatter: function (value) {
|
|
1106
|
+
return value.toLocaleString(formatCulture, { useGrouping: format == MetadataFormats.NumberWithThousandsSeparator });
|
|
1107
|
+
}
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1110
|
+
if (format == MetadataFormats.None)
|
|
1111
|
+
return undefined;
|
|
1112
|
+
if (format == MetadataFormats.CurrencyEuro)
|
|
1113
|
+
return { type: 'currency', precision: 2, currency: "EUR" };
|
|
1114
|
+
if (format == MetadataFormats.CurrencyDollar)
|
|
1115
|
+
return { type: 'currency', precision: 2, currency: "USD" };
|
|
1116
|
+
if (format == MetadataFormats.CurrencyPound)
|
|
1117
|
+
return { type: 'currency', precision: 2, currency: "GBP" };
|
|
1118
|
+
if (format == MetadataFormats.CurrencyYen)
|
|
1119
|
+
return { type: 'currency', currency: "JPY" };
|
|
1120
|
+
return undefined;
|
|
1121
|
+
}, []);
|
|
1122
|
+
useEffect(() => {
|
|
1123
|
+
setFocusedItem(undefined); // resetta sempre prima
|
|
1124
|
+
let cols = [];
|
|
1125
|
+
searchResult?.dtdResult?.columns?.map((col, index) => {
|
|
1126
|
+
let keyField = getDataColumnName(searchResult?.fromTID, col);
|
|
1127
|
+
const isVisible = col.extendedProperties?.["Visibility"] != "Hidden";
|
|
1128
|
+
const dataDomain = MetadataDataDomains[(col.extendedProperties?.["DataDomain"] ?? "None")];
|
|
1129
|
+
const dataListID = Number(col.extendedProperties?.["DataListID"]);
|
|
1130
|
+
const dataListViewMode = DataListViewModes[(col.extendedProperties?.["DataListViewMode"] ?? "None")];
|
|
1131
|
+
cols.push({
|
|
1132
|
+
dataField: keyField,
|
|
1133
|
+
dataType: dataType(col),
|
|
1134
|
+
visible: isVisible,
|
|
1135
|
+
cellRender: (cellData) => cellRender(cellData, dataDomain, dataListID, dataListViewMode),
|
|
1136
|
+
caption: col.caption,
|
|
1137
|
+
format: getDisplayFormat(col),
|
|
1138
|
+
});
|
|
1139
|
+
});
|
|
1140
|
+
setColumns(cols);
|
|
1141
|
+
let newDataSource = searchResultDescriptorToSimpleArray(searchResult);
|
|
1142
|
+
setDataSource(newDataSource);
|
|
1143
|
+
// setFocusedItem(newDataSource && newDataSource.length > 0 ? newDataSource[0] : undefined);
|
|
1144
|
+
}, [searchResult]);
|
|
1145
|
+
useEffect(() => {
|
|
1146
|
+
let newDataSource = searchResultDescriptorToSimpleArray(searchResult);
|
|
1147
|
+
setDataSource(newDataSource);
|
|
1148
|
+
// setFocusedItem(newDataSource?.find(o => o?.rowIndex === focusedItem?.rowIndex));
|
|
1149
|
+
}, [lastUpdateSearchTime]);
|
|
1150
|
+
// Handles selection change in the data grid
|
|
1151
|
+
const handleSelectionChange = useCallback((e) => {
|
|
1152
|
+
if (onSelectionChanged === undefined)
|
|
1153
|
+
return;
|
|
1154
|
+
const selectedRowsData = e.component.getSelectedRowsData() ?? [];
|
|
1155
|
+
onSelectionChanged(selectedRowsData);
|
|
1156
|
+
}, [onSelectionChanged]);
|
|
1157
|
+
// Handles focus change in the data grid
|
|
1158
|
+
const handleFocusedRowChange = useCallback((e) => {
|
|
1159
|
+
// if (setFocusedItem === undefined) return;
|
|
1160
|
+
// if (e.row === undefined) { setFocusedItem(undefined); return; }
|
|
1161
|
+
// setFocusedItem(e.row.data);
|
|
1162
|
+
onFocusedItemChanged?.(e.row?.data);
|
|
1163
|
+
}, [setFocusedItem]);
|
|
1164
|
+
// useEffect(() => {
|
|
1165
|
+
// onFocusedItemChanged?.(focusedItem)
|
|
1166
|
+
// }, [focusedItem])
|
|
1167
|
+
// Handler for double-click row event
|
|
1168
|
+
const onRowDblClick = useCallback((e) => {
|
|
1169
|
+
if (onDblClick === undefined)
|
|
1170
|
+
return;
|
|
1171
|
+
if (e.data === undefined)
|
|
1172
|
+
return;
|
|
1173
|
+
if (e.event?.target.closest('.tm-dcmt-icon')) {
|
|
1174
|
+
// Era sull'icona, non fare nulla
|
|
1175
|
+
return;
|
|
1176
|
+
}
|
|
1177
|
+
// setFocusedItem(e.data);
|
|
1178
|
+
onFocusedItemChanged?.(e.data);
|
|
1179
|
+
onDblClick();
|
|
1180
|
+
}, [onDblClick]);
|
|
1181
|
+
const dataColumns = useMemo(() => {
|
|
1182
|
+
return [
|
|
1183
|
+
{
|
|
1184
|
+
dataType: "object",
|
|
1185
|
+
dataField: 'FILEEXT',
|
|
1186
|
+
caption: '',
|
|
1187
|
+
visible: true,
|
|
1188
|
+
width: 50,
|
|
1189
|
+
cellRender: (cellData) => renderDcmtIcon(cellData, onDownloadDcmtsAsync, openInOffice),
|
|
1190
|
+
allowResizing: false,
|
|
1191
|
+
filterOperations: ['=']
|
|
1192
|
+
},
|
|
1193
|
+
...columns.filter(col => col.dataField !== 'FILEEXT')
|
|
1194
|
+
];
|
|
1195
|
+
}, [columns, onDownloadDcmtsAsync, openInOffice]);
|
|
1196
|
+
const onContentReady = useCallback((e) => {
|
|
1197
|
+
if (e === undefined)
|
|
1198
|
+
return;
|
|
1199
|
+
if (setVisibleItems === undefined)
|
|
1200
|
+
return;
|
|
1201
|
+
const visibleRows = e.component.getVisibleRows();
|
|
1202
|
+
setVisibleItems(visibleRows.map((row) => { return row.data; }));
|
|
1203
|
+
}, []);
|
|
1204
|
+
useEffect(() => { onVisibleItemChanged?.(visibleItems); }, [visibleItems]);
|
|
1205
|
+
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsx(TMDataGrid, { id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearch, showFilterPanel: true, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: TMDataGridPageSize.Small, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, onContextMenuPreparing: onContextMenuPreparing, onKeyDown: onKeyDown, counterConfig: { show: true } }), (showExportForm && searchResult && onCloseExportForm) && _jsx(TMDataGridExportForm, { dataColumns: dataColumns, dataSource: dataSource, selectedRowKeys: selectedRowKeys, onCloseExportForm: onCloseExportForm, searchResult: searchResult })] });
|
|
1206
|
+
};
|
|
1207
|
+
//#region TMSearchResultSelector
|
|
1208
|
+
const StyledItemTemplate = styled.div `
|
|
1209
|
+
background: ${(props) => props.$isSelected ? 'oklch(from var(--dx-color-primary) l c h / .2) !important' : 'transparent'};
|
|
1210
|
+
cursor: pointer;
|
|
1211
|
+
`;
|
|
1212
|
+
const MemoizedStyledItemTemplate = React.memo(StyledItemTemplate);
|
|
1213
|
+
const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCategory = false, selectedTID, onSelectionChanged }) => {
|
|
1214
|
+
const [selectedResult, setSelectedResult] = useState(undefined);
|
|
1215
|
+
/** Group results by category */
|
|
1216
|
+
const groupedResults = useMemo(() => {
|
|
1217
|
+
return searchResults.reduce((acc, result) => {
|
|
1218
|
+
const category = result.category ?? 'Uncategorized';
|
|
1219
|
+
if (!acc[category])
|
|
1220
|
+
acc[category] = [];
|
|
1221
|
+
acc[category].push(result);
|
|
1222
|
+
return acc;
|
|
1223
|
+
}, {});
|
|
1224
|
+
}, [searchResults]);
|
|
1225
|
+
/** Sort categories alphabetically */
|
|
1226
|
+
const sortedCategories = useMemo(() => {
|
|
1227
|
+
const cats = Object.keys(groupedResults);
|
|
1228
|
+
cats.forEach((category) => {
|
|
1229
|
+
groupedResults[category].sort((a, b) => (a.fromName ?? '').localeCompare(b.fromName ?? ''));
|
|
1230
|
+
});
|
|
1231
|
+
return cats.sort((a, b) => a.localeCompare(b));
|
|
1232
|
+
}, [groupedResults]);
|
|
1233
|
+
/** Sort items within each category alphabetically by fromName */
|
|
1234
|
+
sortedCategories.forEach((category) => {
|
|
1235
|
+
groupedResults[category].sort((a, b) => (a.fromName ?? '').localeCompare(b.fromName ?? ''));
|
|
1236
|
+
});
|
|
1237
|
+
useEffect(() => {
|
|
1238
|
+
if (sortedCategories.length > 0) {
|
|
1239
|
+
const firstCategory = sortedCategories[0];
|
|
1240
|
+
if (groupedResults[firstCategory].length > 0) {
|
|
1241
|
+
setSelectedResult(groupedResults[firstCategory][0]);
|
|
1242
|
+
onSelectionChanged?.(groupedResults[firstCategory][0]);
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
}, [sortedCategories.length]);
|
|
1246
|
+
useEffect(() => {
|
|
1247
|
+
if (selectedTID !== undefined) {
|
|
1248
|
+
const found = searchResults.find(r => Number(r.fromTID) === selectedTID);
|
|
1249
|
+
handleSelect(found);
|
|
1250
|
+
}
|
|
1251
|
+
}, [selectedTID, searchResults]);
|
|
1252
|
+
const handleSelect = useCallback((result) => {
|
|
1253
|
+
if (selectedResult !== result && result !== undefined) {
|
|
1254
|
+
setSelectedResult(result);
|
|
1255
|
+
onSelectionChanged?.(result);
|
|
1256
|
+
}
|
|
1257
|
+
}, [selectedResult, onSelectionChanged]);
|
|
1258
|
+
const resultDcmtCounter = (category) => {
|
|
1259
|
+
let dcmts = searchResults.filter(res => res?.category === category || (res?.category === undefined && category === "Uncategorized"));
|
|
1260
|
+
if (!dcmts)
|
|
1261
|
+
return 0;
|
|
1262
|
+
let counter = 0;
|
|
1263
|
+
for (let dcmt of dcmts) {
|
|
1264
|
+
counter += dcmt.dcmtsFound ?? 0;
|
|
1265
|
+
}
|
|
1266
|
+
return counter;
|
|
1267
|
+
};
|
|
1268
|
+
const getHeaderTitle = (category) => {
|
|
1269
|
+
switch (category) {
|
|
1270
|
+
case "RecentArchive": return SDKUI_Localizator.RecentDocs_Archived;
|
|
1271
|
+
case "RecentView": return SDKUI_Localizator.RecentDocs_Visualized;
|
|
1272
|
+
case "WFAppr": return SDKUI_Localizator.WorkflowApproval;
|
|
1273
|
+
case "Favorites": return SDKUI_Localizator.Favorites;
|
|
1274
|
+
case "FullText": return 'Full text';
|
|
1275
|
+
case "Uncategorized": return "";
|
|
1276
|
+
default: return category;
|
|
1277
|
+
}
|
|
1278
|
+
};
|
|
1279
|
+
const renderItemTemplate = useCallback((data) => (_jsxs("div", { style: { width: '100%', padding: '5px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, children: [_jsx(TMTidViewer, { tid: data.fromTID, did: Number(data.dtdResult?.rows?.[0]?.[1]), showIcon: true, color: TMColors.primary }), _jsx("div", { style: { padding: 3, display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: 'white', color: 'gray', borderRadius: 3 }, children: data.dcmtsReturned })] })), []);
|
|
1280
|
+
const renderCategoryItems = (category) => (_jsx("div", { style: { padding: '5px' }, children: groupedResults[category].map((result, index) => (_jsx(MemoizedStyledItemTemplate, { "$isSelected": selectedResult === result, onClick: () => handleSelect(result), children: renderItemTemplate(result) }, index))) }));
|
|
1281
|
+
if (disableAccordionIfSingleCategory && sortedCategories.length === 1) {
|
|
1282
|
+
const category = sortedCategories[0];
|
|
1283
|
+
return renderCategoryItems(category);
|
|
1284
|
+
}
|
|
1285
|
+
return (_jsx("div", { style: { height: '100%', width: '100%', overflow: 'auto' }, children: sortedCategories.map((category, index) => (_jsx(TMAccordion, { title: getHeaderTitle(category), titleSize: 'Small', firstCounter: _jsx(TMTooltip, { content: 'Numero di tipi documento', children: _jsx(StyledBadge, { style: { width: 'max-content' }, "$backgroundColor": TMColors.primaryColor, children: searchResults.length > 1 && searchResults?.filter(data => data.category === category || (data?.category === undefined && category === "Uncategorized")).length }) }), secondCounter: _jsx(TMTooltip, { content: 'Numero di tutti documenti', children: _jsx(StyledBadge, { style: { width: 'max-content' }, "$backgroundColor": TMColors.tertiary, children: resultDcmtCounter(category) }) }), defaultOpen: (index === 0), children: renderCategoryItems(category) }, category))) }));
|
|
1286
|
+
};
|
|
1287
|
+
//#endregion TMSearchResultSelector
|
|
1288
|
+
const TMDcmtPreviewWrapper = ({ currentDcmt, isVisible }) => {
|
|
1289
|
+
const { setPanelVisibilityById, toggleMaximize, isResizingActive, countVisibleLeafPanels } = useTMPanelManagerContext();
|
|
1290
|
+
const deviceType = useDeviceType();
|
|
1291
|
+
const isMobile = deviceType === DeviceType.MOBILE;
|
|
1292
|
+
return (_jsx(TMDcmtPreview, { onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("tmDcmtPreview") : undefined, dcmtData: currentDcmt, isResizingActive: isResizingActive, isVisible: isVisible }));
|
|
1293
|
+
};
|