@topconsultnpm/sdkui-react 6.22.0-dev2.2 → 6.22.0-dev2.21
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 +1 -1
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +1 -1
- package/lib/components/base/TMButton.d.ts +13 -0
- package/lib/components/base/TMButton.js +137 -5
- package/lib/components/base/TMDataGrid.d.ts +2 -0
- package/lib/components/base/TMDataGrid.js +68 -4
- package/lib/components/base/TMEditorBase.d.ts +2 -0
- package/lib/components/base/TMModal.d.ts +4 -0
- package/lib/components/base/TMModal.js +42 -11
- package/lib/components/base/TMPanel.d.ts +1 -0
- package/lib/components/base/TMPanel.js +79 -20
- package/lib/components/base/TMTooltip.d.ts +2 -1
- package/lib/components/base/TMTooltip.js +23 -6
- package/lib/components/base/TMTreeView.js +108 -67
- package/lib/components/choosers/TMDcmtTypeChooser.js +4 -3
- package/lib/components/choosers/TMDistinctValues.d.ts +9 -7
- package/lib/components/choosers/TMDistinctValues.js +149 -142
- package/lib/components/choosers/TMMetadataChooser.js +1 -1
- package/lib/components/choosers/TMQuickSearchInfo.d.ts +12 -0
- package/lib/components/choosers/TMQuickSearchInfo.js +279 -0
- package/lib/components/choosers/TMQuickSearchSettingsForm.d.ts +16 -0
- package/lib/components/choosers/TMQuickSearchSettingsForm.js +94 -0
- package/lib/components/choosers/TMSelectedValuesSummary.d.ts +13 -0
- package/lib/components/choosers/TMSelectedValuesSummary.js +91 -0
- package/lib/components/editors/TMDropDown.d.ts +3 -0
- package/lib/components/editors/TMDropDown.js +197 -5
- package/lib/components/editors/TMMetadataEditor.d.ts +5 -1
- package/lib/components/editors/TMMetadataEditor.js +8 -3
- package/lib/components/editors/TMTextBox.js +15 -15
- package/lib/components/features/documents/TMBatchUpdateForm.js +19 -5
- package/lib/components/features/documents/TMDcmtForm.d.ts +7 -0
- package/lib/components/features/documents/TMDcmtForm.js +104 -42
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +11 -0
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +74 -7
- package/lib/components/features/documents/TMMasterDetailDcmts.js +95 -33
- package/lib/components/features/documents/TMMasterInfoFields.d.ts +19 -0
- package/lib/components/features/documents/TMMasterInfoFields.js +172 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +40 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +277 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +354 -0
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +234 -0
- package/lib/components/features/documents/TMRelationViewer.d.ts +14 -1
- package/lib/components/features/documents/TMRelationViewer.js +69 -20
- package/lib/components/features/search/TMSearch.js +29 -16
- package/lib/components/features/search/TMSearchQueryEditor.js +5 -3
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -1
- package/lib/components/features/search/TMSearchQueryPanel.js +28 -7
- package/lib/components/features/search/TMSearchResult.d.ts +9 -0
- package/lib/components/features/search/TMSearchResult.js +323 -92
- package/lib/components/features/search/TMTreeSelector.js +18 -5
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +10 -0
- package/lib/components/features/workflow/TMWorkflowPopup.js +8 -4
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +24 -14
- package/lib/components/layout/panelManager/TMPanelWrapper.js +2 -2
- package/lib/components/layout/panelManager/types.d.ts +3 -0
- package/lib/components/viewers/TMMidViewer.js +4 -1
- package/lib/components/viewers/TMTidViewer.js +25 -11
- package/lib/helper/SDKUI_Globals.d.ts +55 -0
- package/lib/helper/SDKUI_Globals.js +82 -0
- package/lib/helper/SDKUI_Localizator.d.ts +24 -0
- package/lib/helper/SDKUI_Localizator.js +240 -0
- package/lib/helper/TMIcons.d.ts +1 -0
- package/lib/helper/TMIcons.js +3 -0
- package/lib/helper/dataGridSearchHelper.d.ts +28 -0
- package/lib/helper/dataGridSearchHelper.js +51 -0
- package/lib/helper/dcmtsHelper.d.ts +20 -0
- package/lib/helper/dcmtsHelper.js +58 -1
- package/lib/helper/helpers.d.ts +20 -0
- package/lib/helper/helpers.js +40 -0
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/helper/queryHelper.d.ts +2 -0
- package/lib/helper/queryHelper.js +3 -1
- package/lib/hooks/tmDistinctValuesGridHelper.d.ts +16 -0
- package/lib/hooks/tmDistinctValuesGridHelper.js +31 -0
- package/lib/hooks/useArchiveListForm.d.ts +39 -0
- package/lib/hooks/useArchiveListForm.js +46 -0
- package/lib/hooks/useCaseFlowApprove.d.ts +56 -0
- package/lib/hooks/useCaseFlowApprove.js +157 -0
- package/lib/hooks/useDataUserIdItem.d.ts +1 -0
- package/lib/hooks/useDataUserIdItem.js +1 -0
- package/lib/hooks/useDocumentOperations.d.ts +2 -0
- package/lib/hooks/useDocumentOperations.js +28 -5
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +98 -0
- package/lib/hooks/useMultiMasterDetailDcmts.js +567 -0
- package/lib/hooks/useRelatedDocuments.js +2 -26
- package/lib/hooks/useTMDistinctValuesMetadataDisplay.d.ts +18 -0
- package/lib/hooks/useTMDistinctValuesMetadataDisplay.js +103 -0
- package/lib/hooks/useTMDistinctValuesQuickSearch.d.ts +49 -0
- package/lib/hooks/useTMDistinctValuesQuickSearch.js +307 -0
- package/lib/hooks/useTMDistinctValuesSelection.d.ts +42 -0
- package/lib/hooks/useTMDistinctValuesSelection.js +103 -0
- package/lib/hooks/useTMDistinctValuesSource.d.ts +29 -0
- package/lib/hooks/useTMDistinctValuesSource.js +105 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/services/caseflow/CaseFlowService.d.ts +236 -0
- package/lib/services/caseflow/CaseFlowService.js +693 -0
- package/lib/services/caseflow/CaseFlowTemplateCacheService.d.ts +28 -0
- package/lib/services/caseflow/CaseFlowTemplateCacheService.js +121 -0
- package/lib/services/caseflow/caseFlowNameCache.d.ts +32 -0
- package/lib/services/caseflow/caseFlowNameCache.js +116 -0
- package/lib/services/caseflow/caseFlowWorkItemUtils.d.ts +61 -0
- package/lib/services/caseflow/caseFlowWorkItemUtils.js +113 -0
- package/lib/services/index.d.ts +4 -0
- package/lib/services/index.js +4 -0
- package/lib/services/platform_services.d.ts +1 -1
- package/package.json +66 -66
|
@@ -126,6 +126,16 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
126
126
|
setSelectedRowKeys(selectedKeys);
|
|
127
127
|
setIsGridBoxOpened(false);
|
|
128
128
|
}, []);
|
|
129
|
+
// Handles click on a tree row in the trees data grid: clicking the already selected tree
|
|
130
|
+
// does not raise onSelectionChanged, so the drop down must be closed here as well
|
|
131
|
+
const onRowClickTrees = useCallback((e) => {
|
|
132
|
+
const tree = e.data;
|
|
133
|
+
if (tree?.id === undefined)
|
|
134
|
+
return;
|
|
135
|
+
setSelectedTreeId(tree.id);
|
|
136
|
+
setSelectedRowKeys([tree.id]);
|
|
137
|
+
setIsGridBoxOpened(false);
|
|
138
|
+
}, []);
|
|
129
139
|
// Handles focus change in the data grid
|
|
130
140
|
const onFocusedRowChanged = useCallback((e) => {
|
|
131
141
|
setFocusedRowKey(e.row?.key);
|
|
@@ -161,6 +171,13 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
161
171
|
}
|
|
162
172
|
}
|
|
163
173
|
}, []);
|
|
174
|
+
// Callback function to handle click events on a tree view row.
|
|
175
|
+
const onRowClickTreeView = useCallback((e) => {
|
|
176
|
+
const treeItem = e.data;
|
|
177
|
+
if (treeItem?.type === TreeItemTypes.DcmtType) {
|
|
178
|
+
onSelectedTIDChanged?.(treeItem.tid, selectedTreeId);
|
|
179
|
+
}
|
|
180
|
+
}, [onSelectedTIDChanged, selectedTreeId]);
|
|
164
181
|
return (_jsx(TMPanel, { title: SDK_Localizator.Trees, isVisible: isVisible, totalItems: trees.length, onClose: onClosePanel, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, toolbar: _jsx(TMButton, { btnStyle: 'icon', caption: defaultTreeId == selectedTreeId ? SDKUI_Localizator.TreeRemoveDefault : SDKUI_Localizator.SetAsDefault, icon: defaultTreeId == selectedTreeId ? _jsx(IconStarRemove, { color: 'rgb(243, 114, 92)' }) : _jsx(IconStar, { color: 'rgb(248, 215, 117)' }), onClick: () => {
|
|
165
182
|
if (defaultTreeId == selectedTreeId) {
|
|
166
183
|
if (layoutMode == LayoutModes.Update)
|
|
@@ -193,11 +210,7 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
193
210
|
}, value: selectedTreeId, opened: isGridBoxOpened, valueExpr: "id", displayExpr: "nameLoc", deferRendering: false, dataSource: trees, onValueChanged: syncDataGridSelection, onOptionChanged: onGridBoxOpened, style: { height: 30, padding: '5px' }, children: _jsx(TMDataGrid, { height: "100%", width: "100%", dataSource: trees, dataColumns: [
|
|
194
211
|
{ dataField: 'nameLoc', caption: SDKUI_Localizator.Name, width: 'auto' },
|
|
195
212
|
{ dataField: 'description', caption: SDKUI_Localizator.Description, width: 'auto' },
|
|
196
|
-
], selection: { mode: 'single', showCheckBoxesMode: "none" }, showHeaderFilter: false, selectedRowKeys: selectedRowKeys, onSelectionChanged: onSelectionChanged, focusedRowKey: focusedRowKey, onFocusedRowChanged: onFocusedRowChanged }) }) }), _jsxs(StyledTreeListWrapper, { children: [_jsxs(TreeList, { height: "100%", dataSource: treeItems, showRowLines: false, showColumnLines: false, showBorders: false, columnAutoWidth: false, keyExpr: "id", parentIdExpr: "parentID", dataStructure: "plain", showColumnHeaders: false, onContentReady: (e) => e.component.clearSelection(), onCellDblClick: onCellDblClickTreeView,
|
|
197
|
-
if (e.selectedRowsData[0] && e.selectedRowsData[0].type == TreeItemTypes.DcmtType) {
|
|
198
|
-
onSelectedTIDChanged?.(e.selectedRowsData[0].tid, selectedTreeId);
|
|
199
|
-
}
|
|
200
|
-
}, children: [_jsx(Column, { dataField: "nameLoc", caption: SDKUI_Localizator.Name, cellRender: renderCell, width: "100%" }), _jsx(Scrolling, { mode: "virtual", useNative: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar) === 1 }), _jsx(Selection, { mode: "single" })] }), _jsxs(StyledOffCanvasPanel, { ref: panelRef, "$isOpen": isMobile && infoDTD !== undefined, children: [_jsxs(StyledDivHorizontal, { style: { gap: 10, padding: '10px 8px', width: '100%', alignItems: 'center' }, children: [_jsx("p", { style: { fontSize: '1.1rem', fontWeight: 'bold' }, children: `${SDKUI_Localizator.DcmtType} - ${SDKUI_Localizator.About}` }), _jsx(IconCloseOutline, { style: { marginLeft: 'auto', cursor: 'pointer' }, onClick: () => setInfoDTD(undefined) })] }), renderDTDTooltipContent(infoDTD)] })] })] })
|
|
213
|
+
], selection: { mode: 'single', showCheckBoxesMode: "none" }, showHeaderFilter: false, selectedRowKeys: selectedRowKeys, onSelectionChanged: onSelectionChanged, onRowClick: onRowClickTrees, focusedRowKey: focusedRowKey, onFocusedRowChanged: onFocusedRowChanged }) }) }), _jsxs(StyledTreeListWrapper, { children: [_jsxs(TreeList, { height: "100%", dataSource: treeItems, showRowLines: false, showColumnLines: false, showBorders: false, columnAutoWidth: false, keyExpr: "id", parentIdExpr: "parentID", dataStructure: "plain", showColumnHeaders: false, onContentReady: (e) => e.component.clearSelection(), onCellDblClick: onCellDblClickTreeView, onRowClick: onRowClickTreeView, children: [_jsx(Column, { dataField: "nameLoc", caption: SDKUI_Localizator.Name, cellRender: renderCell, width: "100%" }), _jsx(Scrolling, { mode: "virtual", useNative: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar) === 1 }), _jsx(Selection, { mode: "single" })] }), _jsxs(StyledOffCanvasPanel, { ref: panelRef, "$isOpen": isMobile && infoDTD !== undefined, children: [_jsxs(StyledDivHorizontal, { style: { gap: 10, padding: '10px 8px', width: '100%', alignItems: 'center' }, children: [_jsx("p", { style: { fontSize: '1.1rem', fontWeight: 'bold' }, children: `${SDKUI_Localizator.DcmtType} - ${SDKUI_Localizator.About}` }), _jsx(IconCloseOutline, { style: { marginLeft: 'auto', cursor: 'pointer' }, onClick: () => setInfoDTD(undefined) })] }), renderDTDTooltipContent(infoDTD)] })] })] })
|
|
201
214
|
: _jsx("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', fontSize: '1.5rem' }, children: SDKUI_Localizator.TreesNoAvailable }) }));
|
|
202
215
|
};
|
|
203
216
|
export default TMTreeSelector;
|
|
@@ -3,6 +3,16 @@ import { DeviceType } from "../../base/TMDeviceProvider";
|
|
|
3
3
|
import { WorkItemDetail } from "../../../ts";
|
|
4
4
|
interface IWorkflowOperationButtonsProps {
|
|
5
5
|
dtd: DcmtTypeDescriptor | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Forza la forma dei pulsanti: `true` = flusso di FIRMA (Firma e approva),
|
|
8
|
+
* `false` = flusso di APPROVAZIONE. Se omesso si deduce dal tipo documento
|
|
9
|
+
* (widget Sign4Top), che è il comportamento del workflow.
|
|
10
|
+
*
|
|
11
|
+
* Serve a chi conosce la natura dell'attività meglio del tipo documento: un
|
|
12
|
+
* work item di sola approvazione su un tipo ABILITATO alla firma non deve
|
|
13
|
+
* mostrare "Firma e approva".
|
|
14
|
+
*/
|
|
15
|
+
signFlow?: boolean;
|
|
6
16
|
approveDisable?: boolean;
|
|
7
17
|
signApproveDisable?: boolean;
|
|
8
18
|
rejectDisable?: boolean;
|
|
@@ -53,16 +53,20 @@ const StyledHorizontalContainer = styled.div `
|
|
|
53
53
|
/* align-items: flex-end; */
|
|
54
54
|
`;
|
|
55
55
|
export const WorkFlowOperationButtons = (props) => {
|
|
56
|
-
const { dtd = undefined, deviceType = DeviceType.DESKTOP, approveDisable = false, signApproveDisable = false, rejectDisable = false, reassignDisable = false, infoDisable = false, onApprove, onSignApprove, onReject, onReAssign, onMoreInfo, } = props;
|
|
56
|
+
const { dtd = undefined, signFlow = undefined, deviceType = DeviceType.DESKTOP, approveDisable = false, signApproveDisable = false, rejectDisable = false, reassignDisable = false, infoDisable = false, onApprove, onSignApprove, onReject, onReAssign, onMoreInfo, } = props;
|
|
57
57
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
58
|
-
// Calcola direttamente se è un workflow di firma per evitare flickering durante il render
|
|
58
|
+
// Calcola direttamente se è un workflow di firma per evitare flickering durante il render.
|
|
59
|
+
// `signFlow`, se fornito, ha la precedenza: chi lo passa conosce la natura
|
|
60
|
+
// dell'attività (es. categoria del work item) meglio del tipo documento.
|
|
59
61
|
const isSignWorkflow = useMemo(() => {
|
|
62
|
+
if (signFlow !== undefined)
|
|
63
|
+
return signFlow;
|
|
60
64
|
if (dtd && dtd.widgets && dtd.widgets.length > 0) {
|
|
61
65
|
return isSign4TopEnabled(dtd.widgets);
|
|
62
66
|
}
|
|
63
67
|
return false;
|
|
64
|
-
}, [dtd]);
|
|
65
|
-
return (_jsx(StyledWorkFlowOperationButtonsContainer, { "$isMobile": isMobile, children: isSignWorkflow ? (_jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconSignaturePencil, {}), caption: SDKUI_Localizator.SignatureAndApprove, width: "160px", disabled: signApproveDisable, onClick: () => !signApproveDisable && onSignApprove?.(), onMouseDown: e => e.stopPropagation(), advancedColor: "#1a9a49", color: "success" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: rejectDisable, onClick: () => !rejectDisable && onReject?.(), onMouseDown: e => e.stopPropagation(), advancedColor: TMColors.error, color: "error" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: "180px", disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), onMouseDown: e => e.stopPropagation(), advancedColor: TMColors.info, color: "info" })] })) : (_jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconApply, {}), caption: SDKUI_Localizator.Approve, disabled: approveDisable, onClick: () => !approveDisable && onApprove?.(), advancedColor: "#1a9a49", color: "success" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: rejectDisable, onClick: () => !rejectDisable && onReject?.(), advancedColor: TMColors.error, color: "error" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconUser, { fontSize: 16 }), caption: SDKUI_Localizator.Reassign, disabled: reassignDisable, onClick: () => !reassignDisable && onReAssign?.(), advancedColor: TMColors.tertiary, color: "tertiary" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: "180px", disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), advancedColor: TMColors.info, color: "info" })] })) }));
|
|
68
|
+
}, [dtd, signFlow]);
|
|
69
|
+
return (_jsx(StyledWorkFlowOperationButtonsContainer, { "$isMobile": isMobile, children: isSignWorkflow ? (_jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconSignaturePencil, {}), caption: SDKUI_Localizator.SignatureAndApprove, width: "160px", disabled: signApproveDisable, onClick: () => !signApproveDisable && onSignApprove?.(), onMouseDown: e => e.stopPropagation(), advancedColor: "#1a9a49", color: "success" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: rejectDisable, onClick: () => !rejectDisable && onReject?.(), onMouseDown: e => e.stopPropagation(), advancedColor: TMColors.error, color: "error" }), onMoreInfo && (_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: "180px", disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), onMouseDown: e => e.stopPropagation(), advancedColor: TMColors.info, color: "info" }))] })) : (_jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconApply, {}), caption: SDKUI_Localizator.Approve, disabled: approveDisable, onClick: () => !approveDisable && onApprove?.(), advancedColor: "#1a9a49", color: "success" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: rejectDisable, onClick: () => !rejectDisable && onReject?.(), advancedColor: TMColors.error, color: "error" }), onReAssign && (_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconUser, { fontSize: 16 }), caption: SDKUI_Localizator.Reassign, disabled: reassignDisable, onClick: () => !reassignDisable && onReAssign?.(), advancedColor: TMColors.tertiary, color: "tertiary" })), onMoreInfo && (_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: "180px", disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), advancedColor: TMColors.info, color: "info" }))] })) }));
|
|
66
70
|
};
|
|
67
71
|
export const WorkFlowApproveRejectPopUp = ({ TID = 0, DID = 0, deviceType = DeviceType.DESKTOP, isReject, selectedItems = [], onClose, onCompleted }) => {
|
|
68
72
|
const { refreshWorkflowApprove } = useWorkflowApprove();
|
|
@@ -5,6 +5,7 @@ interface TMPanelManagerContainerProps {
|
|
|
5
5
|
direction: TMPanelDirection;
|
|
6
6
|
parentId?: string;
|
|
7
7
|
minPanelSizePx?: number;
|
|
8
|
+
gutterSizePx?: number;
|
|
8
9
|
}
|
|
9
10
|
declare const TMPanelManagerContainer: (props: TMPanelManagerContainerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
11
|
export default TMPanelManagerContainer;
|
|
@@ -18,20 +18,20 @@ const StyledPanelContainerWrapper = styled.div `
|
|
|
18
18
|
`;
|
|
19
19
|
// Styled Component per il gutter (separatore)
|
|
20
20
|
const StyledResizerGutter = styled.div `
|
|
21
|
-
cursor: ${props => (props.$direction === 'horizontal' ? 'col-resize' : 'row-resize')};
|
|
22
|
-
${props => (props.$direction === 'horizontal' ? `width: ${
|
|
21
|
+
cursor: ${props => (!props.$canResize ? 'default' : props.$direction === 'horizontal' ? 'col-resize' : 'row-resize')};
|
|
22
|
+
${props => (props.$direction === 'horizontal' ? `width: ${props.$size}px;` : `height: ${props.$size}px;`)}
|
|
23
23
|
flex-shrink: 0;
|
|
24
24
|
background-color: "transparent";
|
|
25
25
|
z-index: 10;
|
|
26
26
|
`;
|
|
27
27
|
const TMPanelManagerContainer = (props) => {
|
|
28
|
-
const { panels, showToolbar, direction, parentId, minPanelSizePx = 150 } = props;
|
|
28
|
+
const { panels, showToolbar, direction, parentId, minPanelSizePx = 150, gutterSizePx } = props;
|
|
29
29
|
const { panelVisibility, setPanelDimensionsById, hasVisiblePanels, maximizedPanels, updateIsResizingActive } = useTMPanelManagerContext();
|
|
30
30
|
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook
|
|
31
31
|
const deviceType = useDeviceType();
|
|
32
32
|
// This avoids unnecessary re-renders by only recalculating when deviceType changes
|
|
33
33
|
let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
|
|
34
|
-
const gutters = Gutters.getGutters();
|
|
34
|
+
const gutters = gutterSizePx ?? Gutters.getGutters();
|
|
35
35
|
// References to store information related to resizing
|
|
36
36
|
// startMousePos: stores the mouse position when resizing starts (x or y coordinate)
|
|
37
37
|
const startMousePos = useRef(0);
|
|
@@ -47,6 +47,19 @@ const TMPanelManagerContainer = (props) => {
|
|
|
47
47
|
const containerRef = useRef(null);
|
|
48
48
|
// Count how many child panels are currently visible (based on panelVisibility)
|
|
49
49
|
const currentlyVisibleChildrenCount = panels.filter(panel => panelVisibility[panel.id]).length;
|
|
50
|
+
/**
|
|
51
|
+
* Pannello ridimensionabile più prossimo a partire da `from` nella direzione `step`:
|
|
52
|
+
* i pannelli non visibili e quelli collassati (che vivono del solo ingombro minimo) si saltano,
|
|
53
|
+
* altrimenti il trascinamento del separatore assegnerebbe spazio a un pannello ridotto
|
|
54
|
+
*/
|
|
55
|
+
const findResizablePanelId = (from, step) => {
|
|
56
|
+
for (let i = from; i >= 0 && i < panels.length; i += step) {
|
|
57
|
+
const candidate = panels[i];
|
|
58
|
+
if (panelVisibility[candidate.id] && candidate.contentOptions?.isCollapsed !== true)
|
|
59
|
+
return candidate.id;
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
};
|
|
50
63
|
// If this component has a parent panel, and the parent panel is visible,
|
|
51
64
|
// but none of the current child panels are visible, return null to avoid rendering empty container
|
|
52
65
|
if (parentId && panelVisibility[parentId] && currentlyVisibleChildrenCount === 0) {
|
|
@@ -156,14 +169,6 @@ const TMPanelManagerContainer = (props) => {
|
|
|
156
169
|
}, children: _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsx(StyledPanelContainerWrapper, { ref: containerRef, "$direction": direction, "$hasVisiblePanels": hasVisiblePanels(), children: panels.map((panel, index) => {
|
|
157
170
|
// Check if current panel is visible according to context state
|
|
158
171
|
const isVisible = panelVisibility[panel.id];
|
|
159
|
-
// Find the closest previous visible panel's ID to place the resizer gutter between
|
|
160
|
-
let prevPanelIdForGutter = null;
|
|
161
|
-
for (let i = index - 1; i >= 0; i--) {
|
|
162
|
-
if (panelVisibility[panels[i].id]) {
|
|
163
|
-
prevPanelIdForGutter = panels[i].id;
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
172
|
/*
|
|
168
173
|
Determine if we should show the gutter (resize handle) before this panel.
|
|
169
174
|
The gutter is shown only if:
|
|
@@ -171,6 +176,11 @@ const TMPanelManagerContainer = (props) => {
|
|
|
171
176
|
- at least one visible panel was encountered before this one
|
|
172
177
|
*/
|
|
173
178
|
const showGutter = isVisible && hasSeenVisiblePanel && maximizedPanels.length === 0;
|
|
179
|
+
// I due pannelli su cui agisce il separatore: i più prossimi fra quelli ridimensionabili.
|
|
180
|
+
// Senza una coppia valida (es. tutti i vicini collassati) il separatore resta solo un divisorio
|
|
181
|
+
const resizeFromId = showGutter ? findResizablePanelId(index - 1, -1) : null;
|
|
182
|
+
const resizeToId = showGutter ? findResizablePanelId(index, 1) : null;
|
|
183
|
+
const canResize = resizeFromId !== null && resizeToId !== null && resizeFromId !== resizeToId;
|
|
174
184
|
// Update the flag once a visible panel is found, so gutters after it are shown correctly
|
|
175
185
|
if (isVisible) {
|
|
176
186
|
hasSeenVisiblePanel = true;
|
|
@@ -178,7 +188,7 @@ const TMPanelManagerContainer = (props) => {
|
|
|
178
188
|
// If the panel has child panels, render a nested TMPanelManagerContainer or a component
|
|
179
189
|
if (panel.children && panel.children.length > 0) {
|
|
180
190
|
const jsxComponent = panel.contentOptions?.component;
|
|
181
|
-
return (_jsxs(React.Fragment, { children: [showGutter && (_jsx(StyledResizerGutter, { "$direction": direction, onMouseDown: (e) => startResizing(e,
|
|
191
|
+
return (_jsxs(React.Fragment, { children: [showGutter && (_jsx(StyledResizerGutter, { "$direction": direction, "$size": gutters, "$canResize": canResize, onMouseDown: canResize ? (e) => startResizing(e, resizeFromId, resizeToId) : undefined })), _jsx(TMPanelWrapper, { panel: panel, children: jsxComponent
|
|
182
192
|
? React.isValidElement(jsxComponent)
|
|
183
193
|
? React.cloneElement(jsxComponent, { groupId: panel.id, mainDirection: panel.childrenGroupDirection || direction })
|
|
184
194
|
: jsxComponent
|
|
@@ -186,7 +196,7 @@ const TMPanelManagerContainer = (props) => {
|
|
|
186
196
|
}
|
|
187
197
|
// If the panel has a component specified, render it with a possible gutter before it
|
|
188
198
|
if (panel.contentOptions && panel.contentOptions.component) {
|
|
189
|
-
return (_jsxs(React.Fragment, { children: [showGutter && (_jsx(StyledResizerGutter, { "$direction": direction, onMouseDown: (e) => startResizing(e,
|
|
199
|
+
return (_jsxs(React.Fragment, { children: [showGutter && (_jsx(StyledResizerGutter, { "$direction": direction, "$size": gutters, "$canResize": canResize, onMouseDown: canResize ? (e) => startResizing(e, resizeFromId, resizeToId) : undefined })), _jsx(TMPanelWrapper, { panel: panel, children: panel.contentOptions.component })] }, panel.id));
|
|
190
200
|
}
|
|
191
201
|
// If no children or components, render nothing for this panel
|
|
192
202
|
return null;
|
|
@@ -34,8 +34,8 @@ const TMPanelWrapper = (props) => {
|
|
|
34
34
|
// Applica 'flex' o 'none' solo se è già stato reso visibile almeno una volta
|
|
35
35
|
display: isCurrentlyVisible ? 'flex' : 'none',
|
|
36
36
|
flexDirection: 'column',
|
|
37
|
-
minWidth: '50px',
|
|
38
|
-
minHeight: '50px',
|
|
37
|
+
minWidth: panel.contentOptions?.minWidth ?? '50px',
|
|
38
|
+
minHeight: panel.contentOptions?.minHeight ?? '50px',
|
|
39
39
|
width: width,
|
|
40
40
|
height: height,
|
|
41
41
|
pointerEvents: 'auto',
|
|
@@ -92,8 +92,11 @@ export const TMMetadataIcon = ({ tid, md, color, layoutMode = LayoutModes.Update
|
|
|
92
92
|
break;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
+
// color='inherit' serve solo all'icona (eredita il colore dell'editor): il tooltip è renderizzato in overlay,
|
|
96
|
+
// dove 'inherit' non risolverebbe al colore dell'editor, quindi lì manteniamo la palette normale
|
|
97
|
+
let tooltipColor = color === 'inherit' ? undefined : color;
|
|
95
98
|
return (_jsx(_Fragment, { children: icon
|
|
96
|
-
? _jsx(TMMetadataTooltip, { tid: tid, md: md, layoutMode: layoutMode, color:
|
|
99
|
+
? _jsx(TMMetadataTooltip, { tid: tid, md: md, layoutMode: layoutMode, color: tooltipColor, children: icon })
|
|
97
100
|
: null }));
|
|
98
101
|
};
|
|
99
102
|
export const TMMetadataTooltip = ({ tid, md, color, children, layoutMode = LayoutModes.Update }) => {
|
|
@@ -259,7 +259,7 @@ export const TMDcmtTypeIcon = ({ dtd }) => {
|
|
|
259
259
|
return (_jsx(TMDcmtTypeTooltip, { dtd: dtd, children: icon }));
|
|
260
260
|
};
|
|
261
261
|
export const TMDcmtTypeTooltip = ({ dtd, children }) => {
|
|
262
|
-
return (_jsx("div", { style: { pointerEvents: 'all' }, children: _jsx(TMTooltip, { content: renderDTDTooltipContent(dtd), children: children }) }));
|
|
262
|
+
return (_jsx("div", { style: { pointerEvents: 'all' }, children: _jsx(TMTooltip, { allowContentInteraction: true, content: renderDTDTooltipContent(dtd), children: children }) }));
|
|
263
263
|
};
|
|
264
264
|
const TMTidViewer = ({ tmSession, tid, did, showIcon = false, color, showId = false, noneSelectionText = `<${SDKUI_Localizator.NoneSelection}>` }) => {
|
|
265
265
|
const [dtd, setDtd] = useState();
|
|
@@ -297,29 +297,43 @@ const TMTidViewer = ({ tmSession, tid, did, showIcon = false, color, showId = fa
|
|
|
297
297
|
textOverflow: 'ellipsis'
|
|
298
298
|
}, children: [showIcon && dtd && _jsx(TMDcmtTypeIcon, { dtd: dtd }), _jsx("p", { title: displayName(), style: {
|
|
299
299
|
textAlign: 'left',
|
|
300
|
+
margin: 0,
|
|
300
301
|
marginLeft: showIcon ? '5px' : '',
|
|
301
|
-
color:
|
|
302
|
+
color: dtd?.isView ? 'red' : (color ?? TMColors.primary),
|
|
302
303
|
whiteSpace: 'nowrap',
|
|
303
304
|
overflow: 'hidden',
|
|
304
305
|
textOverflow: 'ellipsis',
|
|
305
306
|
// paddingRight: '10px'
|
|
306
|
-
}, children: displayName() }), showId && _jsx("p", { style: { padding: '0px 3px' }, children: `(TID: ${tid})` })] }));
|
|
307
|
+
}, children: displayName() }), showId && _jsx("p", { style: { padding: '0px 3px', margin: 0 }, children: `(TID: ${tid})` })] }));
|
|
307
308
|
};
|
|
308
309
|
export default TMTidViewer;
|
|
309
310
|
export const cellRenderTID = (data, noneSelectionText) => {
|
|
310
311
|
return (_jsx(TMTidViewer, { tid: data.value, noneSelectionText: noneSelectionText }));
|
|
311
312
|
};
|
|
312
|
-
/**
|
|
313
|
+
/** Metodi di visualizzazione già richiesti, per non ricaricare i metadati ad ogni riapertura del tooltip */
|
|
314
|
+
const displayNameMethodCache = new Map();
|
|
313
315
|
const TMDisplayNameMethodItem = ({ dtd }) => {
|
|
314
|
-
const [displayNameMethod, setDisplayNameMethod] = useState(
|
|
315
|
-
|
|
316
|
-
|
|
316
|
+
const [displayNameMethod, setDisplayNameMethod] = useState(() => dtd.id ? displayNameMethodCache.get(dtd.id) : undefined);
|
|
317
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
318
|
+
const onShowClick = async (e) => {
|
|
319
|
+
/* Un click qualsiasi chiude il tooltip: senza questo il risultato non sarebbe mai visibile */
|
|
320
|
+
e.stopPropagation();
|
|
321
|
+
if (isLoading || displayNameMethod)
|
|
322
|
+
return;
|
|
323
|
+
setIsLoading(true);
|
|
324
|
+
try {
|
|
317
325
|
const method = await getDTDDisplayNameInfo(dtd);
|
|
326
|
+
if (dtd.id)
|
|
327
|
+
displayNameMethodCache.set(dtd.id, method);
|
|
318
328
|
setDisplayNameMethod(method);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
329
|
+
}
|
|
330
|
+
finally {
|
|
331
|
+
setIsLoading(false);
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
return (_jsxs(StyledTooltipItem, { children: [`${SDKUI_Localizator.DisplayNameMethod}: `, displayNameMethod ?? (isLoading
|
|
335
|
+
? `${SDKUI_Localizator.Loading} ...`
|
|
336
|
+
: _jsx("span", { style: { color: TMColors.primary, cursor: 'pointer', textDecoration: 'underline' }, onClick: onShowClick, children: SDKUI_Localizator.Details }))] }));
|
|
323
337
|
};
|
|
324
338
|
export const renderDTDTooltipContent = (dtd) => {
|
|
325
339
|
const mapAccessLevelToLocalizedString = (level) => {
|
|
@@ -67,6 +67,18 @@ export declare class ThemeSettings {
|
|
|
67
67
|
export declare const DEFAULT_PREVIEW_THRESHOLD = 500;
|
|
68
68
|
export declare const DEFAULT_PAGE_SIZE = 100;
|
|
69
69
|
export declare const DEFAULT_MAX_DCMTS_TO_BE_RETURNED = 200;
|
|
70
|
+
export declare const DEFAULT_QUICK_SEARCH_MAX_DCMTS = 1000;
|
|
71
|
+
/** Ricerca rapida configurata come sorgente alternativa dei valori distinti di un campo */
|
|
72
|
+
export declare class DistinctValuesQuickSearchSettings {
|
|
73
|
+
/** Tipo documento su cui viene eseguita la ricerca rapida */
|
|
74
|
+
tid: number | undefined;
|
|
75
|
+
/** ID della ricerca salvata (SavedQueryDescriptor) da eseguire; SYS_ALL_DCMTS_SQD_ID per la ricerca di sistema con tutti i documenti del tipo documento */
|
|
76
|
+
sqdId: number | undefined;
|
|
77
|
+
/** Metadato del risultato da cui viene prelevato il valore */
|
|
78
|
+
mid: number | undefined;
|
|
79
|
+
/** Numero massimo di documenti restituiti dalla ricerca rapida */
|
|
80
|
+
maxDcmtsToBeReturned: number;
|
|
81
|
+
}
|
|
70
82
|
export declare class SearchSettings {
|
|
71
83
|
autoFindReferences: ObjectClasses[];
|
|
72
84
|
invoiceRetrieveFormat: InvoiceRetrieveFormats;
|
|
@@ -85,7 +97,16 @@ export declare class SearchSettings {
|
|
|
85
97
|
};
|
|
86
98
|
};
|
|
87
99
|
relationExpandLevel: number;
|
|
100
|
+
relationShowZeroDcmts: boolean;
|
|
101
|
+
/** Ricerche rapide configurate per i valori distinti: una per ogni campo, con chiave "tid_mid" */
|
|
102
|
+
distinctValuesQuickSearches: {
|
|
103
|
+
[fieldKey: string]: DistinctValuesQuickSearchSettings;
|
|
104
|
+
};
|
|
88
105
|
}
|
|
106
|
+
/** Ricerca rapida configurata per il campo, se presente */
|
|
107
|
+
export declare const getDistinctValuesQuickSearch: (tid: number | undefined, mid: number | undefined) => DistinctValuesQuickSearchSettings | undefined;
|
|
108
|
+
export declare const saveDistinctValuesQuickSearch: (tid: number | undefined, mid: number | undefined, settings: DistinctValuesQuickSearchSettings) => void;
|
|
109
|
+
export declare const removeDistinctValuesQuickSearch: (tid: number | undefined, mid: number | undefined) => void;
|
|
89
110
|
export declare class FloatingMenuBarSettings {
|
|
90
111
|
orientation?: 'horizontal' | 'vertical';
|
|
91
112
|
itemIds?: string[];
|
|
@@ -95,10 +116,44 @@ export declare class FloatingMenuBarSettings {
|
|
|
95
116
|
};
|
|
96
117
|
positionFormat?: 'pixels' | 'percentage';
|
|
97
118
|
}
|
|
119
|
+
/** Sezioni del riepilogo dell'archiviazione multipla dei dettagli, aperte o collassate */
|
|
120
|
+
export type MultiDetailSectionsOpen = {
|
|
121
|
+
masterInfo: boolean;
|
|
122
|
+
archivedDetails: boolean;
|
|
123
|
+
archiveList: boolean;
|
|
124
|
+
};
|
|
125
|
+
/** Stato persistito di un pannello del riepilogo: visibilità e dimensioni, nel formato del panel manager */
|
|
126
|
+
export type MultiDetailPanelState = {
|
|
127
|
+
visible: boolean;
|
|
128
|
+
width: string;
|
|
129
|
+
height: string;
|
|
130
|
+
};
|
|
131
|
+
/** Stato dei pannelli del riepilogo, indicizzato per id pannello */
|
|
132
|
+
export type MultiDetailPanelStates = Record<string, MultiDetailPanelState>;
|
|
98
133
|
export declare class ArchivingSettings {
|
|
99
134
|
mruTIDs: number[];
|
|
100
135
|
defaultTree: number;
|
|
136
|
+
/** Sezioni collassate dall'utente nel riepilogo, ripristinate alla riapertura */
|
|
137
|
+
multiDetailSectionsOpen: MultiDetailSectionsOpen;
|
|
138
|
+
/**
|
|
139
|
+
* Altezze dei pannelli del riepilogo, gestite dal panel manager. Non comprende il collasso delle
|
|
140
|
+
* sezioni, che è in multiDetailSectionsOpen: resta vuoto finché l'utente non sposta un separatore.
|
|
141
|
+
*/
|
|
142
|
+
multiDetailPanelStates: MultiDetailPanelStates;
|
|
101
143
|
}
|
|
144
|
+
/** Stato di apertura salvato delle sezioni: i default coprono le impostazioni scritte prima di questo campo */
|
|
145
|
+
export declare const getMultiDetailSectionsOpen: () => MultiDetailSectionsOpen;
|
|
146
|
+
export declare const saveMultiDetailSectionsOpen: (sectionsOpen: MultiDetailSectionsOpen) => void;
|
|
147
|
+
/** Stato salvato dei pannelli: vuoto finché l'utente non ne ha ridimensionato nessuno */
|
|
148
|
+
export declare const getMultiDetailPanelStates: () => MultiDetailPanelStates;
|
|
149
|
+
/** Il panel manager applica lo stato salvato solo se esiste: altrimenti riparte dalle quote di default */
|
|
150
|
+
export declare const hasMultiDetailPanelStates: () => boolean;
|
|
151
|
+
export declare const saveMultiDetailPanelStates: (panelStates: MultiDetailPanelStates) => void;
|
|
152
|
+
/**
|
|
153
|
+
* Elimina dal local storage il layout configurato dall'utente per il riepilogo: altezze dei pannelli
|
|
154
|
+
* e sezioni collassate. Alla riapertura le sezioni sono tutte espanse con le quote di default.
|
|
155
|
+
*/
|
|
156
|
+
export declare const clearMultiDetailLayout: () => void;
|
|
102
157
|
export declare class FullTextSettings {
|
|
103
158
|
mruTerms: string[];
|
|
104
159
|
}
|
|
@@ -130,6 +130,20 @@ export class ThemeSettings {
|
|
|
130
130
|
export const DEFAULT_PREVIEW_THRESHOLD = 500; // KB
|
|
131
131
|
export const DEFAULT_PAGE_SIZE = 100;
|
|
132
132
|
export const DEFAULT_MAX_DCMTS_TO_BE_RETURNED = 200;
|
|
133
|
+
export const DEFAULT_QUICK_SEARCH_MAX_DCMTS = 1000;
|
|
134
|
+
/** Ricerca rapida configurata come sorgente alternativa dei valori distinti di un campo */
|
|
135
|
+
export class DistinctValuesQuickSearchSettings {
|
|
136
|
+
constructor() {
|
|
137
|
+
/** Tipo documento su cui viene eseguita la ricerca rapida */
|
|
138
|
+
this.tid = undefined;
|
|
139
|
+
/** ID della ricerca salvata (SavedQueryDescriptor) da eseguire; SYS_ALL_DCMTS_SQD_ID per la ricerca di sistema con tutti i documenti del tipo documento */
|
|
140
|
+
this.sqdId = undefined;
|
|
141
|
+
/** Metadato del risultato da cui viene prelevato il valore */
|
|
142
|
+
this.mid = undefined;
|
|
143
|
+
/** Numero massimo di documenti restituiti dalla ricerca rapida */
|
|
144
|
+
this.maxDcmtsToBeReturned = DEFAULT_QUICK_SEARCH_MAX_DCMTS;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
133
147
|
export class SearchSettings {
|
|
134
148
|
constructor() {
|
|
135
149
|
this.autoFindReferences = [];
|
|
@@ -143,16 +157,84 @@ export class SearchSettings {
|
|
|
143
157
|
this.floatingMenuBar = new FloatingMenuBarSettings();
|
|
144
158
|
this.panelLayout = {};
|
|
145
159
|
this.relationExpandLevel = 4; // Livello di espansione predefinito per le correlazioni
|
|
160
|
+
this.relationShowZeroDcmts = false;
|
|
161
|
+
/** Ricerche rapide configurate per i valori distinti: una per ogni campo, con chiave "tid_mid" */
|
|
162
|
+
this.distinctValuesQuickSearches = {};
|
|
146
163
|
}
|
|
147
164
|
}
|
|
165
|
+
/** Il campo da cui viene aperto il pannello dei valori distinti è identificato dalla coppia (tid, mid) */
|
|
166
|
+
const distinctValuesFieldKey = (tid, mid) => `${tid}_${mid}`;
|
|
167
|
+
/** Ricerca rapida configurata per il campo, se presente */
|
|
168
|
+
export const getDistinctValuesQuickSearch = (tid, mid) => {
|
|
169
|
+
if (!tid || !mid)
|
|
170
|
+
return undefined;
|
|
171
|
+
// Le impostazioni salvate da versioni precedenti non hanno la mappa: va gestita l'assenza
|
|
172
|
+
return SDKUI_Globals.userSettings.searchSettings.distinctValuesQuickSearches?.[distinctValuesFieldKey(tid, mid)];
|
|
173
|
+
};
|
|
174
|
+
export const saveDistinctValuesQuickSearch = (tid, mid, settings) => {
|
|
175
|
+
if (!tid || !mid)
|
|
176
|
+
return;
|
|
177
|
+
// Il proxy delle impostazioni persiste solo intercettando l'assegnazione di una proprietà: la mappa va riassegnata per intero
|
|
178
|
+
SDKUI_Globals.userSettings.searchSettings.distinctValuesQuickSearches = {
|
|
179
|
+
...SDKUI_Globals.userSettings.searchSettings.distinctValuesQuickSearches,
|
|
180
|
+
[distinctValuesFieldKey(tid, mid)]: settings,
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
export const removeDistinctValuesQuickSearch = (tid, mid) => {
|
|
184
|
+
if (!tid || !mid)
|
|
185
|
+
return;
|
|
186
|
+
const fieldKey = distinctValuesFieldKey(tid, mid);
|
|
187
|
+
const quickSearches = SDKUI_Globals.userSettings.searchSettings.distinctValuesQuickSearches;
|
|
188
|
+
if (!quickSearches?.[fieldKey])
|
|
189
|
+
return;
|
|
190
|
+
const { [fieldKey]: removedSettings, ...remainingQuickSearches } = quickSearches;
|
|
191
|
+
SDKUI_Globals.userSettings.searchSettings.distinctValuesQuickSearches = remainingQuickSearches;
|
|
192
|
+
};
|
|
148
193
|
export class FloatingMenuBarSettings {
|
|
149
194
|
}
|
|
195
|
+
/** Alla prima apertura le sezioni sono tutte espanse */
|
|
196
|
+
const DEFAULT_MULTI_DETAIL_SECTIONS_OPEN = { masterInfo: true, archivedDetails: true, archiveList: true };
|
|
150
197
|
export class ArchivingSettings {
|
|
151
198
|
constructor() {
|
|
152
199
|
this.mruTIDs = [];
|
|
153
200
|
this.defaultTree = -1;
|
|
201
|
+
/** Sezioni collassate dall'utente nel riepilogo, ripristinate alla riapertura */
|
|
202
|
+
this.multiDetailSectionsOpen = { ...DEFAULT_MULTI_DETAIL_SECTIONS_OPEN };
|
|
203
|
+
/**
|
|
204
|
+
* Altezze dei pannelli del riepilogo, gestite dal panel manager. Non comprende il collasso delle
|
|
205
|
+
* sezioni, che è in multiDetailSectionsOpen: resta vuoto finché l'utente non sposta un separatore.
|
|
206
|
+
*/
|
|
207
|
+
this.multiDetailPanelStates = {};
|
|
154
208
|
}
|
|
155
209
|
}
|
|
210
|
+
/** Stato di apertura salvato delle sezioni: i default coprono le impostazioni scritte prima di questo campo */
|
|
211
|
+
export const getMultiDetailSectionsOpen = () => ({
|
|
212
|
+
...DEFAULT_MULTI_DETAIL_SECTIONS_OPEN,
|
|
213
|
+
...SDKUI_Globals.userSettings.archivingSettings?.multiDetailSectionsOpen,
|
|
214
|
+
});
|
|
215
|
+
export const saveMultiDetailSectionsOpen = (sectionsOpen) => {
|
|
216
|
+
// Il proxy persiste solo intercettando l'assegnazione di una proprietà: la mappa va riassegnata per intero
|
|
217
|
+
SDKUI_Globals.userSettings.archivingSettings.multiDetailSectionsOpen = { ...sectionsOpen };
|
|
218
|
+
};
|
|
219
|
+
/** Stato salvato dei pannelli: vuoto finché l'utente non ne ha ridimensionato nessuno */
|
|
220
|
+
export const getMultiDetailPanelStates = () => SDKUI_Globals.userSettings.archivingSettings?.multiDetailPanelStates ?? {};
|
|
221
|
+
/** Il panel manager applica lo stato salvato solo se esiste: altrimenti riparte dalle quote di default */
|
|
222
|
+
export const hasMultiDetailPanelStates = () => Object.keys(getMultiDetailPanelStates()).length > 0;
|
|
223
|
+
export const saveMultiDetailPanelStates = (panelStates) => {
|
|
224
|
+
if (!panelStates || Object.keys(panelStates).length === 0)
|
|
225
|
+
return;
|
|
226
|
+
// Il proxy persiste solo intercettando l'assegnazione di una proprietà: la mappa va riassegnata per intero
|
|
227
|
+
SDKUI_Globals.userSettings.archivingSettings.multiDetailPanelStates = { ...panelStates };
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* Elimina dal local storage il layout configurato dall'utente per il riepilogo: altezze dei pannelli
|
|
231
|
+
* e sezioni collassate. Alla riapertura le sezioni sono tutte espanse con le quote di default.
|
|
232
|
+
*/
|
|
233
|
+
export const clearMultiDetailLayout = () => {
|
|
234
|
+
// Il proxy persiste solo intercettando l'assegnazione di una proprietà: entrambe le mappe vanno riassegnate
|
|
235
|
+
SDKUI_Globals.userSettings.archivingSettings.multiDetailPanelStates = {};
|
|
236
|
+
SDKUI_Globals.userSettings.archivingSettings.multiDetailSectionsOpen = { ...DEFAULT_MULTI_DETAIL_SECTIONS_OPEN };
|
|
237
|
+
};
|
|
156
238
|
export class FullTextSettings {
|
|
157
239
|
constructor() {
|
|
158
240
|
this.mruTerms = [];
|