@topconsultnpm/sdkui-react 6.19.0-test2 → 6.20.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/components/base/TMAccordion.js +2 -2
- package/lib/components/choosers/TMDynDataListItemChooser.js +5 -4
- package/lib/components/editors/TMHtmlEditor.js +1 -1
- package/lib/components/editors/TMMetadataValues.js +34 -12
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +74 -63
- package/lib/components/features/documents/TMDcmtBlog.d.ts +1 -7
- package/lib/components/features/documents/TMDcmtBlog.js +29 -2
- package/lib/components/features/documents/TMDcmtForm.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtForm.js +24 -34
- package/lib/components/features/documents/TMDcmtPreview.js +93 -64
- package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
- package/lib/components/features/search/TMSearchQueryPanel.js +1 -1
- package/lib/components/features/search/TMSearchResult.js +249 -58
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +8 -0
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.js +129 -0
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -2
- package/lib/components/features/search/TMSearchResultsMenuItems.js +41 -63
- package/lib/components/features/search/TMTreeSelector.js +1 -1
- package/lib/components/features/search/TMViewHistoryDcmt.d.ts +18 -0
- package/lib/components/features/search/TMViewHistoryDcmt.js +285 -0
- package/lib/components/grids/TMRecentsManager.js +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +3 -7
- package/lib/helper/SDKUI_Globals.js +1 -0
- package/lib/helper/SDKUI_Localizator.d.ts +16 -0
- package/lib/helper/SDKUI_Localizator.js +209 -6
- package/lib/helper/TMIcons.d.ts +3 -1
- package/lib/helper/TMIcons.js +9 -1
- package/lib/helper/TMUtils.d.ts +3 -1
- package/lib/helper/TMUtils.js +51 -0
- package/lib/helper/checkinCheckoutManager.d.ts +55 -0
- package/lib/helper/checkinCheckoutManager.js +266 -0
- package/lib/helper/helpers.d.ts +7 -0
- package/lib/helper/helpers.js +37 -5
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/helper/queryHelper.js +13 -1
- package/lib/services/platform_services.d.ts +1 -1
- package/package.json +52 -52
|
@@ -44,7 +44,7 @@ import TMCustomButton from '../../base/TMCustomButton';
|
|
|
44
44
|
import ToppyDraggableHelpCenter from '../assistant/ToppyDraggableHelpCenter';
|
|
45
45
|
let abortControllerLocal = new AbortController();
|
|
46
46
|
//#endregion
|
|
47
|
-
const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, showHeader = true, onSaveRecents, layoutMode = LayoutModes.Update, showBackButton = true, onClose, onSavedAsyncCallback, TID, DID, formMode = FormModes.Update, canNext, canPrev, count, itemIndex, onNext, onPrev, allowNavigation = true, allowRelations = true, isClosable = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, showDcmtFormSidebar = true, invokedByTodo = false, titleModal, isModal = false, widthModal = "100%", heightModal = "100%", groupId, onWFOperationCompleted, onTaskCompleted, onTaskCreateRequest, inputFile = null, taskFormDialogComponent, taskMoreInfo, connectorFileSave = undefined, inputMids = [], onOpenS4TViewerRequest, s4TViewerDialogComponent, enableDragDropOverlay = false, passToSearch, isSharedDcmt = false, sharedSourceTID, sharedSourceDID, allowButtonsRefs = false, onReferenceClick, }) => {
|
|
47
|
+
const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, showHeader = true, onSaveRecents, layoutMode = LayoutModes.Update, showBackButton = true, onClose, onSavedAsyncCallback, TID, DID, formMode = FormModes.Update, canNext, canPrev, count, itemIndex, onNext, onPrev, allowNavigation = true, allowRelations = true, isClosable = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, showDcmtFormSidebar = true, invokedByTodo = false, titleModal, isModal = false, widthModal = "100%", heightModal = "100%", groupId, onWFOperationCompleted, onTaskCompleted, onTaskCreateRequest, inputFile = null, taskFormDialogComponent, taskMoreInfo, connectorFileSave = undefined, inputMids = [], openS4TViewer = false, onOpenS4TViewerRequest, s4TViewerDialogComponent, enableDragDropOverlay = false, passToSearch, isSharedDcmt = false, sharedSourceTID, sharedSourceDID, allowButtonsRefs = false, onReferenceClick, }) => {
|
|
48
48
|
const [id, setID] = useState('');
|
|
49
49
|
const [showWaitPanelLocal, setShowWaitPanelLocal] = useState(false);
|
|
50
50
|
const [waitPanelTitleLocal, setWaitPanelTitleLocal] = useState('');
|
|
@@ -96,10 +96,11 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
96
96
|
const [isInitialLoading, setIsInitialLoading] = useState(true);
|
|
97
97
|
const [isNavigating, setIsNavigating] = useState(false);
|
|
98
98
|
const [dcmtReferences, setDcmtReferences] = useState(undefined);
|
|
99
|
-
//
|
|
100
|
-
const [
|
|
101
|
-
const
|
|
102
|
-
|
|
99
|
+
// Stato per triggerare il refresh del blog dall'esterno
|
|
100
|
+
const [refreshBlogTrigger, setRefreshBlogTrigger] = useState(0);
|
|
101
|
+
const triggerBlogRefresh = useCallback(async () => {
|
|
102
|
+
setRefreshBlogTrigger(prev => prev + 1);
|
|
103
|
+
}, []);
|
|
103
104
|
useEffect(() => {
|
|
104
105
|
if (!allowButtonsRefs)
|
|
105
106
|
setDcmtReferences(undefined);
|
|
@@ -237,11 +238,11 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
237
238
|
// Imposta il layout e customButtonsLayout immediatamente
|
|
238
239
|
setLayout(resLayout);
|
|
239
240
|
if (layoutMode === LayoutModes.Update && customButtonsLayoutResult) {
|
|
240
|
-
|
|
241
|
-
//setCustomButtonsLayout(customButtonsLayoutResult);
|
|
241
|
+
setCustomButtonsLayout(customButtonsLayoutResult);
|
|
242
242
|
}
|
|
243
243
|
// Carica DTD e metadata
|
|
244
244
|
let dtd = await DcmtTypeListCacheService.GetWithNotGrantedAsync(TID, DID, getMetadataResult);
|
|
245
|
+
console.log('GetWithNotGrantedAsync DTD:', dtd);
|
|
245
246
|
setFromDTD(dtd);
|
|
246
247
|
if (layoutMode === LayoutModes.Update || (layoutMode === LayoutModes.Ark && DID)) {
|
|
247
248
|
await setMetadataList(dtd?.metadata ?? [], getMetadataResult);
|
|
@@ -408,9 +409,11 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
408
409
|
}, [inputMids, layoutMode, formData, formDataOrig]);
|
|
409
410
|
// Memoizza solo il valore WI_SetID per evitare re-render quando altri metadata cambiano
|
|
410
411
|
const workItemSetIDValue = useMemo(() => formData.find(o => o.md?.name === WorkItemMetadataNames.WI_SetID)?.value, [formData]);
|
|
412
|
+
// Valore derivato: true se formData ha elementi validi
|
|
413
|
+
const hasFormData = useMemo(() => formData.length > 0 && formData.some(md => md.mid && md.mid > 99), [formData]);
|
|
411
414
|
useEffect(() => {
|
|
412
415
|
const loadAllWfData = async () => {
|
|
413
|
-
if (layoutMode !== LayoutModes.Update || !DID) {
|
|
416
|
+
if (layoutMode !== LayoutModes.Update || !DID || fromDTD?.templateTID !== TemplateTIDs.WF_WIApprView) {
|
|
414
417
|
setWorkItems([]);
|
|
415
418
|
setWorkflows([]);
|
|
416
419
|
return;
|
|
@@ -460,7 +463,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
460
463
|
setWorkflows(validWorkflows);
|
|
461
464
|
}
|
|
462
465
|
catch (error) {
|
|
463
|
-
|
|
466
|
+
TMExceptionBoxManager.show({ exception: error });
|
|
464
467
|
setWorkItems([]);
|
|
465
468
|
setWorkflows([]);
|
|
466
469
|
}
|
|
@@ -468,9 +471,14 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
468
471
|
setIsWFDataLoading(false);
|
|
469
472
|
}
|
|
470
473
|
};
|
|
474
|
+
// Usa hasFormData invece di formDataRef.current
|
|
475
|
+
if (!hasFormData || !fromDTD?.id) {
|
|
476
|
+
// console.log("formData is empty or fromDTD not loaded, skipping loadAllWfData");
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
471
479
|
if (workItemSetIDValue !== undefined || workflowApproveData.length > 0)
|
|
472
480
|
loadAllWfData();
|
|
473
|
-
}, [workItemSetIDValue, workflowApproveData, DID, layoutMode]);
|
|
481
|
+
}, [hasFormData, workItemSetIDValue, workflowApproveData, DID, layoutMode, fromDTD?.templateTID, fromDTD?.id]);
|
|
474
482
|
const getSelectionDcmtInfo = useCallback(() => {
|
|
475
483
|
let dcmts = [];
|
|
476
484
|
dcmts.push({ TID: TID ?? 0, DID: DID ?? 0 });
|
|
@@ -673,13 +681,11 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
673
681
|
text: customButton.title || 'Bottone personalizzato',
|
|
674
682
|
onClick: () => setCustomButton(customButton)
|
|
675
683
|
}));
|
|
676
|
-
//disabilitato per ora
|
|
677
|
-
/*
|
|
678
684
|
items.push({
|
|
679
|
-
icon: svgToString(
|
|
685
|
+
icon: svgToString(_jsx(IconCheck, {})),
|
|
680
686
|
text: SDKUI_Localizator.CustomButtons,
|
|
681
687
|
items: customButtonsItems
|
|
682
|
-
}
|
|
688
|
+
});
|
|
683
689
|
}
|
|
684
690
|
return items;
|
|
685
691
|
}, [
|
|
@@ -1000,28 +1006,12 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1000
1006
|
setShowAll(true);
|
|
1001
1007
|
}
|
|
1002
1008
|
}, [shouldShowAll, showAll]);
|
|
1003
|
-
const fetchBlogDataAsync = useCallback(async (tid, did) => {
|
|
1004
|
-
try {
|
|
1005
|
-
TMSpinner.show({ description: 'Caricamento - Bacheca...' });
|
|
1006
|
-
const res = await SDK_Globals.tmSession?.NewSearchEngine().BlogRetrieveAsync(tid, did);
|
|
1007
|
-
setBlogsDatasource(res ?? []);
|
|
1008
|
-
setHasLoadedDataOnce(true);
|
|
1009
|
-
setLastLoadedDid(did);
|
|
1010
|
-
}
|
|
1011
|
-
catch (e) {
|
|
1012
|
-
let err = e;
|
|
1013
|
-
TMExceptionBoxManager.show({ exception: err });
|
|
1014
|
-
}
|
|
1015
|
-
finally {
|
|
1016
|
-
TMSpinner.hide();
|
|
1017
|
-
}
|
|
1018
|
-
}, []);
|
|
1019
1009
|
const afterTaskSaved = useCallback(async (task, formMode, forceRefresh = false) => {
|
|
1020
1010
|
const shouldRefresh = forceRefresh || (task && task.state === Task_States.Completed) || formMode === FormModes.Create || formMode === FormModes.Duplicate;
|
|
1021
1011
|
if (TID && DID && shouldRefresh) {
|
|
1022
|
-
await
|
|
1012
|
+
await triggerBlogRefresh();
|
|
1023
1013
|
}
|
|
1024
|
-
}, [TID, DID]);
|
|
1014
|
+
}, [TID, DID, triggerBlogRefresh]);
|
|
1025
1015
|
const tmDcmtForm = useMemo(() => {
|
|
1026
1016
|
return _jsx(_Fragment, { children: metadataValuesSource.length > 0 &&
|
|
1027
1017
|
_jsxs(StyledToolbarCardContainer, { children: [_jsx(TMMetadataValues, { TID: TID, metadataValues: metadataValuesSource, metadataValuesOrig: metadataValuesSourceOrig, isExpertMode: isExpertMode, isOpenDistinctValues: isOpenDistinctValues, openChooserBySingleClick: !isOpenDistinctValues, selectedMID: focusedMetadataValue?.mid, isReadOnly: formMode === FormModes.ReadOnly, layoutMode: layoutMode, deviceType: deviceType, validationItems: validationItems, inputMids: inputMids, layout: layout, onFocusedItemChanged: (item) => { (item?.mid !== focusedMetadataValue?.mid) && setFocusedMetadataValue(item); }, onValueChanged: (newItems) => {
|
|
@@ -1071,7 +1061,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1071
1061
|
handleUndo,
|
|
1072
1062
|
handleClearForm
|
|
1073
1063
|
]);
|
|
1074
|
-
const tmBlog = useMemo(() => _jsx(TMDcmtBlog, {
|
|
1064
|
+
const tmBlog = useMemo(() => _jsx(TMDcmtBlog, { tid: TID, did: DID, allTasks: allTasks, fetchBlogDataTrigger: refreshBlogTrigger, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), [TID, DID, allTasks, refreshBlogTrigger]);
|
|
1075
1065
|
const tmSysMetadata = useMemo(() => _jsx(TMMetadataValues, { layoutMode: layoutMode, openChooserBySingleClick: !isOpenDistinctValues, TID: TID, isReadOnly: true, deviceType: deviceType, metadataValues: formData.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: formData.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [], inputMids: inputMids }), [TID, layoutMode, formData, deviceType, inputMids]);
|
|
1076
1066
|
const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { currentDcmt: currentDcmt, dcmtFile: dcmtFile ?? inputFile, deviceType: deviceType, fromDTD: fromDTD, layoutMode: layoutMode, onFileUpload: (file) => {
|
|
1077
1067
|
setDcmtFile(file);
|
|
@@ -1356,7 +1346,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1356
1346
|
isEditable: true,
|
|
1357
1347
|
value: FormulaHelper.addFormulaTag(newFormula.expression)
|
|
1358
1348
|
}));
|
|
1359
|
-
} }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowMoreInfoPopup(false) }), (isModal && onClose) && _jsx("div", { id: "TMDcmtFormShowConfirmForClose-" + id })] }), _jsx(ToppyDraggableHelpCenter, { initialIsCollapsed: false, deviceType: deviceType, isVisible: showToppyForApprove || showToppyForCompleteMoreInfo || showToppyForReferences, content: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [showToppyForApprove && (workItems.length === 1 ?
|
|
1349
|
+
} }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowMoreInfoPopup(false) }), (isModal && onClose) && _jsx("div", { id: "TMDcmtFormShowConfirmForClose-" + id })] }), _jsx(ToppyDraggableHelpCenter, { initialIsCollapsed: false, deviceType: deviceType, isVisible: (showToppyForApprove || showToppyForCompleteMoreInfo || showToppyForReferences) && !openS4TViewer, content: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [showToppyForApprove && (workItems.length === 1 ?
|
|
1360
1350
|
_jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), dtd: fromDTD })
|
|
1361
1351
|
:
|
|
1362
1352
|
_jsxs("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: [`Devi approvare ${workItems.length} workitem(s) per questo documento.`, `Vai alla sezione di approvazione.`] })), showToppyForCompleteMoreInfo && (_jsxs(_Fragment, { children: [_jsx("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: `${SDKUI_Localizator.MoreInfoCompleteRequestSentBy} ${taskMoreInfo?.fromName}!` }), _jsx(TMButton, { caption: SDKUI_Localizator.CommentAndComplete, color: 'success', showTooltip: false, onClick: () => {
|
|
@@ -136,32 +136,32 @@ export const TMFileViewer = ({ fileBlob, isResizingActive }) => {
|
|
|
136
136
|
const [blobUrl, setBlobUrl] = useState(undefined);
|
|
137
137
|
const [fileType, setFileType] = useState(undefined);
|
|
138
138
|
const [formattedXml, setFormattedXml] = useState(undefined);
|
|
139
|
-
const [isMobile, setIsMobile] = useState(false);
|
|
140
|
-
useEffect(() => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}, []);
|
|
139
|
+
// const [isMobile, setIsMobile] = useState<boolean>(false);
|
|
140
|
+
// useEffect(() => {
|
|
141
|
+
// const checkIsMobile = () => {
|
|
142
|
+
// const userAgent = navigator.userAgent || navigator.vendor || (window as any).opera;
|
|
143
|
+
// // Only detect actual mobile/tablet devices, NOT desktop browsers
|
|
144
|
+
// const isMobileDevice =
|
|
145
|
+
// // Traditional mobile detection (phones and tablets)
|
|
146
|
+
// /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent) ||
|
|
147
|
+
// // Additional Android tablet detection (covers tablets in landscape)
|
|
148
|
+
// /android.*tablet|android.*mobile/i.test(userAgent) ||
|
|
149
|
+
// // Touch-only devices (excludes laptops with touchscreen)
|
|
150
|
+
// (('ontouchstart' in window || navigator.maxTouchPoints > 0) &&
|
|
151
|
+
// !/Windows NT|Macintosh|Linux/.test(userAgent)) ||
|
|
152
|
+
// // Small screen mobile devices only
|
|
153
|
+
// (window.screen.width <= 768 && /Mobi|Android/i.test(userAgent));
|
|
154
|
+
// setIsMobile(isMobileDevice);
|
|
155
|
+
// };
|
|
156
|
+
// checkIsMobile();
|
|
157
|
+
// // Listen for orientation changes (important for tablets)
|
|
158
|
+
// window.addEventListener('orientationchange', checkIsMobile);
|
|
159
|
+
// window.addEventListener('resize', checkIsMobile);
|
|
160
|
+
// return () => {
|
|
161
|
+
// window.removeEventListener('orientationchange', checkIsMobile);
|
|
162
|
+
// window.removeEventListener('resize', checkIsMobile);
|
|
163
|
+
// };
|
|
164
|
+
// }, []);
|
|
165
165
|
useEffect(() => {
|
|
166
166
|
if (fileBlob) {
|
|
167
167
|
setFileType(fileBlob.type);
|
|
@@ -222,44 +222,73 @@ export const TMFileViewer = ({ fileBlob, isResizingActive }) => {
|
|
|
222
222
|
if (fileBlob.type.includes('image')) {
|
|
223
223
|
return (_jsx(ImageViewer, { fileBlob: fileBlob, alt: '' }));
|
|
224
224
|
}
|
|
225
|
-
//
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
225
|
+
// if (fileType === 'application/pdf' && isMobile) {
|
|
226
|
+
// return (
|
|
227
|
+
// <object
|
|
228
|
+
// key={blobUrl}
|
|
229
|
+
// data={blobUrl}
|
|
230
|
+
// type="application/pdf"
|
|
231
|
+
// width="100%"
|
|
232
|
+
// height="100%"
|
|
233
|
+
// style={{
|
|
234
|
+
// border: 'none',
|
|
235
|
+
// zIndex: 0,
|
|
236
|
+
// pointerEvents: isResizingActive === true ? "none" : "auto"
|
|
237
|
+
// }}
|
|
238
|
+
// >
|
|
239
|
+
// {/* Fallback UI if <object> tag fails to render PDF */}
|
|
240
|
+
// <div style={{
|
|
241
|
+
// padding: '40px',
|
|
242
|
+
// textAlign: 'center',
|
|
243
|
+
// display: 'flex',
|
|
244
|
+
// flexDirection: 'column',
|
|
245
|
+
// alignItems: 'center',
|
|
246
|
+
// justifyContent: 'center',
|
|
247
|
+
// height: '100%',
|
|
248
|
+
// gap: '20px'
|
|
249
|
+
// }}>
|
|
250
|
+
// <IconPreview fontSize={96} />
|
|
251
|
+
// <div>
|
|
252
|
+
// <h3>{SDKUI_Localizator.PDFDocument}</h3>
|
|
253
|
+
// <p>{SDKUI_Localizator.PreviewNotAvailableOnDevice}</p>
|
|
254
|
+
// </div>
|
|
255
|
+
// <div style={{ display: 'flex', gap: '10px', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center' }}>
|
|
256
|
+
// <a
|
|
257
|
+
// href={blobUrl}
|
|
258
|
+
// download="document.pdf"
|
|
259
|
+
// style={{
|
|
260
|
+
// minWidth: '180px',
|
|
261
|
+
// padding: '12px 24px',
|
|
262
|
+
// backgroundColor: TMColors.primaryColor,
|
|
263
|
+
// color: 'white',
|
|
264
|
+
// textDecoration: 'none',
|
|
265
|
+
// borderRadius: '4px',
|
|
266
|
+
// display: 'inline-block'
|
|
267
|
+
// }}
|
|
268
|
+
// >
|
|
269
|
+
// {SDKUI_Localizator.DownloadFile}
|
|
270
|
+
// </a>
|
|
271
|
+
// <a
|
|
272
|
+
// href={blobUrl}
|
|
273
|
+
// target="_blank"
|
|
274
|
+
// rel="noopener noreferrer"
|
|
275
|
+
// style={{
|
|
276
|
+
// minWidth: '180px',
|
|
277
|
+
// padding: '12px 24px',
|
|
278
|
+
// backgroundColor: TMColors.primaryColor,
|
|
279
|
+
// color: 'white',
|
|
280
|
+
// textDecoration: 'none',
|
|
281
|
+
// borderRadius: '4px',
|
|
282
|
+
// display: 'inline-block'
|
|
283
|
+
// }}
|
|
284
|
+
// >
|
|
285
|
+
// {SDKUI_Localizator.OpenInNewTab}
|
|
286
|
+
// </a>
|
|
287
|
+
// </div>
|
|
288
|
+
// </div>
|
|
289
|
+
// </object>
|
|
290
|
+
// );
|
|
291
|
+
// }
|
|
263
292
|
return (_jsx("iframe", { srcDoc: formattedXml ? `<html><body>${formattedXml}</body></html>` : undefined, src: !formattedXml
|
|
264
293
|
? (fileType === 'application/pdf' ? `${blobUrl}#view=FitH&scrollbar=1` : blobUrl)
|
|
265
294
|
: undefined, title: "File Viewer", width: "100%", height: "100%", style: { border: 'none', zIndex: 0, pointerEvents: isResizingActive === true ? "none" : "auto" } }, blobUrl));
|
|
@@ -176,7 +176,7 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
|
|
|
176
176
|
TMExceptionBoxManager.show({ exception: ex });
|
|
177
177
|
}
|
|
178
178
|
};
|
|
179
|
-
return (_jsxs("div", { style: { height: height ?? '100%', width: '100%', display: 'flex', flexDirection: 'column', gap: '5px', paddingTop: allowShowSearch ? '5px' : undefined }, children: [allowShowSearch &&
|
|
179
|
+
return (_jsxs("div", { onContextMenu: (e) => e.preventDefault(), style: { height: height ?? '100%', width: '100%', display: 'flex', flexDirection: 'column', gap: '5px', paddingTop: allowShowSearch ? '5px' : undefined }, children: [allowShowSearch &&
|
|
180
180
|
_jsx("div", { style: { width: '100%', display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '10px', paddingBottom: '10px', paddingTop: '10px' }, children: _jsx(TMSearchBar, { marginLeft: '0px', maxWidth: '300px', searchValue: searchText, onSearchValueChanged: (e) => setSearchText(e) }) }), _jsx("div", { style: {
|
|
181
181
|
display: 'flex',
|
|
182
182
|
flexDirection: 'column',
|
|
@@ -314,7 +314,7 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
|
|
|
314
314
|
{ icon: _jsx(IconMenuCAArchive, { viewBox: '11 11.5 26 27', fontSize: 16, strokeWidth: 2, color: 'black' }), beginGroup: true, text: SDKUI_Localizator.PassToArchive, onClick: handlePassToArchive }
|
|
315
315
|
], onMenuShown: () => setIsQueryPanelActive(true) })
|
|
316
316
|
: _jsx(_Fragment, {}) }), children: [_jsx(ConfirmQueryParamsDialog, {}), SQD
|
|
317
|
-
? _jsxs("div", { style: { height: '100%', width: '100%', position: 'relative', display: 'flex', flexDirection: 'column', gap: 5 }, children: [showAdvancedSearch
|
|
317
|
+
? _jsxs("div", { onContextMenu: (e) => e.preventDefault(), style: { height: '100%', width: '100%', position: 'relative', display: 'flex', flexDirection: 'column', gap: 5 }, children: [showAdvancedSearch
|
|
318
318
|
? _jsx(TMQueryEditor, { formMode: FormModes.Update, showToolbar: false, inputData: qd, validateSelect: true, showApply: false, onQDChanged: handleQdChanged })
|
|
319
319
|
: _jsx(TMSearchQueryEditor, { qd: qd, dcmtTypesList: dcmtTypesList, isExpertMode: isExpertMode, showAllMdWhere: showAllMdWhere, onQdChanged: handleQdChanged, onFocusedMetadataChanged: setFocusedTidMid, onAdvancedMenuClick: handleAdvancedMenuClick }), _jsxs("div", { style: {
|
|
320
320
|
display: 'flex',
|