@topconsultnpm/sdkui-react 6.22.0-dev3.3 → 6.22.0-dev3.5
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/NewComponents/ContextMenu/styles.d.ts +45 -43
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +67 -60
- package/lib/components/base/Styled.d.ts +93 -77
- package/lib/components/base/Styled.js +7 -5
- package/lib/components/base/TMCounterBar.d.ts +2 -2
- package/lib/components/base/TMCounterContainer.d.ts +2 -1
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMDataGrid.js +221 -221
- package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
- package/lib/components/base/TMFileManager.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
- package/lib/components/base/TMFileManagerUtils.d.ts +4 -6
- package/lib/components/base/TMLayout.d.ts +4 -4
- package/lib/components/base/TMList.d.ts +2 -1
- package/lib/components/base/TMListView.d.ts +1 -1
- package/lib/components/base/TMPanel.js +167 -167
- package/lib/components/base/TMSpinner.d.ts +2 -1
- package/lib/components/base/TMTab.d.ts +4 -3
- package/lib/components/base/TMTabControl.d.ts +99 -0
- package/lib/components/base/TMTabControl.js +652 -0
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTreeView.d.ts +14 -8
- package/lib/components/base/TMUserAvatar.d.ts +2 -1
- package/lib/components/base/TMVilViewer.d.ts +2 -1
- package/lib/components/base/TMWaitPanel.d.ts +3 -2
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMQuickSearchInfo.d.ts +2 -1
- package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
- package/lib/components/choosers/TMUserChooser.d.ts +2 -2
- package/lib/components/editors/TMEditorStyled.d.ts +20 -42
- package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
- package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
- package/lib/components/editors/TMMetadataValues.js +5 -5
- package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
- package/lib/components/features/documents/TMDcmtForm.js +1 -1
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtIcon.d.ts +2 -1
- package/lib/components/features/documents/TMDcmtPreview.d.ts +8 -6
- package/lib/components/features/documents/TMDcmtTasks.d.ts +2 -1
- package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +2 -1
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +2 -1
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +2 -1
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +13 -15
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +4 -4
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +2 -1
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSearch.d.ts +1 -1
- package/lib/components/features/search/TMSearch.js +68 -9
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +9 -3
- package/lib/components/features/search/TMSearchResult.js +87 -79
- package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +2 -1
- package/lib/components/features/search/TMTreeSelector.js +15 -9
- package/lib/components/features/search/TMViewHistoryDcmt.d.ts +2 -1
- package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
- package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksView.js +6 -12
- package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +3 -2
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +8 -7
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +3 -1
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +3 -1
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- package/lib/components/forms/TMChooserForm.d.ts +2 -1
- package/lib/components/forms/TMSaveForm.d.ts +4 -4
- package/lib/components/grids/TMBlogAttachments.d.ts +2 -1
- package/lib/components/grids/TMBlogHeader.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.d.ts +1 -1
- package/lib/components/grids/TMBlogsPostUtils.d.ts +9 -9
- package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +2 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +5 -6
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
- package/lib/components/pages/TMPage.d.ts +1 -1
- package/lib/components/query/TMQueryEditor.d.ts +14 -10
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
- package/lib/components/sidebar/TMHeader.d.ts +3 -3
- package/lib/components/viewers/TMDataListItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMMidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.d.ts +2 -2
- package/lib/helper/SDKUI_Localizator.d.ts +4 -0
- package/lib/helper/SDKUI_Localizator.js +40 -0
- package/lib/helper/TMAppUpdatedModal.d.ts +2 -1
- package/lib/helper/TMAppUpdatedModal.js +93 -93
- package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
- package/lib/helper/TMIcons.d.ts +280 -280
- package/lib/helper/TMPdfViewer.d.ts +2 -1
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +10 -4
- package/lib/helper/helpers.d.ts +1 -1
- package/lib/hooks/useInputDialog.d.ts +2 -1
- package/lib/services/platform_services.d.ts +3 -2
- package/package.json +71 -71
|
@@ -46,5 +46,5 @@ interface ITMSearchProps {
|
|
|
46
46
|
fetchRemoteCertificates?: (email: string) => Promise<IntesiCertificateData[]>;
|
|
47
47
|
graphometricManager?: IGraphometricManagerProp;
|
|
48
48
|
}
|
|
49
|
-
declare const TMSearch: React.
|
|
49
|
+
declare const TMSearch: (props: ITMSearchProps) => React.JSX.Element;
|
|
50
50
|
export default TMSearch;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { SavedQueryCacheService, DcmtTypeListCacheService, SDK_Localizator, LayoutModes } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import TMSavedQuerySelector from './TMSavedQuerySelector';
|
|
5
5
|
import TMTreeSelector from './TMTreeSelector';
|
|
6
|
-
import { TabPanel, Item } from 'devextreme-react/tab-panel';
|
|
7
6
|
import TMSearchQueryPanel, { refreshLastSearch } from './TMSearchQueryPanel';
|
|
8
7
|
import { getSysAllDcmtsSQD, SYS_ALL_DCMTS_SQD_ID, IconFilter, IconRecentlyViewed, IconSavedQuery, IconTree, mergeSearchResultsAppend, removeMruTid, SDKUI_Globals, SDKUI_Localizator, updateMruTids } from '../../../helper';
|
|
9
8
|
import TMSearchResult from './TMSearchResult';
|
|
9
|
+
import TMTabControl, { TMTabPanel, useTMTabs } from '../../base/TMTabControl';
|
|
10
10
|
import TMRecentsManager from '../../grids/TMRecentsManager';
|
|
11
11
|
import { SearchResultContext } from '../../../ts';
|
|
12
12
|
import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
|
@@ -20,7 +20,7 @@ var TMSearchViews;
|
|
|
20
20
|
TMSearchViews[TMSearchViews["Search"] = 0] = "Search";
|
|
21
21
|
TMSearchViews[TMSearchViews["Result"] = 1] = "Result";
|
|
22
22
|
})(TMSearchViews || (TMSearchViews = {}));
|
|
23
|
-
const
|
|
23
|
+
const TMSearchInstance = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, openInOffice, isVisible, inputTID, inputSqdID, inputMids, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm, editPdfForm = false, openS4TViewer, onOpenS4TViewerRequest, onOpenPdfEditorRequest, openFileUploaderPdfEditor, showTodoDcmtForm, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, passToArchiveCallback, onCurrentTIDChangedCallback, onlyShowSearchQueryPanel, onReferenceClick, refreshFavoriteSavedQueries, inputDID, formAutoOpen, fetchRemoteCertificates, graphometricManager, onSelectedNameChanged }) => {
|
|
24
24
|
const [allSQDs, setAllSQDs] = useState([]);
|
|
25
25
|
const [filteredByTIDSQDs, setFilteredByTIDSQDs] = useState([]);
|
|
26
26
|
const [currentSQD, setCurrentSQD] = useState();
|
|
@@ -34,6 +34,20 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
34
34
|
const [lastQdSearched, setLastQdSearched] = useState();
|
|
35
35
|
const [showSearchResults, setShowSearchResults] = useState(!onlyShowSearchQueryPanel);
|
|
36
36
|
const [maxDcmtsToBeReturned, setMaxDcmtsToBeReturned] = useState(SDKUI_Globals.userSettings.searchSettings?.maxDcmtsToBeReturned ?? 1000);
|
|
37
|
+
// Il titolo del tab e' il nome del tipo documento dell'ultima scelta dell'utente, sia questa fatta
|
|
38
|
+
// dall'albero, dalle scorciatoie o da una ricerca rapida (di cui conta il tipo documento, non il nome).
|
|
39
|
+
// La callback sta in un ref cosi non entra nelle dipendenze di effetti e memo.
|
|
40
|
+
const selectedNameRef = useRef(onSelectedNameChanged);
|
|
41
|
+
selectedNameRef.current = onSelectedNameChanged;
|
|
42
|
+
// Il nome del tipo documento scelto arriva dal descrittore, che qui e' gia' in cache
|
|
43
|
+
const notifySelectedTIDAsync = useCallback(async (tid) => {
|
|
44
|
+
if (!tid || !selectedNameRef.current)
|
|
45
|
+
return;
|
|
46
|
+
const dtd = await DcmtTypeListCacheService.GetAsync(tid);
|
|
47
|
+
const name = dtd?.nameLoc ?? dtd?.name;
|
|
48
|
+
if (name)
|
|
49
|
+
selectedNameRef.current(name);
|
|
50
|
+
}, []);
|
|
37
51
|
const deviceType = useDeviceType();
|
|
38
52
|
useEffect(() => {
|
|
39
53
|
if (onCurrentTIDChangedCallback) {
|
|
@@ -47,6 +61,7 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
47
61
|
useEffect(() => {
|
|
48
62
|
if (!inputTID)
|
|
49
63
|
return;
|
|
64
|
+
notifySelectedTIDAsync(inputTID);
|
|
50
65
|
setCurrentTID(inputTID);
|
|
51
66
|
setCurrentSearchView(TMSearchViews.Search);
|
|
52
67
|
}, [inputTID]);
|
|
@@ -54,6 +69,7 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
54
69
|
const loadSqd = async () => {
|
|
55
70
|
try {
|
|
56
71
|
const resultSqd = await SavedQueryCacheService.GetAsync(inputSqdID);
|
|
72
|
+
notifySelectedTIDAsync(resultSqd?.masterTID);
|
|
57
73
|
await setSQDAsync(resultSqd);
|
|
58
74
|
// Mostra la vista Search per visualizzare i filtri della SavedQuery caricata
|
|
59
75
|
setCurrentSearchView(TMSearchViews.Search);
|
|
@@ -141,12 +157,13 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
141
157
|
setCurrentMruTID(0);
|
|
142
158
|
};
|
|
143
159
|
const onSQDItemClick = useCallback(async (sqd, setSqdAsync) => {
|
|
160
|
+
notifySelectedTIDAsync(sqd.masterTID);
|
|
144
161
|
// Forza ricaricamento completo se la query è già selezionata
|
|
145
162
|
if (sqd.id === currentSQD?.id) {
|
|
146
163
|
await setSqdAsync(undefined);
|
|
147
164
|
}
|
|
148
165
|
await setSqdAsync(sqd);
|
|
149
|
-
}, [currentSQD]);
|
|
166
|
+
}, [currentSQD, notifySelectedTIDAsync]);
|
|
150
167
|
const onSQDDeleted = useCallback(async (sqd, sqdToBeSet, setSqdAsync) => {
|
|
151
168
|
await loadDataSQDsAsync(true, sqd.masterTID);
|
|
152
169
|
if (sqdToBeSet)
|
|
@@ -230,30 +247,35 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
230
247
|
const isTabletOrMobile = deviceType === DeviceType.TABLET || deviceType === DeviceType.MOBILE;
|
|
231
248
|
// --- JSX WRAPPERS ---
|
|
232
249
|
const tmTreeSelectorElement = useMemo(() => _jsx(TMTreeSelectorWrapper, { isMobile: isTabletOrMobile, onSelectedTIDChanged: (tid) => {
|
|
250
|
+
notifySelectedTIDAsync(tid);
|
|
233
251
|
setCurrentTID(tid);
|
|
234
252
|
if (tid && mruTIDs.includes(tid))
|
|
235
253
|
setCurrentMruTID(tid);
|
|
236
254
|
else
|
|
237
255
|
setCurrentMruTID(0);
|
|
238
|
-
} }), [isTabletOrMobile, mruTIDs]);
|
|
256
|
+
} }), [isTabletOrMobile, mruTIDs, notifySelectedTIDAsync]);
|
|
239
257
|
const tmRecentsManagerElement = useMemo(() => _jsx(TMRecentsManagerWrapper, { mruTIDs: mruTIDs, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: (tid) => {
|
|
258
|
+
notifySelectedTIDAsync(tid);
|
|
240
259
|
setCurrentMruTID(tid);
|
|
241
260
|
setCurrentTID(tid);
|
|
242
261
|
}, onDeletedTID: (tid) => {
|
|
243
262
|
let newMruTIDS = removeMruTid(SDKUI_Globals.userSettings.searchSettings.mruTIDs, tid);
|
|
244
263
|
SDKUI_Globals.userSettings.searchSettings.mruTIDs = newMruTIDS;
|
|
245
264
|
setMruTIDs(newMruTIDS);
|
|
246
|
-
} }), [mruTIDs, currentMruTID, deviceType]);
|
|
265
|
+
} }), [mruTIDs, currentMruTID, deviceType, notifySelectedTIDAsync]);
|
|
247
266
|
const tmSearchQueryPanelElement = useMemo(() => _jsx(TMSearchQueryPanelWrapper, { isSearchViewOnScreen: currentSearchView === TMSearchViews.Search, passToArchiveCallback: passToArchiveCallback, isExpertMode: isExpertMode, showBackToResultButton: searchResult.length > 0, fromDTD: fromDTD, SQD: currentSQD, inputMids: inputMids, maxDcmtsToBeReturned: maxDcmtsToBeReturned, onBackToResult: () => { if (onlyShowSearchQueryPanel)
|
|
248
267
|
setShowSearchResults(true); setCurrentSearchView(TMSearchViews.Result); }, onSearchCompleted: handleSearchCompleted, onRefreshRequested: refreshSearchQueryPanelAsync, onDcmtTypeReloaded: handleDcmtTypeReloaded, onSqdSaved: async (newSqd) => {
|
|
249
268
|
await loadDataSQDsAsync(true, newSqd.masterTID);
|
|
250
269
|
await setSQDAsync(newSqd);
|
|
251
270
|
} }), [fromDTD, showSearchResults, setShowSearchResults, currentSQD, currentSearchView, isExpertMode, mruTIDs, searchResult, passToArchiveCallback, inputMids, maxDcmtsToBeReturned, handleSearchCompleted, refreshSearchQueryPanelAsync, handleDcmtTypeReloaded, onlyShowSearchQueryPanel]);
|
|
252
|
-
|
|
271
|
+
// I due tab delle ricerche rapide nell'ordine in cui compaiono: il primo c'e' solo con un tipo
|
|
272
|
+
// documento o una ricerca rapida correnti. currentSQDMode resta la posizione nell'elenco visibile.
|
|
273
|
+
const sqdTabIds = useMemo(() => (currentTID || currentSQD) ? ['byTID', 'all'] : ['all'], [currentTID, currentSQD]);
|
|
274
|
+
const tmSavedQuerySelectorElement = useMemo(() => _jsxs(TMTabControl, { variant: 'module', style: { height: '100%', width: '100%' }, contentStyle: { display: 'flex', flexDirection: 'column', flex: 1, minHeight: 0 }, selectedId: sqdTabIds[currentSQDMode] ?? sqdTabIds[sqdTabIds.length - 1], onSelectedIdChange: (id) => setCurrentSQDMode(sqdTabIds.indexOf(id)), children: [_jsx(TMTabPanel, { id: 'byTID', label: fromDTD?.nameLoc, visible: !!(currentTID || currentSQD), children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: false, items: filteredByTIDSQDs, selectedId: currentSQD?.id, onRefreshData: () => { loadDataSQDsAsync(true); }, onItemClick: (sqd) => {
|
|
253
275
|
onSQDItemClick(sqd, setSQDAsync);
|
|
254
|
-
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? filteredByTIDSQDs.find(o => o.id == 1) : currentSQD, setSQDAsync), refreshFavoriteSavedQueries: refreshFavoriteSavedQueries }) })
|
|
276
|
+
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? filteredByTIDSQDs.find(o => o.id == 1) : currentSQD, setSQDAsync), refreshFavoriteSavedQueries: refreshFavoriteSavedQueries }) }), _jsx(TMTabPanel, { id: 'all', label: SDKUI_Localizator.AllFemale, children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: true, items: allSQDs, manageDefault: false, onItemClick: (sqd) => {
|
|
255
277
|
onSQDItemClick(sqd, setSQDAsync);
|
|
256
|
-
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? undefined : currentSQD, setSQDAsync), refreshFavoriteSavedQueries: refreshFavoriteSavedQueries }) })] }), [currentSQDMode, currentTID, currentSQD, fromDTD, filteredByTIDSQDs, allSQDs]);
|
|
278
|
+
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? undefined : currentSQD, setSQDAsync), refreshFavoriteSavedQueries: refreshFavoriteSavedQueries }) })] }), [currentSQDMode, sqdTabIds, currentTID, currentSQD, fromDTD, filteredByTIDSQDs, allSQDs]);
|
|
257
279
|
// Returns the current panelLayout from user settings, falling back to an empty object if not present.
|
|
258
280
|
const getPanelLayoutSetting = () => {
|
|
259
281
|
return SDKUI_Globals.userSettings.searchSettings.panelLayout ?? {};
|
|
@@ -347,6 +369,43 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
347
369
|
: _jsx(StyledMultiViewPanel, { $isVisible: currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true, minPanelSizePx: !isMobile ? 250 : 150 }) }) }), showSearchResults && _jsx(TMSearchResult, { isVisible: isVisible && currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, openInOffice: openInOffice, onRefreshSearchAsyncDatagrid: onRefreshSearchAsyncDatagrid, onClose: () => { if (onlyShowSearchQueryPanel)
|
|
348
370
|
setShowSearchResults(false); setCurrentSearchView(TMSearchViews.Search); }, backCaption: onlyShowSearchQueryPanel ? SDKUI_Localizator.BackToSearch : undefined, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, openFileUploaderPdfEditor: openFileUploaderPdfEditor, passToArchiveCallback: passToArchiveCallback, onSelectedTIDChanged: onCurrentTIDChangedCallback, showTodoDcmtForm: showTodoDcmtForm, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, inputDID: inputDID, formAutoOpen: formAutoOpen, fetchRemoteCertificates: fetchRemoteCertificates, graphometricManager: graphometricManager })] }));
|
|
349
371
|
};
|
|
372
|
+
const ENABLE_SEARCH_TABS = false;
|
|
373
|
+
// Ogni tab e' un TMSearch completo e indipendente: TMTabControl li tiene tutti montati, cosi piu ricerche
|
|
374
|
+
// restano vive insieme, ognuna con i suoi tipi documento, i suoi filtri e i suoi risultati.
|
|
375
|
+
const TMSearch = (props) => {
|
|
376
|
+
const { isVisible, inputTID, inputSqdID, inputDID, onlyShowSearchQueryPanel, onCurrentTIDChangedCallback } = props;
|
|
377
|
+
const tabs = useTMTabs({ label: SDKUI_Localizator.Search });
|
|
378
|
+
// Tab attivo leggibile senza rilanciare l'effetto qui sotto a ogni cambio tab
|
|
379
|
+
const activeIdRef = useRef(tabs.activeId);
|
|
380
|
+
activeIdRef.current = tabs.activeId;
|
|
381
|
+
// Titoli correnti leggibili dalla callback senza rigenerarla a ogni rinomina
|
|
382
|
+
const itemsRef = useRef(tabs.items);
|
|
383
|
+
itemsRef.current = tabs.items;
|
|
384
|
+
// Il titolo del tab e' il nome appena selezionato; se un altro tab ha gia' quel titolo si numera
|
|
385
|
+
// tra parentesi a partire da 2: NomeTipoDocumento, NomeTipoDocumento (2), NomeTipoDocumento (3)...
|
|
386
|
+
const setTabTitle = useCallback((id, name) => {
|
|
387
|
+
const used = new Set(itemsRef.current.filter(t => t.id !== id).map(t => t.label));
|
|
388
|
+
let label = name;
|
|
389
|
+
for (let i = 2; used.has(label); i++)
|
|
390
|
+
label = `${name} (${i})`;
|
|
391
|
+
tabs.rename(id, label);
|
|
392
|
+
}, [tabs.rename]);
|
|
393
|
+
// Una richiesta dall'esterno (tipo documento, ricerca rapida, documento) riguarda il tab a video in
|
|
394
|
+
// quel momento: gli altri restano sulla ricerca che stanno svolgendo.
|
|
395
|
+
const [inputsTabId, setInputsTabId] = useState(tabs.activeId);
|
|
396
|
+
useEffect(() => { setInputsTabId(activeIdRef.current); }, [inputTID, inputSqdID, inputDID]);
|
|
397
|
+
// Nella modalita a solo pannello di ricerca (es. abbinamento molti a molti) i tab non servono,
|
|
398
|
+
// cosi come non servono finche' i tab non vengono rilasciati
|
|
399
|
+
if (!ENABLE_SEARCH_TABS || onlyShowSearchQueryPanel)
|
|
400
|
+
return _jsx(TMSearchInstance, { ...props });
|
|
401
|
+
return (_jsx(TMTabControl, { ...tabs.controlProps, contentAnimation: 'none', onTabRename: undefined, variant: 'module', style: { height: '100%', width: '100%' }, contentStyle: { display: 'flex', flex: 1, minHeight: 0, position: 'relative' }, children: tabs.items.map(t => {
|
|
402
|
+
const isActiveTab = t.id === tabs.activeId;
|
|
403
|
+
const hasInputs = t.id === inputsTabId;
|
|
404
|
+
return (_jsx(TMTabPanel, { id: t.id, label: t.label, children: _jsx(TMSearchInstance, { ...props, isVisible: isVisible && isActiveTab, inputTID: hasInputs ? inputTID : undefined, inputSqdID: hasInputs ? inputSqdID : undefined, inputDID: hasInputs ? inputDID : undefined,
|
|
405
|
+
// Il tipo documento corrente lo comunica solo il tab a video
|
|
406
|
+
onCurrentTIDChangedCallback: isActiveTab ? onCurrentTIDChangedCallback : undefined, onSelectedNameChanged: (name) => setTabTitle(t.id, name) }) }, t.id));
|
|
407
|
+
}) }));
|
|
408
|
+
};
|
|
350
409
|
export default TMSearch;
|
|
351
410
|
const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
|
|
352
411
|
const { setPanelVisibilityById, toggleMaximize, countVisibleLeafPanels } = useTMPanelManagerContext();
|
|
@@ -29,6 +29,12 @@ interface ITMSearchQueryPanelProps {
|
|
|
29
29
|
declare const TMSearchQueryPanel: React.FunctionComponent<ITMSearchQueryPanelProps>;
|
|
30
30
|
export default TMSearchQueryPanel;
|
|
31
31
|
export declare const refreshLastSearch: (qd: QueryDescriptor | undefined) => Promise<SearchResultDescriptor[] | undefined>;
|
|
32
|
-
export declare const StyledToppyTextContainer: import("styled-components/dist/types").IStyledComponentBase<"web",
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
export declare const StyledToppyTextContainer: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
33
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
34
|
+
}> & string;
|
|
35
|
+
export declare const StyledToppyText: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "style"> & {
|
|
36
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
37
|
+
}> & string;
|
|
38
|
+
export declare const StyledToppyImage: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "style"> & {
|
|
39
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
40
|
+
}> & string;
|
|
@@ -1392,6 +1392,14 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, i
|
|
|
1392
1392
|
let newDataSource = searchResultDescriptorToSimpleArray(searchResult);
|
|
1393
1393
|
setDataSource(newDataSource);
|
|
1394
1394
|
}, [lastUpdateSearchTime]);
|
|
1395
|
+
const gridSorting = useMemo(() => ({ mode: 'multiple' }), []);
|
|
1396
|
+
const gridSelection = useMemo(() => ({ mode: allowMultipleSelection ? 'multiple' : 'single' }), [allowMultipleSelection]);
|
|
1397
|
+
const useNativeScrollbar = SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar === 1;
|
|
1398
|
+
const gridScrolling = useMemo(() => ({
|
|
1399
|
+
columnRenderingMode: 'virtual',
|
|
1400
|
+
rowRenderingMode: 'standard',
|
|
1401
|
+
useNative: useNativeScrollbar
|
|
1402
|
+
}), [useNativeScrollbar]);
|
|
1395
1403
|
// Handles selection change in the data grid
|
|
1396
1404
|
const handleSelectionChange = useCallback((e) => {
|
|
1397
1405
|
if (onSelectionChanged === undefined)
|
|
@@ -1506,12 +1514,12 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, operationItems, allUsers, i
|
|
|
1506
1514
|
const gridCounterConfig = showCounterConfig
|
|
1507
1515
|
? { ...counterConfig, show: true, items: counterConfig?.items ?? defaultCounterItems }
|
|
1508
1516
|
: { show: false };
|
|
1509
|
-
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [!isDataGridReady && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: '10px' }, children: [_jsx(LoadIndicator, { height: 60, width: 60 }), _jsx("div", { children: SDKUI_Localizator.Loading })] })), isDataGridReady && _jsx(TMDataGrid, { ref: dataGridRef, id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, customizeColumns: customizeColumns, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: disableAutoFocus ? undefined : Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearchTMDatagrid, showFilterPanel: true, sorting:
|
|
1517
|
+
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [!isDataGridReady && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', gap: '10px' }, children: [_jsx(LoadIndicator, { height: 60, width: 60 }), _jsx("div", { children: SDKUI_Localizator.Loading })] })), isDataGridReady && _jsx(TMDataGrid, { ref: dataGridRef, id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, customizeColumns: customizeColumns, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: disableAutoFocus ? undefined : Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearchTMDatagrid, showFilterPanel: true, sorting: gridSorting, selection: gridSelection, scrolling: gridScrolling, pageSize: pageSize, compactPager: compactPager, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, showHeaderColumnChooser: true, onKeyDown: onKeyDown, customContextMenuItems: operationItems, counterConfig: gridCounterConfig })] });
|
|
1510
1518
|
};
|
|
1511
1519
|
//#region TMSearchResultSelector
|
|
1512
|
-
const StyledItemTemplate = styled.div `
|
|
1513
|
-
background: ${(props) => props.$isSelected ? 'oklch(from var(--dx-color-primary) l c h / .2) !important' : 'transparent'};
|
|
1514
|
-
cursor: pointer;
|
|
1520
|
+
const StyledItemTemplate = styled.div `
|
|
1521
|
+
background: ${(props) => props.$isSelected ? 'oklch(from var(--dx-color-primary) l c h / .2) !important' : 'transparent'};
|
|
1522
|
+
cursor: pointer;
|
|
1515
1523
|
`;
|
|
1516
1524
|
const MemoizedStyledItemTemplate = React.memo(StyledItemTemplate);
|
|
1517
1525
|
const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCategory = false, selectedTID, selectedSearchResult, autoSelectFirst = true, onSelectionChanged }) => {
|
|
@@ -1718,85 +1726,85 @@ const TMDcmtPreviewWrapper = ({ refreshPreviewTrigger, currentDcmt, isVisible, i
|
|
|
1718
1726
|
return (_jsx(TMDcmtPreview, { dcmtData: currentDcmt, onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, onBack: onBack, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("tmDcmtPreview") : undefined, isResizingActive: isResizingActive, isVisible: isVisible && isPageVisible }, refreshPreviewTrigger));
|
|
1719
1727
|
};
|
|
1720
1728
|
// Styled Components
|
|
1721
|
-
const StyledPlaceholder = styled.div `
|
|
1722
|
-
padding: 20px;
|
|
1723
|
-
text-align: center;
|
|
1724
|
-
color: #888;
|
|
1729
|
+
const StyledPlaceholder = styled.div `
|
|
1730
|
+
padding: 20px;
|
|
1731
|
+
text-align: center;
|
|
1732
|
+
color: #888;
|
|
1725
1733
|
`;
|
|
1726
|
-
const StyledIndexingInfoSection = styled.div `
|
|
1727
|
-
padding: 15px;
|
|
1728
|
-
border-top: 1px solid #e0e0e0;
|
|
1729
|
-
background: linear-gradient(to bottom, #f9f9f9, #f5f5f5);
|
|
1730
|
-
display: flex;
|
|
1731
|
-
flex-direction: column;
|
|
1732
|
-
gap: 10px;
|
|
1734
|
+
const StyledIndexingInfoSection = styled.div `
|
|
1735
|
+
padding: 15px;
|
|
1736
|
+
border-top: 1px solid #e0e0e0;
|
|
1737
|
+
background: linear-gradient(to bottom, #f9f9f9, #f5f5f5);
|
|
1738
|
+
display: flex;
|
|
1739
|
+
flex-direction: column;
|
|
1740
|
+
gap: 10px;
|
|
1733
1741
|
`;
|
|
1734
|
-
const StyledIndexingToggle = styled.button `
|
|
1735
|
-
display: flex;
|
|
1736
|
-
align-items: center;
|
|
1737
|
-
justify-content: space-between;
|
|
1738
|
-
width: 100%;
|
|
1739
|
-
padding: 10px 16px;
|
|
1740
|
-
background: white;
|
|
1741
|
-
border: 1px solid #d0d0d0;
|
|
1742
|
-
border-radius: 6px;
|
|
1743
|
-
cursor: ${props => props.disabled ? 'not-allowed' : 'pointer'};
|
|
1744
|
-
transition: all 0.2s ease;
|
|
1745
|
-
font-size: 14px;
|
|
1746
|
-
font-weight: 500;
|
|
1747
|
-
color: #333;
|
|
1748
|
-
opacity: ${props => props.disabled ? 0.6 : 1};
|
|
1749
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
1750
|
-
|
|
1751
|
-
&:hover:not(:disabled) {
|
|
1752
|
-
background: #f8f8f8;
|
|
1753
|
-
border-color: #2196F3;
|
|
1754
|
-
box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
|
|
1755
|
-
}
|
|
1756
|
-
|
|
1757
|
-
&:active:not(:disabled) {
|
|
1758
|
-
transform: translateY(1px);
|
|
1759
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
1760
|
-
}
|
|
1742
|
+
const StyledIndexingToggle = styled.button `
|
|
1743
|
+
display: flex;
|
|
1744
|
+
align-items: center;
|
|
1745
|
+
justify-content: space-between;
|
|
1746
|
+
width: 100%;
|
|
1747
|
+
padding: 10px 16px;
|
|
1748
|
+
background: white;
|
|
1749
|
+
border: 1px solid #d0d0d0;
|
|
1750
|
+
border-radius: 6px;
|
|
1751
|
+
cursor: ${props => props.disabled ? 'not-allowed' : 'pointer'};
|
|
1752
|
+
transition: all 0.2s ease;
|
|
1753
|
+
font-size: 14px;
|
|
1754
|
+
font-weight: 500;
|
|
1755
|
+
color: #333;
|
|
1756
|
+
opacity: ${props => props.disabled ? 0.6 : 1};
|
|
1757
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
1758
|
+
|
|
1759
|
+
&:hover:not(:disabled) {
|
|
1760
|
+
background: #f8f8f8;
|
|
1761
|
+
border-color: #2196F3;
|
|
1762
|
+
box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
&:active:not(:disabled) {
|
|
1766
|
+
transform: translateY(1px);
|
|
1767
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
1768
|
+
}
|
|
1761
1769
|
`;
|
|
1762
|
-
const StyledLeftContent = styled.div `
|
|
1763
|
-
display: flex;
|
|
1764
|
-
align-items: center;
|
|
1765
|
-
gap: 8px;
|
|
1770
|
+
const StyledLeftContent = styled.div `
|
|
1771
|
+
display: flex;
|
|
1772
|
+
align-items: center;
|
|
1773
|
+
gap: 8px;
|
|
1766
1774
|
`;
|
|
1767
|
-
const StyledRightContent = styled.div `
|
|
1768
|
-
display: flex;
|
|
1769
|
-
align-items: center;
|
|
1770
|
-
gap: 8px;
|
|
1775
|
+
const StyledRightContent = styled.div `
|
|
1776
|
+
display: flex;
|
|
1777
|
+
align-items: center;
|
|
1778
|
+
gap: 8px;
|
|
1771
1779
|
`;
|
|
1772
|
-
const StyledChevron = styled.span `
|
|
1773
|
-
transition: transform 0.2s ease;
|
|
1774
|
-
transform: ${props => props.$isOpen ? 'rotate(180deg)' : 'rotate(0deg)'};
|
|
1775
|
-
color: #666;
|
|
1776
|
-
font-size: 12px;
|
|
1780
|
+
const StyledChevron = styled.span `
|
|
1781
|
+
transition: transform 0.2s ease;
|
|
1782
|
+
transform: ${props => props.$isOpen ? 'rotate(180deg)' : 'rotate(0deg)'};
|
|
1783
|
+
color: #666;
|
|
1784
|
+
font-size: 12px;
|
|
1777
1785
|
`;
|
|
1778
|
-
const StyledIndexingInfoBox = styled.div `
|
|
1779
|
-
position: relative;
|
|
1780
|
-
background: white;
|
|
1781
|
-
border: 1px solid #e0e0e0;
|
|
1782
|
-
border-radius: 6px;
|
|
1783
|
-
padding: 12px;
|
|
1784
|
-
max-height: 200px;
|
|
1785
|
-
overflow: auto;
|
|
1786
|
-
font-family: 'Courier New', monospace;
|
|
1787
|
-
font-size: 12px;
|
|
1788
|
-
color: #333;
|
|
1789
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
1790
|
-
animation: slideDown 0.2s ease;
|
|
1791
|
-
|
|
1792
|
-
@keyframes slideDown {
|
|
1793
|
-
from {
|
|
1794
|
-
opacity: 0;
|
|
1795
|
-
transform: translateY(-10px);
|
|
1796
|
-
}
|
|
1797
|
-
to {
|
|
1798
|
-
opacity: 1;
|
|
1799
|
-
transform: translateY(0);
|
|
1800
|
-
}
|
|
1801
|
-
}
|
|
1786
|
+
const StyledIndexingInfoBox = styled.div `
|
|
1787
|
+
position: relative;
|
|
1788
|
+
background: white;
|
|
1789
|
+
border: 1px solid #e0e0e0;
|
|
1790
|
+
border-radius: 6px;
|
|
1791
|
+
padding: 12px;
|
|
1792
|
+
max-height: 200px;
|
|
1793
|
+
overflow: auto;
|
|
1794
|
+
font-family: 'Courier New', monospace;
|
|
1795
|
+
font-size: 12px;
|
|
1796
|
+
color: #333;
|
|
1797
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
1798
|
+
animation: slideDown 0.2s ease;
|
|
1799
|
+
|
|
1800
|
+
@keyframes slideDown {
|
|
1801
|
+
from {
|
|
1802
|
+
opacity: 0;
|
|
1803
|
+
transform: translateY(-10px);
|
|
1804
|
+
}
|
|
1805
|
+
to {
|
|
1806
|
+
opacity: 1;
|
|
1807
|
+
transform: translateY(0);
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1802
1810
|
`;
|
|
@@ -12,5 +12,5 @@ interface TMSearchResultFloatingActionButtonProps {
|
|
|
12
12
|
selectedDcmtsOrFocused: Array<DcmtInfo>;
|
|
13
13
|
config: TMSearchResultFloatingActionConfig;
|
|
14
14
|
}
|
|
15
|
-
export declare const TMSearchResultFloatingActionButton: (props: TMSearchResultFloatingActionButtonProps) =>
|
|
15
|
+
export declare const TMSearchResultFloatingActionButton: (props: TMSearchResultFloatingActionButtonProps) => React.JSX.Element;
|
|
16
16
|
export default TMSearchResultFloatingActionButton;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { DcmtInfo, IGraphometricManagerProp } from "../../../ts";
|
|
2
3
|
interface TMSignatureInfoContentProps {
|
|
3
4
|
inputDcmt: DcmtInfo;
|
|
4
5
|
graphometricManager?: IGraphometricManagerProp;
|
|
5
6
|
onClose?: () => void;
|
|
6
7
|
}
|
|
7
|
-
declare const TMSignatureInfoContent: (props: TMSignatureInfoContentProps) =>
|
|
8
|
+
declare const TMSignatureInfoContent: (props: TMSignatureInfoContentProps) => React.JSX.Element;
|
|
8
9
|
export default TMSignatureInfoContent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { DcmtTypeListCacheService, LayoutModes, SDK_Localizator, TreeCacheService, TreeItemTypes } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { TreeList, Column, Scrolling, Selection } from 'devextreme-react/tree-list';
|
|
@@ -24,7 +24,6 @@ const TMTreeDcmtTypeCell = ({ tid, isMobile }) => {
|
|
|
24
24
|
};
|
|
25
25
|
const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelectedTIDChanged, onClosePanel, allowMaximize = true, onMaximizePanel }) => {
|
|
26
26
|
const [trees, setTrees] = useState([]);
|
|
27
|
-
const [treeItems, setTreeItems] = useState([]);
|
|
28
27
|
const [selectedTreeId, setSelectedTreeId] = useState(0);
|
|
29
28
|
const [infoDTD, setInfoDTD] = useState();
|
|
30
29
|
// State to store selected row keys
|
|
@@ -34,6 +33,8 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
34
33
|
// Elemento selezionato nell'albero: dopo un refresh va riproposto se esiste ancora
|
|
35
34
|
const [selectedTreeItemKey, setSelectedTreeItemKey] = useState(undefined);
|
|
36
35
|
const selectedTreeItemKeys = useMemo(() => selectedTreeItemKey !== undefined ? [selectedTreeItemKey] : [], [selectedTreeItemKey]);
|
|
36
|
+
// Finche' gli alberi non sono arrivati il pannello mostra il loader invece della lista vuota
|
|
37
|
+
const [isLoadingTrees, setIsLoadingTrees] = useState(true);
|
|
37
38
|
const [isGridBoxOpened, setIsGridBoxOpened] = useState(false);
|
|
38
39
|
const [defaultTreeId, setDefaultTreeId] = useState(-1);
|
|
39
40
|
const deviceType = useDeviceType();
|
|
@@ -89,13 +90,16 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
89
90
|
setSelectedRowKeys([treeToSelect.id]);
|
|
90
91
|
}
|
|
91
92
|
}, [layoutMode]);
|
|
92
|
-
useEffect(() => { loadTreesAsync(); }, [loadTreesAsync]);
|
|
93
93
|
useEffect(() => {
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
setIsLoadingTrees(true);
|
|
95
|
+
loadTreesAsync().finally(() => setIsLoadingTrees(false));
|
|
96
|
+
}, [loadTreesAsync]);
|
|
97
|
+
// Derivato nello stesso render degli alberi: con uno state la TreeList mostrerebbe "Nessun dato" per un frame
|
|
98
|
+
const treeItems = useMemo(() => trees.find(o => o.id == selectedTreeId)?.items ?? [], [trees, selectedTreeId]);
|
|
99
|
+
useEffect(() => {
|
|
96
100
|
// Mantiene la selezione dopo il refresh solo se l'elemento e' ancora presente (al cambio albero si azzera)
|
|
97
|
-
setSelectedTreeItemKey(prev => prev !== undefined &&
|
|
98
|
-
}, [
|
|
101
|
+
setSelectedTreeItemKey(prev => prev !== undefined && treeItems.some(o => o.id == prev) ? prev : undefined);
|
|
102
|
+
}, [treeItems]);
|
|
99
103
|
const renderCell = useCallback((data) => {
|
|
100
104
|
const treeItem = data.data;
|
|
101
105
|
// Documento (DcmtType)
|
|
@@ -187,7 +191,7 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
187
191
|
const onSelectionChangedTreeView = useCallback((e) => {
|
|
188
192
|
setSelectedTreeItemKey(e.selectedRowKeys?.[0]);
|
|
189
193
|
}, []);
|
|
190
|
-
return (_jsx(TMPanel, { title: SDK_Localizator.Trees, isVisible: isVisible, totalItems: trees.length, onClose: onClosePanel, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, onRefresh: () => loadTreesAsync(true), toolbar: _jsx(TMButton, { btnStyle: 'icon', caption: defaultTreeId == selectedTreeId ? SDKUI_Localizator.TreeRemoveDefault : SDKUI_Localizator.SetAsDefault, icon: defaultTreeId == selectedTreeId ? _jsx(IconStarRemove, { color: 'rgb(243, 114, 92)' }) : _jsx(IconStar, { color: 'rgb(248, 215, 117)' }), onClick: () => {
|
|
194
|
+
return (_jsx(TMPanel, { title: SDK_Localizator.Trees, isVisible: isVisible, totalItems: trees.length, onClose: onClosePanel, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, onRefresh: () => loadTreesAsync(true), isRefreshing: isLoadingTrees, toolbar: _jsx(TMButton, { btnStyle: 'icon', caption: defaultTreeId == selectedTreeId ? SDKUI_Localizator.TreeRemoveDefault : SDKUI_Localizator.SetAsDefault, icon: defaultTreeId == selectedTreeId ? _jsx(IconStarRemove, { color: 'rgb(243, 114, 92)' }) : _jsx(IconStar, { color: 'rgb(248, 215, 117)' }), onClick: () => {
|
|
191
195
|
if (defaultTreeId == selectedTreeId) {
|
|
192
196
|
if (layoutMode == LayoutModes.Update)
|
|
193
197
|
SDKUI_Globals.userSettings.searchSettings.defaultTree = -1;
|
|
@@ -220,7 +224,9 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
220
224
|
{ dataField: 'nameLoc', caption: SDKUI_Localizator.Name, width: 'auto' },
|
|
221
225
|
{ dataField: 'description', caption: SDKUI_Localizator.Description, width: 'auto' },
|
|
222
226
|
], selection: { mode: 'single', showCheckBoxesMode: "none" }, showHeaderFilter: false, selectedRowKeys: selectedRowKeys, onSelectionChanged: onSelectionChanged, onRowClick: onRowClickTrees, focusedRowKey: focusedRowKey, onFocusedRowChanged: onFocusedRowChanged }) }) }), _jsxs(StyledTreeListWrapper, { children: [_jsxs(TreeList, { height: "100%", dataSource: treeItems, showRowLines: false, showColumnLines: false, showBorders: false, columnAutoWidth: false, keyExpr: "id", parentIdExpr: "parentID", dataStructure: "plain", showColumnHeaders: false, selectedRowKeys: selectedTreeItemKeys, onSelectionChanged: onSelectionChangedTreeView, onCellDblClick: onCellDblClickTreeView, onRowClick: onRowClickTreeView, children: [_jsx(Column, { dataField: "nameLoc", caption: SDKUI_Localizator.Name, cellRender: renderCell, width: "100%" }), _jsx(Scrolling, { mode: "virtual", useNative: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar) === 1 }), _jsx(Selection, { mode: "single" })] }), _jsxs(StyledOffCanvasPanel, { ref: panelRef, $isOpen: isMobile && infoDTD !== undefined, children: [_jsxs(StyledDivHorizontal, { style: { gap: 10, padding: '10px 8px', width: '100%', alignItems: 'center' }, children: [_jsx("p", { style: { fontSize: '1.1rem', fontWeight: 'bold' }, children: `${SDKUI_Localizator.DcmtType} - ${SDKUI_Localizator.About}` }), _jsx(IconCloseOutline, { style: { marginLeft: 'auto', cursor: 'pointer' }, onClick: () => setInfoDTD(undefined) })] }), renderDTDTooltipContent(infoDTD)] })] })] })
|
|
223
|
-
:
|
|
227
|
+
: isLoadingTrees
|
|
228
|
+
? _jsx(_Fragment, {})
|
|
229
|
+
: _jsx("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', fontSize: '1.5rem' }, children: SDKUI_Localizator.TreesNoAvailable }) }));
|
|
224
230
|
};
|
|
225
231
|
export default TMTreeSelector;
|
|
226
232
|
const StyledTreeDcmtTypeRow = styled(StyledDivHorizontal) `
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { DcmtInfo } from "../../../ts/types";
|
|
2
3
|
import { DeviceType } from "../../base/TMDeviceProvider";
|
|
3
4
|
import { DcmtTypeDescriptor, HomeBlogPost, TaskDescriptor } from "@topconsultnpm/sdk-ts";
|
|
@@ -14,5 +15,5 @@ interface TMViewHistoryDcmtProps {
|
|
|
14
15
|
handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
|
|
15
16
|
handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
|
|
16
17
|
}
|
|
17
|
-
declare const TMViewHistoryDcmt: (props: TMViewHistoryDcmtProps) =>
|
|
18
|
+
declare const TMViewHistoryDcmt: (props: TMViewHistoryDcmtProps) => React.JSX.Element;
|
|
18
19
|
export default TMViewHistoryDcmt;
|
|
@@ -36,5 +36,5 @@ export interface TMTaskFormProps {
|
|
|
36
36
|
onOpenPdfEditorRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void;
|
|
37
37
|
s4TViewerDialogComponent?: React.ReactNode;
|
|
38
38
|
}
|
|
39
|
-
declare const TMTaskForm: (props: TMTaskFormProps) =>
|
|
39
|
+
declare const TMTaskForm: (props: TMTaskFormProps) => React.JSX.Element;
|
|
40
40
|
export default TMTaskForm;
|
|
@@ -8,7 +8,7 @@ interface TaskFormAssignmentNoticeSectionProps {
|
|
|
8
8
|
users: Array<UserDescriptor>;
|
|
9
9
|
requestMoreInfo?: boolean;
|
|
10
10
|
}
|
|
11
|
-
export declare const TaskFormAssignmentNoticeBadge: (props: TaskFormAssignmentNoticeSectionProps) =>
|
|
11
|
+
export declare const TaskFormAssignmentNoticeBadge: (props: TaskFormAssignmentNoticeSectionProps) => React.JSX.Element | null;
|
|
12
12
|
interface RenderContextBlockParams {
|
|
13
13
|
condition: boolean;
|
|
14
14
|
pdg: PdGs;
|
|
@@ -19,7 +19,7 @@ interface TaskFormContextualAttachmentsProps {
|
|
|
19
19
|
currentTask: TaskDescriptor | undefined;
|
|
20
20
|
taskContext: TaskContext | undefined;
|
|
21
21
|
}
|
|
22
|
-
export declare const TaskFormContextualAttachments: (props: TaskFormContextualAttachmentsProps) =>
|
|
22
|
+
export declare const TaskFormContextualAttachments: (props: TaskFormContextualAttachmentsProps) => React.JSX.Element;
|
|
23
23
|
interface TaskFormAssignedToProps {
|
|
24
24
|
formMode: FormModes;
|
|
25
25
|
formData: TaskDescriptor | undefined;
|
|
@@ -31,7 +31,7 @@ interface TaskFormAssignedToProps {
|
|
|
31
31
|
label?: string;
|
|
32
32
|
onValueChanged: (newValue: Array<number> | undefined) => void;
|
|
33
33
|
}
|
|
34
|
-
export declare const TaskAssigneeField: (props: TaskFormAssignedToProps) =>
|
|
34
|
+
export declare const TaskAssigneeField: (props: TaskFormAssignedToProps) => React.JSX.Element;
|
|
35
35
|
interface RenderFieldBaseProps {
|
|
36
36
|
fieldsReadOnly: IFieldsEditability;
|
|
37
37
|
formDataOrig?: TaskDescriptor;
|
|
@@ -50,12 +50,12 @@ interface RenderDateFieldProps extends RenderFieldProps {
|
|
|
50
50
|
label?: string;
|
|
51
51
|
onContentReady?: () => void;
|
|
52
52
|
}
|
|
53
|
-
export declare const RenderNameField: ({ requestMoreInfo, validationItems, setFormData, formData, formDataOrig, fieldsReadOnly }: RenderFieldProps) =>
|
|
54
|
-
export declare const RenderDescriptionField: ({ validationItems, setFormData, formData, formDataOrig, fieldsReadOnly }: RenderFieldProps) =>
|
|
55
|
-
export declare const RenderPriorityField: ({ formData, formDataOrig, fieldsReadOnly, onPriorityValueChange }: RenderPriorityFieldProps) =>
|
|
56
|
-
export declare const RenderStartDateField: ({ label, validationItems, setFormData, formData, formDataOrig, fieldsReadOnly, onContentReady }: RenderDateFieldProps) =>
|
|
57
|
-
export declare const RenderEndDateField: ({ label, validationItems, setFormData, formData, formDataOrig, fieldsReadOnly, onContentReady }: RenderDateFieldProps) =>
|
|
58
|
-
export declare const RenderRemindDateField: ({ validationItems, setFormData, formData, formDataOrig, fieldsReadOnly }: RenderFieldProps) =>
|
|
53
|
+
export declare const RenderNameField: ({ requestMoreInfo, validationItems, setFormData, formData, formDataOrig, fieldsReadOnly }: RenderFieldProps) => React.JSX.Element;
|
|
54
|
+
export declare const RenderDescriptionField: ({ validationItems, setFormData, formData, formDataOrig, fieldsReadOnly }: RenderFieldProps) => React.JSX.Element;
|
|
55
|
+
export declare const RenderPriorityField: ({ formData, formDataOrig, fieldsReadOnly, onPriorityValueChange }: RenderPriorityFieldProps) => React.JSX.Element;
|
|
56
|
+
export declare const RenderStartDateField: ({ label, validationItems, setFormData, formData, formDataOrig, fieldsReadOnly, onContentReady }: RenderDateFieldProps) => React.JSX.Element;
|
|
57
|
+
export declare const RenderEndDateField: ({ label, validationItems, setFormData, formData, formDataOrig, fieldsReadOnly, onContentReady }: RenderDateFieldProps) => React.JSX.Element;
|
|
58
|
+
export declare const RenderRemindDateField: ({ validationItems, setFormData, formData, formDataOrig, fieldsReadOnly }: RenderFieldProps) => React.JSX.Element;
|
|
59
59
|
interface RenderTaskFormStateFieldProps {
|
|
60
60
|
formDataOrig: TaskDescriptor | undefined;
|
|
61
61
|
formData: TaskDescriptor | undefined;
|
|
@@ -71,7 +71,7 @@ interface TMChangeStateFormProps {
|
|
|
71
71
|
handleShowChangeStateForm: (value: boolean) => void;
|
|
72
72
|
setFormData: React.Dispatch<React.SetStateAction<TaskDescriptor | undefined>>;
|
|
73
73
|
}
|
|
74
|
-
export declare const TMChangeStateForm: (props: TMChangeStateFormProps) =>
|
|
74
|
+
export declare const TMChangeStateForm: (props: TMChangeStateFormProps) => React.JSX.Element;
|
|
75
75
|
type TaskRole = "personal" | "sender" | "receiver";
|
|
76
76
|
type StatusTransitionMap = {
|
|
77
77
|
[key in Task_States]?: Task_States[];
|
|
@@ -15,5 +15,5 @@ interface TMTasksAgendaProps {
|
|
|
15
15
|
handleFocusedRowChange: (row: TaskDescriptor | undefined) => void;
|
|
16
16
|
menuItems: TMContextMenuItemProps[];
|
|
17
17
|
}
|
|
18
|
-
declare const TMTasksAgenda: (props: TMTasksAgendaProps) =>
|
|
18
|
+
declare const TMTasksAgenda: (props: TMTasksAgendaProps) => React.JSX.Element;
|
|
19
19
|
export default TMTasksAgenda;
|
|
@@ -19,5 +19,5 @@ interface TMTasksCalendarProps {
|
|
|
19
19
|
handleFocusedRowChange: (row: TaskDescriptor | undefined) => void;
|
|
20
20
|
menuItems: TMContextMenuItemProps[];
|
|
21
21
|
}
|
|
22
|
-
declare const TMTasksCalendar: (props: TMTasksCalendarProps) =>
|
|
22
|
+
declare const TMTasksCalendar: (props: TMTasksCalendarProps) => React.JSX.Element;
|
|
23
23
|
export default TMTasksCalendar;
|
|
@@ -10,5 +10,5 @@ interface TMTasksHeaderProps {
|
|
|
10
10
|
color?: string;
|
|
11
11
|
height?: string;
|
|
12
12
|
}
|
|
13
|
-
declare const TMTasksHeader: (props: TMTasksHeaderProps) =>
|
|
13
|
+
declare const TMTasksHeader: (props: TMTasksHeaderProps) => React.JSX.Element;
|
|
14
14
|
export default TMTasksHeader;
|
|
@@ -16,5 +16,5 @@ interface TMTasksPanelContentProps {
|
|
|
16
16
|
s4TViewerDialogComponent?: React.ReactNode;
|
|
17
17
|
afterTaskSaved?: (task: TaskDescriptor | undefined, formMode: FormModes | undefined, forceRefresh?: boolean) => Promise<void>;
|
|
18
18
|
}
|
|
19
|
-
declare const TMTasksPanelContent: (props: TMTasksPanelContentProps) =>
|
|
19
|
+
declare const TMTasksPanelContent: (props: TMTasksPanelContentProps) => React.JSX.Element;
|
|
20
20
|
export default TMTasksPanelContent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
import { PdGs, Task_States, TaskDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { FormModes } from "../../../ts";
|
|
4
4
|
export declare const taskStateIconMap: (fontSize?: number) => Map<Task_States, JSX.Element>;
|
|
@@ -12,15 +12,15 @@ export declare const renderTaskIcons: (taskData: {
|
|
|
12
12
|
remTime: Date | undefined;
|
|
13
13
|
isNew: boolean;
|
|
14
14
|
numberOfDays: number;
|
|
15
|
-
}) =>
|
|
15
|
+
}) => React.JSX.Element;
|
|
16
16
|
interface TMActionCalendarProps {
|
|
17
17
|
currentTask: TaskDescriptor;
|
|
18
18
|
openTaskForm: (formMode: FormModes, task?: TaskDescriptor) => void;
|
|
19
19
|
onDeleteCallback: (rowIds: Array<number>) => void;
|
|
20
20
|
}
|
|
21
|
-
export declare const TMActionCalendar: (props: TMActionCalendarProps) =>
|
|
22
|
-
export declare const priorityLegend: () =>
|
|
23
|
-
export declare const highlightTaskText: (text: string, search: string, taskId: number) => string | (string |
|
|
21
|
+
export declare const TMActionCalendar: (props: TMActionCalendarProps) => React.JSX.Element;
|
|
22
|
+
export declare const priorityLegend: () => React.JSX.Element;
|
|
23
|
+
export declare const highlightTaskText: (text: string, search: string, taskId: number) => string | (string | React.JSX.Element)[];
|
|
24
24
|
export declare const treeFilterDataSource: (allTasks: Array<TaskDescriptor>) => Array<{
|
|
25
25
|
id: number;
|
|
26
26
|
label: string;
|