@topconsultnpm/sdkui-react 6.22.0-t2 → 6.22.0-t3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +3 -3
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +1 -1
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +6 -6
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +15 -15
- package/lib/components/base/Styled.js +7 -5
- package/lib/components/base/TMAccordionNew.js +7 -7
- package/lib/components/base/TMAlert.d.ts +32 -32
- package/lib/components/base/TMAlert.js +6 -8
- package/lib/components/base/TMAreaManager.js +53 -55
- package/lib/components/base/TMButton.js +4 -4
- package/lib/components/base/TMClosableList.js +3 -3
- package/lib/components/base/TMCustomButton.js +40 -48
- package/lib/components/base/TMDataGrid.d.ts +2 -0
- package/lib/components/base/TMDataGrid.js +35 -7
- package/lib/components/base/TMDropDownMenu.js +1 -1
- package/lib/components/base/TMFileManagerDataGridView.js +1 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +2 -2
- package/lib/components/base/TMLayout.d.ts +2 -2
- package/lib/components/base/TMLayout.js +3 -3
- package/lib/components/base/TMList.js +1 -1
- package/lib/components/base/TMListView.js +3 -3
- package/lib/components/base/TMModal.js +1 -1
- package/lib/components/base/TMPanel.js +8 -8
- package/lib/components/base/TMPopUp.js +2 -2
- package/lib/components/base/TMResizableMenu.js +2 -2
- package/lib/components/base/TMRightSidebar.js +1 -1
- package/lib/components/base/TMShowAllOrMaxItemsButton.js +1 -1
- package/lib/components/base/TMSpinner.d.ts +2 -1
- package/lib/components/base/TMSpinner.js +9 -7
- package/lib/components/base/TMTab.js +2 -2
- package/lib/components/base/TMTabControl.d.ts +106 -0
- package/lib/components/base/TMTabControl.js +664 -0
- package/lib/components/base/TMToggleButton.js +2 -2
- package/lib/components/base/TMToolbarCard.js +3 -3
- package/lib/components/base/TMTreeView.js +35 -3
- package/lib/components/base/TMWaitPanel.js +3 -3
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +169 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.js +320 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +53 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.js +274 -0
- package/lib/components/base/waitPanel/index.d.ts +1 -0
- package/lib/components/base/waitPanel/index.js +1 -0
- package/lib/components/choosers/TMCultureIDPicker.js +2 -2
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDataListItemPicker.js +2 -2
- package/lib/components/choosers/TMDcmtTypeChooser.js +1 -1
- package/lib/components/choosers/TMDiskChooser.js +1 -1
- package/lib/components/choosers/TMDistinctValues.js +28 -19
- package/lib/components/choosers/TMDynDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMImageIDChooser.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.js +2 -2
- package/lib/components/choosers/TMPathChooser.js +17 -34
- package/lib/components/choosers/TMQuickSearchInfo.js +4 -4
- package/lib/components/choosers/TMQuickSearchSettingsForm.js +1 -1
- package/lib/components/choosers/TMRelationChooser.js +1 -1
- package/lib/components/choosers/TMSelectedValuesSummary.js +1 -3
- package/lib/components/choosers/TMUserChooser.js +1 -1
- package/lib/components/editors/TMCheckBox.js +1 -1
- package/lib/components/editors/TMDropDown.js +7 -7
- package/lib/components/editors/TMEditorStyled.d.ts +1 -1
- package/lib/components/editors/TMFormulaEditor.js +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.js +1 -1
- package/lib/components/editors/TMLocalizedTextBox.js +1 -1
- package/lib/components/editors/TMMetadataValues.js +6 -6
- package/lib/components/editors/TMRadioButton.js +2 -2
- package/lib/components/editors/TMSummary.js +3 -3
- package/lib/components/editors/TMTextArea.js +3 -3
- package/lib/components/editors/TMTextBox.js +3 -3
- package/lib/components/editors/TMTextExpression.js +1 -1
- package/lib/components/features/archive/TMArchive.js +7 -2
- package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +29 -0
- package/lib/components/features/assistant/TMHelpOnLineChat.js +1384 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +4 -4
- package/lib/components/features/assistant/TMToppySpeechBubble.js +1 -1
- package/lib/components/features/assistant/dataset/Designer-Suggested-Questions.json +102 -0
- package/lib/components/features/assistant/dataset/Login-Suggested-Questions.json +32 -0
- package/lib/components/features/assistant/dataset/Surfer-Suggested-Questions.json +102 -0
- package/lib/components/features/documents/TMBatchUpdateForm.js +4 -5
- package/lib/components/features/documents/TMCopyToFolderForm.js +50 -42
- package/lib/components/features/documents/TMDcmtForm.js +53 -64
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +2 -2
- package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -3
- package/lib/components/features/documents/TMDcmtIcon.js +3 -5
- package/lib/components/features/documents/TMDcmtPreview.js +6 -4
- package/lib/components/features/documents/TMDcmtTasks.js +2 -9
- package/lib/components/features/documents/TMDownloadRelationViewerSection.js +1 -1
- package/lib/components/features/documents/TMFileUploader.js +7 -7
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +55 -130
- package/lib/components/features/documents/TMMasterInfoFields.js +4 -5
- package/lib/components/features/documents/TMMergeToPdfForm.js +56 -54
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +3 -6
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +1 -1
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +4 -4
- package/lib/components/features/documents/TMRelationViewer.d.ts +16 -9
- package/lib/components/features/documents/TMRelationViewer.js +240 -168
- package/lib/components/features/documents/copyAndMergeDcmtsShared.d.ts +1 -1
- package/lib/components/features/documents/relationTreeState.d.ts +32 -0
- package/lib/components/features/documents/relationTreeState.js +89 -0
- package/lib/components/features/search/TMMetadataOutputForm.js +1 -1
- package/lib/components/features/search/TMMetadataSorterForm.js +1 -1
- package/lib/components/features/search/TMSavedQuerySelector.js +2 -2
- package/lib/components/features/search/TMSearch.d.ts +1 -1
- package/lib/components/features/search/TMSearch.js +71 -12
- package/lib/components/features/search/TMSearchQueryEditor.js +2 -2
- package/lib/components/features/search/TMSearchQueryPanel.js +1 -5
- package/lib/components/features/search/TMSearchResult.d.ts +5 -0
- package/lib/components/features/search/TMSearchResult.js +34 -18
- package/lib/components/features/search/TMSignatureInfoContent.js +1 -1
- package/lib/components/features/search/TMTreeSelector.js +38 -36
- package/lib/components/features/search/TMViewHistoryDcmt.js +14 -25
- package/lib/components/features/tasks/TMTaskForm.js +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.js +3 -3
- package/lib/components/features/tasks/TMTasksAgenda.js +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.js +1 -1
- package/lib/components/features/tasks/TMTasksHeader.js +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.js +1 -1
- package/lib/components/features/tasks/TMTasksView.js +97 -102
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +92 -92
- package/lib/components/features/workflow/TMWorkflowPopup.js +2 -2
- package/lib/components/features/workflow/diagram/ConnectionComponent.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +1 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +1 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +4 -4
- package/lib/components/forms/Login/Menu.js +1 -1
- package/lib/components/forms/Login/OTPReader.js +1 -1
- package/lib/components/forms/Login/PasswordStrengthChecker.js +1 -1
- package/lib/components/forms/Login/RapidAccessLogin.js +2 -2
- package/lib/components/forms/Login/RecoverPasswordFlow.js +2 -2
- package/lib/components/forms/Login/SelectBox.js +1 -1
- package/lib/components/forms/Login/StepIndicator.js +1 -1
- package/lib/components/forms/Login/TMLoginForm.js +7 -7
- package/lib/components/forms/Login/TextBox.js +1 -1
- package/lib/components/forms/TMApplyForm.js +3 -3
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/forms/TMResultDialog.js +1 -1
- package/lib/components/forms/TMSaveForm.js +3 -3
- package/lib/components/grids/TMBlogAttachments.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +92 -96
- package/lib/components/grids/TMBlogsPostUtils.js +1 -1
- package/lib/components/grids/TMRecentsManager.js +4 -4
- package/lib/components/grids/TMValidationItemsList.js +1 -1
- package/lib/components/index.d.ts +6 -0
- package/lib/components/index.js +5 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +3 -3
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +1 -1
- package/lib/components/layout/panelManager/TMPanelWrapper.js +1 -1
- package/lib/components/pages/TMPage.js +30 -32
- package/lib/components/query/TMQueryCountButton.js +1 -1
- package/lib/components/query/TMQueryEditor.d.ts +3 -0
- package/lib/components/query/TMQueryEditor.js +9 -8
- package/lib/components/sidebar/TMCommandsPanel.js +1 -1
- package/lib/components/sidebar/TMHeader.d.ts +1 -0
- package/lib/components/sidebar/TMHeader.js +9 -9
- package/lib/components/sidebar/TMSidebar.js +1 -1
- package/lib/components/sidebar/TMSidebarItem.js +1 -1
- package/lib/components/viewers/TMMidViewer.js +2 -2
- package/lib/components/viewers/TMTidViewer.js +3 -3
- package/lib/components/wizard/TMStepIndicator.js +3 -3
- package/lib/helper/Enum_Localizator.d.ts +4 -4
- package/lib/helper/Enum_Localizator.js +1 -0
- package/lib/helper/Globalization.d.ts +1 -1
- package/lib/helper/SDKUI_Localizator.d.ts +736 -712
- package/lib/helper/SDKUI_Localizator.js +240 -0
- package/lib/helper/TMAppUpdatedModal.js +2 -2
- package/lib/helper/TMIcons.js +1 -3
- package/lib/helper/TMPdfViewer.js +1 -1
- package/lib/helper/TMToppyMessage.js +1 -1
- package/lib/helper/TMUtils.js +1 -1
- package/lib/helper/ZipManager.d.ts +1 -1
- package/lib/helper/ZipManager.js +2 -1
- package/lib/helper/checkinCheckoutManager.d.ts +1 -1
- package/lib/helper/checkinCheckoutManager.js +1 -1
- package/lib/helper/dcmtsHelper.d.ts +4 -2
- package/lib/helper/dcmtsHelper.js +3 -1
- package/lib/helper/helpers.d.ts +1 -1
- package/lib/helper/helpers.js +2 -2
- package/lib/hooks/tmDistinctValuesGridHelper.d.ts +1 -1
- package/lib/hooks/useCaseFlowApprove.d.ts +3 -3
- package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
- package/lib/hooks/useCheckInOutOperations.js +14 -34
- package/lib/hooks/useDcmtOperations.d.ts +3 -12
- package/lib/hooks/useDcmtOperations.js +187 -179
- package/lib/hooks/useDocumentOperations.d.ts +1 -0
- package/lib/hooks/useDocumentOperations.js +16 -27
- package/lib/hooks/useInputDialog.js +1 -1
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +1 -16
- package/lib/hooks/useMultiMasterDetailDcmts.js +65 -67
- package/lib/hooks/usePreventFileDrop.js +9 -0
- package/lib/hooks/useQueryParametersDialog.js +1 -1
- package/lib/hooks/useWorkflowApprove.js +33 -17
- package/lib/services/caseflow/CaseFlowService.d.ts +47 -6
- package/lib/services/caseflow/CaseFlowService.js +82 -14
- package/lib/services/platform_services.d.ts +4 -4
- package/package.json +9 -10
|
@@ -10,7 +10,8 @@ import { loadMessages } from 'devextreme/localization';
|
|
|
10
10
|
import { getFileManagerFolderColor, Globalization, IconAll, IconCloud, IconFolder, IconFolderForCSS, IconSelected, SDKUI_Localizator, svgToString } from '../../helper';
|
|
11
11
|
import { TMExceptionBoxManager } from './TMPopUp';
|
|
12
12
|
import ShowAlert from './TMAlert';
|
|
13
|
-
import
|
|
13
|
+
import TMLayoutContainer from './TMLayout';
|
|
14
|
+
import TMWaitPanelManager from './waitPanel/TMWaitPanelManager';
|
|
14
15
|
import TMCounterContainer, { CounterItemKey } from './TMCounterContainer';
|
|
15
16
|
import { IconPdf, IconTxt, IconXls, IconDocx, IconImage, IconZip, IconXml, IconMp4, IconEmail, IconPpt, IconSigned, IconExe, IconHtml, IconDwg, IconDicom, IconSlddrw } from '../../assets/thumbnails';
|
|
16
17
|
import styled from 'styled-components';
|
|
@@ -89,17 +90,6 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
89
90
|
const [counterValues, setCounterValues] = useState(new Map());
|
|
90
91
|
// State to maintain the selection mode (File System Item - right panel)
|
|
91
92
|
const [selectionMode, setSelectionMode] = useState('single');
|
|
92
|
-
/* State to manage the Wait Panel */
|
|
93
|
-
const [showWaitPanel, setShowWaitPanel] = useState(false);
|
|
94
|
-
const [waitPanelTitle, setWaitPanelTitle] = useState('');
|
|
95
|
-
const [showPrimary, setShowPrimary] = useState(false);
|
|
96
|
-
const [waitPanelTextPrimary, setWaitPanelTextPrimary] = useState('');
|
|
97
|
-
const [waitPanelValuePrimary, setWaitPanelValuePrimary] = useState(0);
|
|
98
|
-
const [waitPanelMaxValuePrimary, setWaitPanelMaxValuePrimary] = useState(0);
|
|
99
|
-
const [showSecondary, setShowSecondary] = useState(false);
|
|
100
|
-
const [waitPanelTextSecondary, setWaitPanelTextSecondary] = useState('');
|
|
101
|
-
const [waitPanelValueSecondary, setWaitPanelValueSecondary] = useState(0);
|
|
102
|
-
const [waitPanelMaxValueSecondary, setWaitPanelMaxValueSecondary] = useState(0);
|
|
103
93
|
// Timer ID to store reference for any scheduled operation
|
|
104
94
|
let timerId = null;
|
|
105
95
|
// Prefix for area folder names
|
|
@@ -430,44 +420,55 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
430
420
|
}
|
|
431
421
|
};
|
|
432
422
|
const downloadItems = async (items) => {
|
|
423
|
+
const files = items.filter(item => !item.isDirectory);
|
|
424
|
+
const isBatch = files.length > 1;
|
|
425
|
+
const waitPanel = TMWaitPanelManager.show({
|
|
426
|
+
title: "Download",
|
|
427
|
+
max: isBatch ? files.length : 0,
|
|
428
|
+
cancelable: true,
|
|
429
|
+
showCounters: false,
|
|
430
|
+
showSecondary: isBatch,
|
|
431
|
+
primaryLabel: isBatch ? 'File' : undefined,
|
|
432
|
+
secondaryLabel: isBatch ? 'File corrente' : undefined,
|
|
433
|
+
});
|
|
434
|
+
abortController = waitPanel.abortController;
|
|
435
|
+
const publishBytes = (loaded, total) => {
|
|
436
|
+
const text = total > 0
|
|
437
|
+
? `Downloading... ${Globalization.getNumberDisplayValue(loaded, true)} / ${Globalization.getNumberDisplayValue(total, true)}`
|
|
438
|
+
: '';
|
|
439
|
+
if (isBatch)
|
|
440
|
+
waitPanel.setSecondary({ value: loaded, max: total, text });
|
|
441
|
+
else
|
|
442
|
+
waitPanel.update({ value: loaded, max: total, subtitle: text });
|
|
443
|
+
};
|
|
444
|
+
// Un solo avviso per tutta l'operazione: con più file riporta quanti ne sono stati scaricati.
|
|
445
|
+
let downloaded = 0;
|
|
446
|
+
const showInterrupted = () => ShowAlert({
|
|
447
|
+
mode: 'warning',
|
|
448
|
+
title: "Download",
|
|
449
|
+
duration: 3000,
|
|
450
|
+
message: isBatch ? SDKUI_Localizator.DownloadInterruptedFiles.replaceParams(downloaded, files.length) : SDKUI_Localizator.DownloadInterrupted,
|
|
451
|
+
});
|
|
433
452
|
try {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
setWaitPanelTitle("Download");
|
|
438
|
-
abortController = new AbortController();
|
|
439
|
-
let i = 0;
|
|
440
|
-
setWaitPanelMaxValuePrimary(items.length);
|
|
441
|
-
let firstBlock = true;
|
|
442
|
-
let maxFileSize = 0;
|
|
443
|
-
for (const item of items) {
|
|
444
|
-
if (item.isDirectory)
|
|
445
|
-
continue;
|
|
446
|
-
if (abortController.signal.aborted) {
|
|
447
|
-
ShowAlert({ message: 'Operazione interrotta', mode: 'warning', title: "Download files", duration: 3000 });
|
|
453
|
+
for (const item of files) {
|
|
454
|
+
if (waitPanel.aborted) {
|
|
455
|
+
showInterrupted();
|
|
448
456
|
return;
|
|
449
457
|
}
|
|
450
|
-
|
|
458
|
+
if (isBatch)
|
|
459
|
+
waitPanel.setSubtitle(`Download ${item.name}`);
|
|
451
460
|
const ad = item.dataItem.dataItem;
|
|
452
461
|
const aid = ad?.id;
|
|
453
462
|
const subFolder = item.parentPath === ad.name ? '' : item.parentPath.replace(ad.name + '/', '');
|
|
454
463
|
const tms = props.tmSession ?? SDK_Globals.tmSession;
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
if (pd.ProgressBarValue === pd.ProgressBarMaximum) {
|
|
464
|
-
setWaitPanelMaxValueSecondary(0);
|
|
465
|
-
setWaitPanelValueSecondary(0);
|
|
466
|
-
setWaitPanelTextSecondary('');
|
|
467
|
-
firstBlock = true;
|
|
468
|
-
}
|
|
469
|
-
});
|
|
470
|
-
setWaitPanelValuePrimary(i + 1);
|
|
464
|
+
let file;
|
|
465
|
+
try {
|
|
466
|
+
file = await tms?.NewAreaEngine().RetrieveFileAsync(aid, subFolder, item.name, FileFormats.None, waitPanel.signal, (pd) => publishBytes(pd.ProgressBarValue, pd.ProgressBarMaximum ?? 0));
|
|
467
|
+
}
|
|
468
|
+
finally {
|
|
469
|
+
if (isBatch)
|
|
470
|
+
publishBytes(0, 0);
|
|
471
|
+
}
|
|
471
472
|
const fileURL = window.URL.createObjectURL(file);
|
|
472
473
|
const alink2 = document.createElement('a');
|
|
473
474
|
alink2.href = fileURL;
|
|
@@ -475,25 +476,22 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
475
476
|
alink2.target = "_blank";
|
|
476
477
|
alink2.rel = "noreferrer";
|
|
477
478
|
alink2.click();
|
|
478
|
-
|
|
479
|
+
downloaded++;
|
|
480
|
+
if (isBatch)
|
|
481
|
+
await waitPanel.step();
|
|
479
482
|
}
|
|
483
|
+
if (files.length > 0)
|
|
484
|
+
ShowAlert({ mode: 'success', message: SDKUI_Localizator.OperationSuccess, title: "Download", duration: 3000 });
|
|
480
485
|
}
|
|
481
486
|
catch (ex) {
|
|
482
487
|
const err = ex;
|
|
483
|
-
if (err.name === 'CanceledError')
|
|
484
|
-
|
|
485
|
-
}
|
|
488
|
+
if (waitPanel.aborted || err.name === 'CanceledError')
|
|
489
|
+
showInterrupted();
|
|
486
490
|
else
|
|
487
491
|
TMExceptionBoxManager.show({ exception: ex });
|
|
488
492
|
}
|
|
489
493
|
finally {
|
|
490
|
-
|
|
491
|
-
setWaitPanelMaxValuePrimary(0);
|
|
492
|
-
setWaitPanelValuePrimary(0);
|
|
493
|
-
setWaitPanelTextSecondary('');
|
|
494
|
-
setWaitPanelMaxValueSecondary(0);
|
|
495
|
-
setWaitPanelValueSecondary(0);
|
|
496
|
-
setShowWaitPanel(false);
|
|
494
|
+
waitPanel.close();
|
|
497
495
|
}
|
|
498
496
|
};
|
|
499
497
|
// Asynchronous function to retrieve the items in a given directory (parentDirectory)
|
|
@@ -767,7 +765,7 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
767
765
|
}
|
|
768
766
|
};
|
|
769
767
|
const folderColor = getFileManagerFolderColor(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER);
|
|
770
|
-
return (_jsx(
|
|
768
|
+
return (_jsx(TMLayoutContainer, { direction: 'vertical', children: _jsxs(StyledFileManagerWrapper, { $folderColor: folderColor, style: { width: "100%", height: "100%" }, children: [_jsxs(FileManager, { width: props.width, ref: fileManagerRef, height: `calc(${props.height} - 30px)`, onItemMoving: onItemCopying, onItemCopying: onItemCopying, onFileUploading: onFileUploading, fileSystemProvider: areaProvider, customizeThumbnail: customizeIcon, rootFolderName: SDK_Localizator.Areas, onSelectionChanged: onSelectionChanged, onDirectoryCreating: onDirectoryCreating, onFocusedItemChanged: onFocusedItemChanged, onSelectedFileOpened: onSelectedFileOpened, onContextMenuItemClick: onContextMenuItemClick,
|
|
771
769
|
/* onItemMoved={() => setCounter(counter => counter + 1)}
|
|
772
770
|
onItemCopied={() => setCounter(counter => counter + 1)}
|
|
773
771
|
onItemDeleted={() => setCounter(counter => counter - 1)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, forwardRef, useRef, useEffect } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import styled from 'styled-components';
|
|
@@ -287,7 +287,7 @@ const TMButton = forwardRef((props, ref) => {
|
|
|
287
287
|
return (_jsx(StyledIconButton, { ref: ref, color: color, caption: caption, disabled: disabled, fontSize: fontSize, padding: padding, onClick: onClick, onMouseDown: (e) => !disabled && onMouseDown?.(e), children: icon }));
|
|
288
288
|
}
|
|
289
289
|
else if (btnStyle === 'advanced') {
|
|
290
|
-
return (_jsxs(StyledAdvancedButton, { ref: ref,
|
|
290
|
+
return (_jsxs(StyledAdvancedButton, { ref: ref, $width: width ?? '90px', $height: height ?? '30px', onMouseOver: () => !disabled && setIsHovered(true), onMouseOut: () => setIsHovered(false), $isDisabled: disabled, $isPrimaryOutline: advancedType === 'primary' && (advancedColor === 'primaryOutline' || color === 'primaryOutline'), onClick: () => !disabled && onClick?.(), onMouseDown: (e) => !disabled && onMouseDown?.(e), children: [_jsx(StyledAdvancedButtonIcon, { $color: advancedColor, $isVisible: isHovered, $isDisabled: disabled, $type: advancedType, children: icon }), _jsx(StyledAdvancedButtonText, { $color: advancedColor, $isDisabled: disabled, $type: advancedType, $reserveArrow: hasSecondaryActions, children: caption })] }));
|
|
291
291
|
}
|
|
292
292
|
else {
|
|
293
293
|
return (_jsx(StyledTextButton, { ref: ref, color: color, caption: caption, disabled: disabled, fontSize: fontSize, onClick: onClick, onMouseDown: (e) => !disabled && onMouseDown?.(e), children: caption }));
|
|
@@ -296,12 +296,12 @@ const TMButton = forwardRef((props, ref) => {
|
|
|
296
296
|
const renderTooltip = () => {
|
|
297
297
|
return (showTooltip &&
|
|
298
298
|
_jsxs(_Fragment, { children: [caption &&
|
|
299
|
-
_jsx(StyledButtonTooltipHeader, {
|
|
299
|
+
_jsx(StyledButtonTooltipHeader, { $description: description, children: _jsx(StyledButtonTooltipItem, { $color: color, children: caption }) }), description && _jsx(StyledButtonTooltipItem, { children: description })] }));
|
|
300
300
|
};
|
|
301
301
|
const buttonWithTooltip = showTooltip
|
|
302
302
|
? _jsx(TMTooltip, { hideAfterDelay: true, content: renderTooltip(), children: renderedButton() })
|
|
303
303
|
: renderedButton();
|
|
304
|
-
const renderSplitButton = () => (_jsxs(StyledSplitContainer, { ref: splitContainerRef, children: [buttonWithTooltip, _jsx(StyledSplitArrow, { type: 'button',
|
|
304
|
+
const renderSplitButton = () => (_jsxs(StyledSplitContainer, { ref: splitContainerRef, children: [buttonWithTooltip, _jsx(StyledSplitArrow, { type: 'button', $isDisabled: disabled, $isOpen: isDropdownOpen, "aria-haspopup": 'menu', "aria-expanded": isDropdownOpen, onClick: (e) => { e.stopPropagation(); toggleDropdown(); }, onMouseDown: (e) => e.stopPropagation(), children: _jsx(IconChevronDown, { fontSize: 14 }) }), isDropdownOpen && createPortal(_jsx(StyledDropdown, { ref: dropdownRef, role: 'menu', $left: dropdownPos.left, $top: dropdownPos.top, $minWidth: dropdownPos.minWidth, children: secondaryActions.map((action, idx) => (_jsxs(StyledDropdownItem, { type: 'button', role: 'menuitem', $disabled: action.disabled, disabled: action.disabled, onClick: () => {
|
|
305
305
|
if (action.disabled)
|
|
306
306
|
return;
|
|
307
307
|
setIsDropdownOpen(false);
|
|
@@ -67,8 +67,8 @@ const TMClosableList = ({ dataSource, visibility = false, label, inline = false,
|
|
|
67
67
|
const renderedItems = () => {
|
|
68
68
|
return (dataSource.map((item, index) => (_jsx(StyledClosableItem, { children: item }, index))));
|
|
69
69
|
};
|
|
70
|
-
return (_jsxs(StyledClosableContainer, {
|
|
71
|
-
_jsxs(StyledClosableItems, {
|
|
72
|
-
_jsxs(StyledClosableItems, {
|
|
70
|
+
return (_jsxs(StyledClosableContainer, { $isMobile: devicrType === DeviceType.TABLET, $padding: hasPadding ? '5px' : '0', children: [_jsxs(StyledClosableContext, { children: [label && _jsxs(StyledClosableLabel, { $isMobile: devicrType === DeviceType.MOBILE, $inline: inline, children: [label, ":"] }), status ?
|
|
71
|
+
_jsxs(StyledClosableItems, { $isMobile: devicrType === DeviceType.MOBILE, $inline: inline, children: [" ", renderedItems(), " "] }) :
|
|
72
|
+
_jsxs(StyledClosableItems, { $isMobile: devicrType === DeviceType.MOBILE, $inline: inline, children: [" ", _jsxs(StyledClosableItem, { children: [" ", dataSource[0], " "] }), " "] })] }), dataSource.length > 1 && _jsxs(StyledClosabelIcon, { onClick: () => setStatus(!status), children: [!status && _jsxs(StyledClosableItemsCount, { children: [" (", _jsx("span", { children: "+" }), " ", dataSource.length - 1, " ", dataSource.length === 2 ? SDKUI_Localizator.OneMore : SDKUI_Localizator.More, ") "] }), !status ? _jsx(IconRight, { fontSize: 14 }) : _jsx(IconDown, { fontSize: 14 })] })] }));
|
|
73
73
|
};
|
|
74
74
|
export default TMClosableList;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState, useMemo } from 'react';
|
|
3
3
|
import TMModal from './TMModal';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
|
-
import { SDKUI_Localizator
|
|
5
|
+
import { SDKUI_Localizator } from '../..';
|
|
6
6
|
import { getButtonAttributes, getSelectedItem } from '../../helper/dcmtsHelper';
|
|
7
7
|
import { DeviceType, useDeviceType } from './TMDeviceProvider';
|
|
8
|
+
import TMWaitPanelManager from './waitPanel/TMWaitPanelManager';
|
|
8
9
|
const IframeContainer = styled.div `
|
|
9
10
|
display: flex;
|
|
10
11
|
height: 100%;
|
|
@@ -53,12 +54,6 @@ const TMCustomButton = (props) => {
|
|
|
53
54
|
const [loading, setLoading] = useState(true);
|
|
54
55
|
const [error, setError] = useState(false);
|
|
55
56
|
const itemsToProcess = useMemo(() => selectedItems && selectedItems.length > 0 ? selectedItems : [attributes], [selectedItems, attributes]);
|
|
56
|
-
// Stati per il wait panel
|
|
57
|
-
const [showWaitPanel, setShowWaitPanel] = useState(itemsToProcess.length > 0 && !RunOnce);
|
|
58
|
-
const [waitPanelText, setWaitPanelText] = useState(SDKUI_Localizator.CustomButtonActions.replaceParams(1, itemsToProcess.length));
|
|
59
|
-
const [waitPanelValue, setWaitPanelValue] = useState(0);
|
|
60
|
-
const [waitPanelMaxValue, setWaitPanelMaxValue] = useState(itemsToProcess.length);
|
|
61
|
-
const [abortController, setAbortController] = useState(undefined);
|
|
62
57
|
// Aggiungi timestamp all'URL per evitare cache
|
|
63
58
|
const iframeUrl = useMemo(() => {
|
|
64
59
|
if (!scriptUrl)
|
|
@@ -83,41 +78,45 @@ const TMCustomButton = (props) => {
|
|
|
83
78
|
setLoading(false);
|
|
84
79
|
setError(true);
|
|
85
80
|
};
|
|
86
|
-
const executeSequentially = async (
|
|
81
|
+
const executeSequentially = async () => {
|
|
87
82
|
if (!itemsToProcess)
|
|
88
83
|
return;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
84
|
+
const waitPanel = TMWaitPanelManager.show({
|
|
85
|
+
title: SDKUI_Localizator.CustomButtonAction,
|
|
86
|
+
max: itemsToProcess.length,
|
|
87
|
+
cancelable: true,
|
|
88
|
+
showCounters: false,
|
|
89
|
+
});
|
|
90
|
+
try {
|
|
91
|
+
for (const [index, item] of itemsToProcess.entries()) {
|
|
92
|
+
if (waitPanel.aborted)
|
|
93
|
+
break;
|
|
94
|
+
waitPanel.setSubtitle(SDKUI_Localizator.CustomButtonActions.replaceParams(index + 1, itemsToProcess.length));
|
|
95
|
+
// Attendi che l'iframe sia pronto e invia il messaggio
|
|
96
|
+
await new Promise((resolve) => {
|
|
97
|
+
const checkIframe = setInterval(() => {
|
|
98
|
+
if (iframeRef.current?.contentWindow) {
|
|
99
|
+
clearInterval(checkIframe);
|
|
100
|
+
if (selectedItems && selectedItems.length > 0) {
|
|
101
|
+
//devo convertire item in formData
|
|
102
|
+
const processedItem = getSelectedItem(args, formData, item);
|
|
103
|
+
postMessageIframe(processedItem);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
postMessageIframe(item);
|
|
107
|
+
}
|
|
108
|
+
// Attendi prima di passare al prossimo
|
|
109
|
+
setTimeout(resolve, 500);
|
|
106
110
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
}, 100);
|
|
117
|
-
});
|
|
111
|
+
}, 100);
|
|
112
|
+
});
|
|
113
|
+
await waitPanel.step();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
finally {
|
|
117
|
+
waitPanel.close();
|
|
118
|
+
onClose?.();
|
|
118
119
|
}
|
|
119
|
-
setShowWaitPanel(false);
|
|
120
|
-
onClose?.();
|
|
121
120
|
};
|
|
122
121
|
const postMessageIframe = (data) => {
|
|
123
122
|
console.log("TMCustomButton - postMessageIframe - data:", data);
|
|
@@ -130,14 +129,7 @@ const TMCustomButton = (props) => {
|
|
|
130
129
|
return;
|
|
131
130
|
if (!RunOnce && itemsToProcess.length > 0) {
|
|
132
131
|
// esegui per ogni item selezionato
|
|
133
|
-
|
|
134
|
-
controller.signal.addEventListener('abort', () => {
|
|
135
|
-
setShowWaitPanel(false);
|
|
136
|
-
onClose?.();
|
|
137
|
-
});
|
|
138
|
-
setAbortController(controller);
|
|
139
|
-
setWaitPanelMaxValue(itemsToProcess.length);
|
|
140
|
-
executeSequentially(controller);
|
|
132
|
+
executeSequentially();
|
|
141
133
|
}
|
|
142
134
|
else {
|
|
143
135
|
// Modalità RunOnce: invia dati all'iframe quando è caricato
|
|
@@ -157,6 +149,6 @@ const TMCustomButton = (props) => {
|
|
|
157
149
|
}
|
|
158
150
|
}, []);
|
|
159
151
|
const iframeContent = (_jsxs(IframeContainer, { style: !RunOnce ? { visibility: 'hidden' } : {}, children: [loading && _jsx(LoadingOverlay, {}), error && _jsx("div", { children: "Si \u00E8 verificato un errore nel caricamento del contenuto." }), !error && _jsx(StyledIframe, { ref: iframeRef, loading: 'lazy', onLoad: handleLoad, onError: handleError, src: iframeUrl })] }));
|
|
160
|
-
return isModal && RunOnce ? (_jsx(TMModal, { title: button.title, width: isMobile ? '95%' : '60%', height: isMobile ? '95%' : '70%', resizable: isMobile ? false : true, expandable: isMobile ? false : true, onClose: onClose, children: iframeContent })) : !RunOnce &&
|
|
152
|
+
return isModal && RunOnce ? (_jsx(TMModal, { title: button.title, width: isMobile ? '95%' : '60%', height: isMobile ? '95%' : '70%', resizable: isMobile ? false : true, expandable: isMobile ? false : true, onClose: onClose, children: iframeContent })) : !RunOnce && iframeContent;
|
|
161
153
|
};
|
|
162
154
|
export default TMCustomButton;
|
|
@@ -34,6 +34,8 @@ export interface TMDataGridProps<T> extends IDataGridOptions {
|
|
|
34
34
|
searchPanelToolbarPosition?: 'before' | 'default';
|
|
35
35
|
/** Trigger to set focus on SearchPanel (only if visible) - change the number to trigger focus */
|
|
36
36
|
searchPanelFocusTrigger?: number;
|
|
37
|
+
/** Riporta il fuoco nella casella di ricerca dopo che la griglia ha applicato il testo digitato, così si può continuare a scrivere */
|
|
38
|
+
keepSearchPanelFocus?: boolean;
|
|
37
39
|
/** Show the header filter */
|
|
38
40
|
showHeaderFilter?: boolean;
|
|
39
41
|
/** Show the filter panel */
|
|
@@ -19,11 +19,11 @@ const TMDataGrid = React.forwardRef((props, ref) => {
|
|
|
19
19
|
// main properties
|
|
20
20
|
keyExpr = 'id', dataSource, focusedRowEnabled = true, hoverStateEnabled = true, focusedRowKey, selectedRowKeys = [],
|
|
21
21
|
// custom options
|
|
22
|
-
dataColumns = [], pageSize = TMDataGridPageSize.Large, showHeaderFilter = true, showFilterPanel = true, showHeaderColumnChooser = false, showLoadPanel = true, showSearchPanel = true, searchPanelToolbarPosition = 'before', searchPanelFocusTrigger = 0, counterConfig = { show: false, items: new Map() }, compactPager = false, onHasFiltersChange, customContextMenuItems,
|
|
22
|
+
dataColumns = [], pageSize = TMDataGridPageSize.Large, showHeaderFilter = true, showFilterPanel = true, showHeaderColumnChooser = false, showLoadPanel = true, showSearchPanel = true, searchPanelToolbarPosition = 'before', searchPanelFocusTrigger = 0, keepSearchPanelFocus = true, counterConfig = { show: false, items: new Map() }, compactPager = false, onHasFiltersChange, customContextMenuItems,
|
|
23
23
|
// events and callbacks
|
|
24
24
|
onSelectionChanged, onFocusedRowChanged, onRowDblClick, onRowClick, onCellClick, onCellDblClick, onOptionChanged, onContentReady, onContextMenuPreparing, onInitialized, onEditorPreparing, onCellPrepared, onRowPrepared, onRowUpdating, onRowExpanded, onRowCollapsed, onRowUpdated, onSaved, onEditCanceled, onEditingStart, onEditingChange, customizeColumns, onKeyDown, scrolling = { mode: 'standard', useNative: SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar === 1 }, paging = { enabled: true, pageSize: pageSize }, pager = { visible: true, showInfo: true, showNavigationButtons: true }, selection = { mode: 'multiple', showCheckBoxesMode: "always", selectAllMode: "allPages" }, sorting, summary, stateStoring, grouping, groupPanel, filterRow, headerFilter, editing, rowDragging, masterDetail,
|
|
25
25
|
// other properties
|
|
26
|
-
disabled = false, autoNavigateToFocusedRow = true, columnResizingMode = 'widget', columnHidingEnabled = true, columnAutoWidth = true, allowColumnResizing = true, allowColumnReordering = true, showBorders = true, showRowLines = SDKUI_Globals.userSettings?.themeSettings.gridSettings.showRowLines === 1, showColumnLines = SDKUI_Globals.userSettings?.themeSettings.gridSettings.showColumnLines === 1, showColumnHeaders = true, rowAlternationEnabled = false, wordWrapEnabled = false, noDataText, columnMinWidth,
|
|
26
|
+
disabled = false, autoNavigateToFocusedRow = true, columnResizingMode = 'widget', columnHidingEnabled = true, columnAutoWidth = true, allowColumnResizing = true, allowColumnReordering = true, showBorders = true, showRowLines = SDKUI_Globals.userSettings?.themeSettings.gridSettings.showRowLines === 1, showColumnLines = SDKUI_Globals.userSettings?.themeSettings.gridSettings.showColumnLines === 1, showColumnHeaders = true, rowAlternationEnabled = false, repaintChangesOnly = false, wordWrapEnabled = false, noDataText, columnMinWidth,
|
|
27
27
|
// styles
|
|
28
28
|
id, width = '100%', height = '100%', } = props;
|
|
29
29
|
const internalRef = React.useRef(null);
|
|
@@ -42,6 +42,9 @@ const TMDataGrid = React.forwardRef((props, ref) => {
|
|
|
42
42
|
const gridContainerRef = useRef(null);
|
|
43
43
|
// Ref per evitare focus ripetuti sulla search panel
|
|
44
44
|
const searchPanelFocusedRef = useRef(false);
|
|
45
|
+
// true quando il testo è stato confermato mentre si stava scrivendo: il fuoco va rimesso nella casella
|
|
46
|
+
const restoreSearchPanelFocusRef = useRef(false);
|
|
47
|
+
const getSearchPanelInput = useCallback(() => internalRef.current?.instance().element().querySelector('.dx-datagrid-search-panel input'), []);
|
|
45
48
|
useEffect(() => {
|
|
46
49
|
const count = getRecordCount(dataSource);
|
|
47
50
|
setTotalRecordCount(count);
|
|
@@ -342,12 +345,33 @@ const TMDataGrid = React.forwardRef((props, ref) => {
|
|
|
342
345
|
}
|
|
343
346
|
}, 100);
|
|
344
347
|
}
|
|
345
|
-
|
|
348
|
+
/* Applicando il testo la griglia ricostruisce la propria barra di intestazione, e con essa la casella di
|
|
349
|
+
ricerca: senza rimettere il fuoco si dovrebbe cliccare di nuovo nella casella per continuare a scrivere.
|
|
350
|
+
Il rinvio serve ad agire sulla casella definitiva, non su quella che sta per essere sostituita. */
|
|
351
|
+
if (restoreSearchPanelFocusRef.current) {
|
|
352
|
+
restoreSearchPanelFocusRef.current = false;
|
|
353
|
+
setTimeout(() => {
|
|
354
|
+
const searchInput = getSearchPanelInput();
|
|
355
|
+
if (!searchInput || document.activeElement === searchInput)
|
|
356
|
+
return;
|
|
357
|
+
searchInput.focus();
|
|
358
|
+
// Il cursore va in fondo al testo già digitato: si continua a scrivere da dove si era rimasti
|
|
359
|
+
const caretPosition = searchInput.value.length;
|
|
360
|
+
searchInput.setSelectionRange(caretPosition, caretPosition);
|
|
361
|
+
}, 0);
|
|
362
|
+
}
|
|
363
|
+
}, [onContentReady, showSearchPanel, searchPanelFocusTrigger, getSearchPanelInput]);
|
|
346
364
|
const onOptionChangedCallback = useCallback((e) => {
|
|
347
365
|
// Assicurati che component esista
|
|
348
366
|
const grid = e.component;
|
|
349
367
|
if (!grid)
|
|
350
368
|
return;
|
|
369
|
+
// Il testo digitato viene confermato dopo una pausa: se il fuoco è ancora nella casella, va conservato.
|
|
370
|
+
// Senza la casella a video non c'è nulla da riportare a fuoco: il testo può cambiare solo da codice
|
|
371
|
+
if (keepSearchPanelFocus && showSearchPanel && e.fullName === 'searchPanel.text') {
|
|
372
|
+
const searchInput = getSearchPanelInput();
|
|
373
|
+
restoreSearchPanelFocusRef.current = !!searchInput && document.activeElement === searchInput;
|
|
374
|
+
}
|
|
351
375
|
// Controlla se il cambiamento riguarda i filtri
|
|
352
376
|
const isFilterChange = e.fullName === 'filterValue' || (e.fullName?.startsWith('columns') && e.fullName.endsWith('filterValues'));
|
|
353
377
|
if (isFilterChange) {
|
|
@@ -374,7 +398,11 @@ const TMDataGrid = React.forwardRef((props, ref) => {
|
|
|
374
398
|
}
|
|
375
399
|
// Propaga l'evento originale
|
|
376
400
|
onOptionChanged?.(e);
|
|
377
|
-
}, [onOptionChanged, onHasFiltersChange]);
|
|
401
|
+
}, [onOptionChanged, onHasFiltersChange, keepSearchPanelFocus, showSearchPanel, getSearchPanelInput]);
|
|
402
|
+
/* Ricreare questo oggetto a ogni render lo farebbe leggere come un cambiamento da devextreme-react, che confronta
|
|
403
|
+
le opzioni per riferimento: ogni cambio di headerFilter invalida la barra di intestazione della griglia, cioè
|
|
404
|
+
proprio dove sta la casella di ricerca. Tenendolo stabile la barra viene ricostruita solo quando serve davvero. */
|
|
405
|
+
const headerFilterSearch = useMemo(() => ({ enabled: true, ...headerFilter?.search }), [headerFilter?.search]);
|
|
378
406
|
// In modalità compatta il pager usa il displayMode 'compact' di DevExtreme (page numbers sostituiti da "pagina / totale"),
|
|
379
407
|
// salvo displayMode esplicito passato dal chiamante
|
|
380
408
|
const effectivePager = useMemo(() => {
|
|
@@ -382,20 +410,20 @@ const TMDataGrid = React.forwardRef((props, ref) => {
|
|
|
382
410
|
return pager;
|
|
383
411
|
return { ...pager, displayMode: pager.displayMode ?? 'compact' };
|
|
384
412
|
}, [pager, compactPager]);
|
|
385
|
-
return _jsxs(StyledDataGridContainer, {
|
|
413
|
+
return _jsxs(StyledDataGridContainer, { $compactPager: compactPager, style: { width: "100%", height: "100%" }, children: [_jsx(HeaderFilterMenuGlobalStyle, {}), _jsx("div", { ref: gridContainerRef, style: { width: "100%", height: counterConfig.show ? "calc(100% - 25px)" : "100%" }, children: _jsxs(DataGrid, { ref: internalRef, id: id, className: `tm-datagrid ${hasFilters ? 'has-filters' : ''}`,
|
|
386
414
|
// main properties
|
|
387
415
|
keyExpr: keyExpr, dataSource: dataSource, selectedRowKeys: selectedRowKeys, focusedRowEnabled: focusedRowEnabled, hoverStateEnabled: hoverStateEnabled,
|
|
388
416
|
// events and callbacks
|
|
389
417
|
onSelectionChanged: onSelectionChangedCallback, onRowDblClick: onRowDblClickCallback, onRowPrepared: onRowPrepared, onContextMenuPreparing: onContextMenuPreparingCallback, onToolbarPreparing: onToolbarPreparingCallback, onFocusedRowChanged: onFocusedRowChanged, onRowClick: onRowClick, onCellClick: onCellClick, onCellDblClick: onCellDblClick, onOptionChanged: onOptionChangedCallback, onContentReady: onContentReadyCallback, onInitialized: onInitialized, customizeColumns: customizeColumns, onEditorPreparing: onEditorPreparing, onCellPrepared: onCellPrepared, onRowUpdating: onRowUpdating, onRowExpanded: onRowExpanded, onRowCollapsed: onRowCollapsed, onRowUpdated: onRowUpdated, onSaved: onSaved, onEditCanceled: onEditCanceled, onEditingStart: onEditingStart, onEditingChange: onEditingChange, onKeyDown: onKeyDown,
|
|
390
418
|
// other properties
|
|
391
|
-
disabled: disabled, autoNavigateToFocusedRow: autoNavigateToFocusedRow, focusedRowKey: focusedRowKey, columnHidingEnabled: columnHidingEnabled, columnResizingMode: columnResizingMode, columnAutoWidth: columnAutoWidth, allowColumnResizing: allowColumnResizing, allowColumnReordering: allowColumnReordering, showBorders: showBorders, showRowLines: showRowLines, showColumnLines: showColumnLines, showColumnHeaders: showColumnHeaders, rowAlternationEnabled: rowAlternationEnabled, wordWrapEnabled: wordWrapEnabled, columnMinWidth: columnMinWidth, noDataText: noDataText,
|
|
419
|
+
disabled: disabled, autoNavigateToFocusedRow: autoNavigateToFocusedRow, focusedRowKey: focusedRowKey, columnHidingEnabled: columnHidingEnabled, columnResizingMode: columnResizingMode, columnAutoWidth: columnAutoWidth, allowColumnResizing: allowColumnResizing, allowColumnReordering: allowColumnReordering, showBorders: showBorders, showRowLines: showRowLines, showColumnLines: showColumnLines, showColumnHeaders: showColumnHeaders, rowAlternationEnabled: rowAlternationEnabled, repaintChangesOnly: repaintChangesOnly, wordWrapEnabled: wordWrapEnabled, columnMinWidth: columnMinWidth, noDataText: noDataText,
|
|
392
420
|
// styles
|
|
393
421
|
width: width, height: height, style: {
|
|
394
422
|
userSelect: 'none',
|
|
395
423
|
// Temporary: iOS-specific styles to prevent default long-press menu and text selection
|
|
396
424
|
WebkitTouchCallout: 'none',
|
|
397
425
|
WebkitUserSelect: 'none'
|
|
398
|
-
}, children: [dataColumns.map((column, index) => (_jsx(Column, { ...column, alignment: column.alignment ?? 'left' }, column.caption + index.toString()))), sorting && _jsx(Sorting, { ...sorting }), selection && _jsx(Selection, { ...selection }), scrolling && _jsx(Scrolling, { ...scrolling }), summary && _jsx(Summary, { ...summary }), showHeaderFilter && _jsx(HeaderFilter, { visible: true, ...headerFilter, search:
|
|
426
|
+
}, children: [dataColumns.map((column, index) => (_jsx(Column, { ...column, alignment: column.alignment ?? 'left' }, column.caption + index.toString()))), sorting && _jsx(Sorting, { ...sorting }), selection && _jsx(Selection, { ...selection }), scrolling && _jsx(Scrolling, { ...scrolling }), summary && _jsx(Summary, { ...summary }), showHeaderFilter && _jsx(HeaderFilter, { visible: true, ...headerFilter, search: headerFilterSearch }), rowDragging && _jsx(RowDragging, { ...rowDragging }), filterRow && _jsx(FilterRow, { ...filterRow }), showFilterPanel && _jsx(FilterPanel, { visible: true }), showHeaderColumnChooser && _jsxs(ColumnChooser, { height: "400px", enabled: !showHeaderColumnChooser, mode: "select", children: [_jsx(Position, { my: "center", at: "center", of: window }), _jsx(ColumnChooserSearch, { enabled: true }), _jsx(ColumnChooserSelection, { allowSelectAll: false, selectByClick: true, recursive: true })] }), stateStoring && _jsx(StateStoring, { ...stateStoring }), groupPanel && _jsx(GroupPanel, { ...groupPanel }), _jsx(Grouping, { contextMenuEnabled: true, ...grouping }), _jsx(LoadPanel, { enabled: showLoadPanel }), _jsx(SearchPanel, { visible: showSearchPanel, searchVisibleColumnsOnly: true, highlightSearchText: true }), editing && _jsx(Editing, { ...editing }), paging && _jsx(Paging, { ...paging }), effectivePager && _jsx(Pager, { ...effectivePager, visible: totalRecordCount > pageSize }), masterDetail && _jsx(MasterDetail, { ...masterDetail })] }) }), counterConfig.show && _jsx("div", { style: { width: "100%", height: "25px", display: "flex", alignItems: "center", gap: "15px", backgroundColor: "#e0e0e0" }, children: _jsx(TMCounterContainer, { items: counterValues, bgColorContainer: counterConfig.bgColorContainer, bgColorItem: counterConfig.bgColorItem, hoverColorItem: counterConfig.hoverColorItem, textColorItem: counterConfig.textColorItem }) }), customContextMenuItems && (_jsx(TMContextMenu, { target: ".dx-data-row", items: processCustomContextMenuItems(customContextMenuItems, customContextMenuRowKey), externalControl: {
|
|
399
427
|
visible: customContextMenuVisible,
|
|
400
428
|
position: customContextMenuPosition,
|
|
401
429
|
onClose: () => setCustomContextMenuVisible(false)
|
|
@@ -43,6 +43,6 @@ const TMDropDownMenu = forwardRef(({ content, items, disabled = false, color = T
|
|
|
43
43
|
submenu: item.items ? convertToContextMenuItems(item.items) : undefined,
|
|
44
44
|
}));
|
|
45
45
|
};
|
|
46
|
-
return (_jsx(TMContextMenu, { items: convertToContextMenuItems(items), trigger: "left", children: _jsx(StyledContent, { ref: dropDownMenuElementRef, tabIndex: disabled ? -1 : 0,
|
|
46
|
+
return (_jsx(TMContextMenu, { items: convertToContextMenuItems(items), trigger: "left", children: _jsx(StyledContent, { ref: dropDownMenuElementRef, tabIndex: disabled ? -1 : 0, $disabled: disabled, $color: color, $backgroundColor: backgroundColor, $borderRadius: borderRadius, children: content }) }));
|
|
47
47
|
});
|
|
48
48
|
export default TMDropDownMenu;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
3
|
import { getFileItemLinkUrl } from "./TMFileManagerUtils";
|
|
4
4
|
import { formatBytes, Globalization, renderHighlightedText, SDKUI_Localizator } from "../../helper";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
import { colors, getFileItemLinkUrl, TMFileItemContainer } from './TMFileManagerUtils';
|
|
4
4
|
import { formatBytes, Globalization, renderHighlightedText, SDKUI_Localizator } from '../../helper';
|
|
@@ -155,7 +155,7 @@ const TMFileManagerThumbnailItems = (props) => {
|
|
|
155
155
|
}
|
|
156
156
|
const editLockTooltipText = _jsxs(_Fragment, { children: [_jsxs("div", { style: { textAlign: "center" }, children: [editMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-edit" }), SDKUI_Localizator.CurrentUserExtract] })), lockMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-lock" }), SDKUI_Localizator.ExtractedFromOtherUser] }))] }), _jsx("hr", {}), _jsxs("div", { style: { textAlign: "left" }, children: [_jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedBy }), ": ", findCheckOutUserName(item) ?? '-', " (ID: ", item.checkOutUserID, ")"] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedOn }), ": ", Globalization.getDateTimeDisplayValue(item.checkoutDate?.toString())] })] }), _jsx("hr", {}), _jsx("ul", { children: _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Version }), ": ", item.version ?? 1] }) }), _jsx("hr", {}), _jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Extension }), ": ", item.ext] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.CreationTime }), ": ", Globalization.getDateTimeDisplayValue(item.creationTime?.toString())] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.LastUpdateTime }), ": ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime?.toString())] })] })] })] });
|
|
157
157
|
const tooltipContent = (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "ID:" }), " ", item.id ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "DID:" }), " ", item.did ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "TID:" }), " ", item.tid ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Name, ":"] }), " ", item.name ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Extension, ":"] }), " ", item.ext ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Author, ":"] }), " ", item.updaterName ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Version, ":"] }), " ", item.version] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Size, ":"] }), " ", formatBytes(item.size ?? 0)] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.CreationTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.creationTime)] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.LastUpdateTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime)] }), item.description && _jsxs(_Fragment, { children: [_jsx("hr", {}), _jsxs("div", { style: { maxWidth: '400px', overflowWrap: 'anywhere' }, children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Description, ":"] }), " ", item.description] })] })] }));
|
|
158
|
-
return _jsx(TMFileItemContainer, { className: "tm-file-manager-thumbnail-items", ref: containerRef, id: "tm-file-manager-thumbnail-item-" + item.id.toString(),
|
|
158
|
+
return _jsx(TMFileItemContainer, { className: "tm-file-manager-thumbnail-items", ref: containerRef, id: "tm-file-manager-thumbnail-item-" + item.id.toString(), $backgroundColor: bgColor, $bgHoverColor: bgHoverColor, $textColor: textColor, onDoubleClick: () => onDoubleClickHandler(item), onContextMenu: (e) => onContextMenu(e, item), onClick: (e) => onClickHandler(e, item), tabIndex: 0, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, children: _jsxs("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', width: '100%' }, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', flex: 1, minWidth: 0 }, children: [_jsxs("div", { style: { marginRight: '16px', flexShrink: 0, display: 'flex', flexDirection: 'column', alignItems: 'center' }, children: [_jsx("div", { style: { width: '40px' }, children: _jsx(TMDcmtIcon, { tid: item.tid, did: item.did, fileExtension: item.ext, downloadMode: getFileItemLinkUrl(item) !== undefined ? 'none' : 'openInNewWindow', tooltipContent: tooltipContent, isSigned: item.isSigned }) }), _jsxs("div", { style: { display: 'flex', justifyContent: 'center', width: '40px' }, children: [editMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: !isSelected ? colors.MEDIUM_GREEN : '#fff', fontWeight: "bold" }, className: "dx-icon-edit" }) }), lockMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: !isSelected ? colors.MEDIUM_GREEN : '#fff', fontWeight: "bold" }, className: "dx-icon-lock" }) })] })] }), _jsxs("div", { style: { overflow: 'hidden', minWidth: 0 }, children: [_jsx("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block', fontSize: '1rem', fontWeight: "bold" }, children: _jsx(TMTooltip, { parentStyle: { overflow: 'hidden' }, childStyle: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block' }, children: renderHighlightedText(item.name, searchText, isSelected) }) }), _jsx("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block', fontSize: 'calc(1rem - 1px)' }, children: formatBytes(item.size ?? 0) })] })] }), item.version && (_jsx("div", { style: { flexShrink: 0, marginLeft: '12px', whiteSpace: 'nowrap' }, children: _jsx(TMTooltip, { content: SDKUI_Localizator.Version, children: _jsx("div", { style: { border: "2px solid #28a745", backgroundColor: "#28a745", color: "#ffffff", borderRadius: '50%', width: '30px', height: '30px', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '12px', fontWeight: 'bold' }, children: item.version }) }) }))] }) }, "tm-file-manager-thumbnail-item-" + item.id);
|
|
159
159
|
}) });
|
|
160
160
|
};
|
|
161
161
|
export default TMFileManagerThumbnailItems;
|
|
@@ -22,10 +22,10 @@ declare const TMSplitterLayout: ({ animation, showSeparator, separatorColor, ove
|
|
|
22
22
|
animation?: boolean;
|
|
23
23
|
separatorColor?: string;
|
|
24
24
|
separatorActiveColor?: string;
|
|
25
|
-
overflow?:
|
|
25
|
+
overflow?: 'hidden' | 'visible';
|
|
26
26
|
showSeparator?: boolean;
|
|
27
27
|
separatorSize?: number;
|
|
28
|
-
direction?:
|
|
28
|
+
direction?: 'horizontal' | 'vertical';
|
|
29
29
|
children?: React.ReactNode;
|
|
30
30
|
start?: string[];
|
|
31
31
|
min?: string[];
|
|
@@ -51,7 +51,7 @@ const StyledCardContext = styled.div `
|
|
|
51
51
|
padding: ${props => props.$padding ? '5px' : '0'};
|
|
52
52
|
`;
|
|
53
53
|
const TMCard = ({ borderRadius = true, onClick, scrollX = false, scrollY = false, width = '100%', height = '100%', children, title = '', fontSize = FontSize.defaultFontSize, fontWeight, showBorder = true, padding = true, scroll = false, backgroundColor, color }) => {
|
|
54
|
-
return (_jsxs("div", { onClick: onClick, style: { width: width, height: height, fontSize: fontSize, overflow: 'hidden' }, children: [title.length > 0 && _jsx(StyledCardHeader, {
|
|
54
|
+
return (_jsxs("div", { onClick: onClick, style: { width: width, height: height, fontSize: fontSize, overflow: 'hidden' }, children: [title.length > 0 && _jsx(StyledCardHeader, { $borderRadius: borderRadius, $fontWeight: fontWeight, $backgroundColor: backgroundColor, $color: color, children: title }), _jsxs(StyledCardContext, { $scrollX: scrollX, $scrollY: scrollY, $scroll: scroll, $padding: padding, $showHeader: title.length > 0, style: { border: showBorder ? '2px solid #CAD9EB' : 'none', borderBottomLeftRadius: showBorder ? '3px' : '0', borderBottomRightRadius: showBorder ? '3px' : '0' }, children: [" ", children, " "] })] }));
|
|
55
55
|
};
|
|
56
56
|
const TMSplitterLayout = ({ animation = false, showSeparator = true, separatorColor = '#e4e4e4', overflow = 'hidden', separatorActiveColor = 'orange', separatorSize = 4, direction = 'horizontal', children, start = ['50%', '50%'], min = ['150px', '150px'], }) => {
|
|
57
57
|
function isReactFragment(variableToInspect) {
|
|
@@ -191,11 +191,11 @@ const TMSplitterLayout = ({ animation = false, showSeparator = true, separatorCo
|
|
|
191
191
|
return (_jsxs("div", { ref: containerRef, style: { display: 'flex', width: '100%', height: '100%', flexDirection: direction === 'vertical' ? 'column' : 'row', position: 'relative', }, children: [_jsxs("div", { style: { position: 'relative', transition: animation ? 'ease 300ms' : 'none', overflow: overflow, height: direction === 'vertical' ? start[0] : '100%', width: direction === 'horizontal' ? start[0] : '100%', minHeight: direction === 'vertical' ? min[0] : '100%', minWidth: direction === 'horizontal' ? min[0] : '100%', }, ref: firstDivRef, children: [" ", React.Children.toArray(children)[0], " ", isResizing && _jsx("div", { style: { position: 'absolute', top: '0px', left: '0px', zIndex: 1000, backgroundColor: 'transparent', width: '100%', height: '100%', pointerEvents: 'none' } }), " "] }), !isFrag && (_jsx("div", { ref: sepRef, style: { display: showSeparator ? 'block' : 'none', backgroundColor: separatorBgColor, cursor: direction === 'vertical' ? 's-resize' : 'e-resize', minWidth: direction === 'horizontal' ? `${separatorSize}px` : '100%', minHeight: direction === 'vertical' ? `${separatorSize}px` : '100%', } })), _jsxs("div", { style: { position: 'relative', transition: animation ? 'ease 300ms' : 'none', overflow: overflow, height: direction === 'vertical' ? start[1] : '100%', width: direction === 'horizontal' ? start[1] : '100%', minHeight: direction === 'vertical' ? min[1] : '100%', minWidth: direction === 'horizontal' ? min[1] : '100%', }, ref: secondDivRef, children: [" ", React.Children.toArray(children)[1], " ", isResizing && _jsx("div", { style: { position: 'absolute', top: '0px', left: '0px', zIndex: 1000, backgroundColor: 'transparent', width: '100%', height: '100%', pointerEvents: 'none' } }), " "] })] }));
|
|
192
192
|
};
|
|
193
193
|
const TMLayoutItem = ({ onClick, children, width = '100%', minWidth, maxWidth, maxHeight, height = '100%', minHeight }) => {
|
|
194
|
-
return (_jsx(StyledLayoutItem, { onClick: onClick,
|
|
194
|
+
return (_jsx(StyledLayoutItem, { onClick: onClick, $height: height, $maxHeight: maxHeight, $minHeight: minHeight, $width: width, $minWidth: minWidth, $maxWidth: maxWidth, children: children }));
|
|
195
195
|
};
|
|
196
196
|
const TMLayoutContainer = ({ gap = 3, onClick, justifyContent = 'flex-start', alignItems = 'flex-start', children, direction = 'vertical', onContextMenu }) => {
|
|
197
197
|
const renderedEls = () => { return (React.Children.map(children, child => (child))); };
|
|
198
|
-
return (_jsxs(StyledLayoutContainer, {
|
|
198
|
+
return (_jsxs(StyledLayoutContainer, { $alignItems: alignItems, $justifyContent: justifyContent, onClick: onClick, onContextMenu: onContextMenu, $direction: direction, style: { gap: gap }, children: [" ", renderedEls(), " "] }));
|
|
199
199
|
};
|
|
200
200
|
export { TMCard, TMLayoutItem, TMSplitterLayout };
|
|
201
201
|
export default TMLayoutContainer;
|
|
@@ -48,7 +48,7 @@ const TMList = ({ items }) => {
|
|
|
48
48
|
onClick(); // Call the item's onClick handler if provided
|
|
49
49
|
};
|
|
50
50
|
return (_jsx(StyledListContainer, { children: items?.map((item, index) => {
|
|
51
|
-
return (_jsxs(StyledListItem, {
|
|
51
|
+
return (_jsxs(StyledListItem, { $isSelected: selectedIndex === index, onClick: () => handleItemClick(index, item.onClick), children: [_jsx(StyledIconWrapper, { children: item.icon }), _jsx("span", { children: item.text })] }, index));
|
|
52
52
|
}) }));
|
|
53
53
|
};
|
|
54
54
|
export default TMList;
|