@topconsultnpm/sdkui-react-beta 6.13.51 → 6.13.54
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/TMMasterDetailDcmts.js +28 -3
- package/lib/components/features/search/TMSearch.js +81 -161
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +2 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +4 -3
- package/lib/components/features/search/TMSearchResult.js +2 -3
- package/lib/components/features/search/TMTreeSelector.d.ts +1 -0
- package/lib/components/features/search/TMTreeSelector.js +2 -2
- package/lib/components/forms/Login/TMLoginForm.js +3 -3
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +6 -4
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +2 -2
- package/lib/components/layout/panelManager/types.d.ts +2 -1
- package/lib/components/settings/SettingsAppearance.js +1 -0
- package/lib/helper/SDKUI_Localizator.d.ts +2 -0
- package/lib/helper/SDKUI_Localizator.js +20 -0
- package/lib/helper/queryHelper.js +2 -2
- package/package.json +1 -1
@@ -470,7 +470,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
470
470
|
break;
|
471
471
|
}
|
472
472
|
} }), _jsxs(StyledFormButtonsContainer, { children: [_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: 10 }, children: _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: layoutMode === LayoutModes.Update ? _jsxs(_Fragment, { children: [_jsx(TMSaveFormButtonSave, { showTooltip: false, btnStyle: 'advanced', advancedColor: '#f09c0a', isModified: isModified, formMode: formMode, errorsCount: validationItems.filter(o => o.ResultType == ResultTypes.ERROR).length, onSaveAsync: confirmActionPopup }), _jsx(TMSaveFormButtonUndo, { btnStyle: 'toolbar', showTooltip: true, color: 'primary', isModified: isModified, formMode: formMode, onUndo: onUndoHandler })] }) :
|
473
|
-
_jsxs(_Fragment, { children: [_jsx(TMButton, { disabled: archiveBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconBoxArchiveIn, {}), showTooltip: false, caption:
|
473
|
+
_jsxs(_Fragment, { children: [_jsx(TMButton, { disabled: archiveBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconBoxArchiveIn, {}), width: 'auto', showTooltip: false, caption: SDKUI_Localizator.Archive, advancedColor: TMColors.success, onClick: confirmActionPopup }), _jsx(TMButton, { disabled: !clearFormBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconClear, {}), width: 'auto', showTooltip: false, caption: SDKUI_Localizator.Clear, advancedColor: TMColors.tertiary, onClick: clearFormHandler }), DID && _jsx(TMButton, { disabled: undoBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconUndo, {}), width: '150px', showTooltip: false, caption: SDKUI_Localizator.Undo, advancedColor: TMColors.tertiary, onClick: onUndoHandler })] }) }) }), totalItems > listMaxItems && _jsx(TMShowAllOrMaxItemsButton, { showAll: showAll, dataSourceLength: totalItems, onClick: () => { setShowAll(!showAll); } })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, TID: TID, DID: DID, op: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, TID: TID, DID: DID, op: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, TID: TID, DID: DID, onClose: () => setShowReAssignPopup(false) }), _jsx(ConfirmAttachmentsDialog, {})] }) }) }), isOpenPreview || isOpenMiddlePanel() ?
|
474
474
|
_jsx(TMLayoutItem, { children: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, showSeparator: deviceType !== DeviceType.MOBILE && (isOpenPreview && isOpenMiddlePanel()), start: getSecondarySplitterStartLayout(), min: ['0', '0'], separatorColor: 'transparent', children: [isOpenMiddlePanel()
|
475
475
|
? _jsx(TMLayoutItem, { children: _jsxs(TMPanel, { showHeader: !(isOpenDetails && layoutMode === LayoutModes.Update), title: titleText(), onClose: () => { closeMiddlePanel(); }, children: [isOpenBoard && layoutMode === LayoutModes.Update &&
|
476
476
|
_jsx(TMDcmtBlog, { tid: TID, did: DID }), isOpenSysMetadata && layoutMode === LayoutModes.Update &&
|
@@ -5,13 +5,12 @@ import { ContextMenu } from 'devextreme-react';
|
|
5
5
|
import { TMNothingToShow } from './TMDcmtPreview';
|
6
6
|
import TMDcmtForm from './TMDcmtForm';
|
7
7
|
import TMSearchResult from '../search/TMSearchResult';
|
8
|
-
import { genUniqueId, getExceptionMessage, IconFolder, IconDetailDcmts, SDKUI_Localizator, svgToString, IconMail, IconDcmtTypeOnlyMetadata, IconCopy, IconMultipleSelection, IconMenuVertical, IconSearchCheck, IconDataList, SDKUI_Globals, IconInfo } from '../../../helper';
|
8
|
+
import { genUniqueId, getExceptionMessage, IconFolder, IconCheckFile, IconDetailDcmts, SDKUI_Localizator, svgToString, IconMail, IconDcmtTypeOnlyMetadata, IconCopy, IconMultipleSelection, IconMenuVertical, IconSearchCheck, IconDataList, SDKUI_Globals, IconInfo } from '../../../helper';
|
9
9
|
import { hasDetailRelations } from '../../../helper/dcmtsHelper';
|
10
10
|
import { FormModes, SearchResultContext } from '../../../ts';
|
11
11
|
import { TMColors } from '../../../utils/theme';
|
12
12
|
import { StyledDivHorizontal, StyledBadge } from '../../base/Styled';
|
13
13
|
import ShowAlert from '../../base/TMAlert';
|
14
|
-
import TMButton from '../../base/TMButton';
|
15
14
|
import { DeviceType } from '../../base/TMDeviceProvider';
|
16
15
|
import { TMExceptionBoxManager } from '../../base/TMPopUp';
|
17
16
|
import TMSpinner from '../../base/TMSpinner';
|
@@ -290,11 +289,37 @@ const TMMasterDetailDcmts = ({ deviceType, inputDcmts, isForMaster, showCurrentD
|
|
290
289
|
setSelectedItems(items);
|
291
290
|
}, []);
|
292
291
|
const commandsMenuItems = [
|
292
|
+
{
|
293
|
+
icon: svgToString(_jsx(IconMultipleSelection, { color: allowMultipleSelection ? TMColors.tertiary : TMColors.text_normal })),
|
294
|
+
text: "Selezione multipla",
|
295
|
+
operationType: 'singleRow',
|
296
|
+
onClick: () => {
|
297
|
+
setAllowMultipleSelection(prev => !prev);
|
298
|
+
}
|
299
|
+
},
|
300
|
+
{
|
301
|
+
icon: svgToString(_jsx(IconCheckFile, {})),
|
302
|
+
text: "Consenti dettagli con 0 documenti",
|
303
|
+
operationType: 'singleRow',
|
304
|
+
onClick: () => {
|
305
|
+
setShowZeroDcmts(prev => !prev);
|
306
|
+
}
|
307
|
+
},
|
308
|
+
{
|
309
|
+
icon: svgToString(_jsx(IconDetailDcmts, { transform: 'scale(-1, 1)' })),
|
310
|
+
text: SDKUI_Localizator.DcmtsMaster,
|
311
|
+
operationType: 'singleRow',
|
312
|
+
disabled: !focusedItem?.isDcmt || !isForMaster,
|
313
|
+
onClick: () => {
|
314
|
+
appendMasterDcmts?.(focusedItem?.tid, focusedItem?.did);
|
315
|
+
}
|
316
|
+
},
|
293
317
|
{
|
294
318
|
icon: svgToString(_jsx(IconMail, {})),
|
295
319
|
text: "Invia per posta",
|
296
320
|
operationType: 'multiRow',
|
297
321
|
disabled: false,
|
322
|
+
beginGroup: true,
|
298
323
|
items: [
|
299
324
|
{
|
300
325
|
icon: svgToString(_jsx(IconMail, {})),
|
@@ -378,7 +403,7 @@ const TMMasterDetailDcmts = ({ deviceType, inputDcmts, isForMaster, showCurrentD
|
|
378
403
|
]
|
379
404
|
}
|
380
405
|
];
|
381
|
-
const toolbar = _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [allowMultipleSelection && _jsx("p", { style: { color: TMColors.colorHeader, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${selectedItems.length} selezionati` }),
|
406
|
+
const toolbar = _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [allowMultipleSelection && _jsx("p", { style: { color: TMColors.colorHeader, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${selectedItems.length} selezionati` }), allowNavigation && canPrev != undefined && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), allowNavigation && canNext != undefined && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(IconMenuVertical, { id: `commands-detail-${id}`, color: 'white', cursor: 'pointer' }), _jsx(ContextMenu, { showEvent: 'click', dataSource: commandsMenuItems, target: `#commands-detail-${id}` })] });
|
382
407
|
const getTitle = () => isForMaster ? `${SDKUI_Localizator.DcmtsMaster} - ${dtdMaster?.nameLoc}` : SDKUI_Localizator.DcmtsDetail;
|
383
408
|
const isMobile = deviceType === DeviceType.MOBILE;
|
384
409
|
const renderTMTreeView = (handleTogglePanel) => _jsx(TMPanel, { title: getTitle(), onBack: onBack, toolbar: toolbar, allowMaximize: !isMobile, children: isLoading ? _jsx(_Fragment, {}) :
|
@@ -1,20 +1,18 @@
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import { useCallback, useEffect,
|
2
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
3
3
|
import { SavedQueryCacheService, DcmtTypeListCacheService, SDK_Localizator } from '@topconsultnpm/sdk-ts-beta';
|
4
4
|
import TMSavedQuerySelector from './TMSavedQuerySelector';
|
5
5
|
import TMTreeSelector from './TMTreeSelector';
|
6
6
|
import { TabPanel, Item } from 'devextreme-react/tab-panel';
|
7
7
|
import TMSearchQueryPanel, { refreshLastSearch } from './TMSearchQueryPanel';
|
8
|
-
import { getSysAllDcmtsSQD, IconFilter,
|
8
|
+
import { getSysAllDcmtsSQD, IconFilter, IconRecentlyViewed, IconSavedQuery, IconTree, SDKUI_Globals, SDKUI_Localizator } from '../../../helper';
|
9
9
|
import TMSearchResult from './TMSearchResult';
|
10
10
|
import TMRecentsManager from '../../grids/TMRecentsManager';
|
11
11
|
import { SearchResultContext } from '../../../ts';
|
12
12
|
import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
13
13
|
import { StyledMultiViewPanel } from '../../base/Styled';
|
14
|
-
import {
|
15
|
-
import
|
16
|
-
import { useResizablePanels } from '../../layout/panel/useResizablePanels';
|
17
|
-
import TMPanel from '../../base/TMPanel';
|
14
|
+
import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
|
15
|
+
import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
|
18
16
|
var TMSearchViews;
|
19
17
|
(function (TMSearchViews) {
|
20
18
|
TMSearchViews[TMSearchViews["Search"] = 0] = "Search";
|
@@ -121,18 +119,17 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
121
119
|
await setSqdAsync?.(sqdToBeSet);
|
122
120
|
}, []);
|
123
121
|
const isMobile = deviceType === DeviceType.MOBILE;
|
124
|
-
|
122
|
+
// --- JSX WRAPPERS ---
|
123
|
+
const tmTreeSelectorElement = useMemo(() => _jsx(TMTreeSelectorWrapper, { isMobile: isMobile, onSelectedTIDChanged: (tid) => {
|
125
124
|
setCurrentTID(tid);
|
126
125
|
if (tid && mruTIDs.includes(tid))
|
127
126
|
setCurrentMruTID(tid);
|
128
127
|
else
|
129
128
|
setCurrentMruTID(0);
|
130
|
-
|
131
|
-
|
132
|
-
const renderTMRecentsManager = (handleTogglePanel) => _jsx(TMRecentsManager, { mruTIDs: mruTIDs, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: (tid) => {
|
129
|
+
} }), [isMobile, mruTIDs]);
|
130
|
+
const tmRecentsManagerElement = useMemo(() => _jsx(TMRecentsManagerWrapper, { mruTIDs: mruTIDs, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: (tid) => {
|
133
131
|
setCurrentMruTID(tid);
|
134
132
|
setCurrentTID(tid);
|
135
|
-
isMobile && handleTogglePanel?.('TMSearchQueryPanel');
|
136
133
|
}, onDeletedTID: (tid) => {
|
137
134
|
let newMruTIDS = mruTIDs.slice();
|
138
135
|
let index = newMruTIDS.findIndex(o => o == tid);
|
@@ -140,8 +137,8 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
140
137
|
newMruTIDS.splice(index, 1);
|
141
138
|
SDKUI_Globals.userSettings.searchSettings.mruTIDs = newMruTIDS.filter(tid => tid != undefined && tid != null);
|
142
139
|
setMruTIDs(newMruTIDS);
|
143
|
-
} });
|
144
|
-
const
|
140
|
+
} }), [mruTIDs, currentMruTID, deviceType]);
|
141
|
+
const tmSearchQueryPanelElement = useMemo(() => _jsx(TMSearchQueryPanelWrapper, { isExpertMode: isExpertMode, fromDTD: fromDTD, SQD: currentSQD, onSearchCompleted: (searchResult, qd) => {
|
145
142
|
setSearchResult(searchResult);
|
146
143
|
if (searchResult.length <= 0)
|
147
144
|
return;
|
@@ -162,158 +159,81 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
162
159
|
}, onSqdSaved: async (newSqd) => {
|
163
160
|
await loadDataSQDsAsync(true, newSqd.masterTID);
|
164
161
|
await setSQDAsync(newSqd);
|
165
|
-
} });
|
166
|
-
const
|
162
|
+
} }), [fromDTD, currentSQD, isExpertMode, mruTIDs]);
|
163
|
+
const tmSavedQuerySelectorElement = useMemo(() => _jsxs(TabPanel, { width: "100%", height: "100%", showNavButtons: true, repaintChangesOnly: true, selectedIndex: currentSQDMode, onSelectedIndexChange: (index) => setCurrentSQDMode(index), children: [(currentTID || currentSQD) ? _jsx(Item, { title: fromDTD?.nameLoc, children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: false, items: filteredByTIDSQDs, selectedId: currentSQD?.id, onRefreshData: () => { loadDataSQDsAsync(true); }, onItemClick: (sqd) => {
|
167
164
|
onSQDItemClick(sqd, setSQDAsync);
|
168
|
-
|
169
|
-
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? filteredByTIDSQDs.find(o => o.id == 1) : currentSQD, setSQDAsync) }) }) : _jsx(_Fragment, {}), _jsx(Item, { title: SDKUI_Localizator.Alls2, children: _jsx(TMSavedQuerySelector, { allowShowSearch: true, items: allSQDs, manageDefault: false,
|
170
|
-
// selectedId={currentSQD?.id}
|
171
|
-
onItemClick: (sqd) => {
|
165
|
+
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? filteredByTIDSQDs.find(o => o.id == 1) : currentSQD, setSQDAsync) }) }) : _jsx(_Fragment, {}), _jsx(Item, { title: SDKUI_Localizator.Alls2, children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: true, items: allSQDs, manageDefault: false, onItemClick: (sqd) => {
|
172
166
|
onSQDItemClick(sqd, setSQDAsync);
|
173
|
-
|
174
|
-
|
175
|
-
|
167
|
+
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? undefined : currentSQD, setSQDAsync) }) })] }), [currentSQDMode, currentTID, currentSQD, fromDTD, filteredByTIDSQDs, allSQDs]);
|
168
|
+
// --- PANEL DEFINITIONS ---
|
169
|
+
const allInitialPanelVisibility = {
|
170
|
+
'TMTreeSelector': true,
|
171
|
+
'TMRecentsManager': true,
|
172
|
+
'TMSearchQueryPanel': true,
|
173
|
+
'TMSavedQuerySelector': true,
|
174
|
+
};
|
175
|
+
const initialPanelDimensions = {
|
176
|
+
'TMTreeSelector': { width: '20%', height: '100%' },
|
177
|
+
'TMRecentsManager': { width: '20%', height: '100%' },
|
178
|
+
'TMSearchQueryPanel': { width: '40%', height: '100%' },
|
179
|
+
'TMSavedQuerySelector': { width: '20%', height: '100%' },
|
180
|
+
};
|
181
|
+
const initialPanels = useMemo(() => [
|
182
|
+
{
|
183
|
+
id: 'TMTreeSelector',
|
184
|
+
name: 'TMTreeSelector',
|
185
|
+
contentOptions: { component: tmTreeSelectorElement },
|
186
|
+
toolbarOptions: { icon: _jsx(IconTree, { fontSize: 24 }), visible: true, orderNumber: 1, isActive: allInitialPanelVisibility['TMTreeSelector'] }
|
187
|
+
},
|
188
|
+
{
|
189
|
+
id: 'TMRecentsManager',
|
190
|
+
name: 'TMRecentsManager',
|
191
|
+
contentOptions: { component: tmRecentsManagerElement, panelContainer: { title: SDKUI_Localizator.Shortcuts } },
|
192
|
+
toolbarOptions: { icon: _jsx(IconRecentlyViewed, { fontSize: 24 }), visible: true, orderNumber: 2, isActive: allInitialPanelVisibility['TMRecentsManager'] }
|
193
|
+
},
|
194
|
+
{
|
195
|
+
id: 'TMSearchQueryPanel',
|
196
|
+
name: 'TMSearchQueryPanel',
|
197
|
+
contentOptions: { component: tmSearchQueryPanelElement },
|
198
|
+
toolbarOptions: { icon: _jsx(IconFilter, { fontSize: 24 }), visible: true, orderNumber: 3, isActive: allInitialPanelVisibility['TMSearchQueryPanel'] }
|
199
|
+
},
|
200
|
+
{
|
201
|
+
id: 'TMSavedQuerySelector',
|
202
|
+
name: 'TMSavedQuerySelector',
|
203
|
+
contentOptions: { component: tmSavedQuerySelectorElement, panelContainer: { title: SDK_Localizator.SavedQueries } },
|
204
|
+
toolbarOptions: { icon: _jsx(IconSavedQuery, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['TMSavedQuerySelector'] }
|
205
|
+
}
|
206
|
+
], [tmTreeSelectorElement, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement]);
|
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 &&
|
176
208
|
_jsx(TMSearchResult, { isVisible: currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync: async () => {
|
177
209
|
setSearchResult(await refreshLastSearch(lastQdSearched) ?? []);
|
178
210
|
}, onTaskCreateRequest: onTaskCreateRequest, onClose: () => { setCurrentSearchView(TMSearchViews.Search); } })] }));
|
179
211
|
};
|
180
|
-
const TMSearchPanelContent = ({ isMobile, panelTMTreeSelector, panelTMRecentsManager, panelTMSearchQueryPanel, panelTMSavedQuerySelector }) => {
|
181
|
-
const gutters = SDKUI_Globals.userSettings.themeSettings.gutters;
|
182
|
-
const { visibility, maximizedPanelId, getPanelDimensions, togglePanel, toggleMaximizePanel, setPanelDisabledById, setPanelVisibility, hasVisiblePanels } = useTMPanelContext();
|
183
|
-
const containerRef = useRef(null);
|
184
|
-
const { onMouseDown } = useResizablePanels(containerRef);
|
185
|
-
const { width: widthPanel1, height: heightPanel1 } = getPanelDimensions('TMTreeSelector');
|
186
|
-
const { width: widthPanel2, height: heightPanel2 } = getPanelDimensions('TMRecentsManager');
|
187
|
-
const { width: widthPanel3, height: heightPanel3 } = getPanelDimensions('TMSearchQueryPanel');
|
188
|
-
const { width: widthPanel4, height: heightPanel4 } = getPanelDimensions('TMSavedQuerySelector');
|
189
|
-
return (_jsxs("div", { style: { display: 'flex', height: '100%', width: '100%', flexDirection: isMobile ? 'column' : 'row', gap: gutters }, children: [_jsx("div", { style: {
|
190
|
-
display: 'flex',
|
191
|
-
flexGrow: 1,
|
192
|
-
width: `calc(100% - ${isMobile ? 0 : 70}px)`,
|
193
|
-
height: `calc(100% - ${isMobile ? 55 : 0}px)`,
|
194
|
-
flexDirection: 'row'
|
195
|
-
}, children: _jsxs("div", { style: { width: '100%', height: '100%' }, children: [_jsxs("div", { ref: containerRef, style: {
|
196
|
-
display: hasVisiblePanels() ? 'flex' : 'none',
|
197
|
-
width: '100%',
|
198
|
-
height: '100%',
|
199
|
-
}, children: [_jsx("div", { style: {
|
200
|
-
display: visibility.TMTreeSelector ? 'block' : 'none',
|
201
|
-
width: widthPanel1,
|
202
|
-
height: heightPanel1,
|
203
|
-
overflow: 'hidden',
|
204
|
-
}, children: panelTMTreeSelector(() => togglePanel('TMSearchQueryPanel')) }), visibility.TMTreeSelector && visibility.TMRecentsManager && maximizedPanelId === null && (_jsx("div", { style: {
|
205
|
-
background: 'transparent',
|
206
|
-
cursor: 'col-resize',
|
207
|
-
width: `${gutters}px`,
|
208
|
-
height: '100%',
|
209
|
-
userSelect: 'none',
|
210
|
-
}, onMouseDown: (e) => onMouseDown(e, 'TMTreeSelector', 'TMRecentsManager', true) })), _jsx("div", { style: {
|
211
|
-
display: visibility.TMRecentsManager ? 'block' : 'none',
|
212
|
-
width: widthPanel2,
|
213
|
-
height: heightPanel2,
|
214
|
-
overflow: 'hidden',
|
215
|
-
}, children: _jsx(TMPanel, { title: 'Scorciatoie', onClose: () => togglePanel('TMRecentsManager'), onMaximize: () => toggleMaximizePanel('TMRecentsManager'), onHeaderDoubleClick: () => toggleMaximizePanel('TMRecentsManager'), allowMaximize: !isMobile, children: panelTMRecentsManager(() => togglePanel('TMSearchQueryPanel')) }) }), visibility.TMRecentsManager && visibility.TMSearchQueryPanel && maximizedPanelId === null && (_jsx("div", { style: {
|
216
|
-
background: 'transparent',
|
217
|
-
cursor: 'col-resize',
|
218
|
-
width: `${gutters}px`,
|
219
|
-
height: '100%',
|
220
|
-
userSelect: 'none',
|
221
|
-
}, onMouseDown: (e) => onMouseDown(e, 'TMRecentsManager', 'TMSearchQueryPanel', true) })), _jsx("div", { style: {
|
222
|
-
display: visibility.TMSearchQueryPanel ? 'block' : 'none',
|
223
|
-
width: widthPanel3,
|
224
|
-
height: heightPanel3,
|
225
|
-
overflow: 'hidden',
|
226
|
-
}, children: panelTMSearchQueryPanel }), visibility.TMSearchQueryPanel && visibility.TMSavedQuerySelector && maximizedPanelId === null && (_jsx("div", { style: {
|
227
|
-
background: 'transparent',
|
228
|
-
cursor: 'col-resize',
|
229
|
-
width: `${gutters}px`,
|
230
|
-
height: '100%',
|
231
|
-
userSelect: 'none',
|
232
|
-
}, onMouseDown: (e) => onMouseDown(e, 'TMSearchQueryPanel', 'TMSavedQuerySelector', true) })), _jsx("div", { style: {
|
233
|
-
display: visibility.TMSavedQuerySelector ? 'block' : 'none',
|
234
|
-
width: widthPanel4,
|
235
|
-
height: heightPanel4,
|
236
|
-
overflow: 'hidden',
|
237
|
-
}, children: _jsx(TMPanel, { title: SDK_Localizator.SavedQueries, onClose: () => togglePanel('TMSavedQuerySelector'), onMaximize: () => toggleMaximizePanel('TMSavedQuerySelector'), onHeaderDoubleClick: () => toggleMaximizePanel('TMSavedQuerySelector'), allowMaximize: !isMobile, children: panelTMSavedQuerySelector(() => togglePanel('TMSearchQueryPanel')) }) })] }), _jsxs("div", { style: {
|
238
|
-
display: hasVisiblePanels() ? 'none' : 'flex',
|
239
|
-
flexDirection: 'column',
|
240
|
-
width: '100%',
|
241
|
-
height: '100%',
|
242
|
-
justifyContent: 'center',
|
243
|
-
alignItems: 'center',
|
244
|
-
fontSize: '1.5rem',
|
245
|
-
fontWeight: 'bold',
|
246
|
-
color: '#888',
|
247
|
-
backgroundColor: '#fff',
|
248
|
-
borderRadius: '10px'
|
249
|
-
}, children: [_jsx(IconInfo, { style: { fontSize: 50 } }), _jsx("div", { children: SDKUI_Localizator.NoPanelSelected })] })] }) }), _jsx("div", { style: {
|
250
|
-
display: 'flex',
|
251
|
-
flexDirection: isMobile ? 'row' : 'column',
|
252
|
-
alignItems: 'center',
|
253
|
-
width: isMobile ? '100%' : '50px',
|
254
|
-
height: isMobile ? '50px' : 'max-content',
|
255
|
-
background: 'transparent linear-gradient(90deg, #CCE0F4 0%, #7EC1E7 14%, #39A6DB 28%, #1E9CD7 35%, #0075BE 78%, #005B97 99%) 0% 0% no-repeat padding-box',
|
256
|
-
borderRadius: isMobile ? '10px' : '10px 0px 0px 10px',
|
257
|
-
padding: '10px',
|
258
|
-
gap: '10px'
|
259
|
-
}, children: _jsx(TMPanelToolbar, {}) })] }));
|
260
|
-
};
|
261
212
|
export default TMSearch;
|
262
|
-
const
|
263
|
-
{
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
}
|
290
|
-
},
|
291
|
-
{
|
292
|
-
id: 'TMSearchQueryPanel',
|
293
|
-
name: SDK_Localizator.QueryWhere,
|
294
|
-
children: [],
|
295
|
-
contentOptions: {
|
296
|
-
width: '40%',
|
297
|
-
height: '100%',
|
298
|
-
},
|
299
|
-
toolbarOptions: {
|
300
|
-
icon: _jsx(IconFilter, { fontSize: 24 }),
|
301
|
-
visible: false,
|
302
|
-
isActive: true
|
303
|
-
}
|
304
|
-
},
|
305
|
-
{
|
306
|
-
id: 'TMSavedQuerySelector',
|
307
|
-
name: SDK_Localizator.SavedQueries,
|
308
|
-
children: [],
|
309
|
-
contentOptions: {
|
310
|
-
width: '20%',
|
311
|
-
height: '100%',
|
312
|
-
},
|
313
|
-
toolbarOptions: {
|
314
|
-
icon: _jsx(IconSavedQuery, { fontSize: 24 }),
|
315
|
-
visible: true,
|
316
|
-
isActive: true
|
317
|
-
}
|
318
|
-
},
|
319
|
-
];
|
213
|
+
const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
|
214
|
+
const { setPanelVisibilityById, toggleMaximize } = useTMPanelManagerContext();
|
215
|
+
return (_jsx(TMTreeSelector, { onClosePanel: () => setPanelVisibilityById('TMTreeSelector', false), onMaximizePanel: () => toggleMaximize('TMTreeSelector'), onSelectedTIDChanged: (tid) => {
|
216
|
+
onSelectedTIDChanged?.(tid);
|
217
|
+
isMobile && setPanelVisibilityById('TMSearchQueryPanel', true);
|
218
|
+
} }));
|
219
|
+
};
|
220
|
+
const TMRecentsManagerWrapper = ({ mruTIDs, currentMruTID, deviceType, onSelectedTID, onDeletedTID }) => {
|
221
|
+
const { setPanelVisibilityById } = useTMPanelManagerContext();
|
222
|
+
return (_jsx(TMRecentsManager, { mruTIDs: mruTIDs, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: (tid) => {
|
223
|
+
onSelectedTID?.(tid);
|
224
|
+
deviceType === DeviceType.MOBILE && setPanelVisibilityById('TMSearchQueryPanel', true);
|
225
|
+
}, onDeletedTID: (tid) => {
|
226
|
+
onDeletedTID?.(tid);
|
227
|
+
} }));
|
228
|
+
};
|
229
|
+
const TMSearchQueryPanelWrapper = ({ fromDTD, SQD, isExpertMode, onSearchCompleted, onSqdSaved }) => {
|
230
|
+
const { setPanelVisibilityById, toggleMaximize } = useTMPanelManagerContext();
|
231
|
+
return (_jsx(TMSearchQueryPanel, { onClosePanel: () => setPanelVisibilityById('TMSearchQueryPanel', false), onMaximizePanel: () => toggleMaximize('TMSearchQueryPanel'), isExpertMode: isExpertMode, fromDTD: fromDTD, SQD: SQD, onSearchCompleted: onSearchCompleted, onSqdSaved: onSqdSaved }));
|
232
|
+
};
|
233
|
+
const TMSavedQuerySelectorWrapper = ({ items, selectedId, allowShowSearch, manageDefault, onRefreshData, onItemClick, onDeleted }) => {
|
234
|
+
const { setPanelVisibilityById } = useTMPanelManagerContext();
|
235
|
+
return (_jsx(TMSavedQuerySelector, { allowShowSearch: allowShowSearch, manageDefault: manageDefault, items: items, selectedId: selectedId, onRefreshData: onRefreshData, onItemClick: (sqd) => {
|
236
|
+
onItemClick?.(sqd);
|
237
|
+
setPanelVisibilityById('TMSearchQueryPanel', true);
|
238
|
+
}, onDeleted: onDeleted }));
|
239
|
+
};
|
@@ -9,6 +9,8 @@ interface ITMSearchQueryPanelProps {
|
|
9
9
|
onSqdSaved?: (newSqd: SavedQueryDescriptor) => void;
|
10
10
|
onFocusedMetadataChanged?: (tid_mid: TID_MID | undefined) => void;
|
11
11
|
onSearchCompleted?: (searchResult: SearchResultDescriptor[], qd: QueryDescriptor | undefined) => void;
|
12
|
+
onClosePanel?: () => void;
|
13
|
+
onMaximizePanel?: () => void;
|
12
14
|
}
|
13
15
|
declare const TMSearchQueryPanel: React.FunctionComponent<ITMSearchQueryPanelProps>;
|
14
16
|
export default TMSearchQueryPanel;
|
@@ -23,7 +23,7 @@ import TMQueryEditor from '../../query/TMQueryEditor';
|
|
23
23
|
import TMSavedQueryForm from './TMSavedQueryForm';
|
24
24
|
import { AdvancedMenuButtons } from '../../editors/TMMetadataValues';
|
25
25
|
import TMShowAllOrMaxItemsButton from '../../base/TMShowAllOrMaxItemsButton';
|
26
|
-
const TMSearchQueryPanel = ({ fromDTD, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, SQD, onSearchCompleted, onFocusedMetadataChanged, onSqdSaved, onBack }) => {
|
26
|
+
const TMSearchQueryPanel = ({ fromDTD, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, SQD, onSearchCompleted, onFocusedMetadataChanged, onSqdSaved, onBack, onClosePanel, onMaximizePanel }) => {
|
27
27
|
const [confirmQueryParams, ConfirmQueryParamsDialog] = useQueryParametersDialog();
|
28
28
|
const [qd, setQd] = useState();
|
29
29
|
const [lastQdParams, setLastQdParams] = useState([]);
|
@@ -102,7 +102,8 @@ const TMSearchQueryPanel = ({ fromDTD, isExpertMode = SDKUI_Globals.userSettings
|
|
102
102
|
}
|
103
103
|
}
|
104
104
|
};
|
105
|
-
|
105
|
+
const isMobile = deviceType === DeviceType.MOBILE;
|
106
|
+
return (_jsxs(_Fragment, { children: [_jsxs(TMPanel, { title: fromDTD?.nameLoc ?? SDKUI_Localizator.Search_Metadata, allowMaximize: !isMobile, onMaximize: isMobile ? undefined : onMaximizePanel, onHeaderDoubleClick: isMobile ? undefined : onMaximizePanel, onBack: onBack, keepActiveState: keepStatePanelIsActive, toolbar: _jsx(_Fragment, { children: (SQD && !showSqdForm) ?
|
106
107
|
_jsx(TMDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'icon', caption: 'Altro', icon: _jsx(IconMenuVertical, { color: 'white' }), showTooltip: false }), items: [
|
107
108
|
{ icon: _jsx(IconAddCircleOutline, {}), text: SDKUI_Localizator.SavedQueryNew, onClick: () => { openSqdForm(FormModes.Create); } },
|
108
109
|
{ icon: _jsx(IconEdit, {}), text: SDKUI_Localizator.SavedQueryUpdate, disabled: (SQD && SQD.id == 1), onClick: () => { openSqdForm(FormModes.Update); } },
|
@@ -121,7 +122,7 @@ const TMSearchQueryPanel = ({ fromDTD, isExpertMode = SDKUI_Globals.userSettings
|
|
121
122
|
setShowDistinctValuesPanel(true);
|
122
123
|
}
|
123
124
|
}, onQdChanged: (newQd) => { if (!deepCompare(qd, newQd))
|
124
|
-
setQd(newQd); } }), _jsxs("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '80px', padding: '15px', position: 'relative' }, children: [_jsxs("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: [_jsx(TMButton, { btnStyle: 'advanced', icon: _jsx(IconSearch, {}), showTooltip: false, caption: SDKUI_Localizator.Search, advancedColor: '#4A96D2', onClick: async () => await searchAsync(qd, showAdvancedSearch) }), _jsx(TMButton, { btnStyle: 'advanced', advancedType: 'primary', showTooltip: false, caption: SDKUI_Localizator.Clear, icon: _jsx(IconClear, {}), advancedColor: 'white', color: 'primaryOutline', onClick: clearFilters })] }), (!showAdvancedSearch && qd?.where && qd?.where?.length > initialMaxItems) &&
|
125
|
+
setQd(newQd); } }), _jsxs("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '80px', padding: '15px', position: 'relative' }, children: [_jsxs("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: [_jsx(TMButton, { btnStyle: 'advanced', icon: _jsx(IconSearch, {}), showTooltip: false, width: 'auto', caption: SDKUI_Localizator.Search, advancedColor: '#4A96D2', onClick: async () => await searchAsync(qd, showAdvancedSearch) }), _jsx(TMButton, { btnStyle: 'advanced', advancedType: 'primary', showTooltip: false, caption: SDKUI_Localizator.Clear, icon: _jsx(IconClear, {}), width: 'auto', advancedColor: 'white', color: 'primaryOutline', onClick: clearFilters })] }), (!showAdvancedSearch && qd?.where && qd?.where?.length > initialMaxItems) &&
|
125
126
|
_jsx(TMShowAllOrMaxItemsButton, { showAll: showAllMdWhere, dataSourceLength: qd?.where?.length, onClick: () => { setShowAllMdWhere(!showAllMdWhere); } })] }), showFiltersConfig &&
|
126
127
|
_jsx(TMMetadataChooserForm, { allowMultipleSelection: true, height: '500px', width: '600px', allowSysMetadata: true, qd: qd, selectedIDs: qd?.where?.map((w) => ({ tid: w.tid, mid: w.mid })), onClose: () => setShowFiltersConfig(false), onChoose: (tid_mids) => {
|
127
128
|
if (!fromDTD?.metadata)
|
@@ -349,7 +349,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
349
349
|
, {
|
350
350
|
// allowMultipleSelection={allowMultipleSelection}
|
351
351
|
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 &&
|
352
|
-
_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', 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: () => {
|
352
|
+
_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', transform: 'scale(-1, 1)' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true) }), _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasMasterRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white' }), 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: () => {
|
353
353
|
setIsOpenBatchUpdate(false);
|
354
354
|
}, onSavedCallbackAsync: async () => {
|
355
355
|
setIsOpenBatchUpdate(false);
|
@@ -358,8 +358,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
358
358
|
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), (isVisible && fromDTD?.templateTID === TemplateTIDs.WF_WIApprView && !isOpenDcmtForm && !isOpenDetails && !isOpenMaster) &&
|
359
359
|
_jsx(ToppyHelpCenter, { deviceType: deviceType,
|
360
360
|
// onClick={() => isMobile ? openConfigureMode?.() : undefined}
|
361
|
-
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 }) }) }), (
|
362
|
-
_jsx(ToppyHelpCenter, { deviceType: deviceType, top: -100, content: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [currentTIDHasDetailRelations && _jsx(TMButton, { btnStyle: 'advanced', disabled: !focusedItem?.DID, showTooltip: false, width: '180px', icon: _jsx(IconDetailDcmts, { transform: 'scale(-1, 1)' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true), advancedColor: TMColors.primaryColor, color: 'success' }), currentTIDHasMasterRelations && _jsx(TMButton, { btnStyle: 'advanced', disabled: !focusedItem?.DID, showTooltip: false, width: '180px', icon: _jsx(IconDetailDcmts, {}), caption: SDKUI_Localizator.DcmtsMaster, onClick: () => setIsOpenMaster(true), advancedColor: TMColors.primaryColor, color: 'error' })] }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {})] }) });
|
361
|
+
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, {})] }) });
|
363
362
|
const renderTMBlog = (handleTogglePanel) => _jsx(TMDcmtBlog, { tid: focusedItem?.TID, did: focusedItem?.DID });
|
364
363
|
const renderTMSysMetadata = (handleTogglePanel) => _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: [] });
|
365
364
|
const renderTMDcmtPreview = (handleTogglePanel) => _jsx(TMDcmtPreview, { onClose: () => {
|
@@ -5,6 +5,7 @@ interface ITMTreeSelectorProps {
|
|
5
5
|
isVisible?: boolean;
|
6
6
|
onSelectedTIDChanged?: (tid: number | undefined, treeId?: number | undefined) => void;
|
7
7
|
onClosePanel?: () => void;
|
8
|
+
onMaximizePanel?: () => void;
|
8
9
|
}
|
9
10
|
declare const TMTreeSelector: React.FC<ITMTreeSelectorProps>;
|
10
11
|
export default TMTreeSelector;
|
@@ -12,7 +12,7 @@ import TMPanel from '../../base/TMPanel';
|
|
12
12
|
import TMTidViewer from '../../viewers/TMTidViewer';
|
13
13
|
import { TMColors } from '../../../utils/theme';
|
14
14
|
import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
15
|
-
const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelectedTIDChanged, onClosePanel }) => {
|
15
|
+
const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelectedTIDChanged, onClosePanel, onMaximizePanel }) => {
|
16
16
|
const deviceType = useDeviceType();
|
17
17
|
const isMobile = deviceType === DeviceType.MOBILE;
|
18
18
|
const [trees, setTrees] = useState([]);
|
@@ -94,7 +94,7 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
94
94
|
}
|
95
95
|
;
|
96
96
|
}, []);
|
97
|
-
return (_jsx(TMPanel, { title: SDK_Localizator.Trees, isVisible: isVisible, totalItems: trees.length, onClose: isMobile ? undefined : onClosePanel, allowMaximize: !isMobile, 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: () => {
|
97
|
+
return (_jsx(TMPanel, { title: SDK_Localizator.Trees, isVisible: isVisible, totalItems: trees.length, onClose: isMobile ? undefined : onClosePanel, allowMaximize: !isMobile, onMaximize: isMobile ? undefined : onMaximizePanel, onHeaderDoubleClick: isMobile ? undefined : onMaximizePanel, 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: () => {
|
98
98
|
if (defaultTreeId == selectedTreeId) {
|
99
99
|
SDKUI_Globals.userSettings.searchSettings.defaultTree = -1;
|
100
100
|
setDefaultTreeId(-1);
|
@@ -325,15 +325,15 @@ const TMLoginForm = (props) => {
|
|
325
325
|
if (loginStep === 2 && authMode === AuthenticationModes.TopMediaWithMFA) {
|
326
326
|
try {
|
327
327
|
await loginForMFAAsync(3);
|
328
|
+
if (loginStep === 2) {
|
329
|
+
setLoginStep(3);
|
330
|
+
}
|
328
331
|
}
|
329
332
|
catch (e) {
|
330
333
|
TMExceptionBoxManager.show({ exception: e });
|
331
334
|
return;
|
332
335
|
}
|
333
336
|
}
|
334
|
-
if (loginStep === 2) {
|
335
|
-
setLoginStep(3);
|
336
|
-
}
|
337
337
|
if (loginStep === 3)
|
338
338
|
return;
|
339
339
|
};
|
@@ -175,14 +175,16 @@ const TMPanelManagerContainer = (props) => {
|
|
175
175
|
}
|
176
176
|
// If the panel has child panels, render a nested TMPanelManagerContainer or a component
|
177
177
|
if (panel.children && panel.children.length > 0) {
|
178
|
-
const
|
179
|
-
return (_jsxs(React.Fragment, { children: [showGutter && (_jsx(StyledResizerGutter, { "$direction": direction, onMouseDown: (e) => startResizing(e, prevPanelIdForGutter, panel.id) })), _jsx(TMPanelWrapper, { panel: panel, children:
|
180
|
-
?
|
178
|
+
const jsxComponent = panel.contentOptions?.component;
|
179
|
+
return (_jsxs(React.Fragment, { children: [showGutter && (_jsx(StyledResizerGutter, { "$direction": direction, onMouseDown: (e) => startResizing(e, prevPanelIdForGutter, panel.id) })), _jsx(TMPanelWrapper, { panel: panel, children: jsxComponent
|
180
|
+
? React.isValidElement(jsxComponent)
|
181
|
+
? React.cloneElement(jsxComponent, { groupId: panel.id, mainDirection: panel.childrenGroupDirection || direction })
|
182
|
+
: jsxComponent
|
181
183
|
: _jsx(TMPanelManagerContainer, { panels: panel.children, direction: panel.childrenGroupDirection || direction, parentId: panel.id, showToolbar: false }) })] }, panel.id));
|
182
184
|
}
|
183
185
|
// If the panel has a component specified, render it with a possible gutter before it
|
184
186
|
if (panel.contentOptions && panel.contentOptions.component) {
|
185
|
-
return (_jsxs(React.Fragment, { children: [showGutter && (_jsx(StyledResizerGutter, { "$direction": direction, onMouseDown: (e) => startResizing(e, prevPanelIdForGutter, panel.id) })), _jsx(TMPanelWrapper, { panel: panel, children:
|
187
|
+
return (_jsxs(React.Fragment, { children: [showGutter && (_jsx(StyledResizerGutter, { "$direction": direction, onMouseDown: (e) => startResizing(e, prevPanelIdForGutter, panel.id) })), _jsx(TMPanelWrapper, { panel: panel, children: panel.contentOptions.component })] }, panel.id));
|
186
188
|
}
|
187
189
|
// If no children or components, render nothing for this panel
|
188
190
|
return null;
|
@@ -30,7 +30,7 @@ export const TMPanelManagerProvider = (props) => {
|
|
30
30
|
const { visibilityMap, disabledMap } = getToolbarStates(panels);
|
31
31
|
setToolbarButtonsVisibility(visibilityMap);
|
32
32
|
setToolbarButtonsDisabled(disabledMap);
|
33
|
-
}, [
|
33
|
+
}, []);
|
34
34
|
// Callback to update the visibility state of a specific panel and its related hierarchy
|
35
35
|
const updatePanelVisibility = useCallback((id, isVisible, prevVisibility) => {
|
36
36
|
// Clone previous visibility state to work with
|
@@ -97,7 +97,7 @@ export const TMPanelManagerProvider = (props) => {
|
|
97
97
|
return updatePanelVisibility(initialMobilePanelId, true, prev);
|
98
98
|
});
|
99
99
|
}
|
100
|
-
}, [isMobile
|
100
|
+
}, [isMobile]);
|
101
101
|
// Function to maximize a panel (and its parent panels)
|
102
102
|
const maximizePanel = useCallback((id) => {
|
103
103
|
// Get all parent panel IDs recursively for the given panel ID
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { ReactNode } from "react";
|
1
2
|
import { ITMPanelProps } from "../../base/TMPanel";
|
2
3
|
export type TMPanelDirection = 'horizontal' | 'vertical';
|
3
4
|
export interface TMPanelDefinition {
|
@@ -7,7 +8,7 @@ export interface TMPanelDefinition {
|
|
7
8
|
currentGroupDirection?: TMPanelDirection;
|
8
9
|
childrenGroupDirection?: TMPanelDirection;
|
9
10
|
contentOptions?: {
|
10
|
-
component:
|
11
|
+
component: ReactNode;
|
11
12
|
panelContainer?: ITMPanelProps;
|
12
13
|
};
|
13
14
|
toolbarOptions?: {
|
@@ -49,6 +49,7 @@ const SettingsAppearance = ({ landingPagesOptions, permissions = { canArchive: t
|
|
49
49
|
triggerUIUpdate();
|
50
50
|
} }), _jsx(TMButton, { elementStyle: { marginTop: '10px' }, caption: SDKUI_Localizator.Restore, showTooltip: false, onClick: () => {
|
51
51
|
SDKUI_Globals.userSettings.themeSettings = new ThemeSettings();
|
52
|
+
SDKUI_Globals.userSettings.landingPage = LandingPages.DASHBOARD;
|
52
53
|
triggerUIUpdate();
|
53
54
|
} })] }));
|
54
55
|
};
|
@@ -19,6 +19,7 @@ export declare class SDKUI_Localizator {
|
|
19
19
|
static get AddToHomePage(): "Zur Startseite hinzufügen" | "Add to Home Page" | "Añadir a la página inicial" | "Ajoute à Home Page" | "Adicionar a Home Page" | "Aggiungi alla Home Page";
|
20
20
|
static get Advanced(): "Erweitert" | "Advanced" | "Avanzado" | "Avancé" | "Avançado" | "Avanzate";
|
21
21
|
static get All(): "Alle" | "All" | "Todos" | "Tous" | "Tutti";
|
22
|
+
static get AllDcmts(): "Alle Dokumente" | "All documents" | "Todos los documentos" | "Tous les documents" | "Todos os documentos" | "Tutti i documenti";
|
22
23
|
static get AllDcmtTypes(): "Alle Dokumenttypen" | "All document types" | "Todos los tipos documento" | "Tous les types de documents" | "Todos os tipos de documentos" | "Tutti i tipi documento";
|
23
24
|
static get AllFilesAndFoldersInSupportArea(): "Alle Dateien und Ordner im Support-Bereich" | "All files and folders within the support area" | "Todos los archivos y carpetas dentro del área de soporte" | "Tous les fichiers et dossiers dans la zone de support" | "Todos os arquivos e pastas na área de apoio" | "Tutti i file e le cartelle all'interno dell'area di appoggio";
|
24
25
|
static get AllItems(): "alle Artikel" | "All items" | "Todos los artículos" | "tous les articles" | "todos os artigos" | "tutti gli elementi";
|
@@ -353,6 +354,7 @@ export declare class SDKUI_Localizator {
|
|
353
354
|
static get SharingModes_Private(): "Privat" | "Private" | "Privada" | "Privé" | "Privado" | "Privata";
|
354
355
|
static get SharingModes_Public(): "Öffentlich" | "Public" | "Pública" | "Público" | "Pubblica";
|
355
356
|
static get SharingModes_Shared(): "Geteilt" | "Shared" | "Compartida" | "Partagé" | "Partilhada" | "Condivisa";
|
357
|
+
static get Shortcuts(): "Tastenkombinationen" | "Shortcuts" | "Atajos" | "Raccourcis" | "Atalhos" | "Scorciatoie";
|
356
358
|
static get Show_CompleteName(): "Vollständigen Namen anzeigen" | "View full name" | "Mostrar nombre completo" | "Afficher le nom complet" | "Mostrar nome completo" | "Visualizza nome completo";
|
357
359
|
static get ShowDetails(): "Details anzeigen" | "Show details" | "Mostrar detalles" | "Afficher les détails" | "Mostrar detalhes" | "Mostra dettagli";
|
358
360
|
static get ShowFilters(): string;
|
@@ -138,6 +138,16 @@ export class SDKUI_Localizator {
|
|
138
138
|
default: return "Tutti";
|
139
139
|
}
|
140
140
|
}
|
141
|
+
static get AllDcmts() {
|
142
|
+
switch (this._cultureID) {
|
143
|
+
case CultureIDs.De_DE: return "Alle Dokumente";
|
144
|
+
case CultureIDs.En_US: return "All documents";
|
145
|
+
case CultureIDs.Es_ES: return "Todos los documentos";
|
146
|
+
case CultureIDs.Fr_FR: return "Tous les documents";
|
147
|
+
case CultureIDs.Pt_PT: return "Todos os documentos";
|
148
|
+
default: return "Tutti i documenti";
|
149
|
+
}
|
150
|
+
}
|
141
151
|
static get AllDcmtTypes() {
|
142
152
|
switch (this._cultureID) {
|
143
153
|
case CultureIDs.De_DE: return "Alle Dokumenttypen";
|
@@ -3488,6 +3498,16 @@ export class SDKUI_Localizator {
|
|
3488
3498
|
default: return "Condivisa";
|
3489
3499
|
}
|
3490
3500
|
}
|
3501
|
+
static get Shortcuts() {
|
3502
|
+
switch (this._cultureID) {
|
3503
|
+
case CultureIDs.De_DE: return "Tastenkombinationen";
|
3504
|
+
case CultureIDs.En_US: return "Shortcuts";
|
3505
|
+
case CultureIDs.Es_ES: return "Atajos";
|
3506
|
+
case CultureIDs.Fr_FR: return "Raccourcis";
|
3507
|
+
case CultureIDs.Pt_PT: return "Atalhos";
|
3508
|
+
default: return "Scorciatoie";
|
3509
|
+
}
|
3510
|
+
}
|
3491
3511
|
static get Show_CompleteName() {
|
3492
3512
|
switch (this._cultureID) {
|
3493
3513
|
case CultureIDs.De_DE: return "Vollständigen Namen anzeigen";
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { AccessLevels, MetadataDataDomains, DcmtTypeListCacheService, SystemMIDsAsNumber, MetadataDataTypes, QueryDescriptor, QueryFunctions, SelectItem, SelectItemVisibilities, FromItem, LayoutModes, QueryOperators, SavedQueryDescriptor, SearchEngine, WhereItem, OrderByItem } from '@topconsultnpm/sdk-ts-beta';
|
2
2
|
import { DateDisplayTypes, Globalization } from './Globalization';
|
3
3
|
import { MetadataValueDescriptorEx } from '../ts';
|
4
|
+
import { SDKUI_Localizator } from './SDKUI_Localizator';
|
4
5
|
export const getTIDsByQd = (qd) => {
|
5
6
|
let tids = [];
|
6
7
|
qd?.from?.tid && tids.push({ tid: qd.from?.tid, alias: undefined });
|
@@ -153,8 +154,7 @@ export const getSysAllDcmtsSQD = async (tid, easyOr) => {
|
|
153
154
|
sqd.id = 1;
|
154
155
|
sqd.masterTID = tid;
|
155
156
|
sqd.isEasyWhere = 1;
|
156
|
-
sqd.name =
|
157
|
-
sqd.description = "Restituisce tutti i documenti";
|
157
|
+
sqd.name = SDKUI_Localizator.AllDcmts;
|
158
158
|
sqd.qd = await getQD(tid, easyOr);
|
159
159
|
return sqd;
|
160
160
|
};
|