@topconsultnpm/sdkui-react-beta 6.13.57 → 6.13.58
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/features/documents/TMDcmtForm.js +1 -1
- package/lib/components/features/documents/TMDcmtPreview.d.ts +2 -1
- package/lib/components/features/documents/TMDcmtPreview.js +7 -5
- package/lib/components/features/search/TMSearch.js +5 -5
- package/lib/components/features/search/TMSearchResult.js +83 -163
- package/lib/helper/helpers.js +0 -4
- package/package.json +1 -1
@@ -486,7 +486,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
486
486
|
} })] }) })
|
487
487
|
: _jsx(_Fragment, {}), isOpenPreview
|
488
488
|
? _jsxs(TMLayoutItem, { children: [layoutMode === LayoutModes.Update ?
|
489
|
-
_jsx(TMDcmtPreview, {
|
489
|
+
_jsx(TMDcmtPreview, { onClosePanel: () => { setIsOpenPreview(false); onClosePreviewPanel?.(); }, dcmtData: currentDcmt }) :
|
490
490
|
_jsx(TMFileUploader, { onFileUpload: (file) => setDcmtFile(file), onClose: () => setIsOpenPreview(false), isRequired: fromDTD?.archiveConstraint === ArchiveConstraints.ContentCompulsory && dcmtFile === null, defaultBlob: dcmtFile, deviceType: deviceType }), " "] })
|
491
491
|
: _jsx(_Fragment, {})] }) }) : _jsx(_Fragment, {})] }), isOpenDistinctValues &&
|
492
492
|
_jsx(TMDistinctValues, { tid: TID, mid: focusedMetadataValue?.mid, isModal: true, showHeader: false, layoutMode: layoutMode, onSelectionChanged: (e) => {
|
@@ -6,7 +6,8 @@ interface ITMDcmtPreviewProps {
|
|
6
6
|
canPrev?: boolean;
|
7
7
|
onNext?: () => void;
|
8
8
|
onPrev?: () => void;
|
9
|
-
|
9
|
+
onClosePanel?: () => void;
|
10
|
+
onMaximizePanel?: () => void;
|
10
11
|
}
|
11
12
|
declare const TMDcmtPreview: React.FC<ITMDcmtPreviewProps>;
|
12
13
|
export default TMDcmtPreview;
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
3
3
|
import styled from 'styled-components';
|
4
4
|
import { RetrieveFileOptions, DcmtOpers, GeneralRetrieveFormats, FileFormats } from '@topconsultnpm/sdk-ts-beta';
|
5
|
-
import { extensionHandler, sleep, getExceptionMessage, formatBytes, IconMenuVertical, IconCloseCircle, IconClear,
|
5
|
+
import { extensionHandler, sleep, getExceptionMessage, formatBytes, IconMenuVertical, IconCloseCircle, IconClear, IconCloseOutline, IconPreview, SDKUI_Globals, IconZoomOutLinear, IconZoomInLinear, IconPrintOutline } from '../../../helper';
|
6
6
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
7
7
|
import { FileExtensionHandler, FormModes } from '../../../ts';
|
8
8
|
import { TMColors } from '../../../utils/theme';
|
@@ -10,18 +10,20 @@ import ShowAlert from '../../base/TMAlert';
|
|
10
10
|
import TMButton from '../../base/TMButton';
|
11
11
|
import TMDropDownMenu from '../../base/TMDropDownMenu';
|
12
12
|
import { TMExceptionBoxManager } from '../../base/TMPopUp';
|
13
|
-
import TMTooltip from '../../base/TMTooltip';
|
14
13
|
import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
15
14
|
import { TMSaveFormButtonPrevious, TMSaveFormButtonNext } from '../../forms/TMSaveForm';
|
16
15
|
import { StyledAnimatedComponentOpacity } from '../../base/Styled';
|
17
16
|
import TMPanel from '../../base/TMPanel';
|
18
|
-
|
17
|
+
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
18
|
+
const TMDcmtPreview = ({ dcmtData, onClosePanel, canNext, canPrev, onNext, onPrev, onMaximizePanel }) => {
|
19
19
|
const [dcmtBlob, setDcmtBlob] = useState(undefined);
|
20
20
|
const [showPreview, setShowPreview] = useState(false);
|
21
21
|
const [isFromCache, setIsFromCache] = useState(false);
|
22
22
|
const [error, setError] = useState('');
|
23
23
|
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, getDcmtFileAsync, clearDcmtsFileCache, removeDcmtsFileCache, isDcmtFileInCache } = useDcmtOperations();
|
24
24
|
const cacheKey = dcmtData ? `${dcmtData.tid}-${dcmtData.did}` : '00';
|
25
|
+
const deviceType = useDeviceType();
|
26
|
+
const isMobile = deviceType === DeviceType.MOBILE;
|
25
27
|
useEffect(() => {
|
26
28
|
setDcmtBlob(undefined);
|
27
29
|
setError('');
|
@@ -85,10 +87,10 @@ const TMDcmtPreview = ({ dcmtData, onClose, canNext, canPrev, onNext, onPrev })
|
|
85
87
|
}
|
86
88
|
return title;
|
87
89
|
};
|
88
|
-
return (_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: _jsx(TMPanel, { padding: '0', title: titleHandler(), toolbar: _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: '10px' }, children: [onPrev && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), onNext && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(StyledHeaderIcon, { "$color": TMColors.primaryColor, children: _jsx(TMDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'icon', caption: 'Altro', icon: _jsx(IconMenuVertical, {}), showTooltip: false }), items: [
|
90
|
+
return (_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: _jsx(TMPanel, { padding: '0', title: titleHandler(), onClose: isMobile ? undefined : onClosePanel, allowMaximize: !isMobile, onMaximize: isMobile ? undefined : onMaximizePanel, onHeaderDoubleClick: isMobile ? undefined : onMaximizePanel, toolbar: _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: '10px' }, children: [onPrev && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), onNext && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(StyledHeaderIcon, { "$color": TMColors.primaryColor, children: _jsx(TMDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'icon', caption: 'Altro', icon: _jsx(IconMenuVertical, {}), showTooltip: false }), items: [
|
89
91
|
{ icon: _jsx(IconCloseCircle, {}), text: "Rimuovi elemento dalla cache", onClick: () => { removeDcmtsFileCache(cacheKey); setIsFromCache(false); } },
|
90
92
|
{ icon: _jsx(IconClear, {}), text: "Cancella la cache", onClick: () => { clearDcmtsFileCache(); setIsFromCache(false); } },
|
91
|
-
] }, "btn13") })
|
93
|
+
] }, "btn13") })] }), children: error
|
92
94
|
? _jsx(TMNothingToShow, { icon: _jsx(IconCloseOutline, { fontSize: 92, color: TMColors.error }), text: error })
|
93
95
|
: renderedPreview(dcmtData?.tid, dcmtData?.did, dcmtData?.fileExt, dcmtData?.fileSize, dcmtData?.fileCount, extensionHandler(dcmtData?.fileExt), showPreview, () => { loadDocumentWithCache(); setShowPreview(true); }, dcmtBlob) }) }));
|
94
96
|
};
|
@@ -181,29 +181,29 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
181
181
|
const initialPanels = useMemo(() => [
|
182
182
|
{
|
183
183
|
id: 'TMTreeSelector',
|
184
|
-
name:
|
184
|
+
name: SDK_Localizator.Trees,
|
185
185
|
contentOptions: { component: tmTreeSelectorElement },
|
186
186
|
toolbarOptions: { icon: _jsx(IconTree, { fontSize: 24 }), visible: true, orderNumber: 1, isActive: allInitialPanelVisibility['TMTreeSelector'] }
|
187
187
|
},
|
188
188
|
{
|
189
189
|
id: 'TMRecentsManager',
|
190
|
-
name:
|
190
|
+
name: SDKUI_Localizator.Shortcuts,
|
191
191
|
contentOptions: { component: tmRecentsManagerElement, panelContainer: { title: SDKUI_Localizator.Shortcuts } },
|
192
192
|
toolbarOptions: { icon: _jsx(IconRecentlyViewed, { fontSize: 24 }), visible: true, orderNumber: 2, isActive: allInitialPanelVisibility['TMRecentsManager'] }
|
193
193
|
},
|
194
194
|
{
|
195
195
|
id: 'TMSearchQueryPanel',
|
196
|
-
name:
|
196
|
+
name: fromDTD?.nameLoc ?? SDKUI_Localizator.Search_Metadata,
|
197
197
|
contentOptions: { component: tmSearchQueryPanelElement },
|
198
198
|
toolbarOptions: { icon: _jsx(IconFilter, { fontSize: 24 }), visible: true, orderNumber: 3, isActive: allInitialPanelVisibility['TMSearchQueryPanel'] }
|
199
199
|
},
|
200
200
|
{
|
201
201
|
id: 'TMSavedQuerySelector',
|
202
|
-
name:
|
202
|
+
name: SDK_Localizator.SavedQueries,
|
203
203
|
contentOptions: { component: tmSavedQuerySelectorElement, panelContainer: { title: SDK_Localizator.SavedQueries } },
|
204
204
|
toolbarOptions: { icon: _jsx(IconSavedQuery, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['TMSavedQuerySelector'] }
|
205
205
|
}
|
206
|
-
], [tmTreeSelectorElement, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement]);
|
206
|
+
], [tmTreeSelectorElement, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement, fromDTD]);
|
207
207
|
return (_jsxs(_Fragment, { children: [_jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }), searchResult.length > 0 &&
|
208
208
|
_jsx(TMSearchResult, { isVisible: currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync: async () => {
|
209
209
|
setSearchResult(await refreshLastSearch(lastQdSearched) ?? []);
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import React, { useCallback, useEffect, useMemo,
|
3
|
-
import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes, TemplateTIDs, DcmtTypeListCacheService, AccessLevels, SystemMIDsAsNumber
|
2
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
3
|
+
import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes, TemplateTIDs, DcmtTypeListCacheService, AccessLevels, SystemMIDsAsNumber } from '@topconsultnpm/sdk-ts-beta';
|
4
4
|
import styled from 'styled-components';
|
5
5
|
import { getCommandsMenuItems, getSelectedDcmtsOrFocused } from './TMSearchResultsMenuItems';
|
6
6
|
import { ContextMenu } from 'devextreme-react';
|
7
|
-
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, IconDownload, IconSignature, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, IconArchive, IconActivityLog, IconStar, IconFreeSearch, IconChevronDown, searchResultToMetadataValues, SDKUI_Globals, IconSearchCheck
|
7
|
+
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, IconDownload, IconSignature, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, IconArchive, IconActivityLog, IconStar, IconFreeSearch, IconChevronDown, searchResultToMetadataValues, SDKUI_Globals, IconSearchCheck } from '../../../helper';
|
8
8
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
9
9
|
import { useInputAttachmentsDialog, useInputCvtFormatDialog } from '../../../hooks/useInputDialog';
|
10
10
|
import { DcmtOperationTypes, FormModes, SearchResultContext, DownloadTypes } from '../../../ts';
|
@@ -33,10 +33,8 @@ import TMBatchUpdateForm from '../../features/documents/TMBatchUpdateForm';
|
|
33
33
|
import TMDcmtForm, { ToppyHelpCenter } from '../documents/TMDcmtForm';
|
34
34
|
import TMDcmtBlog from '../documents/TMDcmtBlog';
|
35
35
|
import TMDcmtIcon from '../documents/TMDcmtIcon';
|
36
|
-
import {
|
37
|
-
import
|
38
|
-
import TMPanel from '../../base/TMPanel';
|
39
|
-
import { TMPanelToolbar } from '../../layout/panel/TMPanelToolbar';
|
36
|
+
import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
|
37
|
+
import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
|
40
38
|
//#region Internal Components
|
41
39
|
const CommandsContextMenu = React.memo(({ target, menuItems, allowPin }) => {
|
42
40
|
return (_jsx(ContextMenu, { showEvent: 'click', dataSource: menuItems, target: `${target}` }));
|
@@ -128,10 +126,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
128
126
|
fileExt: currentMetadataValues.find(o => o.mid == SystemMIDsAsNumber.FileExt)?.value
|
129
127
|
});
|
130
128
|
}, [currentMetadataValues]);
|
131
|
-
// useEffect(() => { setIsOpenBoard(showBoard); }, [showBoard])
|
132
|
-
// useEffect(() => { setIsOpenSysMetadata(showSysMetadata); }, [showSysMetadata])
|
133
129
|
useEffect(() => { setIsOpenDcmtForm(showDcmtForm); }, [showDcmtForm]);
|
134
|
-
// useEffect(() => { setIsOpenPreview(showPreview) }, [showPreview])
|
135
130
|
const openFormHandler = (layoutMode) => { setIsOpenDcmtForm(true); setDcmtFormLayoutMode(layoutMode); };
|
136
131
|
const openTaskFormHandler = (value) => {
|
137
132
|
if (selectedItems.length > 1)
|
@@ -341,91 +336,92 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
341
336
|
if (!searchResults || searchResults.length <= 0)
|
342
337
|
return _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%' }, children: [_jsx(IconBoard, { fontSize: 96 }), _jsx("div", { style: { fontSize: "15px", marginTop: "10px" }, children: SDKUI_Localizator.NoDcmtFound })] });
|
343
338
|
const isMobile = deviceType === DeviceType.MOBILE;
|
344
|
-
const
|
345
|
-
|
346
|
-
|
347
|
-
|
339
|
+
const tmSearchResult = useMemo(() => _jsxs(_Fragment, { children: [_jsxs(TMLayoutItem, { height: '100%', children: [_jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, separatorActiveColor: 'transparent', separatorColor: 'transparent', min: ['0', '0'], showSeparator: showSelector && deviceType !== DeviceType.MOBILE, start: showSelector ? deviceType !== DeviceType.MOBILE ? ['25%', '75%'] : splitterSize : ['0%', '100%'], children: [showSelector ?
|
340
|
+
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, onSelectionChanged: onSearchResultSelectionChanged }) })
|
341
|
+
:
|
342
|
+
_jsx(_Fragment, {}), _jsxs(TMLayoutItem, { children: [_jsx(TMSearchResultGrid
|
343
|
+
// allowMultipleSelection={allowMultipleSelection}
|
344
|
+
, {
|
348
345
|
// allowMultipleSelection={allowMultipleSelection}
|
349
|
-
, {
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
_jsx(
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
346
|
+
inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], lastUpdateSearchTime: lastUpdateSearchTime, onDblClick: () => openFormHandler(LayoutModes.Update), onContextMenuPreparing: onContextMenuPreparing, onSelectionChanged: (items) => { setSelectedItems(items); }, onVisibleItemChanged: setVisibleItems, onFocusedItemChanged: setFocusedItem }), allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE &&
|
347
|
+
_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, icon: _jsx(IconDownload, { color: 'white' }), onClick: () => { downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt); } }), _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasDetailRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true) }), _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(TMButton, { btnStyle: 'icon', caption: 'Firma e marca', icon: _jsx(IconSignature, { color: 'white' }), onClick: () => { ShowAlert({ message: "TODO Firma e marca ", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } }), _jsx(IconMenuVertical, { id: `commands-floating-${id}`, color: 'white', cursor: 'pointer' }), _jsx(CommandsContextMenu, { target: `#commands-floating-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler) })] })] })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onUpdate: onUpdate, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), op: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onUpdate: onUpdate, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), op: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onUpdate: onUpdate, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: SDKUI_Localizator.BatchUpdate, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
|
348
|
+
setIsOpenBatchUpdate(false);
|
349
|
+
}, onSavedCallbackAsync: async () => {
|
350
|
+
setIsOpenBatchUpdate(false);
|
351
|
+
setIsModifiedBatchUpdate(false);
|
352
|
+
await refreshSelectionDataRowsAsync();
|
353
|
+
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), (isVisible && fromDTD?.templateTID === TemplateTIDs.WF_WIApprView && !isOpenDcmtForm && !isOpenDetails && !isOpenMaster) &&
|
354
|
+
_jsx(ToppyHelpCenter, { deviceType: deviceType,
|
355
|
+
// onClick={() => isMobile ? openConfigureMode?.() : undefined}
|
356
|
+
content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), approveDisable: disable, rejectDisable: disable, reassignDisable: disable, infoDisable: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length !== 1 }) }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {})] }), [
|
357
|
+
getTitleHeader,
|
358
|
+
searchResults,
|
359
|
+
selectedSearchResult,
|
360
|
+
lastUpdateSearchTime,
|
361
|
+
focusedItem,
|
362
|
+
selectedItems,
|
363
|
+
fromDTD,
|
364
|
+
currentTIDHasDetailRelations,
|
365
|
+
currentTIDHasMasterRelations,
|
366
|
+
showApprovePopup,
|
367
|
+
showRejectPopup,
|
368
|
+
showReAssignPopup,
|
369
|
+
isOpenBatchUpdate,
|
370
|
+
isOpenDetails,
|
371
|
+
isOpenMaster,
|
372
|
+
isOpenDcmtForm
|
373
|
+
]);
|
374
|
+
const tmBlog = useMemo(() => _jsx(TMDcmtBlog, { tid: focusedItem?.TID, did: focusedItem?.DID }), [focusedItem?.TID, focusedItem?.DID]);
|
375
|
+
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?.TID, currentMetadataValues, deviceType]);
|
376
|
+
const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { currentDcmt: currentDcmt }), [currentDcmt]);
|
377
|
+
// --- PANEL DEFINITIONS ---
|
378
|
+
const allInitialPanelVisibility = {
|
379
|
+
'tmSearchResult': true,
|
380
|
+
'tmBlog': false,
|
381
|
+
'tmSysMetadata': false,
|
382
|
+
'tmDcmtPreview': false,
|
383
|
+
};
|
384
|
+
const initialPanelDimensions = {
|
385
|
+
'tmSearchResult': { width: '25%', height: '100%' },
|
386
|
+
'tmBlog': { width: '25%', height: '100%' },
|
387
|
+
'tmSysMetadata': { width: '25%', height: '100%' },
|
388
|
+
'tmDcmtPreview': { width: '25%', height: '100%' },
|
389
|
+
};
|
390
|
+
const initialPanels = useMemo(() => [
|
369
391
|
{
|
370
|
-
id: '
|
371
|
-
name:
|
372
|
-
children: [],
|
392
|
+
id: 'tmSearchResult',
|
393
|
+
name: getTitleHeader(),
|
373
394
|
contentOptions: {
|
374
|
-
|
375
|
-
|
395
|
+
component: tmSearchResult,
|
396
|
+
panelContainer: {
|
397
|
+
title: getTitleHeader(),
|
398
|
+
allowMaximize: !isMobile,
|
399
|
+
onBack: (!isClosable && context === SearchResultContext.METADATA_SEARCH) || (isMobile && context !== SearchResultContext.METADATA_SEARCH && splitterSize[1] === '100%') ? onBack : undefined,
|
400
|
+
onClose: isClosable ? onBack : undefined
|
401
|
+
},
|
402
|
+
toolbar: searchResutlToolbar
|
376
403
|
},
|
377
|
-
toolbarOptions: {
|
378
|
-
icon: _jsx(IconSearchCheck, { fontSize: 24 }),
|
379
|
-
visible: true,
|
380
|
-
isActive: true
|
381
|
-
}
|
404
|
+
toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: true, orderNumber: 1, isActive: allInitialPanelVisibility['tmSearchResult'] }
|
382
405
|
},
|
383
406
|
{
|
384
|
-
id: '
|
407
|
+
id: 'tmBlog',
|
385
408
|
name: SDKUI_Localizator.BlogCase,
|
386
|
-
|
387
|
-
|
388
|
-
width: '25%',
|
389
|
-
height: '100%',
|
390
|
-
},
|
391
|
-
toolbarOptions: {
|
392
|
-
icon: _jsx(IconBoard, { fontSize: 24 }),
|
393
|
-
// disabled: !focusedItem?.DID,
|
394
|
-
visible: true,
|
395
|
-
isActive: false,
|
396
|
-
}
|
409
|
+
contentOptions: { component: tmBlog, panelContainer: { title: SDKUI_Localizator.BlogCase, allowMaximize: !isMobile } },
|
410
|
+
toolbarOptions: { icon: _jsx(IconBoard, { fontSize: 24 }), visible: true, orderNumber: 2, isActive: allInitialPanelVisibility['tmBlog'] }
|
397
411
|
},
|
398
412
|
{
|
399
|
-
id: '
|
413
|
+
id: 'tmSysMetadata',
|
400
414
|
name: SDKUI_Localizator.MetadataSystem,
|
401
|
-
|
402
|
-
|
403
|
-
width: '25%',
|
404
|
-
height: '100%',
|
405
|
-
},
|
406
|
-
toolbarOptions: {
|
407
|
-
icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }),
|
408
|
-
visible: true,
|
409
|
-
// disabled: !focusedItem?.DID,
|
410
|
-
isActive: false,
|
411
|
-
}
|
415
|
+
contentOptions: { component: tmSysMetadata, panelContainer: { title: SDKUI_Localizator.MetadataSystem, allowMaximize: !isMobile } },
|
416
|
+
toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: true, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
|
412
417
|
},
|
413
418
|
{
|
414
|
-
id: '
|
419
|
+
id: 'tmDcmtPreview',
|
415
420
|
name: SDKUI_Localizator.PreviewDocument,
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
},
|
421
|
-
toolbarOptions: {
|
422
|
-
icon: _jsx(IconShow, { fontSize: 24 }),
|
423
|
-
disabled: !focusedItem?.DID && fromDTD?.archiveConstraint === ArchiveConstraints.OnlyMetadata,
|
424
|
-
visible: true,
|
425
|
-
isActive: false,
|
426
|
-
}
|
427
|
-
},
|
428
|
-
];
|
421
|
+
contentOptions: { component: tmDcmtPreview },
|
422
|
+
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
|
423
|
+
}
|
424
|
+
], [tmSearchResult, tmBlog, tmSysMetadata, tmDcmtPreview]);
|
429
425
|
return (_jsxs(StyledMultiViewPanel, { "$isVisible": isVisible, children: [_jsx(StyledMultiViewPanel, { "$isVisible": !isOpenDcmtForm && !isOpenDetails && !isOpenMaster, style: {
|
430
426
|
display: 'flex',
|
431
427
|
flexDirection: isMobile ? 'column' : 'row',
|
@@ -433,7 +429,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
433
429
|
gap: SDKUI_Globals.userSettings.themeSettings.gutters,
|
434
430
|
width: '100%',
|
435
431
|
height: '100%',
|
436
|
-
}, 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: _jsx(
|
432
|
+
}, 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: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmSearchResult', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }) }), _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) => {
|
437
433
|
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}`));
|
438
434
|
})] }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: isOpenDcmtForm && _jsx(TMDcmtForm, { isModal: openDcmtFormAsModal, titleModal: fromDTD?.name ?? '', TID: focusedItem?.TID, DID: focusedItem?.DID, layoutMode: dcmtFormLayoutMode, showPreview: deviceType !== DeviceType.MOBILE, 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); }, onSavedAsyncCallback: async (tid, did) => { await refreshFocusedDataRowAsync(tid, did, true); } }) })] }));
|
439
435
|
};
|
@@ -699,84 +695,8 @@ const TMSearchResultSelector = ({ searchResults = [], onSelectionChanged }) => {
|
|
699
695
|
};
|
700
696
|
return (_jsx("div", { style: { height: '100%', width: '100%', overflow: 'auto' }, children: sortedCategories.map((category) => (_jsxs("div", { children: [_jsxs(StyledGroupTemplate, { onClick: () => toggleCategory(category), children: [activeCategories.includes(category) ? _jsx(IconChevronDown, {}) : _jsx(IconChevronDown, { transform: 'scale(-1, 1)' }), renderGroupTemplate(category)] }, category), activeCategories.includes(category) && (_jsx("div", { style: { padding: '5px' }, children: groupedResults[category].map((result, index) => (_jsx(StyledItemTemplate, { "$isSelected": selectedResult === result, onClick: () => handleSelect(result), children: renderItemTemplate(result) }, index))) }))] }, category))) }));
|
701
697
|
};
|
702
|
-
|
703
|
-
|
704
|
-
const {
|
705
|
-
|
706
|
-
const { onMouseDown } = useResizablePanels(containerRef);
|
707
|
-
const { width: widthPanel1, height: heightPanel1 } = getPanelDimensions('TMSearchResult');
|
708
|
-
const { width: widthPanel2, height: heightPanel2 } = getPanelDimensions('TMBlog');
|
709
|
-
const { width: widthPanel3, height: heightPanel3 } = getPanelDimensions('TMSysMetadata');
|
710
|
-
const { width: widthPanel4, height: heightPanel4 } = getPanelDimensions('TMDcmtPreview');
|
711
|
-
return (_jsxs("div", { style: { display: 'flex', height: '100%', width: '100%', flexDirection: isMobile ? 'column' : 'row', gap: gutters }, children: [_jsx("div", { style: {
|
712
|
-
display: 'flex',
|
713
|
-
flexGrow: 1,
|
714
|
-
width: `calc(100% - ${isMobile ? 0 : 70}px)`,
|
715
|
-
height: `calc(100% - ${isMobile ? 55 : 0}px)`,
|
716
|
-
flexDirection: 'row'
|
717
|
-
}, children: _jsxs("div", { style: { width: '100%', height: '100%' }, children: [_jsxs("div", { ref: containerRef, style: {
|
718
|
-
display: hasVisiblePanels() ? 'flex' : 'none',
|
719
|
-
width: '100%',
|
720
|
-
height: '100%',
|
721
|
-
}, children: [_jsx("div", { style: {
|
722
|
-
display: visibility.TMSearchResult ? 'block' : 'none',
|
723
|
-
width: widthPanel1,
|
724
|
-
height: heightPanel1,
|
725
|
-
overflow: 'hidden',
|
726
|
-
}, children: panelTMSearchResult() }), visibility.TMSearchResult && visibility.TMBlog && maximizedPanelId === null && (_jsx("div", { style: {
|
727
|
-
background: 'transparent',
|
728
|
-
cursor: 'col-resize',
|
729
|
-
width: `${gutters}px`,
|
730
|
-
height: '100%',
|
731
|
-
userSelect: 'none',
|
732
|
-
}, onMouseDown: (e) => onMouseDown(e, 'TMSearchResult', 'TMBlog', true) })), _jsx("div", { style: {
|
733
|
-
display: visibility.TMBlog ? 'block' : 'none',
|
734
|
-
width: widthPanel2,
|
735
|
-
height: heightPanel2,
|
736
|
-
overflow: 'hidden',
|
737
|
-
}, children: _jsx(TMPanel, { title: SDKUI_Localizator.BlogCase, onClose: () => togglePanel('TMBlog'), onMaximize: () => toggleMaximizePanel('TMBlog'), onHeaderDoubleClick: () => toggleMaximizePanel('TMBlog'), allowMaximize: !isMobile, children: panelTMBlog() }) }), visibility.TMBlog && visibility.TMSysMetadata && maximizedPanelId === null && (_jsx("div", { style: {
|
738
|
-
background: 'transparent',
|
739
|
-
cursor: 'col-resize',
|
740
|
-
width: `${gutters}px`,
|
741
|
-
height: '100%',
|
742
|
-
userSelect: 'none',
|
743
|
-
}, onMouseDown: (e) => onMouseDown(e, 'TMBlog', 'TMSysMetadata', true) })), _jsx("div", { style: {
|
744
|
-
display: visibility.TMSysMetadata ? 'block' : 'none',
|
745
|
-
width: widthPanel3,
|
746
|
-
height: heightPanel3,
|
747
|
-
overflow: 'hidden',
|
748
|
-
}, children: _jsx(TMPanel, { title: SDKUI_Localizator.MetadataSystem, onClose: () => togglePanel('TMSysMetadata'), onMaximize: () => toggleMaximizePanel('TMSysMetadata'), onHeaderDoubleClick: () => toggleMaximizePanel('TMSysMetadata'), allowMaximize: !isMobile, children: panelTMSysMetadata() }) }), visibility.TMSysMetadata && visibility.TMDcmtPreview && maximizedPanelId === null && (_jsx("div", { style: {
|
749
|
-
background: 'transparent',
|
750
|
-
cursor: 'col-resize',
|
751
|
-
width: `${gutters}px`,
|
752
|
-
height: '100%',
|
753
|
-
userSelect: 'none',
|
754
|
-
}, onMouseDown: (e) => onMouseDown(e, 'TMSysMetadata', 'TMDcmtPreview', true) })), _jsx("div", { style: {
|
755
|
-
display: visibility.TMDcmtPreview ? 'block' : 'none',
|
756
|
-
width: widthPanel4,
|
757
|
-
height: heightPanel4,
|
758
|
-
overflow: 'hidden',
|
759
|
-
}, children: panelTMDcmtPreview(() => togglePanel('TMDcmtPreview')) })] }), _jsxs("div", { style: {
|
760
|
-
display: hasVisiblePanels() ? 'none' : 'flex',
|
761
|
-
flexDirection: 'column',
|
762
|
-
width: '100%',
|
763
|
-
height: '100%',
|
764
|
-
justifyContent: 'center',
|
765
|
-
alignItems: 'center',
|
766
|
-
fontSize: '1.5rem',
|
767
|
-
fontWeight: 'bold',
|
768
|
-
color: '#888',
|
769
|
-
backgroundColor: '#fff',
|
770
|
-
borderRadius: '10px'
|
771
|
-
}, children: [_jsx(IconInfo, { style: { fontSize: 50 } }), _jsx("div", { children: SDKUI_Localizator.NoPanelSelected })] })] }) }), showSearchResultSidebar && _jsx("div", { style: {
|
772
|
-
display: 'flex',
|
773
|
-
flexDirection: isMobile ? 'row' : 'column',
|
774
|
-
alignItems: 'center',
|
775
|
-
width: isMobile ? '100%' : '50px',
|
776
|
-
height: isMobile ? '50px' : 'max-content',
|
777
|
-
background: 'transparent linear-gradient(90deg, #CCE0F4 0%, #7EC1E7 14%, #39A6DB 28%, #1E9CD7 35%, #0075BE 78%, #005B97 99%) 0% 0% no-repeat padding-box',
|
778
|
-
borderRadius: isMobile ? '10px' : '10px 0px 0px 10px',
|
779
|
-
padding: '10px',
|
780
|
-
gap: '10px'
|
781
|
-
}, children: _jsx(TMPanelToolbar, {}) })] }));
|
698
|
+
//#endregion TMSearchResultSelector
|
699
|
+
const TMDcmtPreviewWrapper = ({ currentDcmt }) => {
|
700
|
+
const { setPanelVisibilityById, toggleMaximize } = useTMPanelManagerContext();
|
701
|
+
return (_jsx(TMDcmtPreview, { onClosePanel: () => setPanelVisibilityById('tmDcmtPreview', false), onMaximizePanel: () => toggleMaximize('tmDcmtPreview'), dcmtData: currentDcmt }));
|
782
702
|
};
|
package/lib/helper/helpers.js
CHANGED
@@ -558,10 +558,6 @@ export const calcSaveFormTitle = (rootTitle, formMode, updateId, pathKeys) => {
|
|
558
558
|
return title + " > " + pathKeys.join(" > ");
|
559
559
|
};
|
560
560
|
export function calcIsModified(formData, formDataOrig) {
|
561
|
-
// if (formData instanceof MailSenderJobDescriptor && formDataOrig instanceof MailSenderJobDescriptor) {
|
562
|
-
// return !DeepCompareHelper.deepCompareUnorderedNormalized(formData, formDataOrig);
|
563
|
-
// }
|
564
|
-
// return JSON.stringify(formData) !== JSON.stringify(formDataOrig);
|
565
561
|
if (!formData && !formDataOrig)
|
566
562
|
return false;
|
567
563
|
let isMailSender = formData?.mailFormat !== undefined &&
|