@topconsultnpm/sdkui-react 6.22.0-dev3.2 → 6.22.0-dev3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +43 -17
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +78 -19
- package/lib/components/base/Styled.d.ts +79 -27
- package/lib/components/base/Styled.js +7 -5
- package/lib/components/base/TMCounterBar.d.ts +2 -2
- package/lib/components/base/TMCounterContainer.d.ts +2 -1
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMDataGrid.d.ts +2 -0
- package/lib/components/base/TMDataGrid.js +34 -6
- package/lib/components/base/TMDataGridExportForm.d.ts +2 -1
- package/lib/components/base/TMFileManager.d.ts +2 -1
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -1
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
- package/lib/components/base/TMFileManagerUtils.d.ts +3 -1
- package/lib/components/base/TMLayout.d.ts +4 -4
- package/lib/components/base/TMList.d.ts +2 -1
- package/lib/components/base/TMListView.d.ts +1 -1
- package/lib/components/base/TMPanel.js +167 -167
- package/lib/components/base/TMSpinner.d.ts +2 -1
- package/lib/components/base/TMTab.d.ts +4 -3
- package/lib/components/base/TMTabControl.d.ts +106 -0
- package/lib/components/base/TMTabControl.js +664 -0
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTreeView.d.ts +13 -5
- package/lib/components/base/TMTreeView.js +19 -1
- package/lib/components/base/TMUserAvatar.d.ts +2 -1
- package/lib/components/base/TMVilViewer.d.ts +2 -1
- package/lib/components/base/TMWaitPanel.d.ts +3 -2
- package/lib/components/base/TMWaitPanel.js +1 -1
- package/lib/components/choosers/TMDistinctValues.js +27 -18
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +2 -1
- package/lib/components/choosers/TMQuickSearchInfo.d.ts +2 -1
- package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
- package/lib/components/choosers/TMUserChooser.d.ts +2 -2
- package/lib/components/editors/TMEditorStyled.d.ts +15 -5
- package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +2 -1
- package/lib/components/editors/TMHtmlEditor.d.ts +2 -1
- package/lib/components/editors/TMMetadataValues.js +5 -5
- package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
- package/lib/components/features/archive/TMArchive.js +7 -2
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -1
- package/lib/components/features/documents/TMCopyToFolderForm.js +18 -7
- package/lib/components/features/documents/TMDcmtForm.js +3 -2
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtIcon.d.ts +2 -1
- package/lib/components/features/documents/TMDcmtPreview.d.ts +7 -3
- package/lib/components/features/documents/TMDcmtTasks.d.ts +2 -1
- package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
- package/lib/components/features/documents/TMFileUploader.js +26 -26
- package/lib/components/features/documents/TMMasterDetailDcmts.js +40 -13
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +2 -1
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +2 -1
- package/lib/components/features/documents/TMMergeToPdfForm.js +8 -7
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +2 -1
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +13 -15
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +4 -4
- package/lib/components/features/documents/TMRelationViewer.d.ts +21 -3
- package/lib/components/features/documents/TMRelationViewer.js +140 -104
- package/lib/components/features/documents/relationTreeState.d.ts +32 -0
- package/lib/components/features/documents/relationTreeState.js +89 -0
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +2 -1
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +2 -1
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSearch.d.ts +1 -1
- package/lib/components/features/search/TMSearch.js +68 -9
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +9 -3
- package/lib/components/features/search/TMSearchResult.d.ts +5 -0
- package/lib/components/features/search/TMSearchResult.js +13 -4
- package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +2 -1
- package/lib/components/features/search/TMTreeSelector.js +37 -35
- package/lib/components/features/search/TMViewHistoryDcmt.d.ts +2 -1
- package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
- package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksView.js +6 -12
- package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +3 -2
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +8 -7
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +3 -1
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +3 -1
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- package/lib/components/forms/TMChooserForm.d.ts +2 -1
- package/lib/components/forms/TMResultDialog.js +1 -1
- package/lib/components/forms/TMSaveForm.d.ts +4 -4
- package/lib/components/grids/TMBlogAttachments.d.ts +2 -1
- package/lib/components/grids/TMBlogHeader.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.d.ts +1 -1
- package/lib/components/grids/TMBlogsPostUtils.d.ts +9 -9
- package/lib/components/grids/TMValidationItemsList.d.ts +2 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +2 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +4 -2
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
- package/lib/components/pages/TMPage.d.ts +1 -1
- package/lib/components/query/TMQueryEditor.d.ts +12 -4
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/sidebar/TMAboutApp.d.ts +2 -1
- package/lib/components/sidebar/TMCommandsPanel.d.ts +3 -1
- package/lib/components/sidebar/TMHeader.d.ts +3 -3
- package/lib/components/viewers/TMDataListItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +3 -2
- package/lib/components/viewers/TMMidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.d.ts +2 -2
- package/lib/helper/Enum_Localizator.js +1 -0
- package/lib/helper/SDKUI_Localizator.d.ts +6 -0
- package/lib/helper/SDKUI_Localizator.js +60 -0
- package/lib/helper/TMAppUpdatedModal.d.ts +2 -1
- package/lib/helper/TMAppUpdatedModal.js +93 -93
- package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
- package/lib/helper/TMIcons.d.ts +280 -280
- package/lib/helper/TMPdfViewer.d.ts +2 -1
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +10 -4
- package/lib/helper/helpers.d.ts +1 -1
- package/lib/hooks/useDcmtOperations.js +94 -56
- package/lib/hooks/useDocumentOperations.d.ts +1 -0
- package/lib/hooks/useDocumentOperations.js +2 -2
- package/lib/hooks/useInputDialog.d.ts +2 -1
- package/lib/hooks/usePreventFileDrop.js +9 -0
- package/lib/services/caseflow/CaseFlowService.d.ts +32 -1
- package/lib/services/caseflow/CaseFlowService.js +58 -1
- package/lib/services/platform_services.d.ts +3 -2
- package/package.json +22 -22
|
@@ -29,11 +29,19 @@ interface ITMTreeViewProps {
|
|
|
29
29
|
showLoadMoreButton?: boolean;
|
|
30
30
|
enableVirtualization?: boolean;
|
|
31
31
|
}
|
|
32
|
-
declare const TMTreeView: ({ dataSource, focusedItem, selectedItems, allowMultipleSelection, onDataChanged, calculateItemsForNode, itemRender, onNodeUpdate, onFocusedItemChanged, onSelectionChanged, shouldDelayFocusOnEvent, onItemContextMenu, autoSelectChildren, itemsPerPage, showLoadMoreButton, enableVirtualization }: ITMTreeViewProps) =>
|
|
32
|
+
declare const TMTreeView: ({ dataSource, focusedItem, selectedItems, allowMultipleSelection, onDataChanged, calculateItemsForNode, itemRender, onNodeUpdate, onFocusedItemChanged, onSelectionChanged, shouldDelayFocusOnEvent, onItemContextMenu, autoSelectChildren, itemsPerPage, showLoadMoreButton, enableVirtualization }: ITMTreeViewProps) => React.JSX.Element;
|
|
33
33
|
export default TMTreeView;
|
|
34
|
-
export declare const StyledTreeContainer: import("styled-components/dist/types").IStyledComponentBase<"web",
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
export declare const StyledTreeContainer: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
35
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
36
|
+
}> & string;
|
|
37
|
+
export declare const StyledItemContent: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
38
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
39
|
+
}> & string;
|
|
40
|
+
export declare const StyledTreeNode: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
41
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
42
|
+
}, {
|
|
37
43
|
$isSelected?: boolean;
|
|
38
44
|
}>> & string;
|
|
39
|
-
export declare const StyledStickyPaginator: import("styled-components/dist/types").IStyledComponentBase<"web",
|
|
45
|
+
export declare const StyledStickyPaginator: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
46
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
47
|
+
}> & string;
|
|
@@ -147,15 +147,26 @@ const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMul
|
|
|
147
147
|
return [];
|
|
148
148
|
return flattenTreeWithDepth(dataSource);
|
|
149
149
|
}, [enableVirtualization, dataSource, flattenTreeWithDepth]);
|
|
150
|
+
// Chiave dell'ultimo elemento verso cui si è effettivamente scrollato.
|
|
151
|
+
// Evita di ripetere lo scroll quando cambia solo la struttura dell'albero
|
|
152
|
+
// (es. espansione di un nodo) a parità di elemento focalizzato.
|
|
153
|
+
const lastScrolledKeyRef = useRef(undefined);
|
|
150
154
|
// Scroll verso l'elemento focalizzato quando cambia (navigazione con frecce)
|
|
151
155
|
useEffect(() => {
|
|
152
|
-
if (!focusedItem?.key)
|
|
156
|
+
if (!focusedItem?.key) {
|
|
157
|
+
lastScrolledKeyRef.current = undefined;
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
// Focus invariato: l'effect è stato rieseguito solo perché l'albero è cambiato
|
|
161
|
+
// (espansione/collasso di un nodo). La posizione di scroll non va toccata.
|
|
162
|
+
if (lastScrolledKeyRef.current === focusedItem.key)
|
|
153
163
|
return;
|
|
154
164
|
if (enableVirtualization) {
|
|
155
165
|
// Lista virtualizzata: usa scrollToRow per garantire che l'elemento sia visibile
|
|
156
166
|
const index = flattenedItems.findIndex(item => item.node.key === focusedItem.key);
|
|
157
167
|
if (index >= 0 && listRef.current) {
|
|
158
168
|
listRef.current.scrollToRow({ index, align: 'smart' });
|
|
169
|
+
lastScrolledKeyRef.current = focusedItem.key;
|
|
159
170
|
}
|
|
160
171
|
}
|
|
161
172
|
else {
|
|
@@ -164,6 +175,7 @@ const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMul
|
|
|
164
175
|
const element = containerRef.current.querySelector(`[data-node-key="${focusedItem.key}"]`);
|
|
165
176
|
if (element) {
|
|
166
177
|
element.scrollIntoView({ block: 'nearest', inline: 'nearest' });
|
|
178
|
+
lastScrolledKeyRef.current = focusedItem.key;
|
|
167
179
|
}
|
|
168
180
|
}
|
|
169
181
|
}
|
|
@@ -447,6 +459,12 @@ const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMul
|
|
|
447
459
|
return selectedCount > 0 && selectedCount < childKeys.length;
|
|
448
460
|
}, [flattenTree]);
|
|
449
461
|
const hasVisibleItems = useCallback((node) => {
|
|
462
|
+
// Nodo già caricato: conta i figli visibili (isExpandible è solo una stima a priori)
|
|
463
|
+
if (node.isLoaded) {
|
|
464
|
+
if (!node.items)
|
|
465
|
+
return false;
|
|
466
|
+
return node.items.filter(o => !o.hidden).length > 0;
|
|
467
|
+
}
|
|
450
468
|
// If node has explicit isExpandible value, use that
|
|
451
469
|
if (node.isExpandible !== undefined) {
|
|
452
470
|
return node.isExpandible;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface TMUserAvatarProps {
|
|
2
3
|
displayName: string;
|
|
3
4
|
nameForColorCalculation: string;
|
|
4
5
|
tooltipName?: string;
|
|
5
6
|
returnType?: 'jsx' | 'svg';
|
|
6
7
|
}
|
|
7
|
-
declare const TMUserAvatar: (props: TMUserAvatarProps) => string |
|
|
8
|
+
declare const TMUserAvatar: (props: TMUserAvatarProps) => string | React.JSX.Element;
|
|
8
9
|
export default TMUserAvatar;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
2
3
|
declare const TMVilViewer: ({ vil }: {
|
|
3
4
|
vil?: ValidationItem[];
|
|
4
|
-
}) =>
|
|
5
|
+
}) => React.JSX.Element | null;
|
|
5
6
|
export default TMVilViewer;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { ITMLayoutContainerProps } from './TMLayout';
|
|
2
3
|
interface ITMWaitPanelProps {
|
|
3
4
|
title?: string;
|
|
@@ -14,7 +15,7 @@ interface ITMWaitPanelProps {
|
|
|
14
15
|
onAbortClick?: (abortController: AbortController | undefined) => void;
|
|
15
16
|
useHighZIndex?: boolean;
|
|
16
17
|
}
|
|
17
|
-
export declare const TMWaitPanel: (props: ITMWaitPanelProps) =>
|
|
18
|
+
export declare const TMWaitPanel: (props: ITMWaitPanelProps) => React.JSX.Element;
|
|
18
19
|
interface ITMLayoutWaitingContainerProps extends ITMLayoutContainerProps {
|
|
19
20
|
showWaitPanel?: boolean;
|
|
20
21
|
waitPanelTitle?: string;
|
|
@@ -30,5 +31,5 @@ interface ITMLayoutWaitingContainerProps extends ITMLayoutContainerProps {
|
|
|
30
31
|
abortController?: AbortController;
|
|
31
32
|
usePortal?: boolean;
|
|
32
33
|
}
|
|
33
|
-
export declare const TMLayoutWaitingContainer: ({ showWaitPanel, showWaitPanelPrimary, showWaitPanelSecondary, waitPanelTitle, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, isCancelable, abortController, usePortal, gap, onClick, justifyContent, alignItems, children, direction }: ITMLayoutWaitingContainerProps) =>
|
|
34
|
+
export declare const TMLayoutWaitingContainer: ({ showWaitPanel, showWaitPanelPrimary, showWaitPanelSecondary, waitPanelTitle, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, isCancelable, abortController, usePortal, gap, onClick, justifyContent, alignItems, children, direction }: ITMLayoutWaitingContainerProps) => React.JSX.Element;
|
|
34
35
|
export {};
|
|
@@ -34,7 +34,7 @@ const StyledTitle = styled.h2 ` margin: 0; font-size: 1.5em; color: #333; `;
|
|
|
34
34
|
const StyledProgressBarContainer = styled.div ` width: 100%; height: 20px; background: #e0e0e0; border-radius: 10px; overflow: hidden; margin: 20px 0; `;
|
|
35
35
|
const StyledProgressBar = styled.div ` height: 100%; background: #4caf50; transition: width 0.3s ease; `;
|
|
36
36
|
const StyledProgressText = styled.p ` font-weight: bold; color: #333; margin: 0; `;
|
|
37
|
-
const StyledMessage = styled.p ` color: #666; font-size: 0.9em; margin-top: 10px; `;
|
|
37
|
+
const StyledMessage = styled.p ` color: #666; font-size: 0.9em; margin-top: 10px; white-space: pre-line; `;
|
|
38
38
|
const StyledAbortButton = styled.button ` background: #ff4d4d; color: white; border: none; border-radius: 5px; padding: 10px 20px; font-size: 1em; cursor: pointer; margin-top: 20px; &:hover { background: #ff6666; } `;
|
|
39
39
|
export const TMWaitPanel = (props) => {
|
|
40
40
|
const { title, showPrimary, textPrimary, valuePrimary, maxValuePrimary, showSecondary, textSecondary, valueSecondary, maxValueSecondary, isCancelable, abortController, onAbortClick, useHighZIndex } = props;
|
|
@@ -2,7 +2,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
3
|
import { LayoutModes, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
|
-
import { calcResponsiveSizes, IconAll, IconDelete, IconPencil, IconRefresh, SDKUI_Localizator } from '../../helper';
|
|
5
|
+
import { calcResponsiveSizes, IconAll, IconDelete, IconPencil, IconRefresh, IconSelected, SDKUI_Localizator } from '../../helper';
|
|
6
6
|
import TMButton from '../base/TMButton';
|
|
7
7
|
import TMDataGrid from '../base/TMDataGrid';
|
|
8
8
|
import { CounterItemKey } from '../base/TMCounterContainer';
|
|
@@ -56,6 +56,7 @@ const StyledGridContainer = styled.div `
|
|
|
56
56
|
font-weight: 600;
|
|
57
57
|
}
|
|
58
58
|
`;
|
|
59
|
+
const NO_SELECTED_ROW_KEYS = [];
|
|
59
60
|
/* Quota di larghezza attribuita a ciascuna colonna della griglia, oltre a una base fissa per la barra dei comandi.
|
|
60
61
|
I limiti evitano i due estremi: sotto il 40% la barra dei comandi diventa illeggibile, oltre il 95% il modale esce dallo schermo */
|
|
61
62
|
const QUICK_SEARCH_BASE_WIDTH_PERC = 16;
|
|
@@ -110,23 +111,31 @@ const TMDistinctValues = ({ tid, mid, layoutMode = LayoutModes.None, allowAppend
|
|
|
110
111
|
const isGridReady = !isQuickSearchGridVisible || quickSearch.columns.length > 0;
|
|
111
112
|
const counterConfig = useMemo(() => {
|
|
112
113
|
const counts = isQuickSearchGridVisible ? quickSearch.counts : distinctValues.counts;
|
|
114
|
+
const items = new Map([
|
|
115
|
+
[CounterItemKey.selectedItems, {
|
|
116
|
+
key: CounterItemKey.selectedItems,
|
|
117
|
+
show: true,
|
|
118
|
+
caption: SDKUI_Localizator.SelectedItems,
|
|
119
|
+
value: selection.selectedValues.length,
|
|
120
|
+
icon: _jsx(IconSelected, {}),
|
|
121
|
+
order: 1
|
|
122
|
+
}]
|
|
123
|
+
]);
|
|
113
124
|
// Senza il totale resta il conteggio predefinito della griglia: un rapporto con totale a zero sarebbe fuorviante
|
|
114
|
-
if (
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
};
|
|
129
|
-
}, [isQuickSearchGridVisible, quickSearch.counts, distinctValues.counts]);
|
|
125
|
+
if (counts?.found) {
|
|
126
|
+
items.set(CounterItemKey.allItems, {
|
|
127
|
+
key: CounterItemKey.allItems,
|
|
128
|
+
show: true,
|
|
129
|
+
caption: `${counts.returned} restituiti su ${counts.found} trovati`,
|
|
130
|
+
value: `${counts.returned}/${counts.found}`,
|
|
131
|
+
icon: _jsx(IconAll, {}),
|
|
132
|
+
order: -1
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
return { show: true, items: items };
|
|
136
|
+
}, [isQuickSearchGridVisible, quickSearch.counts, distinctValues.counts, selection.selectedValues]);
|
|
137
|
+
// Configurazione fissa: dal pannello si preleva un valore per volta, le caselle di selezione non servono
|
|
138
|
+
const gridSelection = useMemo(() => ({ showCheckBoxesMode: 'none' }), []);
|
|
130
139
|
const modeDataSource = useMemo(() => ([
|
|
131
140
|
{ value: DistinctValuesModes.DistinctValues, display: SDKUI_Localizator.DistinctValues },
|
|
132
141
|
{ value: DistinctValuesModes.QuickSearch, display: SDK_Localizator.SavedQuery },
|
|
@@ -151,7 +160,7 @@ const TMDistinctValues = ({ tid, mid, layoutMode = LayoutModes.None, allowAppend
|
|
|
151
160
|
_jsx(TMButton, { btnStyle: 'toolbar', color: 'error', caption: SDKUI_Localizator.Delete, icon: _jsx(IconDelete, {}), onClick: quickSearch.onDeleteSettingsClick }), _jsx(TMButton, { btnStyle: 'toolbar', caption: SDKUI_Localizator.Refresh, icon: _jsx(IconRefresh, {}), onClick: () => refreshAsync() }), selection.isAppendVisible && _jsxs(StyledAppendBar, { children: [_jsx(TMCheckBox, { label: 'Accoda e separa con', value: selection.isAppendMode, onValueChanged: selection.onAppendModeChanged }), _jsx(TMTextBox, { width: '30px', readOnly: true, disabled: !selection.isAppendMode, value: separator })] })] }) }), _jsx(TMSelectedValuesSummary, { items: selection.selectedValues, onRemove: selection.onRemoveSelectedValue, onClear: selection.onClearSelectedValues }), _jsx(StyledGridContainer, { children: isGridReady && _jsx(TMDataGrid
|
|
152
161
|
/* Le due modalità hanno colonne del tutto diverse: ognuna ha la propria istanza di griglia.
|
|
153
162
|
Nei valori distinti l'intestazione è il nome del metadato, che arriva insieme al primo caricamento */
|
|
154
|
-
, { focusedRowKey: selection.focusedItem ? selection.focusedItem.rowIndex : undefined, selection:
|
|
163
|
+
, { focusedRowKey: selection.focusedItem ? selection.focusedItem.rowIndex : undefined, selection: gridSelection, selectedRowKeys: NO_SELECTED_ROW_KEYS, searchPanel: { highlightCaseSensitive: true, visible: true }, searchPanelFocusTrigger: 1, dataColumns: isQuickSearchGridVisible ? quickSearch.columns : distinctValues.columns, dataSource: isQuickSearchGridVisible ? quickSearch.dataSource : distinctValues.dataSource, customizeColumns: isQuickSearchGridVisible ? quickSearch.customizeColumns : distinctValues.customizeColumns, keyExpr: 'rowIndex', height: 'calc(100%)', showHeaderColumnChooser: true, onFocusedRowChanged: selection.onFocusedRowChanged, onRowDblClick: () => onClosePanelCallback?.(), counterConfig: counterConfig }, isQuickSearchGridVisible ? 'quickSearch' : `distinctValues_${distinctValues.md?.id ?? 0}`) })] }));
|
|
155
164
|
};
|
|
156
165
|
return (_jsxs(_Fragment, { children: [isModal
|
|
157
166
|
? isModalReady && _jsx(TMModal, { title: panelTitle, width: isQuickSearchGridVisible ? calcResponsiveSizes(deviceType, quickSearchModalWidth ?? calcQuickSearchModalWidth(0), '95%', '95%') : calcResponsiveSizes(deviceType, '700px', '95%', '95%'), height: isQuickSearchGridVisible ? '95%' : calcResponsiveSizes(deviceType, '600px', '95%', '95%'), resizable: true, expandable: true, onClose: onClosePanelCallback, children: renderContent() }, isQuickSearchGridVisible ? 'quickSearch' : 'distinctValues')
|
|
@@ -41,4 +41,4 @@ interface ITMDynDataListItemChooserFormProps extends ITMChooserFormProps<DataLis
|
|
|
41
41
|
/** Se presente, sono i parametri da passare alla query per recuperare il dataSource */
|
|
42
42
|
queryParamsDynDataList?: string[];
|
|
43
43
|
}
|
|
44
|
-
export declare const TMDynDataListItemChooserForm: (props: ITMDynDataListItemChooserFormProps) =>
|
|
44
|
+
export declare const TMDynDataListItemChooserForm: (props: ITMDynDataListItemChooserFormProps) => React.JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { InvoiceRetrieveFormats } from '@topconsultnpm/sdk-ts';
|
|
2
3
|
import { ITMEnumDataBinding } from '../../ts';
|
|
3
|
-
declare const TMInvoiceRetrieveFormats: ({ value, valueOrig, onValueChanged, valuesToExclude, label, width }: ITMEnumDataBinding<InvoiceRetrieveFormats>) =>
|
|
4
|
+
declare const TMInvoiceRetrieveFormats: ({ value, valueOrig, onValueChanged, valuesToExclude, label, width }: ITMEnumDataBinding<InvoiceRetrieveFormats>) => React.JSX.Element;
|
|
4
5
|
export default TMInvoiceRetrieveFormats;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { OrderRetrieveFormats } from '@topconsultnpm/sdk-ts';
|
|
2
3
|
import { ITMEnumDataBinding } from '../../ts';
|
|
3
|
-
declare const TMOrderRetrieveFormats: ({ value, valueOrig, onValueChanged, valuesToExclude, label, width }: ITMEnumDataBinding<OrderRetrieveFormats>) =>
|
|
4
|
+
declare const TMOrderRetrieveFormats: ({ value, valueOrig, onValueChanged, valuesToExclude, label, width }: ITMEnumDataBinding<OrderRetrieveFormats>) => React.JSX.Element;
|
|
4
5
|
export default TMOrderRetrieveFormats;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { TMEditorButtonData } from '../base/TMEditorBase';
|
|
2
3
|
interface ITMQuickSearchInfo {
|
|
3
4
|
/** Tipo documento della ricerca rapida: serve a ricostruire la ricerca di sistema con tutti i documenti */
|
|
@@ -7,6 +8,6 @@ interface ITMQuickSearchInfo {
|
|
|
7
8
|
}
|
|
8
9
|
export declare const useTMQuickSearchInfo: ({ tid, sqdId }: ITMQuickSearchInfo) => {
|
|
9
10
|
infoButton: TMEditorButtonData | undefined;
|
|
10
|
-
detailForm:
|
|
11
|
+
detailForm: React.JSX.Element | null;
|
|
11
12
|
};
|
|
12
13
|
export {};
|
|
@@ -19,13 +19,13 @@ export declare const TMRelationIdViewer: ({ relationType, relationId, showIcon,
|
|
|
19
19
|
relationId?: number;
|
|
20
20
|
showIcon?: boolean;
|
|
21
21
|
noneSelectionText?: string;
|
|
22
|
-
}) =>
|
|
22
|
+
}) => React.JSX.Element;
|
|
23
23
|
export declare const TMRelationIcon: ({ rd, relationType }: {
|
|
24
24
|
rd: RelationDescriptor | undefined;
|
|
25
25
|
relationType?: RelationTypes;
|
|
26
|
-
}) =>
|
|
26
|
+
}) => React.JSX.Element;
|
|
27
27
|
export declare const TMRelationTooltip: ({ rd, relationType, children }: {
|
|
28
28
|
rd?: RelationDescriptor;
|
|
29
29
|
relationType: RelationTypes | undefined;
|
|
30
30
|
children: React.ReactNode;
|
|
31
|
-
}) =>
|
|
31
|
+
}) => React.JSX.Element;
|
|
@@ -38,8 +38,8 @@ interface ITMUserChooserFormProps extends ITMChooserFormProps<UserDescriptor> {
|
|
|
38
38
|
export declare const TMUserChooserForm: React.FunctionComponent<ITMUserChooserFormProps>;
|
|
39
39
|
export declare const TMUserIcon: ({ ud }: {
|
|
40
40
|
ud?: UserDescriptor;
|
|
41
|
-
}) =>
|
|
41
|
+
}) => React.JSX.Element | null;
|
|
42
42
|
export declare const TMUserTooltip: ({ ud, children }: {
|
|
43
43
|
ud?: UserDescriptor;
|
|
44
44
|
children: React.ReactNode;
|
|
45
|
-
}) =>
|
|
45
|
+
}) => React.JSX.Element;
|
|
@@ -2,10 +2,14 @@ import { ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
|
2
2
|
export declare const TMEditorsDefaultBorderRadius = "5px";
|
|
3
3
|
export declare const TMEditorsDefaultLabelFontSize = "0.9rem";
|
|
4
4
|
export declare const editorColorManager: (validationItems: ValidationItem[]) => string;
|
|
5
|
-
export declare const StyledEditorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").
|
|
5
|
+
export declare const StyledEditorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
6
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
7
|
+
}, {
|
|
6
8
|
$width: string;
|
|
7
9
|
}>> & string;
|
|
8
|
-
export declare const StyledEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").
|
|
10
|
+
export declare const StyledEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "style"> & {
|
|
11
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
12
|
+
}, {
|
|
9
13
|
$vil: ValidationItem[];
|
|
10
14
|
$width: string;
|
|
11
15
|
$type: string;
|
|
@@ -16,19 +20,25 @@ export declare const StyledEditor: import("styled-components/dist/types").IStyle
|
|
|
16
20
|
$isMobile?: boolean;
|
|
17
21
|
$borderRadius?: string;
|
|
18
22
|
}>> & string;
|
|
19
|
-
export declare const StyledEditorIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").
|
|
23
|
+
export declare const StyledEditorIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
24
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
25
|
+
}, {
|
|
20
26
|
$vil: ValidationItem[];
|
|
21
27
|
$disabled: boolean;
|
|
22
28
|
$isModified: boolean;
|
|
23
29
|
}>> & string;
|
|
24
|
-
export declare const StyledEditorLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").
|
|
30
|
+
export declare const StyledEditorLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
31
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
32
|
+
}, {
|
|
25
33
|
$isFocused: boolean;
|
|
26
34
|
$labelPosition: 'right' | 'left' | 'top';
|
|
27
35
|
$disabled: boolean;
|
|
28
36
|
$fontSize?: string;
|
|
29
37
|
$color?: string;
|
|
30
38
|
}>> & string;
|
|
31
|
-
export declare const StyledTextareaEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").
|
|
39
|
+
export declare const StyledTextareaEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "style"> & {
|
|
40
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
41
|
+
}, {
|
|
32
42
|
$vil: ValidationItem[];
|
|
33
43
|
$width: string;
|
|
34
44
|
$isModified: boolean;
|
|
@@ -30,7 +30,7 @@ export declare class FormulaDescriptor {
|
|
|
30
30
|
description?: string;
|
|
31
31
|
syntax?: string;
|
|
32
32
|
}
|
|
33
|
-
export declare const renderFormulaIcon: (iconType: FormulaIconTypes, tid?: number, md?: MetadataDescriptor) =>
|
|
33
|
+
export declare const renderFormulaIcon: (iconType: FormulaIconTypes, tid?: number, md?: MetadataDescriptor) => React.JSX.Element;
|
|
34
34
|
declare const TMFormulaEditor: React.FunctionComponent<ITMApplyFormProps<FormulaDescriptor>>;
|
|
35
35
|
export default TMFormulaEditor;
|
|
36
36
|
export declare class FormulaHelper {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface IHtmlContentDisplay {
|
|
2
3
|
markup: string;
|
|
3
4
|
isSelected: boolean;
|
|
4
5
|
searchText?: string;
|
|
5
6
|
}
|
|
6
|
-
declare const TMHtmlContentDisplay: (props: IHtmlContentDisplay) =>
|
|
7
|
+
declare const TMHtmlContentDisplay: (props: IHtmlContentDisplay) => React.JSX.Element;
|
|
7
8
|
export default TMHtmlContentDisplay;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
2
3
|
export declare const sanitizeAndFormatComment: (raw?: string) => string;
|
|
3
4
|
export interface ITMHtmlEditor {
|
|
@@ -34,5 +35,5 @@ export interface ITMHtmlEditor {
|
|
|
34
35
|
/** If true, displays a character count below the editor */
|
|
35
36
|
showCount?: boolean;
|
|
36
37
|
}
|
|
37
|
-
declare const TMHtmlEditor: (props: ITMHtmlEditor) =>
|
|
38
|
+
declare const TMHtmlEditor: (props: ITMHtmlEditor) => React.JSX.Element;
|
|
38
39
|
export default TMHtmlEditor;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
3
|
import styled from "styled-components";
|
|
4
|
-
import { AccessLevels,
|
|
5
|
-
import { IconUndo, IconPencil, IconFunction, IconMenuVertical, IconDataList, SDKUI_Localizator, IconNull, stringIsNullOrEmpty, deepCompare, SDKUI_Globals, IconDcmtTypeSys, isApprovalWorkflowView
|
|
4
|
+
import { AccessLevels, DcmtTypeListCacheService, LayoutGroupBorderStyles, LayoutGroupOrientations, LayoutItemTypes, LayoutModes, MetadataDataDomains, MetadataDataTypes, SDK_Globals, SystemMIDsAsNumber, SystemTIDs, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
|
|
5
|
+
import { IconUndo, IconPencil, IconFunction, IconMenuVertical, IconDataList, SDKUI_Localizator, IconNull, stringIsNullOrEmpty, deepCompare, SDKUI_Globals, IconDcmtTypeSys, isApprovalWorkflowView } from "../../helper";
|
|
6
6
|
import { TMColors } from "../../utils/theme";
|
|
7
7
|
import TMButton from "../base/TMButton";
|
|
8
8
|
import TMDropDownMenu from "../base/TMDropDownMenu";
|
|
@@ -13,7 +13,7 @@ import { FormulaHelper } from "./TMFormulaEditor";
|
|
|
13
13
|
import { ChronologyMIDs, DraftsMIDs, DSAttachsMIDs } from "../../ts";
|
|
14
14
|
import { TMNothingToShow } from "../features/documents/TMDcmtPreview";
|
|
15
15
|
import TMAccordion from "../base/TMAccordion";
|
|
16
|
-
import
|
|
16
|
+
import TMTabControl, { TMTabPanel } from "../base/TMTabControl";
|
|
17
17
|
import { TMExceptionBoxManager } from "../base/TMPopUp";
|
|
18
18
|
// Costante per la minWidth degli elementi - garantisce coerenza tra layout orizzontale e verticale
|
|
19
19
|
const ITEM_MIN_WIDTH = 200;
|
|
@@ -754,7 +754,7 @@ const TMLayoutTabPanel = React.memo(({ tabItems }) => {
|
|
|
754
754
|
const handleSelectedIndexChange = useCallback((index) => {
|
|
755
755
|
setActiveTabIndex(index);
|
|
756
756
|
}, []);
|
|
757
|
-
return (_jsx(
|
|
757
|
+
return (_jsx(TMTabControl, { variant: 'moduleFilled', contentAnimation: 'none', swipeEnabled: false, selectedId: String(activeTabIndex), onSelectedIdChange: (id) => handleSelectedIndexChange(Number(id)), style: { width: '100%', height: '100%' }, children: tabItems.map((tabItem, index) => (_jsx(TMTabPanel, { id: String(index), label: _jsxs(_Fragment, { children: [_jsx("span", { children: tabItem.title }), tabItem.errorCount !== undefined && tabItem.errorCount > 0 && (_jsx(TMTooltip, { content: _jsxs("div", { style: {
|
|
758
758
|
minWidth: '240px',
|
|
759
759
|
padding: '14px',
|
|
760
760
|
borderRadius: '10px',
|
|
@@ -787,5 +787,5 @@ const TMLayoutTabPanel = React.memo(({ tabItems }) => {
|
|
|
787
787
|
fontSize: '0.85em',
|
|
788
788
|
color: '#7f1d1d',
|
|
789
789
|
lineHeight: 1.4
|
|
790
|
-
}, children: error.message })] }, idx))) })] }), children: _jsx(StyledErrorBadge, { children: tabItem.errorCount > 99 ? '99+' : tabItem.errorCount }) }))] })
|
|
790
|
+
}, children: error.message })] }, idx))) })] }), children: _jsx(StyledErrorBadge, { children: tabItem.errorCount > 99 ? '99+' : tabItem.errorCount }) }))] }), children: _jsx("div", { style: { width: '100%', overflowX: 'auto' }, children: _jsx("div", { style: { minWidth: 'max-content' }, children: tabItem.content }) }) }, `tab-${tabItem.layoutItemID}`))) }));
|
|
791
791
|
});
|
|
@@ -14,5 +14,5 @@ interface TMTreeDropDownProps {
|
|
|
14
14
|
isValidKey?: (key: number) => boolean;
|
|
15
15
|
elementStyle?: React.CSSProperties;
|
|
16
16
|
}
|
|
17
|
-
declare const TMTreeDropDown: (props: TMTreeDropDownProps) =>
|
|
17
|
+
declare const TMTreeDropDown: (props: TMTreeDropDownProps) => React.JSX.Element;
|
|
18
18
|
export default TMTreeDropDown;
|
|
@@ -22,12 +22,17 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
|
|
|
22
22
|
const pendingMidsRef = React.useRef(null);
|
|
23
23
|
const deviceType = useDeviceType();
|
|
24
24
|
useEffect(() => { setMruTIDs(SDKUI_Globals.userSettings.archivingSettings.mruTIDs); }, []);
|
|
25
|
+
// Applica inputTID solo quando cambia davvero: non deve sovrascrivere il tipo documento
|
|
26
|
+
// selezionato dall'utente.
|
|
25
27
|
useEffect(() => {
|
|
26
28
|
if (!inputTID)
|
|
27
29
|
return;
|
|
28
30
|
setCurrentTID(inputTID);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
}, [inputTID]);
|
|
32
|
+
// Evidenzia la scorciatoia del tipo documento corrente, anche quando mruTIDs cambia.
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
setCurrentMruTID(currentTID && mruTIDs.includes(currentTID) ? currentTID : 0);
|
|
35
|
+
}, [currentTID, mruTIDs]);
|
|
31
36
|
useEffect(() => {
|
|
32
37
|
pendingMidsRef.current = inputMids;
|
|
33
38
|
if (currentTID && currentTID > 0 && inputMids && inputMids.length > 0) {
|
|
@@ -11,5 +11,5 @@ interface TMToppyDraggableHelpCenterProps {
|
|
|
11
11
|
/** Callback chiamato quando si clicca sull'immagine di Toppy */
|
|
12
12
|
onToppyImageClick?: () => void;
|
|
13
13
|
}
|
|
14
|
-
declare const TMToppyDraggableHelpCenter: (props: TMToppyDraggableHelpCenterProps) =>
|
|
14
|
+
declare const TMToppyDraggableHelpCenter: (props: TMToppyDraggableHelpCenterProps) => React.JSX.Element;
|
|
15
15
|
export default TMToppyDraggableHelpCenter;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { BlogPost, UserDescriptor } from "@topconsultnpm/sdk-ts";
|
|
2
3
|
import { FileItem } from '../../base/TMFileManagerUtils';
|
|
3
4
|
import { TMBlogContextDescriptor } from '../../grids/TMBlogsPostUtils';
|
|
@@ -18,5 +19,5 @@ interface TMBlogCommentFormProps {
|
|
|
18
19
|
/** External save handler - when provided, bypasses internal engine logic */
|
|
19
20
|
onCustomSave?: (blogPost: BlogPost) => Promise<void>;
|
|
20
21
|
}
|
|
21
|
-
declare const TMBlogCommentForm: (props: TMBlogCommentFormProps) =>
|
|
22
|
+
declare const TMBlogCommentForm: (props: TMBlogCommentFormProps) => React.JSX.Element;
|
|
22
23
|
export default TMBlogCommentForm;
|
|
@@ -114,7 +114,7 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
|
|
|
114
114
|
// ---- Scrittura file nel filesystem locale ----
|
|
115
115
|
const writeFileToFolder = async (file, dcmtInfo) => {
|
|
116
116
|
try {
|
|
117
|
-
|
|
117
|
+
const baseFileName = await generateTargetFileName(file, dcmtInfo, {
|
|
118
118
|
fileNamingMode: settings.fileNamingMode,
|
|
119
119
|
separatorChar: settings.separatorChar,
|
|
120
120
|
});
|
|
@@ -123,7 +123,7 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
|
|
|
123
123
|
const url = URL.createObjectURL(file);
|
|
124
124
|
const a = document.createElement('a');
|
|
125
125
|
a.href = url;
|
|
126
|
-
a.download =
|
|
126
|
+
a.download = baseFileName;
|
|
127
127
|
document.body.appendChild(a);
|
|
128
128
|
a.target = '_blank';
|
|
129
129
|
a.rel = 'noreferrer';
|
|
@@ -132,20 +132,22 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
|
|
|
132
132
|
URL.revokeObjectURL(url);
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
|
-
const
|
|
135
|
+
const folderHandle = folderHandleRef.current;
|
|
136
|
+
let targetFileName = baseFileName;
|
|
137
|
+
const exists = await fileExists(folderHandle, targetFileName);
|
|
136
138
|
if (exists) {
|
|
137
139
|
switch (settings.fileExistsMode) {
|
|
138
140
|
case 'skip':
|
|
139
141
|
return;
|
|
140
142
|
case 'rename':
|
|
141
|
-
targetFileName = await generateUniqueFileName(
|
|
143
|
+
targetFileName = await generateUniqueFileName(folderHandle, targetFileName);
|
|
142
144
|
break;
|
|
143
145
|
case 'overwrite':
|
|
144
146
|
default:
|
|
145
147
|
break;
|
|
146
148
|
}
|
|
147
149
|
}
|
|
148
|
-
const fileHandle = await
|
|
150
|
+
const fileHandle = await folderHandle.getFileHandle(targetFileName, { create: true });
|
|
149
151
|
const writable = await fileHandle.createWritable();
|
|
150
152
|
await writable.write(file);
|
|
151
153
|
await writable.close();
|
|
@@ -179,7 +181,6 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
|
|
|
179
181
|
await downloadDcmtsAsync({ inputDcmts: dcmtInfosToDownload, downloadType: DownloadTypes.Dcmt, downloadMode: 'download', onFileDownloaded: writeFileToFolder, skipConfirmation: true, retrieveOptions, useCache: false });
|
|
180
182
|
}
|
|
181
183
|
else if (settings.exportMode === 'zip') {
|
|
182
|
-
const zipEntries = [];
|
|
183
184
|
const fileNameCounts = new Map();
|
|
184
185
|
const getUniqueZipFileName = (fileName) => {
|
|
185
186
|
const lowerName = fileName.toLowerCase();
|
|
@@ -192,14 +193,24 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
|
|
|
192
193
|
const ext = dotIndex > 0 ? fileName.substring(dotIndex) : '';
|
|
193
194
|
return `${baseName} (${count})${ext}`;
|
|
194
195
|
};
|
|
196
|
+
// I file scaricati si raccolgono in mappa (nome incluso) e l'archivio viene costruito
|
|
197
|
+
// dopo, nell'ordine di selezione, così i suffissi di deduplica restano coerenti.
|
|
198
|
+
const downloadedEntries = new Map();
|
|
195
199
|
const collectFileForZip = async (file, dcmtInfo) => {
|
|
196
200
|
const targetFileName = await generateTargetFileName(file, dcmtInfo, {
|
|
197
201
|
fileNamingMode: settings.fileNamingMode,
|
|
198
202
|
separatorChar: settings.separatorChar,
|
|
199
203
|
});
|
|
200
|
-
|
|
204
|
+
downloadedEntries.set(`${dcmtInfo.TID}_${dcmtInfo.DID}`, { file, targetFileName });
|
|
201
205
|
};
|
|
202
206
|
await downloadDcmtsAsync({ inputDcmts: dcmtInfosToDownload, downloadType: DownloadTypes.Dcmt, downloadMode: 'download', onFileDownloaded: collectFileForZip, skipConfirmation: true, retrieveOptions, useCache: false });
|
|
207
|
+
const zipEntries = [];
|
|
208
|
+
for (const dcmtInfo of dcmtInfosToDownload) {
|
|
209
|
+
const entry = downloadedEntries.get(`${dcmtInfo.TID}_${dcmtInfo.DID}`);
|
|
210
|
+
if (!entry)
|
|
211
|
+
continue;
|
|
212
|
+
zipEntries.push({ filename: getUniqueZipFileName(entry.targetFileName), data: entry.file });
|
|
213
|
+
}
|
|
203
214
|
if (zipEntries.length > 0) {
|
|
204
215
|
const zipFileName = settings.zipFileName.trim().toLowerCase().endsWith('.zip')
|
|
205
216
|
? settings.zipFileName.trim()
|
|
@@ -1697,7 +1697,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1697
1697
|
} }), (isModal && onClose) && _jsx("div", { id: "TMDcmtFormShowConfirmForClose-" + id })] }) }), _jsx(TMToppyDraggableHelpCenter, { isVisible: isToppyVisible, content: _jsx(TMDcmtFormActionButtons, { showToppyForApprove: showToppyForApprove, workItems: workItems, caseFlowWorkItems: showToppyForCaseFlow ? caseFlowWorkItems : [], onCompleteCaseFlowWorkItem: completeCaseFlowWorkItem, onRejectCaseFlowWorkItem: rejectCaseFlowWorkItem, deviceType: deviceType, isMobile: isMobile, handleSignApprove: handleSignApprove, updateShowApprovePopup: updateShowApprovePopup, updateShowRejectPopup: updateShowRejectPopup, updateShowReAssignPopup: updateShowReAssignPopup, updateShowMoreInfoPopup: updateShowMoreInfoPopup, fromDTD: fromDTD, showToppyForCompleteMoreInfo: showToppyForCompleteMoreInfo, moreInfoTasks: moreInfoTasks, setShowCommentForm: setShowCommentForm, showToppyForReferences: showToppyForReferences, dcmtReferences: dcmtReferences, referenceActionMap: referenceActionMap, handleNavigateToReference: handleNavigateToReference, setShowMoreInfoTaskPopup: setShowMoreInfoTaskPopup, setShowMoreInfoTaskTask: setShowMoreInfoTaskTask }) })] }), (showCommentForm && TID && DID) &&
|
|
1698
1698
|
_jsx(TMBlogCommentForm, { maxLength: 500, context: blogCommentFormContext, onClose: handleBlogCommentFormClose, onCustomSave: onBlogCommentFormCustomSave, participants: emptyParticipants, showAttachmentsSection: false, allArchivedDocumentsFileItems: emptyArchivedDocumentsFileItems })] }), renderDcmtOperations, renderFloatingBar] }));
|
|
1699
1699
|
};
|
|
1700
|
-
return (_jsxs("div", { style: { width: '100%', height: '100%' }, children: [(isModal && onClose)
|
|
1700
|
+
return (_jsxs("div", { style: (isModal && onClose) ? { width: 0, height: 0 } : { width: '100%', height: '100%' }, children: [(isModal && onClose)
|
|
1701
1701
|
? _jsx(TMModal, { title: titleModal, onClose: handleClose, width: widthModal ?? '100%', height: heightModal ?? '100%', hidePopup: false, askClosingConfirm: true, children: _jsx("div", { style: { width: "100%", height: "100%", display: 'block', padding: "4px", position: 'relative' }, children: renderDcmtForm() }) })
|
|
1702
1702
|
: renderDcmtForm(), (showMoreInfoTaskPopup && showMoreInfoTaskTask && showMoreInfoTaskTask.id && handleNavigateToWGs && handleNavigateToDossiers && getAllTasks && deleteTaskByIdsCallback && addTaskCallback && editTaskCallback) && _jsx(TMTaskForm, { id: Number(showMoreInfoTaskTask.id), title: showMoreInfoTaskTask.name ?? 'N/A', formMode: FormModes.Update, onSaved: onSavedTaskFormCallback, editTaskCallback: editTaskCallback, onClose: () => { setShowMoreInfoTaskPopup(false); setShowMoreInfoTaskTask(undefined); }, onCancel: () => { setShowMoreInfoTaskPopup(false); setShowMoreInfoTaskTask(undefined); }, isModal: true, showBackButton: false, hasNavigation: false, width: taskModalSizes(deviceType, FormModes.Update).width, height: taskModalSizes(deviceType, FormModes.Update).height, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, visualizedTasks: [], currentTask: null, setCurrentTask: () => { }, selectedRowKeys: [], handleFocusedRowKeyChange: () => { }, onStatusChanged: () => { }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback }), (showMultiDetailArchiveModal && fromDTD && multiDetailMasterDcmts.length > 0) &&
|
|
1703
1703
|
_jsx(TMMultiMasterDetailDcmtsForm, { dtd: fromDTD, masterDcmt: multiDetailMasterDcmts[0], onClose: () => { setShowMultiDetailArchiveModal(false); setMultiDetailMasterDcmts([]); }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar, showTodoDcmtForm: showTodoDcmtForm, openFileUploaderPdfEditor: openFileUploaderPdfEditor, graphometricManager: graphometricManager, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, fetchRemoteCertificates: fetchRemoteCertificates, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, onReferenceClick: onReferenceClick, onTaskCreateRequest: onTaskCreateRequest })] }));
|
|
@@ -1783,7 +1783,8 @@ const validateCustomRegEx = (mvd, value, validationItems) => {
|
|
|
1783
1783
|
const regex = new RegExp(`^(?:${pattern})$`);
|
|
1784
1784
|
if (!regex.test(value)) {
|
|
1785
1785
|
const fieldName = mvd.md?.nameLoc ?? mvd.md?.name ?? SDKUI_Localizator.Field;
|
|
1786
|
-
const
|
|
1786
|
+
const description = mvd.md?.description?.trim();
|
|
1787
|
+
const message = description ? description : SDKUI_Localizator.InvalidFormatValue;
|
|
1787
1788
|
validationItems.push(new ValidationItem(ResultTypes.ERROR, fieldName, message));
|
|
1788
1789
|
}
|
|
1789
1790
|
}
|
|
@@ -41,5 +41,5 @@ interface TMDcmtFormActionButtonsProps {
|
|
|
41
41
|
setShowMoreInfoTaskPopup: React.Dispatch<React.SetStateAction<boolean>>;
|
|
42
42
|
setShowMoreInfoTaskTask: React.Dispatch<React.SetStateAction<TaskDescriptor | undefined>>;
|
|
43
43
|
}
|
|
44
|
-
declare const TMDcmtFormActionButtons: (props: TMDcmtFormActionButtonsProps) =>
|
|
44
|
+
declare const TMDcmtFormActionButtons: (props: TMDcmtFormActionButtonsProps) => React.JSX.Element;
|
|
45
45
|
export default TMDcmtFormActionButtons;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { DcmtInfo, DownloadModes, DownloadTypes } from '../../../ts';
|
|
2
3
|
import { FileDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
4
|
interface ITMDcmtIconProps {
|
|
@@ -16,5 +17,5 @@ interface ITMDcmtIconProps {
|
|
|
16
17
|
/** Se true, renderizza il wait panel nel body tramite Portal (centrato a schermo intero) */
|
|
17
18
|
usePortal?: boolean;
|
|
18
19
|
}
|
|
19
|
-
declare const TMDcmtIcon: ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode, tooltipContent, openInOffice, onDownloadDcmtsAsync, usePortal }: ITMDcmtIconProps) =>
|
|
20
|
+
declare const TMDcmtIcon: ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode, tooltipContent, openInOffice, onDownloadDcmtsAsync, usePortal }: ITMDcmtIconProps) => React.JSX.Element;
|
|
20
21
|
export default TMDcmtIcon;
|
|
@@ -25,8 +25,12 @@ export declare const TMNothingToShow: ({ text, secondText, fileExt, icon }: {
|
|
|
25
25
|
secondText?: any;
|
|
26
26
|
fileExt?: string;
|
|
27
27
|
icon?: any;
|
|
28
|
-
}) =>
|
|
29
|
-
export declare const StyledHeaderIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").
|
|
28
|
+
}) => React.JSX.Element;
|
|
29
|
+
export declare const StyledHeaderIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
30
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
31
|
+
}, {
|
|
30
32
|
$color: string;
|
|
31
33
|
}>> & string;
|
|
32
|
-
export declare const StyledPanelStatusContainer: import("styled-components/dist/types").IStyledComponentBase<"web",
|
|
34
|
+
export declare const StyledPanelStatusContainer: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
35
|
+
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
36
|
+
}> & string;
|