@topconsultnpm/sdkui-react-beta 6.15.59 → 6.15.60
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/base/TMPanel.js +5 -4
- package/lib/components/features/documents/TMBatchUpdateForm.js +2 -2
- package/lib/components/features/documents/TMDcmtForm.js +2 -2
- package/lib/components/features/search/TMSearchResult.js +4 -4
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +4 -3
- package/lib/helper/SDKUI_Globals.d.ts +0 -2
- package/lib/helper/SDKUI_Globals.js +1 -5
- package/package.json +1 -1
|
@@ -5,8 +5,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
*/
|
|
6
6
|
import { useCallback, useRef, useState, forwardRef, useImperativeHandle } from 'react';
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { IconArrowLeft, IconClearButton, IconWindowMaximize, IconWindowMinimize, isPositiveNumber,
|
|
8
|
+
import { IconArrowLeft, IconClearButton, IconWindowMaximize, IconWindowMinimize, isPositiveNumber, SDKUI_Localizator } from '../../helper';
|
|
9
9
|
import TMButton from './TMButton';
|
|
10
|
+
import { Gutters } from '../../utils/theme';
|
|
10
11
|
const StyledPanelContainer = styled.div `
|
|
11
12
|
width: 100%;
|
|
12
13
|
height: 100%;
|
|
@@ -20,10 +21,10 @@ const StyledPanelContainer = styled.div `
|
|
|
20
21
|
position: ${({ $isMaximized }) => $isMaximized ? 'fixed' : 'relative'};
|
|
21
22
|
top: ${({ $isMaximized }) => $isMaximized ? '50px' : 'auto'};
|
|
22
23
|
left: ${({ $isMaximized }) => $isMaximized ? '50px' : 'auto'};
|
|
23
|
-
width: ${({ $isMaximized }) => $isMaximized ? `calc(100vw - 50px - (${
|
|
24
|
-
height: ${({ $isMaximized }) => $isMaximized ? `calc(100vh - 50px - (${
|
|
24
|
+
width: ${({ $isMaximized }) => $isMaximized ? `calc(100vw - 50px - (${Gutters.getGutters()}px * 2))` : '100%'};
|
|
25
|
+
height: ${({ $isMaximized }) => $isMaximized ? `calc(100vh - 50px - (${Gutters.getGutters()}px * 2))` : '100%'};
|
|
25
26
|
z-index: ${({ $isMaximized }) => $isMaximized ? 2000 : 'auto'};
|
|
26
|
-
margin: ${({ $isMaximized }) => $isMaximized ? `${
|
|
27
|
+
margin: ${({ $isMaximized }) => $isMaximized ? `${Gutters.getGutters()}px` : '0'};
|
|
27
28
|
/* transition: all 0.2s; */
|
|
28
29
|
`;
|
|
29
30
|
const StyledPanelHeader = styled.div `
|
|
@@ -18,7 +18,7 @@ import TMMetadataValues, { ShowCheckBoxesMode, AdvancedMenuButtons } from '../..
|
|
|
18
18
|
import { TMSaveFormButtonSave, TMSaveFormButtonUndo } from '../../forms/TMSaveForm';
|
|
19
19
|
import TMPanel from '../../base/TMPanel';
|
|
20
20
|
import TMModal from '../../base/TMModal';
|
|
21
|
-
import { TMColors } from '../../../utils/theme';
|
|
21
|
+
import { Gutters, TMColors } from '../../../utils/theme';
|
|
22
22
|
const TMBatchUpdateForm = ({ inputDcmts, TID, DID, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, titleModal, isModal = false, widthModal = "100%", heightModal = "100%", onSavedCallbackAsync, onBack, onStatusChanged }) => {
|
|
23
23
|
const [metadataValues, setMetadataValues] = useState([]);
|
|
24
24
|
const [metadataValuesOrig, setMetadataValuesOrig] = useState([]);
|
|
@@ -115,7 +115,7 @@ const TMBatchUpdateForm = ({ inputDcmts, TID, DID, isExpertMode = SDKUI_Globals.
|
|
|
115
115
|
const metadataValuesSource = metadataValues.filter(o => o.mid && o.mid > 100).slice(0, showAll ? metadataValues.filter(o => o.mid && o.mid > 100).length : listMaxItems);
|
|
116
116
|
const metadataValuesSourceOrig = metadataValuesOrig.filter(o => o.mid && o.mid > 100).slice(0, showAll ? metadataValuesOrig.filter(o => o.mid && o.mid > 100).length : listMaxItems);
|
|
117
117
|
const renderContent = () => {
|
|
118
|
-
return (_jsx(TMLayoutWaitingContainer, { showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, isCancelable: true, abortController: abortController, children: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize:
|
|
118
|
+
return (_jsx(TMLayoutWaitingContainer, { showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, isCancelable: true, abortController: abortController, children: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: Gutters.getGutters(), separatorColor: 'transparent', separatorActiveColor: 'transparent', showSeparator: showFormulaEditor, start: showFormulaEditor ? ['50%', '50%'] : ['100%', '0%'], min: ['0', '0'], children: [_jsx(TMPanel, { title: isModal ? 'Modifica i metadati' : `${SDKUI_Localizator.BatchUpdate} (${inputDcmts.length} documenti selezionati)`, onBack: deviceType === DeviceType.MOBILE ? onBack : undefined,
|
|
119
119
|
// onClose={deviceType !== DeviceType.MOBILE ? onBack : undefined}
|
|
120
120
|
allowMaximize: !isModal, showHeader: !isModal, children: _jsxs(StyledToolbarCardContainer, { children: [_jsx(TMMetadataValues, { TID: TID, isExpertMode: isExpertMode, showCheckBoxes: ShowCheckBoxesMode.Always, showNullValueCheckBoxes: true, metadataValues: metadataValuesSource, metadataValuesOrig: metadataValuesSourceOrig, validationItems: validationItems, isOpenDistinctValues: showDistinctValuesPanel, selectedMID: focusedMetadataValue?.mid, onFocusedItemChanged: (item) => { setFocusedMetadataValue(item); }, onValueChanged: (newItems) => {
|
|
121
121
|
setMetadataValues((prevItems) => prevItems.map((item) => {
|
|
@@ -10,7 +10,7 @@ import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
|
10
10
|
import { handleArchiveVisibility, searchResultToMetadataValues } from '../../../helper/queryHelper';
|
|
11
11
|
import { genUniqueId, IconShow, SDKUI_Localizator, updateMruTids, IconBoard, IconDcmtTypeSys, IconDetailDcmts, svgToString, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconPreview, isTaskMoreInfo } from '../../../helper';
|
|
12
12
|
import { hasDetailRelations, hasMasterRelations, isXMLFileExt } from '../../../helper/dcmtsHelper';
|
|
13
|
-
import { TMColors } from '../../../utils/theme';
|
|
13
|
+
import { Gutters, TMColors } from '../../../utils/theme';
|
|
14
14
|
import { StyledFormButtonsContainer, StyledModalContainer, StyledToolbarCardContainer } from '../../base/Styled';
|
|
15
15
|
import ShowAlert from '../../base/TMAlert';
|
|
16
16
|
import TMButton from '../../base/TMButton';
|
|
@@ -625,7 +625,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
625
625
|
display: 'flex',
|
|
626
626
|
flexDirection: deviceType === DeviceType.MOBILE ? 'column' : 'row',
|
|
627
627
|
justifyContent: 'space-between',
|
|
628
|
-
gap:
|
|
628
|
+
gap: Gutters.getGutters(),
|
|
629
629
|
width: '100%',
|
|
630
630
|
height: '100%',
|
|
631
631
|
position: 'relative',
|
|
@@ -3,11 +3,11 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
3
3
|
import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes, TemplateTIDs, DcmtTypeListCacheService, AccessLevels, SystemMIDsAsNumber } from '@topconsultnpm/sdk-ts-beta';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { getCommandsMenuItems, getSelectedDcmtsOrFocused } from './TMSearchResultsMenuItems';
|
|
6
|
-
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, IconDownload, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, searchResultToMetadataValues,
|
|
6
|
+
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, IconDownload, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, IconSearchCheck, TMCommandsContextMenu } from '../../../helper';
|
|
7
7
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
8
8
|
import { useInputAttachmentsDialog, useInputCvtFormatDialog } from '../../../hooks/useInputDialog';
|
|
9
9
|
import { DcmtOperationTypes, FormModes, SearchResultContext, DownloadTypes } from '../../../ts';
|
|
10
|
-
import { TMColors } from '../../../utils/theme';
|
|
10
|
+
import { Gutters, TMColors } from '../../../utils/theme';
|
|
11
11
|
import { StyledModalContainer, StyledBadge, StyledMultiViewPanel } from '../../base/Styled';
|
|
12
12
|
import TMButton from '../../base/TMButton';
|
|
13
13
|
import TMDataGrid, { TMDataGridPageSize } from '../../base/TMDataGrid';
|
|
@@ -360,7 +360,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
360
360
|
const tmSearchResult = useMemo(() => (!searchResults || searchResults.length <= 0)
|
|
361
361
|
? _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%' }, children: [_jsx(IconBoard, { fontSize: 96 }), _jsx("div", { style: { fontSize: "15px", marginTop: "10px" }, children: SDKUI_Localizator.NoDcmtFound }), _jsx("div", { style: { marginTop: "10px" }, children: _jsx(TMButton, { fontSize: "15px", icon: _jsx("i", { className: 'dx-icon-share' }), caption: SDKUI_Localizator.Share, onClick: openAddDocumentForm }) })] })
|
|
362
362
|
:
|
|
363
|
-
_jsxs(_Fragment, { children: [_jsxs(TMLayoutItem, { height: '100%', children: [_jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize:
|
|
363
|
+
_jsxs(_Fragment, { children: [_jsxs(TMLayoutItem, { height: '100%', children: [_jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: Gutters.getGutters(), separatorActiveColor: 'transparent', separatorColor: 'transparent', min: ['0', '0'], showSeparator: showSelector && deviceType !== DeviceType.MOBILE, start: showSelector ? deviceType !== DeviceType.MOBILE ? ['30%', '70%'] : splitterSize : ['0%', '100%'], children: [showSelector ?
|
|
364
364
|
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
365
365
|
:
|
|
366
366
|
_jsx(_Fragment, {}), _jsxs(TMLayoutItem, { children: [_jsx(TMSearchResultGrid, { inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], lastUpdateSearchTime: lastUpdateSearchTime, onDblClick: () => openFormHandler(LayoutModes.Update), onContextMenuPreparing: onContextMenuPreparing, onSelectionChanged: (items) => { setSelectedItems(items); }, onVisibleItemChanged: setVisibleItems, onFocusedItemChanged: setFocusedItem, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync(inputDcmts, downloadType, downloadMode, onFileOpened, confirmAttachments), showExportForm: showExportForm, onCloseExportForm: onCloseExportForm }), allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE &&
|
|
@@ -448,7 +448,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
448
448
|
display: 'flex',
|
|
449
449
|
flexDirection: isMobile ? 'column' : 'row',
|
|
450
450
|
justifyContent: 'space-between',
|
|
451
|
-
gap:
|
|
451
|
+
gap: Gutters.getGutters(),
|
|
452
452
|
width: '100%',
|
|
453
453
|
height: '100%',
|
|
454
454
|
}, children: _jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: (groupId && groupId.length > 0) ?
|
|
@@ -4,8 +4,9 @@ import styled from 'styled-components';
|
|
|
4
4
|
import { useTMPanelManagerContext } from './TMPanelManagerContext';
|
|
5
5
|
import TMPanelWrapper from './TMPanelWrapper';
|
|
6
6
|
import TMPanelManagerToolbar from './TMPanelManagerToolbar';
|
|
7
|
-
import { IconInfo,
|
|
7
|
+
import { IconInfo, SDKUI_Localizator } from '../../../helper';
|
|
8
8
|
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
|
9
|
+
import { Gutters } from '../../../utils/theme';
|
|
9
10
|
// Styled Component per il contenitore principale di PanelContainer
|
|
10
11
|
const StyledPanelContainerWrapper = styled.div `
|
|
11
12
|
display: ${props => (props.$hasVisiblePanels ? 'flex' : 'none')};
|
|
@@ -17,7 +18,7 @@ const StyledPanelContainerWrapper = styled.div `
|
|
|
17
18
|
// Styled Component per il gutter (separatore)
|
|
18
19
|
const StyledResizerGutter = styled.div `
|
|
19
20
|
cursor: ${props => (props.$direction === 'horizontal' ? 'col-resize' : 'row-resize')};
|
|
20
|
-
${props => (props.$direction === 'horizontal' ? `width: ${
|
|
21
|
+
${props => (props.$direction === 'horizontal' ? `width: ${Gutters.getGutters()}px;` : `height: ${Gutters.getGutters()}px;`)}
|
|
21
22
|
flex-shrink: 0;
|
|
22
23
|
background-color: "transparent";
|
|
23
24
|
z-index: 10;
|
|
@@ -29,7 +30,7 @@ const TMPanelManagerContainer = (props) => {
|
|
|
29
30
|
const deviceType = useDeviceType();
|
|
30
31
|
// This avoids unnecessary re-renders by only recalculating when deviceType changes
|
|
31
32
|
let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
|
|
32
|
-
const gutters =
|
|
33
|
+
const gutters = Gutters.getGutters();
|
|
33
34
|
// References to store information related to resizing
|
|
34
35
|
// startMousePos: stores the mouse position when resizing starts (x or y coordinate)
|
|
35
36
|
const startMousePos = useRef(0);
|
|
@@ -30,8 +30,6 @@ export declare class DataGridSettings {
|
|
|
30
30
|
export declare class ThemeSettings {
|
|
31
31
|
fontSize: string;
|
|
32
32
|
gridSettings: DataGridSettings;
|
|
33
|
-
/** Calcola dinamicamente i gutters in base alla dimensione attuale della finestra. */
|
|
34
|
-
get gutters(): number;
|
|
35
33
|
constructor(skipCssUpdate?: boolean);
|
|
36
34
|
/**
|
|
37
35
|
* Controlla la serializzazione JSON di questo oggetto.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InvoiceRetrieveFormats, LocalStorageService, OrderRetrieveFormats } from "@topconsultnpm/sdk-ts-beta";
|
|
2
|
-
import { FontSize
|
|
2
|
+
import { FontSize } from "../utils/theme";
|
|
3
3
|
// import { LandingPages } from "./helpers";
|
|
4
4
|
export const dcmtsFileCacheDownload = new Map();
|
|
5
5
|
export const dcmtsFileCachePreview = new Map();
|
|
@@ -63,10 +63,6 @@ export class DataGridSettings {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
export class ThemeSettings {
|
|
66
|
-
/** Calcola dinamicamente i gutters in base alla dimensione attuale della finestra. */
|
|
67
|
-
get gutters() {
|
|
68
|
-
return Gutters.getGutters();
|
|
69
|
-
}
|
|
70
66
|
constructor(skipCssUpdate = false) {
|
|
71
67
|
this.fontSize = FontSize.defaultFontSizeInPixel;
|
|
72
68
|
this.gridSettings = new DataGridSettings();
|