@topconsultnpm/sdkui-react-beta 6.15.16 → 6.15.18
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/search/TMSearch.d.ts +2 -0
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchResult.d.ts +3 -0
- package/lib/components/features/search/TMSearchResult.js +8 -6
- package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +16 -0
- package/lib/components/features/search/TMSearchResultFloatingActionButton.js +46 -0
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +1 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +6 -6
- package/lib/helper/SDKUI_Localizator.d.ts +2 -1
- package/lib/helper/SDKUI_Localizator.js +11 -1
- package/package.json +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DcmtTypeDescriptor, TaskDescriptor } from '@topconsultnpm/sdk-ts-beta';
|
|
3
3
|
import { DcmtInfo, TaskContext } from '../../../ts';
|
|
4
|
+
import { TMSearchResultFloatingActionConfig } from './TMSearchResultFloatingActionButton';
|
|
4
5
|
interface ITMSearchProps {
|
|
5
6
|
inputTID?: number;
|
|
6
7
|
inputSqdID?: number;
|
|
7
8
|
isExpertMode?: boolean;
|
|
9
|
+
floatingActionConfig?: TMSearchResultFloatingActionConfig;
|
|
8
10
|
onRefreshAfterAddDcmtToFavs?: () => void;
|
|
9
11
|
onFileOpened?: (dcmtFile: File | undefined) => void;
|
|
10
12
|
onFocusedItemChanged?: (tid?: number, did?: number) => void;
|
|
@@ -18,7 +18,7 @@ var TMSearchViews;
|
|
|
18
18
|
TMSearchViews[TMSearchViews["Search"] = 0] = "Search";
|
|
19
19
|
TMSearchViews[TMSearchViews["Result"] = 1] = "Result";
|
|
20
20
|
})(TMSearchViews || (TMSearchViews = {}));
|
|
21
|
-
const TMSearch = ({ onFocusedItemChanged = undefined, inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm }) => {
|
|
21
|
+
const TMSearch = ({ onFocusedItemChanged = undefined, inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm }) => {
|
|
22
22
|
const [allSQDs, setAllSQDs] = useState([]);
|
|
23
23
|
const [filteredByTIDSQDs, setFilteredByTIDSQDs] = useState([]);
|
|
24
24
|
const [currentSQD, setCurrentSQD] = useState();
|
|
@@ -196,7 +196,7 @@ const TMSearch = ({ onFocusedItemChanged = undefined, inputTID, inputSqdID, isEx
|
|
|
196
196
|
toolbarOptions: { icon: _jsx(IconSavedQuery, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['TMSavedQuerySelector'] }
|
|
197
197
|
}
|
|
198
198
|
], [tmTreeSelectorElement, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement, fromDTD, mruTIDs]);
|
|
199
|
-
return (_jsxs(_Fragment, { children: [_jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }), _jsx(TMSearchResult, { isVisible: currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync: async () => {
|
|
199
|
+
return (_jsxs(_Fragment, { children: [_jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }), _jsx(TMSearchResult, { isVisible: currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync: async () => {
|
|
200
200
|
let newResult = await refreshLastSearch(lastQdSearched) ?? [];
|
|
201
201
|
setSearchResult(newResult);
|
|
202
202
|
if (newResult.length <= 0) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SearchResultDescriptor, DcmtTypeDescriptor, TaskDescriptor, WorkingGroupDescriptor } from '@topconsultnpm/sdk-ts-beta';
|
|
3
3
|
import { DcmtInfo, SearchResultContext, TaskContext } from '../../../ts';
|
|
4
|
+
import { TMSearchResultFloatingActionConfig } from './TMSearchResultFloatingActionButton';
|
|
4
5
|
export declare const getSearchResultCountersSingleCategory: (searchResults: SearchResultDescriptor[]) => string;
|
|
5
6
|
interface ITMSearchResultProps {
|
|
6
7
|
context?: SearchResultContext;
|
|
@@ -18,6 +19,7 @@ interface ITMSearchResultProps {
|
|
|
18
19
|
selectedSearchResultTID?: number;
|
|
19
20
|
workingGroupContext?: WorkingGroupDescriptor;
|
|
20
21
|
disableAccordionIfSingleCategory?: boolean;
|
|
22
|
+
floatingActionConfig?: TMSearchResultFloatingActionConfig;
|
|
21
23
|
onClose?: () => void;
|
|
22
24
|
onWFOperationCompleted?: () => Promise<void>;
|
|
23
25
|
onSelectedTIDChanged?: (TID: number) => void;
|
|
@@ -28,6 +30,7 @@ interface ITMSearchResultProps {
|
|
|
28
30
|
onTaskCreateRequest?: (taskContext: TaskContext, onTaskCreated?: (task?: TaskDescriptor) => void) => void;
|
|
29
31
|
openWGsCopyMoveForm?: (mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void;
|
|
30
32
|
openCommentFormCallback?: (documents: Array<DcmtInfo>) => void;
|
|
33
|
+
openAddDocumentForm?: () => void;
|
|
31
34
|
}
|
|
32
35
|
declare const TMSearchResult: React.FC<ITMSearchResultProps>;
|
|
33
36
|
export default TMSearchResult;
|
|
@@ -37,6 +37,7 @@ import ShowAlert from '../../base/TMAlert';
|
|
|
37
37
|
import ToppyHelpCenter from '../assistant/ToppyHelpCenter';
|
|
38
38
|
import TMAccordion from '../../base/TMAccordion';
|
|
39
39
|
import TMDataGridExportForm from '../../base/TMDataGridExportForm';
|
|
40
|
+
import TMSearchResultFloatingActionButton from './TMSearchResultFloatingActionButton';
|
|
40
41
|
//#region Internal Components
|
|
41
42
|
const CommandsContextMenu = React.memo(({ target, menuItems, allowPin }) => {
|
|
42
43
|
return (_jsx(ContextMenu, { showEvent: 'click', dataSource: menuItems, target: `${target}` }));
|
|
@@ -59,7 +60,7 @@ const orderByName = (array) => {
|
|
|
59
60
|
return 1;
|
|
60
61
|
} return 0; });
|
|
61
62
|
};
|
|
62
|
-
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, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onFocusedItemChanged = undefined, onTaskCreateRequest, openWGsCopyMoveForm, openCommentFormCallback }) => {
|
|
63
|
+
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, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onFocusedItemChanged = undefined, onTaskCreateRequest, openWGsCopyMoveForm, openCommentFormCallback, openAddDocumentForm }) => {
|
|
63
64
|
const [id, setID] = useState('');
|
|
64
65
|
const [showApprovePopup, setShowApprovePopup] = useState(false);
|
|
65
66
|
const [showRejectPopup, setShowRejectPopup] = useState(false);
|
|
@@ -230,7 +231,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
230
231
|
return;
|
|
231
232
|
if (e.target === 'content') {
|
|
232
233
|
e.items = e.items || [];
|
|
233
|
-
const menuItems = getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, openWGsCopyMoveForm, openCommentFormCallback);
|
|
234
|
+
const menuItems = getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, openWGsCopyMoveForm, openCommentFormCallback, openAddDocumentForm);
|
|
234
235
|
e.items.push(...menuItems);
|
|
235
236
|
}
|
|
236
237
|
};
|
|
@@ -357,7 +358,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
357
358
|
}
|
|
358
359
|
};
|
|
359
360
|
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 &&
|
|
360
|
-
_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(CommandsContextMenu, { target: `#commands-header-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, openWGsCopyMoveForm, openCommentFormCallback) })] });
|
|
361
|
+
_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(CommandsContextMenu, { target: `#commands-header-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, openWGsCopyMoveForm, openCommentFormCallback, openAddDocumentForm) })] });
|
|
361
362
|
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') })] });
|
|
362
363
|
const handleAddItem = (tid, did) => {
|
|
363
364
|
let newItem = { TID: tid ?? 0, DID: did ?? 0 };
|
|
@@ -375,14 +376,14 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
375
376
|
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
376
377
|
:
|
|
377
378
|
_jsx(_Fragment, {}), _jsxs(TMLayoutItem, { children: [_jsx(TMSearchResultGrid, { 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, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync(inputDcmts, downloadType, downloadMode, onFileOpened, confirmAttachments), showExportForm: showExportForm, onCloseExportForm: onCloseExportForm }), allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE &&
|
|
378
|
-
_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(CommandsContextMenu, { target: `#commands-floating-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, openWGsCopyMoveForm, openCommentFormCallback) })] })] }), "m"] }), 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: () => {
|
|
379
|
+
_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(CommandsContextMenu, { target: `#commands-floating-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, openWGsCopyMoveForm, openCommentFormCallback, openAddDocumentForm) })] })] }), "m"] }), 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: () => {
|
|
379
380
|
setIsOpenBatchUpdate(false);
|
|
380
381
|
}, onSavedCallbackAsync: async () => {
|
|
381
382
|
setIsOpenBatchUpdate(false);
|
|
382
383
|
setIsModifiedBatchUpdate(false);
|
|
383
384
|
await refreshSelectionDataRowsAsync();
|
|
384
385
|
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), showToppyForApprove && !showApprovePopup && !showRejectPopup && !showReAssignPopup && !showMoreInfoPopup &&
|
|
385
|
-
_jsx(ToppyHelpCenter, { deviceType: deviceType, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: () => ShowAlert({ message: 'TODO', mode: 'info', title: SDKUI_Localizator.SignatureAndApprove, duration: 3000 }), onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), approveDisable: disable, signApproveDisable: disable, rejectDisable: disable, reassignDisable: disable, infoDisable: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length !== 1 }) }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {})] }), [
|
|
386
|
+
_jsx(ToppyHelpCenter, { deviceType: deviceType, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: () => ShowAlert({ message: 'TODO', mode: 'info', title: SDKUI_Localizator.SignatureAndApprove, duration: 3000 }), onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), approveDisable: disable, signApproveDisable: disable, rejectDisable: disable, reassignDisable: disable, infoDisable: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length !== 1 }) }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), (floatingActionConfig && floatingActionConfig.isVisible) && _jsx(TMSearchResultFloatingActionButton, { selectedDcmtsOrFocused: getSelectedDcmtsOrFocused(selectedItems, focusedItem), config: floatingActionConfig })] }), [
|
|
386
387
|
searchResults,
|
|
387
388
|
selectedSearchResult,
|
|
388
389
|
lastUpdateSearchTime,
|
|
@@ -400,6 +401,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
400
401
|
isOpenMaster,
|
|
401
402
|
isOpenDcmtForm,
|
|
402
403
|
showToppyForApprove,
|
|
404
|
+
floatingActionConfig,
|
|
403
405
|
disableAccordionIfSingleCategory,
|
|
404
406
|
getTitleHeader
|
|
405
407
|
]);
|
|
@@ -657,7 +659,7 @@ const TMSearchResultGrid = ({ inputFocusedItem, allowMultipleSelection = true, s
|
|
|
657
659
|
setShowFilterPanel(!!e.value);
|
|
658
660
|
}
|
|
659
661
|
}, []);
|
|
660
|
-
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: focusedItem?.rowIndex, showSearchPanel: false, showFilterPanel: showFilterPanel, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: TMDataGridPageSize.Small, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, onOptionChanged: onOptionChanged, onContextMenuPreparing: onContextMenuPreparing, onKeyDown: onKeyDown, counterConfig: { show: true } }), (showExportForm && searchResult && onCloseExportForm) && _jsx(TMDataGridExportForm, { dataColumns: dataColumns, dataSource: dataSource, selectedRowKeys: selectedRowKeys, onCloseExportForm: onCloseExportForm, searchResult: searchResult })] });
|
|
662
|
+
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: false, showFilterPanel: showFilterPanel, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: TMDataGridPageSize.Small, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, onOptionChanged: onOptionChanged, onContextMenuPreparing: onContextMenuPreparing, onKeyDown: onKeyDown, counterConfig: { show: true } }), (showExportForm && searchResult && onCloseExportForm) && _jsx(TMDataGridExportForm, { dataColumns: dataColumns, dataSource: dataSource, selectedRowKeys: selectedRowKeys, onCloseExportForm: onCloseExportForm, searchResult: searchResult })] });
|
|
661
663
|
};
|
|
662
664
|
//#region TMSearchResultSelector
|
|
663
665
|
const StyledItemTemplate = styled.div `
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DcmtInfo } from '../../../ts';
|
|
3
|
+
export interface TMSearchResultFloatingActionConfig {
|
|
4
|
+
isVisible?: boolean;
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
type?: 'single' | 'multi';
|
|
7
|
+
tooltip?: React.ReactNode;
|
|
8
|
+
iconElement?: React.ReactNode;
|
|
9
|
+
onClick?: (selectedDcmtsOrFocused: Array<DcmtInfo>) => void;
|
|
10
|
+
}
|
|
11
|
+
interface TMSearchResultFloatingActionButtonProps {
|
|
12
|
+
selectedDcmtsOrFocused: Array<DcmtInfo>;
|
|
13
|
+
config: TMSearchResultFloatingActionConfig;
|
|
14
|
+
}
|
|
15
|
+
export declare const TMSearchResultFloatingActionButton: (props: TMSearchResultFloatingActionButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default TMSearchResultFloatingActionButton;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import TMTooltip from '../../base/TMTooltip';
|
|
4
|
+
;
|
|
5
|
+
export const TMSearchResultFloatingActionButton = (props) => {
|
|
6
|
+
const { config, selectedDcmtsOrFocused } = props;
|
|
7
|
+
const { isDisabled, tooltip, iconElement, onClick } = config;
|
|
8
|
+
const [isButtonDisabled, setIsButtonDisabled] = useState(false);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const shouldDisable = isDisabled || (config.type === 'single' && selectedDcmtsOrFocused.length !== 1) || (config.type === 'multi' && selectedDcmtsOrFocused.length === 0);
|
|
11
|
+
setIsButtonDisabled(shouldDisable);
|
|
12
|
+
}, [config, selectedDcmtsOrFocused]);
|
|
13
|
+
return _jsx("button", { disabled: isButtonDisabled, style: {
|
|
14
|
+
position: 'absolute',
|
|
15
|
+
bottom: '10px',
|
|
16
|
+
right: '20px',
|
|
17
|
+
width: '40px',
|
|
18
|
+
height: '40px',
|
|
19
|
+
borderRadius: "50%",
|
|
20
|
+
backgroundColor: "#C2388B",
|
|
21
|
+
color: '#fff',
|
|
22
|
+
border: 'none',
|
|
23
|
+
cursor: isButtonDisabled ? 'not-allowed' : 'pointer',
|
|
24
|
+
boxShadow: isButtonDisabled ? 'none' : '0 2px 6px rgba(0,0,0,0.2)',
|
|
25
|
+
zIndex: 1000,
|
|
26
|
+
transition: 'background-color 0.3s ease, transform 0.2s ease',
|
|
27
|
+
display: 'flex',
|
|
28
|
+
justifyContent: 'center',
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
pointerEvents: isButtonDisabled ? 'none' : 'auto',
|
|
31
|
+
opacity: isButtonDisabled ? 0.5 : 1,
|
|
32
|
+
}, onMouseEnter: (e) => {
|
|
33
|
+
if (!isButtonDisabled) {
|
|
34
|
+
e.currentTarget.style.backgroundColor = '#D94A9F';
|
|
35
|
+
e.currentTarget.style.transform = 'scale(1.1)';
|
|
36
|
+
e.currentTarget.style.boxShadow = '0 4px 12px rgba(37, 89, 165, 0.6)';
|
|
37
|
+
}
|
|
38
|
+
}, onMouseLeave: (e) => {
|
|
39
|
+
if (!isButtonDisabled) {
|
|
40
|
+
e.currentTarget.style.backgroundColor = "#C2388B";
|
|
41
|
+
e.currentTarget.style.transform = 'scale(1)';
|
|
42
|
+
e.currentTarget.style.boxShadow = '0 2px 6px rgba(0,0,0,0.2)';
|
|
43
|
+
}
|
|
44
|
+
}, onClick: () => onClick?.(selectedDcmtsOrFocused), children: _jsx(TMTooltip, { content: tooltip, children: iconElement || _jsx("i", { className: "dx-icon-save", style: { fontSize: '25px' } }) }) });
|
|
45
|
+
};
|
|
46
|
+
export default TMSearchResultFloatingActionButton;
|
|
@@ -3,4 +3,4 @@ import { DcmtTypeDescriptor, FileDescriptor, FileFormats, LayoutModes, WorkingGr
|
|
|
3
3
|
import { TMDataGridContextMenuItem } from '../../base/TMDataGrid';
|
|
4
4
|
import { DcmtInfo, DcmtOperationTypes, DownloadModes, DownloadTypes, SearchResultContext } from '../../../ts';
|
|
5
5
|
export declare const getSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => DcmtInfo[];
|
|
6
|
-
export declare const getCommandsMenuItems: (dtd: DcmtTypeDescriptor | undefined, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, workingGroupContext: WorkingGroupDescriptor | undefined, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>) => Promise<void>, runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>, onRefreshSearchAsync: (() => Promise<void>) | undefined, onRefreshDataRowsAsync: (() => Promise<void>) | undefined, onRefreshAfterAddDcmtToFavs: (() => void) | undefined, confirmFormat: () => Promise<FileFormats>, confirmAttachments: (list: FileDescriptor[]) => Promise<string[] | undefined>, openTaskFormHandler: () => void, openDetailDcmtsFormHandler: (value: boolean) => void, openMasterDcmtsFormHandler: (value: boolean) => void, openBatchUpdateFormHandler: (value: boolean) => void, openExportForm: () => void, openWGsCopyMoveForm?: ((mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void), openCommentFormCallback?: ((documents: Array<DcmtInfo>) => void)) => Array<TMDataGridContextMenuItem>;
|
|
6
|
+
export declare const getCommandsMenuItems: (dtd: DcmtTypeDescriptor | undefined, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, workingGroupContext: WorkingGroupDescriptor | undefined, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>) => Promise<void>, runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>, onRefreshSearchAsync: (() => Promise<void>) | undefined, onRefreshDataRowsAsync: (() => Promise<void>) | undefined, onRefreshAfterAddDcmtToFavs: (() => void) | undefined, confirmFormat: () => Promise<FileFormats>, confirmAttachments: (list: FileDescriptor[]) => Promise<string[] | undefined>, openTaskFormHandler: () => void, openDetailDcmtsFormHandler: (value: boolean) => void, openMasterDcmtsFormHandler: (value: boolean) => void, openBatchUpdateFormHandler: (value: boolean) => void, openExportForm: () => void, openWGsCopyMoveForm?: ((mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void), openCommentFormCallback?: ((documents: Array<DcmtInfo>) => void), openAddDocumentForm?: () => void) => Array<TMDataGridContextMenuItem>;
|
|
@@ -24,7 +24,7 @@ export const getSelectedDcmtsOrFocused = (selectedItems, focusedItem, fileFormat
|
|
|
24
24
|
}
|
|
25
25
|
return [];
|
|
26
26
|
};
|
|
27
|
-
export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, openWGsCopyMoveForm, openCommentFormCallback) => {
|
|
27
|
+
export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, openWGsCopyMoveForm, openCommentFormCallback, openAddDocumentForm) => {
|
|
28
28
|
// let ftExplanations = focusedItem?.FTExplanations;
|
|
29
29
|
return [
|
|
30
30
|
{
|
|
@@ -398,13 +398,13 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
|
|
|
398
398
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
399
399
|
beginGroup: true,
|
|
400
400
|
items: [
|
|
401
|
-
|
|
401
|
+
{
|
|
402
402
|
icon: "add",
|
|
403
|
-
text: SDKUI_Localizator.
|
|
404
|
-
visible: workingGroupContext !== undefined,
|
|
403
|
+
text: SDKUI_Localizator.SelectAndAdd,
|
|
404
|
+
visible: workingGroupContext !== undefined && openAddDocumentForm !== undefined,
|
|
405
405
|
disabled: workingGroupContext === undefined,
|
|
406
|
-
onClick:
|
|
407
|
-
},
|
|
406
|
+
onClick: () => openAddDocumentForm && openAddDocumentForm(),
|
|
407
|
+
},
|
|
408
408
|
{
|
|
409
409
|
icon: 'movetofolder',
|
|
410
410
|
text: SDKUI_Localizator.AddToDrafts,
|
|
@@ -249,7 +249,7 @@ export declare class SDKUI_Localizator {
|
|
|
249
249
|
static get LoadingParticipants(): string;
|
|
250
250
|
static get Login(): string;
|
|
251
251
|
static get LogDelete(): "Löschen der Logik" | "Logical delete" | "Cancelación lógica" | "Suppression logique" | "Lógica de cancelamento" | "Cancellazione logica";
|
|
252
|
-
static get Logout(): "Abmelden" | "Logout" | "Cerrar sesión" | "Déconnexion" | "Sair" | "
|
|
252
|
+
static get Logout(): "Abmelden" | "Logout" | "Cerrar sesión" | "Déconnexion" | "Sair" | "Esci";
|
|
253
253
|
static get MakeEditable(): "Bearbeitbar machen" | "Make editable" | "Hacer editable" | "Rendre modifiable" | "Faça editável" | "Rendi editabile";
|
|
254
254
|
static get Max_Value(): "Der Maximalwert ist {{0}}" | "The maximum value is {{0}}" | "El valor máximo es {{0}}" | "La valeur maximale est {{0}}" | "O valor máximo é {{0}}" | "Il valore massimo è {{0}}";
|
|
255
255
|
static get MaxDcmtsToBeReturned(): "Maximale Anzahl von Dokumenten" | "Max number of documents" | "Número máximo de documentos" | "Nombre maximum de documents" | "O número máximo de documentos" | "Numero massimo di documenti";
|
|
@@ -418,6 +418,7 @@ export declare class SDKUI_Localizator {
|
|
|
418
418
|
static get SearchResult(): "Suchergebnis" | "Search result" | "Resultado de la búsqueda" | "Résultat de la recherche" | "Resultados da pesquisa" | "Risultato della ricerca";
|
|
419
419
|
static get Seconds(): "Sekunden" | "Seconds" | "Segundos" | "Secondes" | "Segundas" | "Secondi";
|
|
420
420
|
static get Select(): "Wählen Sie Ihre" | "Select" | "Seleccionar" | "Sélectionne" | "Selecione" | "Seleziona";
|
|
421
|
+
static get SelectAndAdd(): "Auswählen und hinzufügen" | "Select and add" | "Seleccionar y añadir" | "Sélectionner et ajouter" | "Selecionar e adicionar" | "Seleziona e aggiungi";
|
|
421
422
|
static get SelectSupportAreaMessage(): "Wählen Sie einen Ablagebereich aus" | "Select a support area" | "Seleccione un área de apoyo" | "Sélectionnez une zone de support" | "Selecione uma área de apoio" | "Selezionare un'area di appoggio";
|
|
422
423
|
static get SelectedSingular(): string;
|
|
423
424
|
static get Selected(): "Ausgewählt" | "Selected" | "Sélectionné" | "Selecionado" | "Seleccionados" | "Selezionati";
|
|
@@ -2463,7 +2463,7 @@ export class SDKUI_Localizator {
|
|
|
2463
2463
|
case CultureIDs.Es_ES: return "Cerrar sesión";
|
|
2464
2464
|
case CultureIDs.Fr_FR: return "Déconnexion";
|
|
2465
2465
|
case CultureIDs.Pt_PT: return "Sair";
|
|
2466
|
-
default: return "
|
|
2466
|
+
default: return "Esci";
|
|
2467
2467
|
}
|
|
2468
2468
|
}
|
|
2469
2469
|
static get MakeEditable() {
|
|
@@ -4144,6 +4144,16 @@ export class SDKUI_Localizator {
|
|
|
4144
4144
|
default: return "Seleziona";
|
|
4145
4145
|
}
|
|
4146
4146
|
}
|
|
4147
|
+
static get SelectAndAdd() {
|
|
4148
|
+
switch (this._cultureID) {
|
|
4149
|
+
case CultureIDs.De_DE: return "Auswählen und hinzufügen";
|
|
4150
|
+
case CultureIDs.En_US: return "Select and add";
|
|
4151
|
+
case CultureIDs.Es_ES: return "Seleccionar y añadir";
|
|
4152
|
+
case CultureIDs.Fr_FR: return "Sélectionner et ajouter";
|
|
4153
|
+
case CultureIDs.Pt_PT: return "Selecionar e adicionar";
|
|
4154
|
+
default: return "Seleziona e aggiungi";
|
|
4155
|
+
}
|
|
4156
|
+
}
|
|
4147
4157
|
static get SelectSupportAreaMessage() {
|
|
4148
4158
|
switch (this._cultureID) {
|
|
4149
4159
|
case CultureIDs.De_DE: return "Wählen Sie einen Ablagebereich aus";
|