@topconsultnpm/sdkui-react-beta 6.13.30 → 6.13.32
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/assets/icomoon.svg +96 -96
- package/lib/assets/italy.svg +16 -16
- package/lib/assets/topmedia-six.svg +65 -65
- package/lib/assets/topmeida-six-bianco.svg +65 -65
- package/lib/components/base/Styled.js +2 -2
- package/lib/components/base/TMPanel.d.ts +1 -0
- package/lib/components/base/TMPanel.js +8 -2
- package/lib/components/features/documents/TMDcmtForm.d.ts +3 -1
- package/lib/components/features/documents/TMDcmtForm.js +25 -20
- package/lib/components/features/documents/TMMasterDetailDcmts.js +2 -2
- package/lib/components/features/search/TMSearch.js +57 -54
- package/lib/components/features/search/TMSearchQueryPanel.js +2 -9
- package/lib/components/features/search/TMSearchResult.d.ts +1 -1
- package/lib/components/features/search/TMSearchResult.js +59 -61
- package/lib/components/features/search/TMTreeSelector.d.ts +1 -0
- package/lib/components/features/search/TMTreeSelector.js +5 -2
- package/lib/components/sidebar/TMCommandsPanel.js +1 -1
- package/lib/helper/SDKUI_Globals.js +2 -2
- package/lib/helper/queryHelper.js +9 -2
- package/lib/utils/theme.d.ts +6 -1
- package/lib/utils/theme.js +10 -1
- package/package.json +1 -1
@@ -11,6 +11,8 @@ const StyledPanelContainer = styled.div `
|
|
11
11
|
border-radius: 10px;
|
12
12
|
opacity: 1;
|
13
13
|
background: #FFFFFF;
|
14
|
+
min-height: 0;
|
15
|
+
overflow: hidden;
|
14
16
|
position: ${({ $isMaximized }) => $isMaximized ? 'fixed' : 'relative'};
|
15
17
|
top: ${({ $isMaximized }) => $isMaximized ? '50px' : 'auto'};
|
16
18
|
left: ${({ $isMaximized }) => $isMaximized ? '50px' : 'auto'};
|
@@ -49,6 +51,7 @@ const StyledPanelHeader = styled.div `
|
|
49
51
|
const StyledPanelContent = styled.div `
|
50
52
|
width: 100%;
|
51
53
|
height: ${props => props.$height};
|
54
|
+
min-height: 0;
|
52
55
|
overflow: hidden;
|
53
56
|
border-bottom-right-radius: 10px;
|
54
57
|
border-bottom-left-radius: 10px;
|
@@ -62,7 +65,7 @@ const StyledPanelContent = styled.div `
|
|
62
65
|
outline: none;
|
63
66
|
}
|
64
67
|
`;
|
65
|
-
const TMPanel = ({ allowMaximize = true, color, backgroundColor, backgroundColorContainer, children, showHeader = true, title, totalItems, displayedItemsCount, toolbar, padding = '5px', keepActiveState = false, onBack, onClose, onHeaderDoubleClick, onMaximize }) => {
|
68
|
+
const TMPanel = ({ allowMaximize = true, color, backgroundColor, backgroundColorContainer, children, showHeader = true, title, totalItems, displayedItemsCount, toolbar, padding = '5px', keepActiveState = false, isVisible = true, onBack, onClose, onHeaderDoubleClick, onMaximize }) => {
|
66
69
|
const [isActive, setIsActive] = useState(false);
|
67
70
|
const [isMaximized, setIsMaximized] = useState(false);
|
68
71
|
const [minWidth, setMinWidth] = useState(undefined);
|
@@ -95,7 +98,10 @@ const TMPanel = ({ allowMaximize = true, color, backgroundColor, backgroundColor
|
|
95
98
|
return newValue;
|
96
99
|
});
|
97
100
|
};
|
98
|
-
return (_jsxs(StyledPanelContainer, { "$isMaximized": onMaximize ? false : isMaximized, style:
|
101
|
+
return (_jsxs(StyledPanelContainer, { "$isMaximized": onMaximize ? false : isMaximized, style: {
|
102
|
+
...(minWidth ? { minWidth } : {}),
|
103
|
+
visibility: isVisible ? 'visible' : 'hidden',
|
104
|
+
}, children: [showHeader &&
|
99
105
|
_jsx(StyledPanelHeader, { "$backgroundColor": backgroundColor, "$color": color, "$isActive": isActive, onDoubleClick: () => { if (onHeaderDoubleClick)
|
100
106
|
onHeaderDoubleClick(); }, tabIndex: -1, onFocus: handleFocus, onBlur: handleBlur, onClick: handleFocus, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', width: '100%' }, children: [_jsxs("div", { ref: titleRowRef, style: { display: 'flex', flexDirection: 'row', alignItems: 'center', gap: '8px' }, children: [onBack &&
|
101
107
|
_jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconArrowLeft, {}), caption: SDKUI_Localizator.Back, onClick: onBack }), _jsx("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center' }, children: _jsxs("p", { style: {
|
@@ -27,7 +27,9 @@ interface ITMDcmtFormProps {
|
|
27
27
|
onClose?: () => void;
|
28
28
|
onSavedAsyncCallback?: (tid: number | undefined, did: number | undefined) => Promise<void>;
|
29
29
|
onSaveRecents?: (TIDs: number[]) => void;
|
30
|
-
|
30
|
+
onClosePreviewPanel?: () => void;
|
31
|
+
onCloseBlogPanel?: () => void;
|
32
|
+
onCloseSysMetadataPanel?: () => void;
|
31
33
|
isModal?: boolean;
|
32
34
|
titleModal?: string;
|
33
35
|
widthModal?: string;
|
@@ -9,7 +9,7 @@ import { DownloadTypes, FormModes } from '../../../ts';
|
|
9
9
|
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
10
10
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
11
11
|
import { handleArchiveVisibility, searchResultToMetadataValues } from '../../../helper/queryHelper';
|
12
|
-
import { genUniqueId, IconShow, SDKUI_Localizator, IconBoard, IconDcmtTypeSys, IconDetailDcmts, svgToString, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconRoundFileUpload } from '../../../helper';
|
12
|
+
import { genUniqueId, IconShow, SDKUI_Localizator, IconBoard, IconDcmtTypeSys, IconDetailDcmts, svgToString, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconRoundFileUpload, IconArrowLeft } from '../../../helper';
|
13
13
|
import { hasDetailRelations, hasMasterRelations, isXMLFileExt } from '../../../helper/dcmtsHelper';
|
14
14
|
import { TMColors } from '../../../utils/theme';
|
15
15
|
import { StyledFormButtonsContainer, StyledModalContainer, StyledToolbarCardContainer } from '../../base/Styled';
|
@@ -33,7 +33,7 @@ import TMPanel from '../../base/TMPanel';
|
|
33
33
|
import TMCommandsPanel from '../../sidebar/TMCommandsPanel';
|
34
34
|
let abortControllerLocal = new AbortController();
|
35
35
|
//#endregion
|
36
|
-
const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes.Update, onClose, onSavedAsyncCallback, TID, DID, formMode = FormModes.Update, canNext, canPrev, count, itemIndex, onNext, onPrev, customRightSidebarItems = [], allowNavigation = true, allowRelations = true, isClosable = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, showDcmtForm = true, showDcmtFormSidebar = true, showPreview = false, showBoard = false, showSysMetadata = false,
|
36
|
+
const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes.Update, onClose, onSavedAsyncCallback, TID, DID, formMode = FormModes.Update, canNext, canPrev, count, itemIndex, onNext, onPrev, customRightSidebarItems = [], allowNavigation = true, allowRelations = true, isClosable = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, showDcmtForm = true, showDcmtFormSidebar = true, showPreview = false, showBoard = false, showSysMetadata = false, onClosePreviewPanel, onCloseBlogPanel, onCloseSysMetadataPanel, titleModal, isModal = false, widthModal = "100%", heightModal = "100%" }) => {
|
37
37
|
const mruTIDs = SDKUI_Globals.userSettings.archivingSettings.mruTIDs;
|
38
38
|
const [id, setID] = useState('');
|
39
39
|
const [showWaitPanelLocal, setShowWaitPanelLocal] = useState(false);
|
@@ -144,10 +144,13 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
144
144
|
return _jsx(IconShow, {});
|
145
145
|
}, [layoutMode, fileIsNotValid]);
|
146
146
|
const closeMiddlePanel = () => {
|
147
|
+
if (isOpenSysMetadata)
|
148
|
+
onCloseSysMetadataPanel?.();
|
149
|
+
if (isOpenBoard)
|
150
|
+
onCloseBlogPanel?.();
|
147
151
|
setIsOpenBoard(false);
|
148
152
|
setIsOpenSysMetadata(false);
|
149
153
|
setIsOpenTags(false);
|
150
|
-
// setIsOpenDistinctValues(false);
|
151
154
|
setIsOpenFormulaEditor(false);
|
152
155
|
};
|
153
156
|
const titleText = () => {
|
@@ -157,7 +160,6 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
157
160
|
return 'Metadati di sistema';
|
158
161
|
if (isOpenBoard)
|
159
162
|
return 'Bacheca';
|
160
|
-
// if (isOpenDistinctValues) return `${SDKUI_Localizator.DistinctValues} (${focusedMetadataValue?.md?.nameLoc})`;
|
161
163
|
if (isOpenFormulaEditor)
|
162
164
|
return `${SDKUI_Localizator.FormulaEditorTitle} (${focusedMetadataValue?.md?.nameLoc})`;
|
163
165
|
return '';
|
@@ -451,7 +453,9 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
451
453
|
gap: SDKUI_Globals.userSettings.themeSettings.gutters,
|
452
454
|
width: '100%',
|
453
455
|
height: '100%',
|
454
|
-
}, children: [_jsx("div", { style: { flex: 1, minWidth: 0, height: '100%' }, children: _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: useWaitPanelLocalState ? showWaitPanelLocal : showWaitPanel, showWaitPanelPrimary: useWaitPanelLocalState ? showPrimaryLocal : showPrimary, showWaitPanelSecondary: useWaitPanelLocalState ? showSecondaryLocal : showSecondary, waitPanelTitle: useWaitPanelLocalState ? waitPanelTitleLocal : waitPanelTitle, waitPanelTextPrimary: useWaitPanelLocalState ? waitPanelTextPrimaryLocal : waitPanelTextPrimary, waitPanelValuePrimary: useWaitPanelLocalState ? waitPanelValuePrimaryLocal : waitPanelValuePrimary, waitPanelMaxValuePrimary: useWaitPanelLocalState ? waitPanelMaxValuePrimaryLocal : waitPanelMaxValuePrimary, waitPanelTextSecondary: useWaitPanelLocalState ? waitPanelTextSecondaryLocal : waitPanelTextSecondary, waitPanelValueSecondary: useWaitPanelLocalState ? waitPanelValueSecondaryLocal : waitPanelValueSecondary, waitPanelMaxValueSecondary: useWaitPanelLocalState ? waitPanelMaxValueSecondaryLocal : waitPanelMaxValueSecondary, isCancelable: useWaitPanelLocalState ? dcmtFile ? dcmtFile.size >= 1000000 : false : true, abortController: useWaitPanelLocalState ? abortControllerLocal : abortController, children: [_jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, separatorColor: 'transparent', showSeparator: (isOpenPreview || isOpenMiddlePanel()) && deviceType !== DeviceType.MOBILE && isOpenDcmtForm, start: getPrimarySplitterStartLayout(), min: deviceType !== DeviceType.MOBILE && isOpenDcmtForm ? ['150px', '0'] : ['0', '0'], children: [_jsx(TMLayoutItem, { children: _jsx(TMPanel, { showHeader: showHeader, title: fromDTD?.nameLoc, toolbar: allowNavigation ? formToolbar : _jsx(_Fragment, {}),
|
456
|
+
}, children: [_jsx("div", { style: { flex: 1, minWidth: 0, height: '100%' }, children: _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: useWaitPanelLocalState ? showWaitPanelLocal : showWaitPanel, showWaitPanelPrimary: useWaitPanelLocalState ? showPrimaryLocal : showPrimary, showWaitPanelSecondary: useWaitPanelLocalState ? showSecondaryLocal : showSecondary, waitPanelTitle: useWaitPanelLocalState ? waitPanelTitleLocal : waitPanelTitle, waitPanelTextPrimary: useWaitPanelLocalState ? waitPanelTextPrimaryLocal : waitPanelTextPrimary, waitPanelValuePrimary: useWaitPanelLocalState ? waitPanelValuePrimaryLocal : waitPanelValuePrimary, waitPanelMaxValuePrimary: useWaitPanelLocalState ? waitPanelMaxValuePrimaryLocal : waitPanelMaxValuePrimary, waitPanelTextSecondary: useWaitPanelLocalState ? waitPanelTextSecondaryLocal : waitPanelTextSecondary, waitPanelValueSecondary: useWaitPanelLocalState ? waitPanelValueSecondaryLocal : waitPanelValueSecondary, waitPanelMaxValueSecondary: useWaitPanelLocalState ? waitPanelMaxValueSecondaryLocal : waitPanelMaxValueSecondary, isCancelable: useWaitPanelLocalState ? dcmtFile ? dcmtFile.size >= 1000000 : false : true, abortController: useWaitPanelLocalState ? abortControllerLocal : abortController, children: [_jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, separatorColor: 'transparent', showSeparator: (isOpenPreview || isOpenMiddlePanel()) && deviceType !== DeviceType.MOBILE && isOpenDcmtForm, start: getPrimarySplitterStartLayout(), min: deviceType !== DeviceType.MOBILE && isOpenDcmtForm ? ['150px', '0'] : ['0', '0'], children: [_jsx(TMLayoutItem, { children: _jsx(TMPanel, { showHeader: showHeader, title: fromDTD?.nameLoc, toolbar: allowNavigation ? formToolbar : _jsx(_Fragment, {}),
|
457
|
+
// onBack={isClosable ? undefined : handleClose}
|
458
|
+
onClose: isClosable ? handleClose : undefined, children: metadataValuesSource.length > 0 && _jsxs(StyledToolbarCardContainer, { children: [_jsx(TMMetadataValues, { TID: TID, metadataValues: metadataValuesSource, metadataValuesOrig: metadataValuesSourceOrig, isExpertMode: isExpertMode, isOpenDistinctValues: isOpenDistinctValues, openChooserBySingleClick: !isOpenDistinctValues, selectedMID: focusedMetadataValue?.mid, layoutMode: layoutMode, deviceType: deviceType, validationItems: validationItems, onFocusedItemChanged: (item) => { (item?.mid !== focusedMetadataValue?.mid) && setFocusedMetadataValue(item); }, onValueChanged: (newItems) => {
|
455
459
|
setFormData((prevItems) => prevItems.map((item) => {
|
456
460
|
const newItem = newItems.find((newItem) => newItem.tid === item.tid && newItem.mid === item.mid);
|
457
461
|
return newItem ? { ...item, ...newItem } : item;
|
@@ -468,21 +472,21 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
468
472
|
} }), _jsxs(StyledFormButtonsContainer, { children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 10 }, children: [fromDTD?.templateTID === TemplateTIDs.WF_WIApprView && _jsx(WorkFlowOperationButtons, { onApprove: () => setShowApprovePopup(true), onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), isInDcmtForm: true }), _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: layoutMode === LayoutModes.Update ? _jsxs(_Fragment, { children: [_jsx(TMSaveFormButtonSave, { showTooltip: false, btnStyle: 'advanced', advancedColor: '#f09c0a', isModified: isModified, formMode: formMode, errorsCount: validationItems.filter(o => o.ResultType == ResultTypes.ERROR).length, onSaveAsync: confirmActionPopup }), _jsx(TMSaveFormButtonUndo, { btnStyle: 'toolbar', showTooltip: true, color: 'primary', isModified: isModified, formMode: formMode, onUndo: onUndoHandler })] }) :
|
469
473
|
_jsxs(_Fragment, { children: [_jsx(TMButton, { disabled: archiveBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconBoxArchiveIn, {}), showTooltip: false, caption: 'Archivia', advancedColor: TMColors.success, onClick: confirmActionPopup }), _jsx(TMButton, { disabled: !clearFormBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconClear, {}), showTooltip: false, caption: 'Pulisci', advancedColor: TMColors.tertiary, onClick: clearFormHandler }), DID && _jsx(TMButton, { disabled: undoBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconUndo, {}), width: '150px', showTooltip: false, caption: 'Annulla modifiche', advancedColor: TMColors.tertiary, onClick: onUndoHandler })] }) })] }), totalItems > listMaxItems && _jsx(TMShowAllOrMaxItemsButton, { showAll: showAll, dataSourceLength: totalItems, onClick: () => { setShowAll(!showAll); } })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, TID: TID, DID: DID, op: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, TID: TID, DID: DID, op: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, TID: TID, DID: DID, onClose: () => setShowReAssignPopup(false) }), _jsx(ConfirmAttachmentsDialog, {})] }) }) }), isOpenPreview || isOpenMiddlePanel() ?
|
470
474
|
_jsx(TMLayoutItem, { children: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, showSeparator: deviceType !== DeviceType.MOBILE && (isOpenPreview && isOpenMiddlePanel()), start: getSecondarySplitterStartLayout(), min: ['0', '0'], separatorColor: 'transparent', children: [isOpenMiddlePanel()
|
471
|
-
? _jsx(TMLayoutItem, { children:
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
475
|
+
? _jsx(TMLayoutItem, { children: _jsxs(TMPanel, { showHeader: !(isOpenDetails && layoutMode === LayoutModes.Update), title: titleText(), toolbar: middlePanelToolbar, onClose: () => { closeMiddlePanel(); }, children: [isOpenBoard && layoutMode === LayoutModes.Update &&
|
476
|
+
_jsx(TMDcmtBlog, { tid: TID, did: DID }), isOpenSysMetadata && layoutMode === LayoutModes.Update &&
|
477
|
+
_jsx(TMMetadataValues, { layoutMode: layoutMode, openChooserBySingleClick: !isOpenDistinctValues, TID: TID, isReadOnly: true, deviceType: deviceType, metadataValues: formData.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: formData.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [] }), isOpenFormulaEditor &&
|
478
|
+
_jsx(TMFormulaEditor, { isModal: false, formMode: FormModes.Update, inputData: getFormula(), showBack: false, onClose: () => setIsOpenFormulaEditor(false), onApplied: (newFormula) => {
|
479
|
+
setFormData((prevItems) => prevItems.map((item) => item.tid == newFormula.tid && item.mid === newFormula.mid ? { ...item, value: FormulaHelper.addFormulaTag(newFormula.expression), isSelected: true, isEditable: true } : item));
|
480
|
+
setFocusedMetadataValue(prevState => ({
|
481
|
+
...prevState,
|
482
|
+
isSelected: true,
|
483
|
+
isEditable: true,
|
484
|
+
value: FormulaHelper.addFormulaTag(newFormula.expression)
|
485
|
+
}));
|
486
|
+
} })] }) })
|
483
487
|
: _jsx(_Fragment, {}), isOpenPreview
|
484
488
|
? _jsxs(TMLayoutItem, { children: [layoutMode === LayoutModes.Update ?
|
485
|
-
_jsx(TMDcmtPreview, { onClose: () => { setIsOpenPreview(false);
|
489
|
+
_jsx(TMDcmtPreview, { onClose: () => { setIsOpenPreview(false); onClosePreviewPanel?.(); }, dcmtData: currentDcmt, canNext: canNext, canPrev: canPrev, onNext: onNext, onPrev: onPrev }) :
|
486
490
|
_jsx(TMFileUploader, { onFileUpload: (file) => setDcmtFile(file), onClose: () => setIsOpenPreview(false), isRequired: fromDTD?.archiveConstraint === ArchiveConstraints.ContentCompulsory && dcmtFile === null, defaultBlob: dcmtFile, deviceType: deviceType }), " "] })
|
487
491
|
: _jsx(_Fragment, {})] }) }) : _jsx(_Fragment, {})] }), isOpenDistinctValues &&
|
488
492
|
_jsx(TMDistinctValues, { tid: TID, mid: focusedMetadataValue?.mid, isModal: true, showHeader: false, layoutMode: layoutMode, onSelectionChanged: (e) => {
|
@@ -495,6 +499,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
495
499
|
setIsOpenPreview(!isOpenPreview); } }
|
496
500
|
] : []),
|
497
501
|
...(layoutMode !== LayoutModes.Ark ? [
|
502
|
+
{ icon: _jsx(IconArrowLeft, {}), onClick: isClosable ? undefined : handleClose },
|
498
503
|
{ icon: _jsx(IconShow, {}), selected: isOpenPreview, disabled: isPreviewDisabled, onClick: () => { if (!isPreviewDisabled)
|
499
504
|
setIsOpenPreview(!isOpenPreview); } },
|
500
505
|
{ icon: _jsx(IconBoard, {}), selected: isOpenBoard, disabled: isBoardDisabled, onClick: () => { if (!isBoardDisabled) {
|
@@ -506,9 +511,9 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
506
511
|
setIsOpenSysMetadata(!isOpenSysMetadata);
|
507
512
|
} } },
|
508
513
|
] : []),
|
509
|
-
...(currentTIDHasMasterRelations ? [{ icon: _jsx(IconDetailDcmts, {}), selected: isOpenMaster, disabled: isMasterDisabled, onClick: () => { if (!isMasterDisabled)
|
514
|
+
...(allowRelations && currentTIDHasMasterRelations ? [{ icon: _jsx(IconDetailDcmts, {}), selected: isOpenMaster, disabled: isMasterDisabled, onClick: () => { if (!isMasterDisabled)
|
510
515
|
setIsOpenMaster(!isOpenMaster); } }] : []),
|
511
|
-
...(currentTIDHasDetailRelations ? [{ icon: _jsx(IconDetailDcmts, { transform: 'scale(-1, 1)' }), selected: isOpenDetails, disabled: isDetailsDisabled, onClick: () => { if (!isDetailsDisabled)
|
516
|
+
...(allowRelations && currentTIDHasDetailRelations ? [{ icon: _jsx(IconDetailDcmts, { transform: 'scale(-1, 1)' }), selected: isOpenDetails, disabled: isDetailsDisabled, onClick: () => { if (!isDetailsDisabled)
|
512
517
|
setIsOpenDetails(!isOpenDetails); } }] : []),
|
513
518
|
...customRightSidebarItems
|
514
519
|
] }), isOpenDetails &&
|
@@ -393,8 +393,8 @@ const TMMasterDetailDcmts = ({ deviceType, inputDcmts, isForMaster, showCurrentD
|
|
393
393
|
_jsx(TMNothingToShow, { text: getTitle(), secondText: SDKUI_Localizator.NoDataToDisplay, icon: isForMaster ? _jsx(IconDetailDcmts, { fontSize: 96, transform: 'scale(-1, 1)' }) : _jsx(IconDetailDcmts, { fontSize: 96 }) })
|
394
394
|
:
|
395
395
|
_jsx(TMTreeView, { dataSource: data, allowMultipleSelection: allowMultipleSelection, calculateItemsForNode: calculateItemsForNode, itemRender: renderItem, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectionChanged: handleSelectedItemsChanged, onDataChanged: (items) => setData(updateHiddenProperty(items)) }) }), _jsx(TMLayoutItem, { children: focusedItem?.isDcmt ?
|
396
|
-
_jsx(TMDcmtForm, { TID: focusedItem?.tid, DID: focusedItem.did, isClosable: deviceType !== DeviceType.MOBILE, allowNavigation: false, allowRelations: deviceType !== DeviceType.MOBILE, showDcmtFormSidebar: deviceType === DeviceType.MOBILE, showPreview: showPreview, showBoard: showBoard, showSysMetadata: showSysMetadata, showDcmtForm: showDcmtForm, onClose: () => { setShowDcmtForm(false); },
|
397
|
-
_jsx(TMSearchResult, { context: SearchResultContext.METADATA_SEARCH, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, onClose: () => { setShowDcmtForm(false); },
|
396
|
+
_jsx(TMDcmtForm, { TID: focusedItem?.tid, DID: focusedItem.did, isClosable: deviceType !== DeviceType.MOBILE, allowNavigation: false, allowRelations: deviceType !== DeviceType.MOBILE, showDcmtFormSidebar: deviceType === DeviceType.MOBILE, showPreview: showPreview, showBoard: showBoard, showSysMetadata: showSysMetadata, showDcmtForm: showDcmtForm, onClose: () => { setShowDcmtForm(false); }, onClosePreviewPanel: () => { setShowPreview(false); } }) :
|
397
|
+
_jsx(TMSearchResult, { context: SearchResultContext.METADATA_SEARCH, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, onClose: () => { setShowDcmtForm(false); }, onClosePreviewPanel: () => { setShowPreview(false); }, onTaskCreateRequest: onTaskCreateRequest }) })] }, "TMDetails-panel") }) }), _jsx(TMCommandsPanel, { isMobile: isMobile, items: [
|
398
398
|
{ icon: _jsx(IconShow, {}), selected: showPreview, onClick: () => { setShowPreview(!showPreview); } },
|
399
399
|
{ icon: _jsx(IconPreview, {}), selected: showDcmtForm, onClick: () => { setShowDcmtForm(!showDcmtForm); } },
|
400
400
|
{ icon: _jsx(IconBoard, {}), selected: showBoard, onClick: () => { setShowSysMetadata(false); setShowBoard(!showBoard); } },
|
@@ -5,7 +5,7 @@ import TMSavedQuerySelector from './TMSavedQuerySelector';
|
|
5
5
|
import TMTreeSelector from './TMTreeSelector';
|
6
6
|
import { TabPanel, Item } from 'devextreme-react/tab-panel';
|
7
7
|
import TMSearchQueryPanel, { refreshLastSearch } from './TMSearchQueryPanel';
|
8
|
-
import { getSysAllDcmtsSQD, IconProgressReady, IconSavedQuery,
|
8
|
+
import { getSysAllDcmtsSQD, IconArrowRight, IconProgressReady, IconSavedQuery, IconTree, SDKUI_Globals, SDKUI_Localizator } from '../../../helper';
|
9
9
|
import { TMLayoutItem, TMSplitterLayout } from '../../base/TMLayout';
|
10
10
|
import TMPanel from '../../base/TMPanel';
|
11
11
|
import TMSearchResult from './TMSearchResult';
|
@@ -29,9 +29,9 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
29
29
|
const [searchResult, setSearchResult] = useState([]);
|
30
30
|
const [mruTIDs, setMruTIDs] = useState([]);
|
31
31
|
const [currentSearchView, setCurrentSearchView] = useState(TMSearchViews.None);
|
32
|
-
const [showDistinctValuesPanel, setShowDistinctValuesPanel] = useState(false);
|
33
32
|
const [showTreesPanel, setShowTreesPanel] = useState(true);
|
34
33
|
const [showRecentsPanel, setShowRecentsPanel] = useState(true);
|
34
|
+
const [showSearchPanel, setShowSearchPanel] = useState(true);
|
35
35
|
const [showSavedQueryPanel, setShowSavedQueryPanel] = useState(true);
|
36
36
|
const [currentSQDMode, setCurrentSQDMode] = useState(1);
|
37
37
|
const [lastQdSearched, setLastQdSearched] = useState();
|
@@ -54,6 +54,7 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
54
54
|
}, [inputSqdID]);
|
55
55
|
useEffect(() => {
|
56
56
|
if (!currentTID || currentTID <= 0) {
|
57
|
+
setShowSearchPanel(false);
|
57
58
|
setSearchResult([]);
|
58
59
|
return;
|
59
60
|
}
|
@@ -63,6 +64,7 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
63
64
|
setFilteredByTIDSQDs(sqds);
|
64
65
|
setCurrentSQDMode(0);
|
65
66
|
await setDefaultSQDAsync(sqds);
|
67
|
+
setShowSearchPanel(true);
|
66
68
|
});
|
67
69
|
}, [currentTID]);
|
68
70
|
useEffect(() => {
|
@@ -131,71 +133,72 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
131
133
|
gap: SDKUI_Globals.userSettings.themeSettings.gutters,
|
132
134
|
width: '100%',
|
133
135
|
height: '100%',
|
134
|
-
}, children: [_jsx("div", { style: { flex: 1, minWidth: 0, height: '100%' }, children: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, separatorActiveColor: 'transparent', separatorColor: 'transparent', showSeparator: deviceType !== DeviceType.MOBILE && showTreesPanel, min: ['0', '0'], start:
|
136
|
+
}, children: [_jsx("div", { style: { flex: 1, minWidth: 0, height: '100%' }, children: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, separatorActiveColor: 'transparent', separatorColor: 'transparent', showSeparator: deviceType !== DeviceType.MOBILE && showTreesPanel, min: ['0', '0'], start: isMobile ? ['100%', '0%'] : showTreesPanel ? ['20%', '80%'] : ['0%', '100%'], children: [!isMobile &&
|
135
137
|
_jsx(TMTreeSelector, { onClose: () => setShowTreesPanel(false), onSelectedTIDChanged: (tid) => {
|
136
138
|
setCurrentTID(tid);
|
137
139
|
if (tid && mruTIDs.includes(tid))
|
138
140
|
setCurrentMruTID(tid);
|
139
141
|
else
|
140
142
|
setCurrentMruTID(0);
|
141
|
-
} }), _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', showSeparator: deviceType !== DeviceType.MOBILE && showSavedQueryPanel
|
143
|
+
} }), _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', showSeparator: deviceType !== DeviceType.MOBILE && showSavedQueryPanel, separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, separatorColor: 'transparent', separatorActiveColor: 'transparent', min: ['0', '0'], start: isMobile ? ['100%', '0%'] : ((showSavedQueryPanel) ? ['70%', '30%'] : ['100%', '0%']), children: [_jsx(TMLayoutItem, { children: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', showSeparator: deviceType !== DeviceType.MOBILE && showRecentsPanel, separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, separatorColor: 'transparent', separatorActiveColor: 'transparent', min: ['0', '0'], start: deviceType === DeviceType.DESKTOP ? (showRecentsPanel ? ['30%', '70%'] : ['0%', '100%']) : (currentTID ? ['0%', '100%'] : ['100%', '0%']), children: [_jsx(TMPanel, { title: "Scorciatoie", totalItems: mruTIDs.length, allowMaximize: !isMobile, onClose: isMobile ? undefined : () => setShowRecentsPanel(false), children: _jsx(TMRecentsManager, { mruTIDs: mruTIDs, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: (tid) => { setCurrentMruTID(tid); setCurrentTID(tid); }, onDeletedTID: (tid) => {
|
142
144
|
let newMruTIDS = mruTIDs.slice();
|
143
145
|
let index = newMruTIDS.findIndex(o => o == tid);
|
144
146
|
if (index >= 0)
|
145
147
|
newMruTIDS.splice(index, 1);
|
146
148
|
SDKUI_Globals.userSettings.searchSettings.mruTIDs = newMruTIDS.filter(tid => tid != undefined && tid != null);
|
147
149
|
setMruTIDs(newMruTIDS);
|
148
|
-
} }) }), _jsx(TMSearchQueryPanel, { isExpertMode: isExpertMode, fromDTD: fromDTD, SQD: currentSQD, onBack: deviceType !== DeviceType.DESKTOP ? () => { setCurrentTID(0); } : undefined, onSearchCompleted: (searchResult, qd) => {
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
150
|
+
} }) }), _jsx(StyledMultiViewPanel, { "$isVisible": showSearchPanel || !isMobile, children: _jsx(TMSearchQueryPanel, { isExpertMode: isExpertMode, fromDTD: fromDTD, SQD: currentSQD, onBack: deviceType !== DeviceType.DESKTOP ? () => { setCurrentTID(0); } : undefined, onSearchCompleted: (searchResult, qd) => {
|
151
|
+
setSearchResult(searchResult);
|
152
|
+
if (searchResult.length <= 0)
|
153
|
+
return;
|
154
|
+
setLastQdSearched(qd);
|
155
|
+
setCurrentSearchView(TMSearchViews.Result);
|
156
|
+
// Salvataggio ultimi 10 TIDs
|
157
|
+
let fromTID = searchResult?.[0].fromTID;
|
158
|
+
let newMruTIDS = mruTIDs.slice();
|
159
|
+
let index = newMruTIDS.findIndex(o => o == fromTID);
|
160
|
+
if (index >= 0)
|
161
|
+
newMruTIDS.splice(index, 1);
|
162
|
+
if (newMruTIDS.length >= 10)
|
163
|
+
newMruTIDS.splice(0, 1);
|
164
|
+
newMruTIDS.push(fromTID);
|
165
|
+
setMruTIDs(newMruTIDS);
|
166
|
+
setCurrentMruTID(fromTID);
|
167
|
+
SDKUI_Globals.userSettings.searchSettings.mruTIDs = newMruTIDS.filter(tid => tid != undefined && tid != null);
|
168
|
+
}, onSqdSaved: async (newSqd) => {
|
169
|
+
await loadDataSQDsAsync(true, newSqd.masterTID);
|
170
|
+
await setSQDAsync(newSqd);
|
171
|
+
} }) })] }) }), _jsx(StyledMultiViewPanel, { "$isVisible": showSavedQueryPanel && !isMobile, children: _jsx(TMPanel, { title: SDK_Localizator.SavedQueries, allowMaximize: !isMobile, onClose: isMobile ? undefined : () => setShowSavedQueryPanel(false), children: _jsxs(TabPanel, { width: "100%", height: "100%", showNavButtons: true, repaintChangesOnly: true, selectedIndex: currentSQDMode, onSelectedIndexChange: (index) => setCurrentSQDMode(index), children: [(currentTID || currentSQD) ? _jsx(Item, { title: fromDTD?.nameLoc, children: _jsx(TMSavedQuerySelector, { allowShowSearch: false, items: filteredByTIDSQDs, selectedId: currentSQD?.id, onRefreshData: () => { loadDataSQDsAsync(true); }, onItemClick: (sqd) => onSQDItemClick(sqd, setSQDAsync), onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? filteredByTIDSQDs.find(o => o.id == 1) : currentSQD, setSQDAsync) }) }) : _jsx(_Fragment, {}), _jsx(Item, { title: SDKUI_Localizator.Alls2, children: _jsx(TMSavedQuerySelector, { allowShowSearch: true, items: allSQDs, manageDefault: false,
|
170
172
|
// selectedId={currentSQD?.id}
|
171
|
-
onItemClick: (sqd) => onSQDItemClick(sqd, setSQDAsync), onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? undefined : currentSQD, setSQDAsync) }) })] }) }) })] })] }) }),
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
173
|
+
onItemClick: (sqd) => onSQDItemClick(sqd, setSQDAsync), onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? undefined : currentSQD, setSQDAsync) }) })] }) }) })] })] }) }), !isMobile &&
|
174
|
+
_jsx(TMCommandsPanel, { isMobile: isMobile, items: [
|
175
|
+
{
|
176
|
+
icon: _jsx(IconTree, {}),
|
177
|
+
selected: showTreesPanel,
|
178
|
+
onClick: () => setShowTreesPanel(!showTreesPanel),
|
179
|
+
},
|
180
|
+
{
|
181
|
+
icon: _jsx(IconProgressReady, {}),
|
182
|
+
selected: showRecentsPanel,
|
183
|
+
onClick: () => setShowRecentsPanel(!showRecentsPanel),
|
184
|
+
},
|
185
|
+
{
|
186
|
+
icon: _jsx(IconSavedQuery, {}),
|
187
|
+
selected: showSavedQueryPanel,
|
188
|
+
onClick: () => setShowSavedQueryPanel(!showSavedQueryPanel),
|
189
|
+
},
|
190
|
+
...(searchResult.length > 0 ? [{
|
191
|
+
icon: _jsx(IconArrowRight, {}),
|
192
|
+
disabled: searchResult.length <= 0,
|
193
|
+
onClick: () => {
|
194
|
+
if (searchResult.length > 0) {
|
195
|
+
setCurrentSearchView(currentSearchView === TMSearchViews.None
|
196
|
+
? TMSearchViews.Result
|
197
|
+
: TMSearchViews.None);
|
198
|
+
}
|
199
|
+
},
|
200
|
+
}] : []),
|
201
|
+
] })] }), searchResult.length > 0 &&
|
199
202
|
_jsx(TMSearchResult, { isVisible: currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync: async () => {
|
200
203
|
// setSearchResult([]);
|
201
204
|
setSearchResult(await refreshLastSearch(lastQdSearched) ?? []);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
2
|
import { useEffect, useState } from 'react';
|
3
|
-
import { PlatformObjectValidator, WhereItem, SDK_Localizator, OrderByItem, SelectItem, SelectItemVisibilities, SDK_Globals,
|
3
|
+
import { PlatformObjectValidator, WhereItem, SDK_Localizator, OrderByItem, SelectItem, SelectItemVisibilities, SDK_Globals, SavedQueryCacheService, SearchEngine, QueryOperators } from '@topconsultnpm/sdk-ts-beta';
|
4
4
|
import styled from 'styled-components';
|
5
5
|
import TMSearchQueryEditor from './TMSearchQueryEditor';
|
6
6
|
import Logo from '../../../assets/Toppy-generico.png';
|
@@ -102,7 +102,7 @@ const TMSearchQueryPanel = ({ fromDTD, isExpertMode = SDKUI_Globals.userSettings
|
|
102
102
|
}
|
103
103
|
}
|
104
104
|
};
|
105
|
-
return (_jsxs(_Fragment, { children: [_jsxs(TMPanel, { title: fromDTD?.nameLoc ?? SDKUI_Localizator.Search_Metadata, onBack: onBack, keepActiveState: keepStatePanelIsActive, toolbar: _jsx(_Fragment, { children: (SQD && !showSqdForm) ?
|
105
|
+
return (_jsxs(_Fragment, { children: [_jsxs(TMPanel, { title: fromDTD?.nameLoc ?? SDKUI_Localizator.Search_Metadata, allowMaximize: deviceType !== DeviceType.MOBILE, onBack: onBack, keepActiveState: keepStatePanelIsActive, toolbar: _jsx(_Fragment, { children: (SQD && !showSqdForm) ?
|
106
106
|
_jsx(TMDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'icon', caption: 'Altro', icon: _jsx(IconMenuVertical, { color: 'white' }), showTooltip: false }), items: [
|
107
107
|
{ icon: _jsx(IconAddCircleOutline, {}), text: SDKUI_Localizator.SavedQueryNew, onClick: () => { openSqdForm(FormModes.Create); } },
|
108
108
|
{ icon: _jsx(IconEdit, {}), text: SDKUI_Localizator.SavedQueryUpdate, disabled: (SQD && SQD.id == 1), onClick: () => { openSqdForm(FormModes.Update); } },
|
@@ -229,13 +229,6 @@ const searchByQdAsync = async (qdInput, searchParams) => {
|
|
229
229
|
qdSearch.where?.forEach(o => o.or = false); // props.easyOr
|
230
230
|
}
|
231
231
|
qdSearch.select?.forEach(o => { o.visibility ??= SelectItemVisibilities.Visible; });
|
232
|
-
if (qdSearch.orderBy && qdSearch.orderBy.length <= 0) {
|
233
|
-
let obi = new OrderByItem();
|
234
|
-
obi.tid = fromTID;
|
235
|
-
obi.mid = SystemMIDsAsNumber.DID;
|
236
|
-
obi.asc = false;
|
237
|
-
qdSearch.orderBy.push(obi);
|
238
|
-
}
|
239
232
|
if (IsParametricQuery(qdSearch)) {
|
240
233
|
const qdParams = await searchParams.confirmQueryParams?.(qdSearch, searchParams.lastQdParams) ?? [];
|
241
234
|
searchParams.setLastQdParamsCallback?.(qdParams);
|
@@ -20,7 +20,7 @@ interface ITMSearchResultProps {
|
|
20
20
|
onSelectedTIDChanged?: (TID: number) => void;
|
21
21
|
onRefreshSearchAsync?: () => Promise<void>;
|
22
22
|
onRefreshAfterAddDcmtToFavs?: () => void;
|
23
|
-
|
23
|
+
onClosePreviewPanel?: () => void;
|
24
24
|
onTaskCreateRequest?: (taskContext: TaskContext) => void;
|
25
25
|
}
|
26
26
|
declare const TMSearchResult: React.FC<ITMSearchResultProps>;
|