@topconsultnpm/sdkui-react-beta 6.15.9 → 6.15.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,178 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Workbook } from 'exceljs';
4
+ import { buildValueToLabelMapFromDataColumns, getExceptionMessage, SDKUI_Localizator } from '../../helper';
5
+ import TMCheckBox from '../editors/TMCheckBox';
6
+ import TMButton from './TMButton';
7
+ import TMDropDown from './TMDropDown';
8
+ import TMModal from './TMModal';
9
+ import { TMExceptionBoxManager } from './TMPopUp';
10
+ import { ResultTypes } from '@topconsultnpm/sdk-ts-beta';
11
+ import TMSpinner from './TMSpinner';
12
+ import { TMResultManager } from '../forms/TMResultDialog';
13
+ const formatDataSource = [
14
+ { value: 'csv', display: 'CSV' },
15
+ { value: 'xlsx', display: 'XLSX' },
16
+ ];
17
+ const TMDataGridExportForm = (props) => {
18
+ const { searchResult, dataSource, dataColumns, selectedRowKeys, onCloseExportForm } = props;
19
+ // State to track the selected export format (default: 'xlsx')
20
+ const [formatSelected, setFormatSelected] = useState('csv');
21
+ // Boolean state to indicate whether to export the "description" fields in data lists
22
+ const [exportDescriptionsForDataLists, setExportDescriptionsForDataLists] = useState(true);
23
+ // Boolean state to indicate whether to export only the selected items
24
+ const [exportSelectedOnly, setExportSelectedOnly] = useState(false);
25
+ // Boolean state to indicate whether to hide the selection during export
26
+ const [hideSelection, setHideSelection] = useState(false);
27
+ const onStatusValueChange = (e) => {
28
+ if (!e?.target?.value)
29
+ return;
30
+ setFormatSelected(e.target.value);
31
+ };
32
+ const downloadFile = (blob, extension) => {
33
+ const pad = (n) => n.toString().padStart(2, '0');
34
+ const getTimestamp = () => {
35
+ const now = new Date();
36
+ return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}_${pad(now.getHours())}-${pad(now.getMinutes())}-${pad(now.getSeconds())}`;
37
+ };
38
+ const url = URL.createObjectURL(blob);
39
+ const a = document.createElement('a');
40
+ a.href = url;
41
+ a.download = `${SDKUI_Localizator.SearchResult}_${getTimestamp()}.${extension}`;
42
+ document.body.appendChild(a);
43
+ a.click();
44
+ document.body.removeChild(a);
45
+ URL.revokeObjectURL(url);
46
+ };
47
+ const handleExport = async () => {
48
+ let result = [];
49
+ try {
50
+ TMSpinner.show({ description: SDKUI_Localizator.Loading });
51
+ // Exit early if dataSource or dataColumns are not defined to avoid errors
52
+ if (!dataSource || !dataColumns)
53
+ return;
54
+ const columns = searchResult?.dtdResult?.columns ?? [];
55
+ const valueToNameMap = exportDescriptionsForDataLists ? await buildValueToLabelMapFromDataColumns(columns) : new Map();
56
+ const selectedSet = new Set(selectedRowKeys);
57
+ const rowsToExport = exportSelectedOnly ? dataSource.filter((_, idx) => selectedSet.has(idx)) : dataSource;
58
+ const visibleColumns = dataColumns.filter(col => hideSelection ? col.visible !== false && col.dataType !== 'object' : col.visible !== false);
59
+ const getValue = (col, value) => {
60
+ let result = exportDescriptionsForDataLists ? valueToNameMap.get(value) ?? value : value;
61
+ if (col.dataType === 'datetime' && result) {
62
+ const parsedDate = new Date(result);
63
+ if (!isNaN(parsedDate.getTime())) {
64
+ result = parsedDate.toLocaleDateString('it-IT');
65
+ }
66
+ }
67
+ // Converte undefined/null in stringa vuota e rimuove eventuali virgolette doppie
68
+ return (result ?? '').toString().replace(/"/g, '');
69
+ };
70
+ switch (formatSelected) {
71
+ case 'csv': {
72
+ const headers = hideSelection
73
+ ? visibleColumns.map(col => col.caption || col.dataField)
74
+ : [SDKUI_Localizator.SelectedSingular, ...visibleColumns.map(col => col.caption || col.dataField)];
75
+ const csvRows = [];
76
+ csvRows.push(headers.join(';'));
77
+ rowsToExport.forEach((item, idx) => {
78
+ const originalIndex = exportSelectedOnly ? selectedRowKeys[idx] : dataSource.indexOf(item);
79
+ const rowValues = [];
80
+ if (!hideSelection) {
81
+ const status = selectedSet.has(originalIndex) ? SDKUI_Localizator.SelectedSingular : SDKUI_Localizator.Deselected;
82
+ rowValues.push(status || '');
83
+ }
84
+ visibleColumns.forEach(col => {
85
+ if (col.dataField) {
86
+ rowValues.push(getValue(col, item[col.dataField]));
87
+ }
88
+ });
89
+ csvRows.push(rowValues.join(';'));
90
+ });
91
+ const blob = new Blob([csvRows.join('\r\n')], { type: 'text/csv;charset=utf-8;' });
92
+ downloadFile(blob, formatSelected);
93
+ result.push({ rowIndex: 1, id1: 1, id2: 0, description: SDKUI_Localizator.OperationSuccess, resultType: ResultTypes.SUCCESS });
94
+ break;
95
+ }
96
+ case 'xlsx': {
97
+ // Create a new Excel workbook and add a worksheet with localized name
98
+ const workbook = new Workbook();
99
+ const worksheet = workbook.addWorksheet(SDKUI_Localizator.SearchResult);
100
+ // Map visible columns to worksheet column definitions
101
+ const baseColumns = visibleColumns.map(col => ({ header: col.caption || col.dataField, key: col.dataField, width: 10 }));
102
+ // Add a selection status column at the beginning if hideSelection is false
103
+ worksheet.columns = hideSelection ? baseColumns : [{ header: SDKUI_Localizator.SelectedSingular, key: '_selected', width: 10 }, ...baseColumns];
104
+ // Style the header row cells: font, fill color, and border
105
+ worksheet.getRow(1).eachCell({ includeEmpty: true }, cell => {
106
+ cell.font = { name: 'Segoe UI', size: 9 };
107
+ cell.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'C0C0C0' } };
108
+ cell.border = { top: { style: 'thin' }, left: { style: 'thin' }, bottom: { style: 'thin' }, right: { style: 'thin' } };
109
+ });
110
+ // Add rows to worksheet
111
+ rowsToExport.forEach((item, idx) => {
112
+ // Get original index of the item in dataSource
113
+ const originalIndex = exportSelectedOnly ? selectedRowKeys[idx] : dataSource.indexOf(item);
114
+ const rowObj = {};
115
+ // Add selection status if hideSelection is false
116
+ if (!hideSelection) {
117
+ rowObj._selected = selectedSet.has(originalIndex) ? SDKUI_Localizator.SelectedSingular : SDKUI_Localizator.Deselected;
118
+ }
119
+ // Add data for each visible column
120
+ visibleColumns.forEach(col => {
121
+ if (col.dataField) {
122
+ rowObj[col.dataField] = getValue(col, item[col.dataField]);
123
+ }
124
+ });
125
+ worksheet.addRow(rowObj);
126
+ });
127
+ // Adjust column widths based on header and cell contents without iterating each cell manually
128
+ worksheet.columns.forEach(col => {
129
+ if (!col || !col.header || !col.key)
130
+ return;
131
+ const headerLength = col.header.toString().length;
132
+ // 'getColumn' accetta solo string | number, col.key è garantito perché controllato sopra
133
+ const maxDataLength = worksheet.getColumn(col.key).values.reduce((max, val) => {
134
+ const strVal = val !== undefined && val !== null ? val.toString() : '';
135
+ const length = strVal.length;
136
+ return length > max ? length : max;
137
+ }, 0);
138
+ col.width = Math.max(headerLength, maxDataLength) + 2;
139
+ });
140
+ // Apply font and border styling to all cells in all rows in a single pass
141
+ worksheet.eachRow((row) => {
142
+ row.eachCell({ includeEmpty: true }, cell => {
143
+ cell.font = { name: 'Segoe UI', size: 9 };
144
+ cell.border = { top: { style: 'thin' }, left: { style: 'thin' }, bottom: { style: 'thin' }, right: { style: 'thin' } };
145
+ });
146
+ });
147
+ // Generate Excel file as a buffer
148
+ const buffer = await workbook.xlsx.writeBuffer();
149
+ // Create a Blob from the buffer for downloading
150
+ const blob = new Blob([buffer], { type: 'application/octet-stream' });
151
+ // Trigger the file download with extension 'xlsx'
152
+ downloadFile(blob, formatSelected);
153
+ result.push({ rowIndex: 1, id1: 1, id2: 0, description: SDKUI_Localizator.OperationSuccess, resultType: ResultTypes.SUCCESS });
154
+ break;
155
+ }
156
+ default:
157
+ break;
158
+ }
159
+ }
160
+ catch (error) {
161
+ result.push({ rowIndex: 1, id1: 1, id2: 0, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
162
+ // Show any exceptions in a custom exception box
163
+ TMExceptionBoxManager.show({ exception: error });
164
+ }
165
+ finally {
166
+ TMSpinner.hide();
167
+ TMResultManager.show(result, SDKUI_Localizator.Export, "ID", undefined);
168
+ onCloseExportForm();
169
+ }
170
+ };
171
+ return _jsx(TMModal, { title: `${SDKUI_Localizator.Export}`, width: '400px', height: '230px', onClose: onCloseExportForm, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '16px', padding: '6px 12px', height: '100%', width: '100%' }, children: [_jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '12px' }, children: _jsx(TMDropDown, { label: SDKUI_Localizator.Format, value: formatSelected, dataSource: formatDataSource, onValueChanged: onStatusValueChange }) }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '12px' }, children: [_jsx(TMCheckBox, { value: exportDescriptionsForDataLists, onValueChanged: () => { setExportDescriptionsForDataLists(prev => !prev); } }), _jsx("span", { children: SDKUI_Localizator.ExportDataListsDescriptionField })] }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '12px' }, children: [_jsx(TMCheckBox, { value: exportSelectedOnly, disabled: selectedRowKeys.length === 0, onValueChanged: () => { setExportSelectedOnly(prev => !prev); } }), _jsxs("span", { children: [SDKUI_Localizator.ExportOnlySelectedDocuments, " (", selectedRowKeys.length, ")"] })] }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '12px' }, children: [_jsx(TMCheckBox, { value: hideSelection, onValueChanged: () => { setHideSelection(prev => !prev); } }), _jsx("span", { children: SDKUI_Localizator.HideSelectionColumnsAndIcons })] }), _jsx("div", { style: {
172
+ display: 'flex',
173
+ justifyContent: 'center',
174
+ gap: '10px',
175
+ marginTop: '5px'
176
+ }, children: _jsx(TMButton, { caption: SDKUI_Localizator.Export, btnStyle: 'normal', color: 'success', showTooltip: false, onClick: handleExport }) })] }) });
177
+ };
178
+ export default TMDataGridExportForm;
@@ -4,7 +4,7 @@ import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, M
4
4
  import styled from 'styled-components';
5
5
  import { getCommandsMenuItems, getSelectedDcmtsOrFocused } from './TMSearchResultsMenuItems';
6
6
  import { ContextMenu } from 'devextreme-react';
7
- import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, IconDownload, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, SDKUI_Globals, IconSearchCheck, IconInfo } from '../../../helper';
7
+ import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, IconDownload, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, SDKUI_Globals, IconSearchCheck } from '../../../helper';
8
8
  import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
9
9
  import { useInputAttachmentsDialog, useInputCvtFormatDialog } from '../../../hooks/useInputDialog';
10
10
  import { DcmtOperationTypes, FormModes, SearchResultContext, DownloadTypes } from '../../../ts';
@@ -37,6 +37,7 @@ import ShowAlert from '../../base/TMAlert';
37
37
  import TMWGsCopyMoveForm from '../wg/TMWGsCopyMoveForm';
38
38
  import ToppyHelpCenter from '../assistant/ToppyHelpCenter';
39
39
  import TMAccordion from '../../base/TMAccordion';
40
+ import TMDataGridExportForm from '../../base/TMDataGridExportForm';
40
41
  //#region Internal Components
41
42
  const CommandsContextMenu = React.memo(({ target, menuItems, allowPin }) => {
42
43
  return (_jsx(ContextMenu, { showEvent: 'click', dataSource: menuItems, target: `${target}` }));
@@ -85,6 +86,8 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
85
86
  const [currentMetadataValues, setCurrentMetadataValues] = useState([]);
86
87
  const [dcmtFormLayoutMode, setDcmtFormLayoutMode] = useState(LayoutModes.Update);
87
88
  const [isModifiedBatchUpdate, setIsModifiedBatchUpdate] = useState(false);
89
+ // State to control whether the export form (for exporting to Excel/CSV/txt and others) should be shown
90
+ const [showExportForm, setShowExportForm] = useState(false);
88
91
  const [confirmFormat, ConfirmFormatDialog] = useInputCvtFormatDialog();
89
92
  const { openConfirmAttachmentsDialog, ConfirmAttachmentsDialog } = useInputAttachmentsDialog();
90
93
  const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync } = useDcmtOperations();
@@ -180,6 +183,12 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
180
183
  const openDetailDcmtsFormHandler = (value) => { setIsOpenDetails(value); };
181
184
  const openMasterDcmtsFormHandler = (value) => { setIsOpenMaster(value); };
182
185
  const openBatchUpdateFormHandler = (value) => { setIsOpenBatchUpdate(value); };
186
+ const openExportForm = useCallback(() => {
187
+ setShowExportForm(true);
188
+ }, []);
189
+ const onCloseExportForm = useCallback(() => {
190
+ setShowExportForm(false);
191
+ }, []);
183
192
  const getTitleHeader = () => {
184
193
  let counters = (showSelector && disableAccordionIfSingleCategory && searchResults.length > 1) ? getSearchResultCountersSingleCategory(searchResults) : "";
185
194
  if (title)
@@ -227,7 +236,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
227
236
  return;
228
237
  if (e.target === 'content') {
229
238
  e.items = e.items || [];
230
- const menuItems = getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, showCopyMoveFormCallback);
239
+ const menuItems = getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, showCopyMoveFormCallback, openExportForm);
231
240
  e.items.push(...menuItems);
232
241
  }
233
242
  };
@@ -354,7 +363,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
354
363
  }
355
364
  };
356
365
  const searchResutlToolbar = _jsxs(_Fragment, { children: [(dcmtsReturned != dcmtsFound) && _jsx("p", { style: { backgroundColor: `white`, color: TMColors.primaryColor, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${dcmtsReturned}/${dcmtsFound} restituiti` }), context === SearchResultContext.FAVORITES_AND_RECENTS &&
357
- _jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconDelete, { color: 'white' }), caption: "Rimuovi da " + (selectedSearchResult?.category === "Favorites" ? '"Preferiti"' : '"Recenti"'), disabled: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length <= 0, onClick: removeDcmtFromFavsOrRecents }) }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconRefresh, { color: 'white' }), caption: SDKUI_Localizator.Refresh, onClick: onRefreshSearchAsync }), _jsx(IconMenuVertical, { id: `commands-header-${id}`, color: 'white', cursor: 'pointer' }), _jsx(CommandsContextMenu, { target: `#commands-header-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, showCopyMoveFormCallback) })] });
366
+ _jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconDelete, { color: 'white' }), caption: "Rimuovi da " + (selectedSearchResult?.category === "Favorites" ? '"Preferiti"' : '"Recenti"'), disabled: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length <= 0, onClick: removeDcmtFromFavsOrRecents }) }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconRefresh, { color: 'white' }), caption: SDKUI_Localizator.Refresh, onClick: onRefreshSearchAsync }), _jsx(IconMenuVertical, { id: `commands-header-${id}`, color: 'white', cursor: 'pointer' }), _jsx(CommandsContextMenu, { target: `#commands-header-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, showCopyMoveFormCallback, openExportForm) })] });
358
367
  const middlePanelToolbar = _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: '10px' }, children: [_jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', isModified: false, iconColor: TMColors.default_background, formMode: FormModes.ReadOnly, canPrev: canNavigateHandler('prev'), onPrev: () => onNavigateHandler('prev') }), _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', isModified: false, iconColor: TMColors.default_background, formMode: FormModes.ReadOnly, canNext: canNavigateHandler('next'), onNext: () => onNavigateHandler('next') })] });
359
368
  const handleAddItem = (tid, did) => {
360
369
  let newItem = { TID: tid ?? 0, DID: did ?? 0 };
@@ -371,8 +380,8 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
371
380
  _jsxs(_Fragment, { children: [_jsxs(TMLayoutItem, { height: '100%', children: [_jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, separatorActiveColor: 'transparent', separatorColor: 'transparent', min: ['0', '0'], showSeparator: showSelector && deviceType !== DeviceType.MOBILE, start: showSelector ? deviceType !== DeviceType.MOBILE ? ['30%', '70%'] : splitterSize : ['0%', '100%'], children: [showSelector ?
372
381
  _jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, onSelectionChanged: onSearchResultSelectionChanged }) })
373
382
  :
374
- _jsx(_Fragment, {}), _jsxs(TMLayoutItem, { children: [_jsx(TMSearchResultGrid, { inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], lastUpdateSearchTime: lastUpdateSearchTime, onDblClick: () => openFormHandler(LayoutModes.Update), onContextMenuPreparing: onContextMenuPreparing, onSelectionChanged: (items) => { setSelectedItems(items); }, onVisibleItemChanged: setVisibleItems, onFocusedItemChanged: setFocusedItem, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync(inputDcmts, downloadType, downloadMode, onFileOpened, confirmAttachments) }), allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE &&
375
- _jsxs(TMFloatingToolbar, { backgroundColor: TMColors.primaryColor, initialLeft: '10px', initialTop: 'calc(100% - 75px)', children: [fromDTD?.perm?.canRetrieveFile === AccessLevels.Yes && _jsx(TMButton, { btnStyle: 'icon', caption: "Download file", disabled: fromDTD?.perm?.canRetrieveFile !== AccessLevels.Yes || !focusedItem?.DID, icon: _jsx(IconDownload, { color: 'white' }), onClick: () => { downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download"); } }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasDetailRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true) }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasMasterRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white', transform: 'scale(-1, 1)' }), caption: SDKUI_Localizator.DcmtsMaster, onClick: () => setIsOpenMaster(true) }), _jsx(IconMenuVertical, { id: `commands-floating-${id}`, color: 'white', cursor: 'pointer' }), _jsx(CommandsContextMenu, { target: `#commands-floating-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, showCopyMoveFormCallback) })] })] }), "m"] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { TID: focusedItem?.TID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: onWFOperationCompleted, onClose: () => setShowMoreInfoPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: `${SDKUI_Localizator.BatchUpdate} (${getSelectionDcmtInfo().length} documenti selezionati)`, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
383
+ _jsx(_Fragment, {}), _jsxs(TMLayoutItem, { children: [_jsx(TMSearchResultGrid, { inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], lastUpdateSearchTime: lastUpdateSearchTime, onDblClick: () => openFormHandler(LayoutModes.Update), onContextMenuPreparing: onContextMenuPreparing, onSelectionChanged: (items) => { setSelectedItems(items); }, onVisibleItemChanged: setVisibleItems, onFocusedItemChanged: setFocusedItem, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync(inputDcmts, downloadType, downloadMode, onFileOpened, confirmAttachments), showExportForm: showExportForm, onCloseExportForm: onCloseExportForm }), allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE &&
384
+ _jsxs(TMFloatingToolbar, { backgroundColor: TMColors.primaryColor, initialLeft: '10px', initialTop: 'calc(100% - 75px)', children: [fromDTD?.perm?.canRetrieveFile === AccessLevels.Yes && _jsx(TMButton, { btnStyle: 'icon', caption: "Download file", disabled: fromDTD?.perm?.canRetrieveFile !== AccessLevels.Yes || !focusedItem?.DID, icon: _jsx(IconDownload, { color: 'white' }), onClick: () => { downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download"); } }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasDetailRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true) }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasMasterRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white', transform: 'scale(-1, 1)' }), caption: SDKUI_Localizator.DcmtsMaster, onClick: () => setIsOpenMaster(true) }), _jsx(IconMenuVertical, { id: `commands-floating-${id}`, color: 'white', cursor: 'pointer' }), _jsx(CommandsContextMenu, { target: `#commands-floating-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, showCopyMoveFormCallback, openExportForm) })] })] }), "m"] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { TID: focusedItem?.TID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: onWFOperationCompleted, onClose: () => setShowMoreInfoPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: `${SDKUI_Localizator.BatchUpdate} (${getSelectionDcmtInfo().length} documenti selezionati)`, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
376
385
  setIsOpenBatchUpdate(false);
377
386
  }, onSavedCallbackAsync: async () => {
378
387
  setIsOpenBatchUpdate(false);
@@ -468,7 +477,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
468
477
  };
469
478
  export default TMSearchResult;
470
479
  const renderDcmtIcon = (cellData, onDownloadDcmtsAsync) => _jsx(TMDcmtIcon, { tid: cellData.data.TID, did: cellData.data.DID, fileExtension: cellData.data.FILEEXT, fileCount: cellData.data.FILECOUNT, isLexProt: cellData.data.IsLexProt, isMail: cellData.data.ISMAIL, isShared: cellData.data.ISSHARED, isSigned: cellData.data.ISSIGNED, downloadMode: 'openInNewWindow', onDownloadDcmtsAsync: onDownloadDcmtsAsync });
471
- const TMSearchResultGrid = ({ inputFocusedItem, allowMultipleSelection = true, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, onContextMenuPreparing, onSelectionChanged, onDblClick }) => {
480
+ const TMSearchResultGrid = ({ inputFocusedItem, allowMultipleSelection = true, showExportForm = false, onCloseExportForm, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, onContextMenuPreparing, onSelectionChanged, onDblClick }) => {
472
481
  const [dataSource, setDataSource] = useState();
473
482
  const [showFilterPanel, setShowFilterPanel] = useState(false);
474
483
  const [columns, setColumns] = useState([]);
@@ -491,7 +500,8 @@ const TMSearchResultGrid = ({ inputFocusedItem, allowMultipleSelection = true, o
491
500
  if (e.event?.key === 'Delete') {
492
501
  TMMessageBoxManager.show({
493
502
  buttons: [ButtonNames.YES, ButtonNames.NO],
494
- message: _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [SDKUI_Localizator.SaveQuestion, " (", selectedRowKeys.length, ")", _jsx(TMTooltip, { content: _jsxs("div", { style: { whiteSpace: 'nowrap' }, children: [_jsx("span", { children: SDKUI_Localizator.RemoveSelectedItemsTemporarily }), _jsx("br", {}), _jsx("span", { children: SDKUI_Localizator.UIOnlyEffectWarning })] }), children: _jsx(IconInfo, { color: TMColors.primary }) })] }),
503
+ title: SDKUI_Localizator.RemoveFromList,
504
+ message: `${SDKUI_Localizator.ConfirmSelectedDocumentsMessage.replaceParams(selectedRowKeys.length)}`,
495
505
  onButtonClick(e) {
496
506
  if (e !== ButtonNames.YES)
497
507
  return;
@@ -588,7 +598,7 @@ const TMSearchResultGrid = ({ inputFocusedItem, allowMultipleSelection = true, o
588
598
  visible: isVisible,
589
599
  cellRender: (cellData) => cellRender(cellData, dataDomain, dataListID, dataListViewMode),
590
600
  caption: col.caption,
591
- format: getDisplayFormat(col)
601
+ format: getDisplayFormat(col),
592
602
  });
593
603
  });
594
604
  setColumns(cols);
@@ -654,7 +664,7 @@ const TMSearchResultGrid = ({ inputFocusedItem, allowMultipleSelection = true, o
654
664
  setShowFilterPanel(!!e.value);
655
665
  }
656
666
  }, []);
657
- return _jsx(TMDataGrid, { id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: focusedItem?.rowIndex, showSearchPanel: false, showFilterPanel: showFilterPanel, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: TMDataGridPageSize.Small, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, onOptionChanged: onOptionChanged, onContextMenuPreparing: onContextMenuPreparing, onKeyDown: onKeyDown, counterConfig: { show: true } });
667
+ return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsx(TMDataGrid, { id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: focusedItem?.rowIndex, showSearchPanel: false, showFilterPanel: showFilterPanel, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: TMDataGridPageSize.Small, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, onOptionChanged: onOptionChanged, onContextMenuPreparing: onContextMenuPreparing, onKeyDown: onKeyDown, counterConfig: { show: true } }), (showExportForm && searchResult && onCloseExportForm) && _jsx(TMDataGridExportForm, { dataColumns: dataColumns, dataSource: dataSource, selectedRowKeys: selectedRowKeys, onCloseExportForm: onCloseExportForm, searchResult: searchResult })] });
658
668
  };
659
669
  //#region TMSearchResultSelector
660
670
  const StyledItemTemplate = styled.div `
@@ -3,4 +3,4 @@ import { DcmtTypeDescriptor, FileDescriptor, FileFormats, LayoutModes, WorkingGr
3
3
  import { TMDataGridContextMenuItem } from '../../base/TMDataGrid';
4
4
  import { DcmtInfo, DcmtOperationTypes, DownloadModes, DownloadTypes, SearchResultContext } from '../../../ts';
5
5
  export declare const getSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => DcmtInfo[];
6
- export declare const getCommandsMenuItems: (dtd: DcmtTypeDescriptor | undefined, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, workingGroupContext: WorkingGroupDescriptor | undefined, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>) => Promise<void>, runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>, onRefreshSearchAsync: (() => Promise<void>) | undefined, onRefreshDataRowsAsync: (() => Promise<void>) | undefined, onRefreshAfterAddDcmtToFavs: (() => void) | undefined, confirmFormat: () => Promise<FileFormats>, confirmAttachments: (list: FileDescriptor[]) => Promise<string[] | undefined>, openTaskFormHandler: () => void, openDetailDcmtsFormHandler: (value: boolean) => void, openMasterDcmtsFormHandler: (value: boolean) => void, openBatchUpdateFormHandler: (value: boolean) => void, showCopyMoveFormCallback: (mode: "copyToWgDraft" | "copyToWgArchivedDoc") => void) => Array<TMDataGridContextMenuItem>;
6
+ export declare const getCommandsMenuItems: (dtd: DcmtTypeDescriptor | undefined, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, workingGroupContext: WorkingGroupDescriptor | undefined, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>) => Promise<void>, runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>, onRefreshSearchAsync: (() => Promise<void>) | undefined, onRefreshDataRowsAsync: (() => Promise<void>) | undefined, onRefreshAfterAddDcmtToFavs: (() => void) | undefined, confirmFormat: () => Promise<FileFormats>, confirmAttachments: (list: FileDescriptor[]) => Promise<string[] | undefined>, openTaskFormHandler: () => void, openDetailDcmtsFormHandler: (value: boolean) => void, openMasterDcmtsFormHandler: (value: boolean) => void, openBatchUpdateFormHandler: (value: boolean) => void, showCopyMoveFormCallback: (mode: "copyToWgDraft" | "copyToWgArchivedDoc") => void, openExportForm: () => void) => Array<TMDataGridContextMenuItem>;
@@ -24,7 +24,7 @@ export const getSelectedDcmtsOrFocused = (selectedItems, focusedItem, fileFormat
24
24
  }
25
25
  return [];
26
26
  };
27
- export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, showCopyMoveFormCallback) => {
27
+ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, showCopyMoveFormCallback, openExportForm) => {
28
28
  // let ftExplanations = focusedItem?.FTExplanations;
29
29
  return [
30
30
  {
@@ -385,7 +385,7 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
385
385
  text: SDKUI_Localizator.ExportTo,
386
386
  operationType: 'multiRow',
387
387
  disabled: false,
388
- onClick: () => ShowAlert({ message: "TODO Esporta in", mode: 'info', title: `${"TODO"}`, duration: 3000 })
388
+ onClick: openExportForm
389
389
  },
390
390
  // {
391
391
  // icon: svgToString(<IconShow />),
@@ -83,6 +83,7 @@ export declare class SDKUI_Localizator {
83
83
  static get ConfirmDownload(): string;
84
84
  static get ConfirmPassword(): "Bestätige das Passwort" | "Confirm password" | "Confirmar Contraseña" | "Confirmez le mot de passe" | "Confirme sua senha" | "Conferma password";
85
85
  static get ConfirmOnCancel(): "Wenn wir fortfahren, gehen die vorgenommenen Änderungen verloren. Fortfahren?" | "All modifications will be lost. Continue?" | "Si sigue adelante, se perderán las modificaciones aportadas. ¿Seguir?" | "Continuant, les changements seront perdus. Continuer?" | "Continuando as alterações feitas serão perdidas. Continuar?" | "Proseguendo le modifiche apportate andranno perse. Proseguire?";
86
+ static get ConfirmSelectedDocumentsMessage(): string;
86
87
  static get Continue(): string;
87
88
  static get ContinueOperation(): "Fortfahren?" | "Continue ?" | "¿Continuar?" | "Continuer?" | "Continuar?" | "Continuare?";
88
89
  static get CopiedSuccessfully(): "In die Zwischenablage kopieren" | "Copied in clipboard successfully" | "Copiado en el portapapeles con éxito" | "Copié dans le presse-papiers avec succès" | "CCopiado na área de transferência com sucesso" | "Copiato negli appunti con successo";
@@ -119,6 +120,7 @@ export declare class SDKUI_Localizator {
119
120
  static get DescriptionTooLongMessage(): "Die Beschreibung ist zu lang: Maximal {{0}' Zeichen" | "Description is too long: Max {{0}} characters" | "La descripción es demasiado larga: Máximo {{0}} caracteres" | "La description est trop longue : Maximum {{0}} caractères" | "A descrição é demasiado longa: Máximo {{0}} caracteres" | "La descrizione è troppo lunga: Massimo {{0}} caratteri";
120
121
  static get Destination(): "Bestimmung" | "Destination" | "Destino" | "Destinazione";
121
122
  static get DetailsView(): string;
123
+ static get Deselected(): string;
122
124
  static get Disabled(): "Deaktiviert" | "Disabled" | "Deshabilitado" | "Désactivé" | "Desabilitado" | "Disabilitato";
123
125
  static get DisplayFormat(): string;
124
126
  static get DistinctValues(): "Unterschiedliche Werte" | "Distinct values" | "Valores distintos" | "Valeurs distinctes" | "Valori distinti";
@@ -149,6 +151,8 @@ export declare class SDKUI_Localizator {
149
151
  static get Error(): "Fehler" | "Error" | "Erreur" | "Erro" | "Errore";
150
152
  static get ErrorLoadingDocument(): string;
151
153
  static get ErrorParsingFileContent(): "Fehler beim Parsen des Dateiinhalts. Stellen Sie sicher, dass die Datei im richtigen Format vorliegt." | "Error parsing the file content. Ensure the file is in the correct format." | "Error al analizar el contenido del archivo. Asegúrese de que el archivo esté en el formato correcto." | "Erreur lors de l'analyse du contenu du fichier. Assurez-vous que le fichier est dans le bon format." | "Erro ao analisar o conteúdo do arquivo. Certifique-se de que o arquivo está no formato correto." | "Errore durante l'analisi del contenuto del file. Assicurati che il file sia nel formato corretto.";
154
+ static get ExportDataListsDescriptionField(): "Exportiere die \"Beschreibung\"-Felder der Datenlisten" | "Export the \"description\" fields of data lists" | "Exportar los campos \"descripción\" de las listas de datos" | "Exporter les champs \"description\" des listes de données" | "Exportar os campos \"descrição\" das listas de dados" | "Esporta i campi \"descrizione\" delle liste dati";
155
+ static get ExportOnlySelectedDocuments(): "Nur ausgewählte Dokumente exportieren" | "Export only selected documents" | "Exportar solo los documentos seleccionados" | "Exporter uniquement les documents sélectionnés" | "Exportar apenas os documentos selecionados" | "Esporta solo i documenti selezionati";
152
156
  static get ExtractedBy(): "Ausgezogen von" | "Extracted by" | "Extraído por" | "Extrait par" | "Estratto da";
153
157
  static get ExtractedFromOtherUser(): string;
154
158
  static get ExtractedOn(): "Ausgezogen am" | "Extracted on" | "Extraído el" | "Extrait le" | "Extraído em" | "Estratto il";
@@ -211,6 +215,7 @@ export declare class SDKUI_Localizator {
211
215
  static get HideFormattingOptions(): "Formatierungsoptionen ausblenden" | "Hide formatting options" | "Ocultar opciones de formato" | "Masquer les options de formatage" | "Ocultar opções de formatação" | "Nascondi opzioni di formattazione";
212
216
  static get HideMetadata(): string;
213
217
  static get HideSearch(): "Suche ausblenden" | "Hide search" | "Ocultar búsqueda" | "Masquer la recherche" | "Ocultar pesquisa" | "Nascondi ricerca";
218
+ static get HideSelectionColumnsAndIcons(): "Auswahlspalten und Symbole ausblenden" | "Hide selection columns and icons" | "Ocultar columnas de selección e iconos" | "Masquer les colonnes de sélection et les icônes" | "Ocultar colunas de seleção e ícones" | "Nascondi le colonne di selezione e icone";
214
219
  static get HistoryActionLabel(): string;
215
220
  static get HistoryLabel(): string;
216
221
  static get ID_Hide(): "Ausblenden ID" | "Hide ID" | "Ocultar ID" | "Masquer ID" | "Nascondi ID";
@@ -374,9 +379,9 @@ export declare class SDKUI_Localizator {
374
379
  static get Relations(): "Korrelationen" | "Correlations" | "Correlaciones" | "Relations" | "Correlacionados" | "Correlazioni";
375
380
  static get RelationManyToMany(): "Folge viele mit vielen" | "Relation many to many" | "Correlación muchos a muchos" | "Corrélation plusieurs à plusieurs" | "Muitos para muitos relação" | "Correlazione molti a molti";
376
381
  static get RelationType(): "Art der Beziehung" | "Relation type" | "Tipo de relación" | "Type de relation" | "Tipo de relacionamento" | "Tipo di relazione";
382
+ static get RemoveFromList(): string;
377
383
  static get RemoveFromWorkgroup(): string;
378
384
  static get RemoveNamedPreferredCredentials(): "Möchten Sie die Anmeldedaten '{{0}}' entfernen, die als bevorzugt festgelegt wurden?" | "Do you want to remove the '{{0}}' credentials set as preferred?" | "¿Quieres eliminar las credenciales '{{0}}' configuradas como preferidas?" | "Voulez-vous supprimer les identifiants '{{0}}' définis comme préférés ?" | "Deseja remover as credenciais '{{0}}' definidas como preferidas?" | "Vuoi rimuovere le credenziali '{{0}}' impostate come preferite?";
379
- static get RemoveSelectedItemsTemporarily(): string;
380
385
  static get RememberCredentials(): "Anmeldedaten merken" | "Remember credentials" | "Recordar credenciales" | "Se souvenir des identifiants" | "Lembrar credenciais" | "Ricorda credenziali";
381
386
  static get Request(): string;
382
387
  static get RequestTo(): string;
@@ -411,7 +416,8 @@ export declare class SDKUI_Localizator {
411
416
  static get Seconds(): "Sekunden" | "Seconds" | "Segundos" | "Secondes" | "Segundas" | "Secondi";
412
417
  static get Select(): "Wählen Sie Ihre" | "Select" | "Seleccionar" | "Sélectionne" | "Selecione" | "Seleziona";
413
418
  static get SelectSupportAreaMessage(): "Wählen Sie einen Ablagebereich aus" | "Select a support area" | "Seleccione un área de apoyo" | "Sélectionnez une zone de support" | "Selecione uma área de apoio" | "Selezionare un'area di appoggio";
414
- static get Selected(): "Ausgewählt" | "Selected" | "Seleccionados" | "Sélectionné" | "Selecionado" | "Selezionati";
419
+ static get SelectedSingular(): string;
420
+ static get Selected(): "Ausgewählt" | "Selected" | "Sélectionné" | "Selecionado" | "Seleccionados" | "Selezionati";
415
421
  static get SelectDesiredFilters(): "Wählen Sie die gewünschten Filter aus" | "Select the desired filters" | "Selecciona los filtros deseados" | "Sélectionnez les filtres souhaités" | "Selecione os filtros desejados" | "Seleziona i filtri desiderati";
416
422
  static get SelectedItems(): "Ausgewählte Artikel" | "Selected items" | "Artículos seleccionados" | "Articles sélectionnés" | "Itens selecionados" | "Elementi selezionati";
417
423
  static get Send(): "Senden" | "Send" | "Enviar" | "Envoyer" | "Invia";
@@ -465,7 +471,6 @@ export declare class SDKUI_Localizator {
465
471
  static get UBLViewFormats_ER_PDF(): "ER Style Sheet (PDF)" | "Hoja de estilo ER (PDF)" | "Feuille de style ER (PDF)" | "Folha de estilo ER (PDF)" | "Foglio di stile ER (PDF)";
466
472
  static get UBLViewFormats_NSO_HTML(): "NSO Style Sheet (HTML)" | "Hoja de estilo NSO (HTML)" | "Feuille de style NSO (HTML)" | "Folha de estilo NSO (HTML)" | "Foglio di stile NSO (HTML)";
467
473
  static get UBLViewFormats_NSO_PDF(): "NSO Style Sheet (PDF)" | "Hoja de estilo NSO (PDF)" | "Feuille de style NSO (PDF)" | "Folha de estilo NSO (PDF)" | "Foglio di stile NSO (PDF)";
468
- static get UIOnlyEffectWarning(): string;
469
474
  static get Undo(): "Änderungen rückgängig machen" | "Undo" | "Anular modificaciones" | "Annule les modifications" | "Anular alterações" | "Annulla modifiche";
470
475
  static get Update(): "Bearbeiten" | "Update" | "Modificar" | "Modifie" | "Modificação" | "Modifica";
471
476
  static get UpdateCompletedSuccessfully(): "Aktualisierung erfolgreich abgeschlossen" | "Update completed successfully" | "Actualización completada con éxito" | "Mise à jour terminée avec succès" | "Atualização concluída com sucesso" | "Aggiornamento completato con successo";
@@ -779,6 +779,22 @@ export class SDKUI_Localizator {
779
779
  default: return "Proseguendo le modifiche apportate andranno perse. Proseguire?";
780
780
  }
781
781
  }
782
+ static get ConfirmSelectedDocumentsMessage() {
783
+ switch (this._cultureID) {
784
+ case CultureIDs.De_DE:
785
+ return "{{0}} Dokument(e) ausgewählt. Möchten Sie den Vorgang bestätigen?";
786
+ case CultureIDs.En_US:
787
+ return "{{0}} document(s) selected. Do you want to confirm the operation?";
788
+ case CultureIDs.Es_ES:
789
+ return "{{0}} documento(s) seleccionado(s). ¿Desea confirmar la operación?";
790
+ case CultureIDs.Fr_FR:
791
+ return "{{0}} document(s) sélectionné(s). Voulez-vous confirmer l'opération ?";
792
+ case CultureIDs.Pt_PT:
793
+ return "{{0}} documento(s) selecionado(s). Deseja confirmar a operação?";
794
+ default:
795
+ return "{{0}} documento/i selezionato/i. Confermare l'operazione?";
796
+ }
797
+ }
782
798
  static get Continue() {
783
799
  switch (this._cultureID) {
784
800
  case CultureIDs.De_DE: return "Fortfahren";
@@ -1139,6 +1155,16 @@ export class SDKUI_Localizator {
1139
1155
  default: return "Vista Dettagliata";
1140
1156
  }
1141
1157
  }
1158
+ static get Deselected() {
1159
+ switch (this._cultureID) {
1160
+ case CultureIDs.De_DE: return "Abgewählt";
1161
+ case CultureIDs.En_US: return "Deselected";
1162
+ case CultureIDs.Es_ES: return "Deseleccionado";
1163
+ case CultureIDs.Fr_FR: return "Désélectionné";
1164
+ case CultureIDs.Pt_PT: return "Desmarcado";
1165
+ default: return "Deselezionato";
1166
+ }
1167
+ }
1142
1168
  static get Disabled() {
1143
1169
  switch (this._cultureID) {
1144
1170
  case CultureIDs.De_DE: return "Deaktiviert";
@@ -1451,6 +1477,26 @@ export class SDKUI_Localizator {
1451
1477
  default: return "Errore durante l'analisi del contenuto del file. Assicurati che il file sia nel formato corretto.";
1452
1478
  }
1453
1479
  }
1480
+ static get ExportDataListsDescriptionField() {
1481
+ switch (this._cultureID) {
1482
+ case CultureIDs.De_DE: return 'Exportiere die "Beschreibung"-Felder der Datenlisten';
1483
+ case CultureIDs.En_US: return 'Export the "description" fields of data lists';
1484
+ case CultureIDs.Es_ES: return 'Exportar los campos "descripción" de las listas de datos';
1485
+ case CultureIDs.Fr_FR: return 'Exporter les champs "description" des listes de données';
1486
+ case CultureIDs.Pt_PT: return 'Exportar os campos "descrição" das listas de dados';
1487
+ default: return 'Esporta i campi "descrizione" delle liste dati';
1488
+ }
1489
+ }
1490
+ static get ExportOnlySelectedDocuments() {
1491
+ switch (this._cultureID) {
1492
+ case CultureIDs.De_DE: return "Nur ausgewählte Dokumente exportieren";
1493
+ case CultureIDs.En_US: return "Export only selected documents";
1494
+ case CultureIDs.Es_ES: return "Exportar solo los documentos seleccionados";
1495
+ case CultureIDs.Fr_FR: return "Exporter uniquement les documents sélectionnés";
1496
+ case CultureIDs.Pt_PT: return "Exportar apenas os documentos selecionados";
1497
+ default: return "Esporta solo i documenti selezionati";
1498
+ }
1499
+ }
1454
1500
  static get ExtractedBy() {
1455
1501
  switch (this._cultureID) {
1456
1502
  case CultureIDs.De_DE: return "Ausgezogen von";
@@ -2070,6 +2116,16 @@ export class SDKUI_Localizator {
2070
2116
  default: return "Nascondi ricerca";
2071
2117
  }
2072
2118
  }
2119
+ static get HideSelectionColumnsAndIcons() {
2120
+ switch (this._cultureID) {
2121
+ case CultureIDs.De_DE: return "Auswahlspalten und Symbole ausblenden";
2122
+ case CultureIDs.En_US: return "Hide selection columns and icons";
2123
+ case CultureIDs.Es_ES: return "Ocultar columnas de selección e iconos";
2124
+ case CultureIDs.Fr_FR: return "Masquer les colonnes de sélection et les icônes";
2125
+ case CultureIDs.Pt_PT: return "Ocultar colunas de seleção e ícones";
2126
+ default: return "Nascondi le colonne di selezione e icone";
2127
+ }
2128
+ }
2073
2129
  static get HistoryActionLabel() {
2074
2130
  switch (this._cultureID) {
2075
2131
  case CultureIDs.De_DE: return "Archivieren";
@@ -3692,6 +3748,16 @@ export class SDKUI_Localizator {
3692
3748
  default: return "Tipo di relazione";
3693
3749
  }
3694
3750
  }
3751
+ static get RemoveFromList() {
3752
+ switch (this._cultureID) {
3753
+ case CultureIDs.De_DE: return "Aus der Liste entfernen";
3754
+ case CultureIDs.En_US: return "Remove from list";
3755
+ case CultureIDs.Es_ES: return "Eliminar de la lista";
3756
+ case CultureIDs.Fr_FR: return "Supprimer de la liste";
3757
+ case CultureIDs.Pt_PT: return "Remover da lista";
3758
+ default: return "Rimuovere dalla lista";
3759
+ }
3760
+ }
3695
3761
  static get RemoveFromWorkgroup() {
3696
3762
  switch (this._cultureID) {
3697
3763
  case CultureIDs.De_DE: return "Aus der Arbeitsgruppe entfernen";
@@ -3718,16 +3784,6 @@ export class SDKUI_Localizator {
3718
3784
  return "Vuoi rimuovere le credenziali '{{0}}' impostate come preferite?";
3719
3785
  }
3720
3786
  }
3721
- static get RemoveSelectedItemsTemporarily() {
3722
- switch (this._cultureID) {
3723
- case CultureIDs.De_DE: return "Ausgewählte Elemente vorübergehend entfernen?";
3724
- case CultureIDs.En_US: return "Temporarily remove selected items?";
3725
- case CultureIDs.Es_ES: return "¿Eliminar temporalmente los elementos seleccionados?";
3726
- case CultureIDs.Fr_FR: return "Supprimer temporairement les éléments sélectionnés ?";
3727
- case CultureIDs.Pt_PT: return "Remover temporariamente os itens selecionados?";
3728
- default: return "Rimuovere temporaneamente gli elementi selezionati?";
3729
- }
3730
- }
3731
3787
  static get RememberCredentials() {
3732
3788
  switch (this._cultureID) {
3733
3789
  case CultureIDs.De_DE: return "Anmeldedaten merken";
@@ -4068,6 +4124,16 @@ export class SDKUI_Localizator {
4068
4124
  default: return "Selezionare un'area di appoggio";
4069
4125
  }
4070
4126
  }
4127
+ static get SelectedSingular() {
4128
+ switch (this._cultureID) {
4129
+ case CultureIDs.De_DE: return "Ausgewählt";
4130
+ case CultureIDs.En_US: return "Selected";
4131
+ case CultureIDs.Es_ES: return "Seleccionado";
4132
+ case CultureIDs.Fr_FR: return "Sélectionné";
4133
+ case CultureIDs.Pt_PT: return "Selecionado";
4134
+ default: return "Selezionato";
4135
+ }
4136
+ }
4071
4137
  static get Selected() {
4072
4138
  switch (this._cultureID) {
4073
4139
  case CultureIDs.De_DE: return "Ausgewählt";
@@ -4609,16 +4675,6 @@ export class SDKUI_Localizator {
4609
4675
  default: return "Foglio di stile NSO (PDF)";
4610
4676
  }
4611
4677
  }
4612
- static get UIOnlyEffectWarning() {
4613
- switch (this._cultureID) {
4614
- case CultureIDs.De_DE: return "Diese Aktion wirkt sich nur auf die Benutzeroberfläche aus. Wenn Sie die Seite aktualisieren, werden die Daten wiederhergestellt.";
4615
- case CultureIDs.En_US: return "This action only affects the user interface. If you refresh the page, the data will be restored.";
4616
- case CultureIDs.Es_ES: return "Esta acción solo afecta a la interfaz de usuario. Si actualizas la página, los datos se restaurarán.";
4617
- case CultureIDs.Fr_FR: return "Cette action affecte uniquement l'interface utilisateur. Si vous actualisez la page, les données seront restaurées.";
4618
- case CultureIDs.Pt_PT: return "Esta ação afeta apenas a interface do usuário. Se você atualizar a página, os dados serão restaurados.";
4619
- default: return "Questa azione ha effetto solo sull'interfaccia utente. Se aggiorni la pagina, i dati verranno ripristinati.";
4620
- }
4621
- }
4622
4678
  static get Undo() {
4623
4679
  switch (this._cultureID) {
4624
4680
  case CultureIDs.De_DE: return "Änderungen rückgängig machen";
@@ -5,3 +5,4 @@ export interface RowData {
5
5
  [key: string]: string | number | null;
6
6
  }
7
7
  export declare const associateColumnsToRows: (columns: Array<DataColumnDescriptor> | undefined, rows: Array<Array<string>> | undefined) => Array<RowData>;
8
+ export declare const buildValueToLabelMapFromDataColumns: (columns: Array<DataColumnDescriptor>) => Promise<Map<string, string>>;
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import styled from "styled-components";
3
3
  import { TMTooltip } from '../components';
4
4
  import { IconKey } from './TMIcons';
5
+ import { DataListCacheService, MetadataDataDomains } from '@topconsultnpm/sdk-ts-beta';
5
6
  import { SDKUI_Localizator } from './SDKUI_Localizator';
6
7
  const StyledIconFileContainer = styled.div `
7
8
  height: 22px;
@@ -116,3 +117,19 @@ export const associateColumnsToRows = (columns, rows) => {
116
117
  return rowObject;
117
118
  });
118
119
  };
120
+ export const buildValueToLabelMapFromDataColumns = async (columns) => {
121
+ const valueToNameMap = new Map();
122
+ for (const col of columns) {
123
+ const dataDomain = MetadataDataDomains[(col.extendedProperties?.["DataDomain"] ?? "None")];
124
+ const dataListID = Number(col.extendedProperties?.["DataListID"]);
125
+ if (dataDomain === MetadataDataDomains.DataList) {
126
+ const dl = await DataListCacheService.GetAsync(dataListID);
127
+ dl?.items?.forEach((item) => {
128
+ if (item?.name !== undefined && item?.value !== undefined) {
129
+ valueToNameMap.set(item.value, item.name);
130
+ }
131
+ });
132
+ }
133
+ }
134
+ return valueToNameMap;
135
+ };