@topconsultnpm/sdkui-react-beta 6.13.45 → 6.13.46
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/features/documents/TMBatchUpdateForm.d.ts +4 -0
- package/lib/components/features/documents/TMBatchUpdateForm.js +37 -31
- package/lib/components/features/documents/TMDcmtForm.d.ts +2 -1
- package/lib/components/features/documents/TMDcmtForm.js +21 -19
- package/lib/components/features/documents/TMMasterDetailDcmts.js +84 -107
- package/lib/components/features/search/TMSearchQueryPanel.js +2 -2
- package/lib/components/features/search/TMSearchResult.d.ts +2 -0
- package/lib/components/features/search/TMSearchResult.js +137 -130
- package/package.json +1 -1
@@ -5,6 +5,10 @@ interface ITMBatchUpdateFormProps {
|
|
5
5
|
TID: number | undefined;
|
6
6
|
DID: number | undefined;
|
7
7
|
isExpertMode?: boolean;
|
8
|
+
isModal?: boolean;
|
9
|
+
titleModal?: string;
|
10
|
+
widthModal?: string;
|
11
|
+
heightModal?: string;
|
8
12
|
onBack?: () => void;
|
9
13
|
onSavedCallbackAsync?: () => Promise<void>;
|
10
14
|
onStatusChanged?: (isModified: boolean, isValid: boolean) => void;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
2
|
import { useEffect, useState } from 'react';
|
3
3
|
import { AccessLevels, DcmtTypeListCacheService, LayoutModes, MetadataDataDomains, ResultTypes, SDK_Globals, ValidationItem } from '@topconsultnpm/sdk-ts-beta';
|
4
4
|
import { searchResultToMetadataValues, getSystemMetadata, calcIsModified, getListMaxItems, SDKUI_Localizator, SDKUI_Globals } from '../../../helper';
|
@@ -17,7 +17,8 @@ import { useMetadataEditableList } from '../../editors/TMMetadataEditor';
|
|
17
17
|
import TMMetadataValues, { ShowCheckBoxesMode, AdvancedMenuButtons } from '../../editors/TMMetadataValues';
|
18
18
|
import { TMSaveFormButtonSave, TMSaveFormButtonUndo } from '../../forms/TMSaveForm';
|
19
19
|
import TMPanel from '../../base/TMPanel';
|
20
|
-
|
20
|
+
import TMModal from '../../base/TMModal';
|
21
|
+
const TMBatchUpdateForm = ({ inputDcmts, TID, DID, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, titleModal, isModal = false, widthModal = "100%", heightModal = "100%", onSavedCallbackAsync, onBack, onStatusChanged }) => {
|
21
22
|
const [metadataValues, setMetadataValues] = useState([]);
|
22
23
|
const [metadataValuesOrig, setMetadataValuesOrig] = useState([]);
|
23
24
|
const [validationItems, setValidationItems] = useState([]);
|
@@ -112,35 +113,40 @@ const TMBatchUpdateForm = ({ inputDcmts, TID, DID, isExpertMode = SDKUI_Globals.
|
|
112
113
|
const totalItems = metadataValues.filter(o => o.mid && o.mid > 100).length;
|
113
114
|
const metadataValuesSource = metadataValues.filter(o => o.mid && o.mid > 100).slice(0, showAll ? metadataValues.filter(o => o.mid && o.mid > 100).length : listMaxItems);
|
114
115
|
const metadataValuesSourceOrig = metadataValuesOrig.filter(o => o.mid && o.mid > 100).slice(0, showAll ? metadataValuesOrig.filter(o => o.mid && o.mid > 100).length : listMaxItems);
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
116
|
+
const renderContent = () => {
|
117
|
+
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: SDKUI_Globals.userSettings.themeSettings.gutters, separatorColor: 'transparent', showSeparator: showFormulaEditor, start: showFormulaEditor ? ['50%', '50%'] : ['100%', '0%'], min: ['0', '0'], children: [_jsx(TMPanel, { title: `${SDKUI_Localizator.BatchUpdate} (${inputDcmts.length} documenti selezionati)`, onBack: deviceType === DeviceType.MOBILE ? onBack : undefined, onClose: deviceType !== DeviceType.MOBILE ? onBack : undefined, 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) => {
|
118
|
+
setMetadataValues((prevItems) => prevItems.map((item) => {
|
119
|
+
const newItem = newItems.find((newItem) => newItem.tid === item.tid && newItem.mid === item.mid);
|
120
|
+
return newItem ? { ...item, ...newItem } : item;
|
121
|
+
}));
|
122
|
+
}, onAdvancedMenuClick: (e) => {
|
123
|
+
switch (e.button) {
|
124
|
+
case AdvancedMenuButtons.DistinctValues:
|
125
|
+
setShowDistinctValuesPanel(!showDistinctValuesPanel);
|
126
|
+
break;
|
127
|
+
case AdvancedMenuButtons.FormulaEditor:
|
128
|
+
setShowFormulaEditor(!showFormulaEditor);
|
129
|
+
break;
|
130
|
+
}
|
131
|
+
} }), _jsxs(StyledFormButtonsContainer, { children: [_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: 10 }, children: _jsxs("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: [_jsx(TMSaveFormButtonSave, { showTooltip: false, btnStyle: 'advanced', advancedColor: '#f09c0a', isModified: errors.length <= 0 && isModified, formMode: FormModes.Update, errorsCount: errors.length, onSaveAsync: onSavedAsync }), _jsx(TMSaveFormButtonUndo, { btnStyle: 'toolbar', showTooltip: true, color: 'primary', isModified: isModified, formMode: FormModes.Update, onUndo: onUndoHandler })] }) }), totalItems > listMaxItems && _jsx(TMShowAllOrMaxItemsButton, { showAll: showAll, dataSourceLength: totalItems, onClick: () => { setShowAll(!showAll); } })] })] }) }), showDistinctValuesPanel && focusedMetadataValue &&
|
132
|
+
_jsx(TMDistinctValues, { isModal: true, tid: TID, mid: focusedMetadataValue?.mid, separator: ', ', allowAppendMode: false, onClosePanelCallback: () => setShowDistinctValuesPanel(false), onSelectionChanged: (e) => {
|
133
|
+
if (!e)
|
134
|
+
return;
|
135
|
+
setMetadataValues((prevItems) => prevItems.map((item) => item.tid == e.tid && item.mid === e.mid ? { ...item, value: e.newValue, isSelected: true } : item));
|
136
|
+
} }), showFormulaEditor && focusedMetadataValue &&
|
137
|
+
_jsx(TMPanel, { title: SDKUI_Localizator.FormulaEditorTitle + (focusedMetadataValue?.md?.nameLoc ? ` (${focusedMetadataValue?.md?.nameLoc})` : ''), onClose: () => setShowFormulaEditor(false), children: _jsx(TMFormulaEditor, { isModal: false, formMode: FormModes.Update, inputData: getFormula(), showBack: false, onClose: () => setShowFormulaEditor(false), onApplied: (newFormula) => {
|
138
|
+
setMetadataValues((prevItems) => prevItems.map((item) => item.tid == newFormula.tid && item.mid === newFormula.mid ? { ...item, value: FormulaHelper.addFormulaTag(newFormula.expression), isSelected: true, isEditable: true } : item));
|
139
|
+
setFocusedMetadataValue(prevState => ({
|
140
|
+
...prevState,
|
141
|
+
isSelected: true,
|
142
|
+
isEditable: true,
|
143
|
+
value: FormulaHelper.addFormulaTag(newFormula.expression)
|
119
144
|
}));
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
setShowFormulaEditor(!showFormulaEditor);
|
127
|
-
break;
|
128
|
-
}
|
129
|
-
} }), _jsxs(StyledFormButtonsContainer, { children: [_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: 10 }, children: _jsxs("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: [_jsx(TMSaveFormButtonSave, { showTooltip: false, btnStyle: 'advanced', advancedColor: '#f09c0a', isModified: errors.length <= 0 && isModified, formMode: FormModes.Update, errorsCount: errors.length, onSaveAsync: onSavedAsync }), _jsx(TMSaveFormButtonUndo, { btnStyle: 'toolbar', showTooltip: true, color: 'primary', isModified: isModified, formMode: FormModes.Update, onUndo: onUndoHandler })] }) }), totalItems > listMaxItems && _jsx(TMShowAllOrMaxItemsButton, { showAll: showAll, dataSourceLength: totalItems, onClick: () => { setShowAll(!showAll); } })] })] }) }), showDistinctValuesPanel && focusedMetadataValue &&
|
130
|
-
_jsx(TMDistinctValues, { isModal: true, tid: TID, mid: focusedMetadataValue?.mid, separator: ', ', allowAppendMode: false, onClosePanelCallback: () => setShowDistinctValuesPanel(false), onSelectionChanged: (e) => {
|
131
|
-
if (!e)
|
132
|
-
return;
|
133
|
-
setMetadataValues((prevItems) => prevItems.map((item) => item.tid == e.tid && item.mid === e.mid ? { ...item, value: e.newValue, isSelected: true } : item));
|
134
|
-
} }), showFormulaEditor && focusedMetadataValue &&
|
135
|
-
_jsx(TMPanel, { title: SDKUI_Localizator.FormulaEditorTitle + (focusedMetadataValue?.md?.nameLoc ? ` (${focusedMetadataValue?.md?.nameLoc})` : ''), onClose: () => setShowFormulaEditor(false), children: _jsx(TMFormulaEditor, { isModal: false, formMode: FormModes.Update, inputData: getFormula(), showBack: false, onClose: () => setShowFormulaEditor(false), onApplied: (newFormula) => {
|
136
|
-
setMetadataValues((prevItems) => prevItems.map((item) => item.tid == newFormula.tid && item.mid === newFormula.mid ? { ...item, value: FormulaHelper.addFormulaTag(newFormula.expression), isSelected: true, isEditable: true } : item));
|
137
|
-
setFocusedMetadataValue(prevState => ({
|
138
|
-
...prevState,
|
139
|
-
isSelected: true,
|
140
|
-
isEditable: true,
|
141
|
-
value: FormulaHelper.addFormulaTag(newFormula.expression)
|
142
|
-
}));
|
143
|
-
addOrRemoveEditableList(newFormula.mid);
|
144
|
-
} }) })] }) }));
|
145
|
+
addOrRemoveEditableList(newFormula.mid);
|
146
|
+
} }) })] }) }));
|
147
|
+
};
|
148
|
+
return (_jsx(_Fragment, { children: (isModal && onBack)
|
149
|
+
? _jsx(TMModal, { title: titleModal, onClose: onBack, width: widthModal ?? '100%', height: heightModal ?? '100%', hidePopup: false, askClosingConfirm: true, children: _jsx("div", { style: { width: "100%", height: "100%", display: 'block', padding: "4px" }, children: renderContent() }) })
|
150
|
+
: renderContent() }));
|
145
151
|
};
|
146
152
|
export default TMBatchUpdateForm;
|
@@ -38,8 +38,9 @@ interface ITMDcmtFormProps {
|
|
38
38
|
}
|
39
39
|
declare const TMDcmtForm: React.FC<ITMDcmtFormProps>;
|
40
40
|
export default TMDcmtForm;
|
41
|
-
export declare const ToppyHelpCenter: ({ content, onClick, deviceType }: {
|
41
|
+
export declare const ToppyHelpCenter: ({ content, onClick, deviceType, top }: {
|
42
42
|
content?: any;
|
43
43
|
onClick?: () => void;
|
44
44
|
deviceType?: DeviceType;
|
45
|
+
top?: number;
|
45
46
|
}) => import("react/jsx-runtime").JSX.Element;
|
@@ -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, IconArrowLeft } 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, IconPreview } 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';
|
@@ -454,22 +454,23 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
454
454
|
gap: SDKUI_Globals.userSettings.themeSettings.gutters,
|
455
455
|
width: '100%',
|
456
456
|
height: '100%',
|
457
|
-
}, 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, {}), onBack: (isClosable && deviceType !== DeviceType.MOBILE) ? undefined : handleClose, onClose: isClosable ?
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
457
|
+
}, 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, {}), onBack: (isClosable && deviceType !== DeviceType.MOBILE) ? undefined : handleClose, onClose: isClosable ? () => setIsOpenDcmtForm(false) : undefined, children: metadataValuesSource.length > 0 &&
|
458
|
+
_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) => {
|
459
|
+
setFormData((prevItems) => prevItems.map((item) => {
|
460
|
+
const newItem = newItems.find((newItem) => newItem.tid === item.tid && newItem.mid === item.mid);
|
461
|
+
return newItem ? { ...item, ...newItem } : item;
|
462
|
+
}));
|
463
|
+
}, onAdvancedMenuClick: (e) => {
|
464
|
+
switch (e.button) {
|
465
|
+
case AdvancedMenuButtons.DistinctValues:
|
466
|
+
setIsOpenDistinctValues(!isOpenDistinctValues);
|
467
|
+
break;
|
468
|
+
case AdvancedMenuButtons.FormulaEditor:
|
469
|
+
setIsOpenFormulaEditor(!isOpenFormulaEditor);
|
470
|
+
break;
|
471
|
+
}
|
472
|
+
} }), _jsxs(StyledFormButtonsContainer, { children: [_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: 10 }, children: _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 })] }) :
|
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() ?
|
473
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()
|
474
475
|
? _jsx(TMLayoutItem, { children: _jsxs(TMPanel, { showHeader: !(isOpenDetails && layoutMode === LayoutModes.Update), title: titleText(), onClose: () => { closeMiddlePanel(); }, children: [isOpenBoard && layoutMode === LayoutModes.Update &&
|
475
476
|
_jsx(TMDcmtBlog, { tid: TID, did: DID }), isOpenSysMetadata && layoutMode === LayoutModes.Update &&
|
@@ -499,6 +500,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
499
500
|
] : []),
|
500
501
|
...(layoutMode !== LayoutModes.Ark ? [
|
501
502
|
...(deviceType === DeviceType.MOBILE ? [{ icon: _jsx(IconArrowLeft, {}), onClick: isClosable ? undefined : handleClose }] : []),
|
503
|
+
{ icon: _jsx(IconPreview, {}), selected: isOpenDcmtForm, onClick: () => { setIsOpenDcmtForm(!isOpenDcmtForm); } },
|
502
504
|
{ icon: _jsx(IconShow, {}), selected: isOpenPreview, disabled: isPreviewDisabled, onClick: () => { if (!isPreviewDisabled)
|
503
505
|
setIsOpenPreview(!isOpenPreview); } },
|
504
506
|
{ icon: _jsx(IconBoard, {}), selected: isOpenBoard, disabled: isBoardDisabled, onClick: () => { if (!isBoardDisabled) {
|
@@ -602,6 +604,6 @@ const ToppyImage = styled.img `
|
|
602
604
|
height: ${props => props.$isMobile ? '140px' : '200px'};
|
603
605
|
cursor: ${props => props.$isMobile ? 'pointer' : 'default'};
|
604
606
|
`;
|
605
|
-
export const ToppyHelpCenter = ({ content, onClick, deviceType }) => {
|
606
|
-
return (_jsxs(ToppyContainer, { children: [_jsx(ToppyImage, { "$isMobile": deviceType === DeviceType.MOBILE, onClick: onClick, src: toppy, alt: "Toppy" }), _jsx("div", { style: { top: deviceType === DeviceType.MOBILE ? -180 :
|
607
|
+
export const ToppyHelpCenter = ({ content, onClick, deviceType, top = -200 }) => {
|
608
|
+
return (_jsxs(ToppyContainer, { children: [_jsx(ToppyImage, { "$isMobile": deviceType === DeviceType.MOBILE, onClick: onClick, src: toppy, alt: "Toppy" }), _jsx("div", { style: { top: deviceType === DeviceType.MOBILE ? -180 : top, right: deviceType === DeviceType.MOBILE ? 20 : 1, transform: 'rotate(20deg)', position: 'absolute', width: 'max-content', height: 'max-content' }, children: content })] }));
|
607
609
|
};
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import { useCallback, useEffect, useMemo, useState } from 'react';
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
3
3
|
import { DataColumnTypes, DcmtTypeListCacheService, MetadataDataDomains, MetadataFormats, RelationCacheService, RelationTypes, ResultTypes, SDK_Globals, SystemMIDs } from '@topconsultnpm/sdk-ts-beta';
|
4
4
|
import { ContextMenu } from 'devextreme-react';
|
5
5
|
import { TMNothingToShow } from './TMDcmtPreview';
|
6
6
|
import TMDcmtForm from './TMDcmtForm';
|
7
7
|
import TMSearchResult from '../search/TMSearchResult';
|
8
|
-
import { genUniqueId, getExceptionMessage, IconFolder,
|
8
|
+
import { genUniqueId, getExceptionMessage, IconFolder, IconDetailDcmts, SDKUI_Localizator, svgToString, IconMail, IconDcmtTypeOnlyMetadata, IconCopy, IconMultipleSelection, IconMenuVertical, IconSearchCheck, IconDataList, SDKUI_Globals, IconInfo } from '../../../helper';
|
9
9
|
import { hasDetailRelations } from '../../../helper/dcmtsHelper';
|
10
10
|
import { FormModes, SearchResultContext } from '../../../ts';
|
11
11
|
import { TMColors } from '../../../utils/theme';
|
@@ -23,7 +23,10 @@ import TMDataListItemViewer from '../../viewers/TMDataListItemViewer';
|
|
23
23
|
import { TMDcmtTypeTooltip } from '../../viewers/TMTidViewer';
|
24
24
|
import TMTreeView from '../../base/TMTreeView';
|
25
25
|
import TMDcmtIcon from './TMDcmtIcon';
|
26
|
-
import
|
26
|
+
import { TMPanelManagerContextProvider, useTMPanelContext } from '../../layout/panel/TMPanelContext';
|
27
|
+
import { useResizablePanels } from '../../layout/panel/useResizablePanels';
|
28
|
+
import { TMPanelToolbar } from '../../layout/panel/TMPanelToolbar';
|
29
|
+
import TMPanel from '../../base/TMPanel';
|
27
30
|
let abortController = new AbortController();
|
28
31
|
const TMMasterDetailDcmts = ({ deviceType, inputDcmts, isForMaster, showCurrentDcmtIndicator = true, allowNavigation, canNext, canPrev, onNext, onPrev, onBack, appendMasterDcmts, onTaskCreateRequest }) => {
|
29
32
|
const [id, setID] = useState('');
|
@@ -378,7 +381,7 @@ const TMMasterDetailDcmts = ({ deviceType, inputDcmts, isForMaster, showCurrentD
|
|
378
381
|
const toolbar = _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [allowMultipleSelection && _jsx("p", { style: { color: TMColors.colorHeader, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${selectedItems.length} selezionati` }), _jsx(TMButton, { btnStyle: 'icon', caption: 'Selezione multipla', icon: _jsx(IconMultipleSelection, { fontSize: 16, color: allowMultipleSelection ? TMColors.tertiary : 'white' }), onClick: () => setAllowMultipleSelection(!allowMultipleSelection) }), allowNavigation && canPrev != undefined && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), allowNavigation && canNext != undefined && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(IconMenuVertical, { id: `commands-detail-${id}`, color: 'white', cursor: 'pointer' }), _jsx(ContextMenu, { showEvent: 'click', dataSource: commandsMenuItems, target: `#commands-detail-${id}` })] });
|
379
382
|
const getTitle = () => isForMaster ? `${SDKUI_Localizator.DcmtsMaster} - ${dtdMaster?.nameLoc}` : SDKUI_Localizator.DcmtsDetail;
|
380
383
|
const isMobile = deviceType === DeviceType.MOBILE;
|
381
|
-
const renderTMTreeView = (handleTogglePanel) => _jsx(
|
384
|
+
const renderTMTreeView = (handleTogglePanel) => _jsx(TMPanel, { title: getTitle(), onBack: onBack, toolbar: toolbar, allowMaximize: !isMobile, children: isLoading ? _jsx(_Fragment, {}) :
|
382
385
|
data.length <= 0
|
383
386
|
?
|
384
387
|
_jsx(TMNothingToShow, { text: getTitle(), secondText: SDKUI_Localizator.NoDataToDisplay, icon: isForMaster ? _jsx(IconDetailDcmts, { fontSize: 96, transform: 'scale(-1, 1)' }) : _jsx(IconDetailDcmts, { fontSize: 96 }) })
|
@@ -387,129 +390,46 @@ const TMMasterDetailDcmts = ({ deviceType, inputDcmts, isForMaster, showCurrentD
|
|
387
390
|
const renderTMFormOrResult = useMemo(() => (handleTogglePanel) => {
|
388
391
|
return (_jsx(_Fragment, { children: focusedItem?.isDcmt ?
|
389
392
|
_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); } }) :
|
390
|
-
_jsx(TMSearchResult, { context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false,
|
393
|
+
_jsx(TMSearchResult, { context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, allowRelations: false, openDcmtFormAsModal: true, searchResults: focusedItem?.searchResult ?? [],
|
394
|
+
// showPreview={showPreview}
|
395
|
+
// showBoard={showBoard}
|
396
|
+
// showSysMetadata={showSysMetadata}
|
397
|
+
showSearchResultSidebar: false, onClose: () => { setShowDcmtForm(false); }, onClosePreviewPanel: () => {
|
391
398
|
setShowPreview(false);
|
392
399
|
handleTogglePanel("commandPreview");
|
393
400
|
}, onTaskCreateRequest: onTaskCreateRequest }) }));
|
394
401
|
}, [focusedItem, showPreview, showBoard, showSysMetadata, showDcmtForm, deviceType]);
|
395
|
-
const
|
402
|
+
const panels = [
|
396
403
|
{
|
397
404
|
id: 'TMTreeView',
|
398
405
|
name: getTitle(),
|
399
|
-
|
400
|
-
type: 'content',
|
406
|
+
children: [],
|
401
407
|
contentOptions: {
|
402
|
-
|
408
|
+
width: '50%',
|
403
409
|
height: '100%',
|
404
|
-
width: '20%',
|
405
|
-
content: renderTMTreeView,
|
406
|
-
panelContainer: {
|
407
|
-
title: getTitle(),
|
408
|
-
allowMaximize: !isMobile,
|
409
|
-
onBack: onBack,
|
410
|
-
toolbar: toolbar
|
411
|
-
},
|
412
410
|
},
|
411
|
+
toolbarOptions: {
|
412
|
+
icon: _jsx(IconDataList, { fontSize: 24 }),
|
413
|
+
visible: true,
|
414
|
+
isActive: true
|
415
|
+
}
|
413
416
|
},
|
414
417
|
{
|
415
418
|
id: 'TMFormOrResult',
|
416
419
|
name: focusedItem?.isDcmt ? "Form del documento" : SDKUI_Localizator.SearchResult,
|
417
|
-
|
418
|
-
type: 'content',
|
420
|
+
children: [],
|
419
421
|
contentOptions: {
|
420
|
-
|
422
|
+
width: '50%',
|
421
423
|
height: '100%',
|
422
|
-
width: '20%',
|
423
|
-
content: renderTMFormOrResult,
|
424
|
-
},
|
425
|
-
},
|
426
|
-
{
|
427
|
-
id: 'commandPreview',
|
428
|
-
name: SDKUI_Localizator.PreviewDocument,
|
429
|
-
toolbarOptions: {
|
430
|
-
icon: _jsx(IconShow, { fontSize: 24 }),
|
431
|
-
visible: true,
|
432
|
-
disabled: !focusedItem,
|
433
|
-
isActive: showPreview,
|
434
|
-
orderNumber: 3,
|
435
424
|
},
|
436
|
-
type: 'button',
|
437
|
-
buttonOptions: {
|
438
|
-
onClick: () => {
|
439
|
-
setShowPreview(prev => !prev);
|
440
|
-
},
|
441
|
-
},
|
442
|
-
},
|
443
|
-
{
|
444
|
-
id: 'commandSysMetadata',
|
445
|
-
name: SDKUI_Localizator.MetadataSystem,
|
446
|
-
toolbarOptions: {
|
447
|
-
icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }),
|
448
|
-
visible: true,
|
449
|
-
disabled: !focusedItem,
|
450
|
-
isActive: showSysMetadata,
|
451
|
-
orderNumber: 3,
|
452
|
-
},
|
453
|
-
type: 'button',
|
454
|
-
buttonOptions: {
|
455
|
-
onClick: () => {
|
456
|
-
setShowSysMetadata(prev => !prev);
|
457
|
-
},
|
458
|
-
},
|
459
|
-
},
|
460
|
-
{
|
461
|
-
id: 'commandBoard',
|
462
|
-
name: SDKUI_Localizator.BlogCase,
|
463
425
|
toolbarOptions: {
|
464
|
-
icon: _jsx(
|
465
|
-
disabled: !focusedItem,
|
426
|
+
icon: _jsx(IconSearchCheck, { fontSize: 24 }),
|
466
427
|
visible: true,
|
467
|
-
isActive:
|
468
|
-
|
469
|
-
|
470
|
-
type: 'button',
|
471
|
-
buttonOptions: {
|
472
|
-
onClick: () => {
|
473
|
-
setShowBoard(prev => !prev);
|
474
|
-
},
|
475
|
-
},
|
476
|
-
},
|
477
|
-
{
|
478
|
-
id: 'commandZeroDcmts',
|
479
|
-
name: "Consenti dettagli con 0 documenti",
|
480
|
-
toolbarOptions: {
|
481
|
-
icon: _jsx(IconCheckFile, { fontSize: 24 }),
|
482
|
-
visible: true,
|
483
|
-
isActive: showZeroDcmts,
|
484
|
-
orderNumber: 3,
|
485
|
-
beginGroup: true,
|
486
|
-
},
|
487
|
-
type: 'button',
|
488
|
-
buttonOptions: {
|
489
|
-
onClick: () => {
|
490
|
-
setShowZeroDcmts(prev => !prev);
|
491
|
-
},
|
492
|
-
},
|
493
|
-
},
|
494
|
-
{
|
495
|
-
id: 'commandMasterDcmts',
|
496
|
-
name: SDKUI_Localizator.DcmtsMaster,
|
497
|
-
toolbarOptions: {
|
498
|
-
icon: _jsx(IconDetailDcmts, { transform: 'scale(-1, 1)', fontSize: 24 }),
|
499
|
-
disabled: !focusedItem?.isDcmt,
|
500
|
-
visible: true,
|
501
|
-
isActive: false,
|
502
|
-
orderNumber: 3,
|
503
|
-
},
|
504
|
-
type: 'button',
|
505
|
-
buttonOptions: {
|
506
|
-
onClick: () => {
|
507
|
-
appendMasterDcmts?.(focusedItem?.tid, focusedItem?.did);
|
508
|
-
},
|
509
|
-
},
|
510
|
-
},
|
428
|
+
isActive: true
|
429
|
+
}
|
430
|
+
}
|
511
431
|
];
|
512
|
-
return (_jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, isCancelable: true, abortController: abortController, children: _jsx(
|
432
|
+
return (_jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, isCancelable: true, abortController: abortController, children: _jsx(TMPanelManagerContextProvider, { panels: panels, initialMobilePanelId: "TMTreeView", children: _jsx(TMMasterDetailPanelContent, { isMobile: isMobile, panelTMTreeView: renderTMTreeView, panelTMFormOrResult: renderTMFormOrResult }) }) }));
|
513
433
|
};
|
514
434
|
export default TMMasterDetailDcmts;
|
515
435
|
function getMetadataKeys(obj) {
|
@@ -589,3 +509,60 @@ const getDisplayValueByColumn = (col, value) => {
|
|
589
509
|
export function IconBackhandIndexPointingRight(props) {
|
590
510
|
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 128 128", width: "1em", height: "1em", ...props, children: [_jsx("path", { fill: "#E0BB95", d: "M58.7 41.1c10.8.1 53.3.4 54.9.4c12.8.3 12.7 16.7.7 16.9c-1.5 0-25 1.1-32.2 1.3c5.2 2 7.5 11.9-3.1 14.9c5 2.6 6.4 12.9-4.2 14.7c3.8 2.5 4.3 10.9-6 14.2c-8.4 2.7-28.2 2-40.3-2.3c-9.1-3.3-8.4-5.8-16.7-5.6c-1.4 0-2.1-1.1-2.4-2.4c-1.3-5.9-1.9-26.3-.3-33.8c.4-1.6 1.7-1.8 2.2-1.9c2.1-.4 4.2-2.5 5-4.3c3.2-6.4 12.8-12.8 23.4-18.2c5.5-2.8 9.2-8.8 10.4-18.3c.8-6.3 8.6-7.7 11.8-2.5c2.2 3.6 2.9 7 2.9 10.4c.2 6.2-1.6 10.1-6.1 16.5" }), _jsx("defs", { children: _jsx("path", { id: "notoBackhandIndexPointingRightMediumLightSkinTone0", d: "M58.7 41.1c10.8.1 53.3.4 54.9.4c12.8.3 12.7 16.7.7 16.9c-1.5 0-25 1.1-32.2 1.3c5.2 2 7.5 11.9-3.1 14.9c5 2.6 6.4 12.9-4.2 14.7c3.8 2.5 4.3 10.9-6 14.2c-8.4 2.7-28.2 2-40.3-2.3c-9.1-3.3-8.4-5.8-16.7-5.6c-1.4 0-2.1-1.1-2.4-2.4c-1.3-5.9-1.9-26.3-.3-33.8c.4-1.6 1.7-1.8 2.2-1.9c2.1-.4 4.2-2.5 5-4.3c3.2-6.4 12.8-12.8 23.4-18.2c5.5-2.8 9.2-8.8 10.4-18.3c.8-6.3 8.6-7.7 11.8-2.5c2.2 3.6 2.9 7 2.9 10.4c.2 6.2-1.6 10.1-6.1 16.5" }) }), _jsx("clipPath", { id: "notoBackhandIndexPointingRightMediumLightSkinTone1", children: _jsx("use", { href: "#notoBackhandIndexPointingRightMediumLightSkinTone0" }) }), _jsx("g", { fill: "#D19661", clipPath: "url(#notoBackhandIndexPointingRightMediumLightSkinTone1)", children: _jsx("path", { d: "M73.3 59.5c.1 1.6 2.8 2.9 2.8 6.4c0 3.7-3 4.7-3.1 7.5c-.1 2.7 2 3.8 1.5 7.7c-.6 4.5-4.1 4-4.2 7.1c0 2.7 1.8 3.2 1.8 6.6c0 3.1-3 5.8-5.5 7s-1.2 3.4 0 3.4s11.9-1.3 14.5-8.2c3-8 11-29.6 8.8-36.9c-7.1-1-11.5-1.6-13.7-1.8c-.7-.1-2.9-.6-2.9 1.2M60.1 40.7c0 .9.1 1.5 1 1.5c1 0 43.6 2.1 51.6 2.3c9.2.2 8.7 7.6 5.9 10.1c-1.9 1.7.6 4 2.2 2.6s4.4-3.4 4.3-8.4s-4.4-8.6-8.4-8.9c-3.8-.3-56.6.8-56.6.8m-51.9 21c15.9 0 14.1-11.7 25.2-18.9c15.4-10.1 16.3-11.1 19.7-25.2c1.2-4.9 5.7-4.4 7.7-2.1s4.9-1.3 3.6-2.7s-7.8-7.7-14.8-1.1s-42 46.2-42 46.2z" }) }), _jsx("defs", { children: _jsx("use", { href: "#notoBackhandIndexPointingRightMediumLightSkinTone0", id: "notoBackhandIndexPointingRightMediumLightSkinTone2" }) }), _jsx("clipPath", { id: "notoBackhandIndexPointingRightMediumLightSkinTone3", children: _jsx("use", { href: "#notoBackhandIndexPointingRightMediumLightSkinTone2" }) }), _jsx("g", { fill: "#8D542E", clipPath: "url(#notoBackhandIndexPointingRightMediumLightSkinTone3)", children: _jsx("path", { d: "M58.7 41.1h-1.9c-.4 0-.8-.4-.2-1.3s5.8-8 5.8-15c0-3.2-.5-7.7-3.4-12.4c-.6-.9.2-1.4.9-1c.7.5 6.4 3.2 6.5 13.4s-7.7 16.3-7.7 16.3m65.1 8.8c-.5 0-1.1-.2-1.7 1c-.7 1.5-3.1 4.4-8.4 4.7s-38.1 2.5-38.9 2.5c-1.1 0-1.2 1.9.1 1.8c1.7-.1 7.2-.2 7.2-.2s30.9 1.8 36.9-.6c6.1-2.4 4.8-9.2 4.8-9.2M86.6 68.5c-.3-.1-.7-.1-1 .3c-1.5 2-4.6 3.5-10.6 3.3c-1.4 0-1.6 2.7.1 2.7c.7 0 4-.1 4-.1l6.6-.2zm-3.6 15c-.3-.1-.7-.1-1.1.4c-1.5 2-3.5 2.8-9.7 3c-1.5.1-1.4 2.6.2 2.6c1.1 0 2.4-.1 2.4-.1l7-.6zm-5.4 12.7c-.3-.1-.8-.2-1.2.4c-.8 1.1-2.9 3-7.5 4.4c-3.7 1.1-21.3 1.9-32.5-.7c-2.3-.5-9.9-3-13.6-5.3s-7.3-1.6-8.3-1.4s-6.3.7-6.3.7l2.5 3.7l27 8.6l38.5-.6z" }) })] }));
|
591
511
|
}
|
512
|
+
const TMMasterDetailPanelContent = ({ isMobile, panelTMTreeView, panelTMFormOrResult }) => {
|
513
|
+
const gutters = SDKUI_Globals.userSettings.themeSettings.gutters;
|
514
|
+
const { visibility, maximizedPanelId, getPanelDimensions, togglePanel, toggleMaximizePanel, setPanelDisabledById, setPanelVisibility, hasVisiblePanels } = useTMPanelContext();
|
515
|
+
const containerRef = useRef(null);
|
516
|
+
const { onMouseDown } = useResizablePanels(containerRef);
|
517
|
+
const { width: widthPanel1, height: heightPanel1 } = getPanelDimensions('TMTreeView');
|
518
|
+
const { width: widthPanel2, height: heightPanel2 } = getPanelDimensions('TMFormOrResult');
|
519
|
+
return (_jsxs("div", { style: { display: 'flex', height: '100%', width: '100%', flexDirection: isMobile ? 'column' : 'row', gap: gutters }, children: [_jsx("div", { style: {
|
520
|
+
display: 'flex',
|
521
|
+
flexGrow: 1,
|
522
|
+
width: `calc(100% - ${isMobile ? 0 : 70}px)`,
|
523
|
+
height: `calc(100% - ${isMobile ? 55 : 0}px)`,
|
524
|
+
flexDirection: 'row'
|
525
|
+
}, children: _jsxs("div", { style: { width: '100%', height: '100%' }, children: [_jsxs("div", { ref: containerRef, style: {
|
526
|
+
display: hasVisiblePanels() ? 'flex' : 'none',
|
527
|
+
width: '100%',
|
528
|
+
height: '100%',
|
529
|
+
}, children: [_jsx("div", { style: {
|
530
|
+
display: visibility.TMTreeView ? 'block' : 'none',
|
531
|
+
width: widthPanel1,
|
532
|
+
height: heightPanel1,
|
533
|
+
overflow: 'hidden',
|
534
|
+
}, children: panelTMTreeView() }), visibility.TMTreeView && visibility.TMFormOrResult && maximizedPanelId === null && (_jsx("div", { style: {
|
535
|
+
background: 'transparent',
|
536
|
+
cursor: 'col-resize',
|
537
|
+
width: `${gutters}px`,
|
538
|
+
height: '100%',
|
539
|
+
userSelect: 'none',
|
540
|
+
}, onMouseDown: (e) => onMouseDown(e, 'TMTreeView', 'TMFormOrResult', true) })), _jsx("div", { style: {
|
541
|
+
display: visibility.TMFormOrResult ? 'block' : 'none',
|
542
|
+
width: widthPanel2,
|
543
|
+
height: heightPanel2,
|
544
|
+
overflow: 'hidden',
|
545
|
+
}, children: panelTMFormOrResult() })] }), _jsxs("div", { style: {
|
546
|
+
display: hasVisiblePanels() ? 'none' : 'flex',
|
547
|
+
flexDirection: 'column',
|
548
|
+
width: '100%',
|
549
|
+
height: '100%',
|
550
|
+
justifyContent: 'center',
|
551
|
+
alignItems: 'center',
|
552
|
+
fontSize: '1.5rem',
|
553
|
+
fontWeight: 'bold',
|
554
|
+
color: '#888',
|
555
|
+
backgroundColor: '#fff',
|
556
|
+
borderRadius: '10px'
|
557
|
+
}, children: [_jsx(IconInfo, { style: { fontSize: 50 } }), _jsx("div", { children: SDKUI_Localizator.NoPanelSelected })] })] }) }), _jsx("div", { style: {
|
558
|
+
display: 'flex',
|
559
|
+
flexDirection: isMobile ? 'row' : 'column',
|
560
|
+
alignItems: 'center',
|
561
|
+
width: isMobile ? '100%' : '50px',
|
562
|
+
height: isMobile ? '50px' : 'max-content',
|
563
|
+
background: 'transparent linear-gradient(90deg, #CCE0F4 0%, #7EC1E7 14%, #39A6DB 28%, #1E9CD7 35%, #0075BE 78%, #005B97 99%) 0% 0% no-repeat padding-box',
|
564
|
+
borderRadius: isMobile ? '10px' : '10px 0px 0px 10px',
|
565
|
+
padding: '10px',
|
566
|
+
gap: '10px'
|
567
|
+
}, children: _jsx(TMPanelToolbar, {}) })] }));
|
568
|
+
};
|
@@ -279,7 +279,7 @@ export const refreshLastSearch = async (qd) => {
|
|
279
279
|
export const StyledToppyTextContainer = styled.div `
|
280
280
|
padding: 30px 50px;
|
281
281
|
max-width: 345px;
|
282
|
-
border: 1px solid #
|
282
|
+
border: 1px solid #2559A5;
|
283
283
|
border-radius: 30px;
|
284
284
|
display: flex;
|
285
285
|
align-items: center;
|
@@ -287,7 +287,7 @@ export const StyledToppyTextContainer = styled.div `
|
|
287
287
|
`;
|
288
288
|
export const StyledToppyText = styled.p `
|
289
289
|
text-align: center;
|
290
|
-
color: #
|
290
|
+
color: #2559A5;
|
291
291
|
font-size: 30px;
|
292
292
|
user-select: none;
|
293
293
|
`;
|
@@ -6,8 +6,10 @@ interface ITMSearchResultProps {
|
|
6
6
|
title?: string;
|
7
7
|
searchResults: SearchResultDescriptor[] | undefined;
|
8
8
|
allowFloatingBar?: boolean;
|
9
|
+
allowRelations?: boolean;
|
9
10
|
isClosable?: boolean;
|
10
11
|
isVisible?: boolean;
|
12
|
+
openDcmtFormAsModal?: boolean;
|
11
13
|
showDcmtForm?: boolean;
|
12
14
|
showPreview?: boolean;
|
13
15
|
showBoard?: boolean;
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
2
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
3
3
|
import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes, TemplateTIDs, DcmtTypeListCacheService, AccessLevels, SystemMIDsAsNumber, ArchiveConstraints } from '@topconsultnpm/sdk-ts-beta';
|
4
4
|
import styled from 'styled-components';
|
5
5
|
import { getCommandsMenuItems, getSelectedDcmtsOrFocused } from './TMSearchResultsMenuItems';
|
6
6
|
import { ContextMenu } from 'devextreme-react';
|
7
|
-
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, IconDownload, IconSignature, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, IconArchive, IconActivityLog, IconStar, IconFreeSearch, IconChevronDown, searchResultToMetadataValues, SDKUI_Globals, IconSearchCheck,
|
7
|
+
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, IconDownload, IconSignature, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, IconArchive, IconActivityLog, IconStar, IconFreeSearch, IconChevronDown, searchResultToMetadataValues, SDKUI_Globals, IconSearchCheck, IconInfo } from '../../../helper';
|
8
8
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
9
9
|
import { useInputAttachmentsDialog, useInputCvtFormatDialog } from '../../../hooks/useInputDialog';
|
10
10
|
import { DcmtOperationTypes, FormModes, SearchResultContext, DownloadTypes } from '../../../ts';
|
@@ -33,7 +33,10 @@ import TMBatchUpdateForm from '../../features/documents/TMBatchUpdateForm';
|
|
33
33
|
import TMDcmtForm, { ToppyHelpCenter } from '../documents/TMDcmtForm';
|
34
34
|
import TMDcmtBlog from '../documents/TMDcmtBlog';
|
35
35
|
import TMDcmtIcon from '../documents/TMDcmtIcon';
|
36
|
-
import
|
36
|
+
import { TMPanelManagerContextProvider, useTMPanelContext } from '../../layout/panel/TMPanelContext';
|
37
|
+
import { useResizablePanels } from '../../layout/panel/useResizablePanels';
|
38
|
+
import TMPanel from '../../base/TMPanel';
|
39
|
+
import { TMPanelToolbar } from '../../layout/panel/TMPanelToolbar';
|
37
40
|
//#region Internal Components
|
38
41
|
const CommandsContextMenu = React.memo(({ target, menuItems, allowPin }) => {
|
39
42
|
return (_jsx(ContextMenu, { showEvent: 'click', dataSource: menuItems, target: `${target}` }));
|
@@ -48,7 +51,7 @@ const orderByName = (array) => {
|
|
48
51
|
return 1;
|
49
52
|
} return 0; });
|
50
53
|
};
|
51
|
-
const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisible = true, searchResults = [], showSearchResultSidebar = true, showSelector = false, onClosePreviewPanel, showDcmtForm = false, showBoard = false, showPreview = false, title, showSysMetadata = false, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onUpdate, onClose, onTaskCreateRequest }) => {
|
54
|
+
const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showSelector = false, onClosePreviewPanel, showDcmtForm = false, showBoard = false, showPreview = false, title, showSysMetadata = false, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onUpdate, onClose, onTaskCreateRequest }) => {
|
52
55
|
const [id, setID] = useState('');
|
53
56
|
const [showApprovePopup, setShowApprovePopup] = useState(false);
|
54
57
|
const [showRejectPopup, setShowRejectPopup] = useState(false);
|
@@ -338,167 +341,90 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
338
341
|
if (!searchResults || searchResults.length <= 0)
|
339
342
|
return _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%' }, children: [_jsx(IconBoard, { fontSize: 96 }), _jsx("div", { style: { fontSize: "15px", marginTop: "10px" }, children: SDKUI_Localizator.NoDcmtFound })] });
|
340
343
|
const isMobile = deviceType === DeviceType.MOBILE;
|
341
|
-
const renderTMSearchResult = (handleTogglePanel) => _jsxs(_Fragment, { children: [_jsxs(TMLayoutItem, { height: '100%', children: [_jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, separatorActiveColor: 'transparent', separatorColor: 'transparent', min: ['0', '0'], showSeparator: showSelector && deviceType !== DeviceType.MOBILE, start: showSelector ? deviceType !== DeviceType.MOBILE ? ['25%', '75%'] : splitterSize : ['0%', '100%'], children: [showSelector ?
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
// allowMultipleSelection={allowMultipleSelection}
|
346
|
-
, {
|
344
|
+
const renderTMSearchResult = (handleTogglePanel) => _jsx(TMPanel, { title: getTitleHeader(), showHeader: showToolbarHeader, allowMaximize: !isMobile, onBack: (!isClosable && context === SearchResultContext.METADATA_SEARCH) ? onBack : undefined, onClose: isClosable ? onBack : undefined, toolbar: searchResutlToolbar, children: _jsxs(_Fragment, { children: [_jsxs(TMLayoutItem, { height: '100%', children: [_jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, separatorActiveColor: 'transparent', separatorColor: 'transparent', min: ['0', '0'], showSeparator: showSelector && deviceType !== DeviceType.MOBILE, start: showSelector ? deviceType !== DeviceType.MOBILE ? ['25%', '75%'] : splitterSize : ['0%', '100%'], children: [showSelector ?
|
345
|
+
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, onSelectionChanged: onSearchResultSelectionChanged }) })
|
346
|
+
:
|
347
|
+
_jsx(_Fragment, {}), _jsxs(TMLayoutItem, { children: [_jsx(TMSearchResultGrid
|
347
348
|
// allowMultipleSelection={allowMultipleSelection}
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
349
|
+
, {
|
350
|
+
// allowMultipleSelection={allowMultipleSelection}
|
351
|
+
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 }), allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE &&
|
352
|
+
_jsxs(TMFloatingToolbar, { backgroundColor: TMColors.primaryColor, initialLeft: '10px', initialTop: 'calc(100% - 75px)', children: [fromDTD?.perm?.canRetrieveFile === AccessLevels.Yes && _jsx(TMButton, { btnStyle: 'icon', caption: "Download file", disabled: fromDTD?.perm?.canRetrieveFile !== AccessLevels.Yes, icon: _jsx(IconDownload, { color: 'white' }), onClick: () => { downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt); } }), _jsx(TMButton, { btnStyle: 'icon', caption: 'Firma e marca', icon: _jsx(IconSignature, { color: 'white' }), onClick: () => { ShowAlert({ message: "TODO Firma e marca ", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } }), _jsx(IconMenuVertical, { id: `commands-floating-${id}`, color: 'white', cursor: 'pointer' }), _jsx(CommandsContextMenu, { target: `#commands-floating-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler) })] })] })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onUpdate: onUpdate, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), op: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onUpdate: onUpdate, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), op: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onUpdate: onUpdate, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: SDKUI_Localizator.BatchUpdate, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => { handleTogglePanel("TMBatchUpdate"); }, onSavedCallbackAsync: async () => {
|
353
|
+
setIsOpenBatchUpdate(false);
|
354
|
+
setIsModifiedBatchUpdate(false);
|
355
|
+
await refreshSelectionDataRowsAsync();
|
356
|
+
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), (isVisible && fromDTD?.templateTID === TemplateTIDs.WF_WIApprView && !isOpenDcmtForm && !isOpenDetails && !isOpenMaster) &&
|
357
|
+
_jsx(ToppyHelpCenter, { deviceType: deviceType,
|
358
|
+
// onClick={() => isMobile ? openConfigureMode?.() : undefined}
|
359
|
+
content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), approveDisable: disable, rejectDisable: disable, reassignDisable: disable, infoDisable: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length !== 1 }) }) }), (!isOpenDcmtForm && allowRelations && (currentTIDHasDetailRelations || currentTIDHasMasterRelations)) &&
|
360
|
+
_jsx(ToppyHelpCenter, { deviceType: deviceType, top: -100, content: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [currentTIDHasDetailRelations && _jsx(TMButton, { btnStyle: 'advanced', disabled: !focusedItem?.DID, showTooltip: false, width: '180px', icon: _jsx(IconDetailDcmts, { transform: 'scale(-1, 1)' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true), advancedColor: TMColors.primaryColor, color: 'success' }), currentTIDHasMasterRelations && _jsx(TMButton, { btnStyle: 'advanced', disabled: !focusedItem?.DID, showTooltip: false, width: '180px', icon: _jsx(IconDetailDcmts, {}), caption: SDKUI_Localizator.DcmtsMaster, onClick: () => setIsOpenMaster(true), advancedColor: TMColors.primaryColor, color: 'error' })] }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {})] }) });
|
353
361
|
const renderTMBlog = (handleTogglePanel) => _jsx(TMDcmtBlog, { tid: focusedItem?.TID, did: focusedItem?.DID });
|
354
362
|
const renderTMSysMetadata = (handleTogglePanel) => _jsx(TMMetadataValues, { layoutMode: LayoutModes.Update, openChooserBySingleClick: true, TID: focusedItem?.TID, isReadOnly: true, deviceType: deviceType, metadataValues: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [] });
|
355
363
|
const renderTMDcmtPreview = (handleTogglePanel) => _jsx(TMDcmtPreview, { onClose: () => {
|
356
364
|
handleTogglePanel("TMDcmtPreview");
|
357
365
|
onClosePreviewPanel?.();
|
358
366
|
}, dcmtData: currentDcmt });
|
359
|
-
const
|
360
|
-
setIsOpenBatchUpdate(false);
|
361
|
-
setIsModifiedBatchUpdate(false);
|
362
|
-
await refreshSelectionDataRowsAsync();
|
363
|
-
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } });
|
364
|
-
const panelsConfig = [
|
367
|
+
const panels = [
|
365
368
|
{
|
366
369
|
id: 'TMSearchResult',
|
367
370
|
name: SDKUI_Localizator.SearchResult,
|
368
|
-
|
369
|
-
type: 'content',
|
371
|
+
children: [],
|
370
372
|
contentOptions: {
|
371
|
-
|
373
|
+
width: '25%',
|
372
374
|
height: '100%',
|
373
|
-
width: '20%',
|
374
|
-
content: renderTMSearchResult,
|
375
|
-
panelContainer: {
|
376
|
-
title: getTitleHeader(),
|
377
|
-
showHeader: showToolbarHeader,
|
378
|
-
allowMaximize: !isMobile,
|
379
|
-
onBack: (!isClosable && context === SearchResultContext.METADATA_SEARCH) ? onBack : undefined,
|
380
|
-
onClose: isClosable ? onBack : undefined,
|
381
|
-
toolbar: searchResutlToolbar
|
382
|
-
},
|
383
375
|
},
|
376
|
+
toolbarOptions: {
|
377
|
+
icon: _jsx(IconSearchCheck, { fontSize: 24 }),
|
378
|
+
visible: true,
|
379
|
+
isActive: true
|
380
|
+
}
|
384
381
|
},
|
385
382
|
{
|
386
383
|
id: 'TMBlog',
|
387
384
|
name: SDKUI_Localizator.BlogCase,
|
388
|
-
|
389
|
-
icon: _jsx(IconBoard, { fontSize: 24 }),
|
390
|
-
disabled: !focusedItem?.DID,
|
391
|
-
visible: true,
|
392
|
-
isActive: showBoard,
|
393
|
-
orderNumber: 2
|
394
|
-
},
|
395
|
-
type: 'content',
|
385
|
+
children: [],
|
396
386
|
contentOptions: {
|
397
|
-
|
387
|
+
width: '25%',
|
398
388
|
height: '100%',
|
399
|
-
width: '20%',
|
400
|
-
content: renderTMBlog,
|
401
|
-
panelContainer: {
|
402
|
-
title: SDKUI_Localizator.BlogCase,
|
403
|
-
allowMaximize: !isMobile,
|
404
|
-
toolbar: middlePanelToolbar
|
405
|
-
},
|
406
389
|
},
|
390
|
+
toolbarOptions: {
|
391
|
+
icon: _jsx(IconBoard, { fontSize: 24 }),
|
392
|
+
// disabled: !focusedItem?.DID,
|
393
|
+
visible: true,
|
394
|
+
isActive: false,
|
395
|
+
}
|
407
396
|
},
|
408
397
|
{
|
409
398
|
id: 'TMSysMetadata',
|
410
399
|
name: SDKUI_Localizator.MetadataSystem,
|
411
|
-
|
412
|
-
icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }),
|
413
|
-
visible: true,
|
414
|
-
disabled: !focusedItem?.DID,
|
415
|
-
isActive: showSysMetadata,
|
416
|
-
orderNumber: 3
|
417
|
-
},
|
418
|
-
type: 'content',
|
400
|
+
children: [],
|
419
401
|
contentOptions: {
|
420
|
-
|
402
|
+
width: '25%',
|
421
403
|
height: '100%',
|
422
|
-
width: '20%',
|
423
|
-
content: renderTMSysMetadata,
|
424
|
-
panelContainer: {
|
425
|
-
title: SDKUI_Localizator.MetadataSystem,
|
426
|
-
allowMaximize: !isMobile,
|
427
|
-
toolbar: middlePanelToolbar
|
428
|
-
},
|
429
404
|
},
|
430
|
-
},
|
431
|
-
{
|
432
|
-
id: 'TMDcmtPreview',
|
433
|
-
name: SDKUI_Localizator.PreviewDocument,
|
434
405
|
toolbarOptions: {
|
435
|
-
icon: _jsx(
|
436
|
-
disabled: !focusedItem?.DID && fromDTD?.archiveConstraint === ArchiveConstraints.OnlyMetadata,
|
437
|
-
visible: true,
|
438
|
-
isActive: showPreview,
|
439
|
-
orderNumber: 4
|
440
|
-
},
|
441
|
-
type: 'content',
|
442
|
-
contentOptions: {
|
406
|
+
icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }),
|
443
407
|
visible: true,
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
},
|
408
|
+
// disabled: !focusedItem?.DID,
|
409
|
+
isActive: false,
|
410
|
+
}
|
448
411
|
},
|
449
412
|
{
|
450
|
-
id: '
|
451
|
-
name: SDKUI_Localizator.
|
452
|
-
|
453
|
-
type: 'content',
|
413
|
+
id: 'TMDcmtPreview',
|
414
|
+
name: SDKUI_Localizator.PreviewDocument,
|
415
|
+
children: [],
|
454
416
|
contentOptions: {
|
455
|
-
|
417
|
+
width: '25%',
|
456
418
|
height: '100%',
|
457
|
-
width: '20%',
|
458
|
-
content: renderTMBatchUpdate,
|
459
419
|
},
|
460
|
-
},
|
461
|
-
{
|
462
|
-
id: 'commandMaster',
|
463
|
-
name: SDKUI_Localizator.DcmtsMaster,
|
464
420
|
toolbarOptions: {
|
465
|
-
icon: _jsx(
|
466
|
-
|
467
|
-
|
468
|
-
isActive:
|
469
|
-
|
470
|
-
beginGroup: true
|
471
|
-
},
|
472
|
-
type: 'button',
|
473
|
-
buttonOptions: {
|
474
|
-
onClick: () => { setIsOpenMaster(true); },
|
475
|
-
},
|
476
|
-
},
|
477
|
-
{
|
478
|
-
id: 'commandDetails',
|
479
|
-
name: SDKUI_Localizator.DcmtsDetail,
|
480
|
-
toolbarOptions: {
|
481
|
-
icon: _jsx(IconDetailDcmts, { transform: 'scale(-1, 1)', fontSize: 24 }),
|
482
|
-
visible: !!currentTIDHasDetailRelations,
|
483
|
-
disabled: !focusedItem?.DID,
|
484
|
-
isActive: !!currentTIDHasDetailRelations,
|
485
|
-
orderNumber: 7,
|
486
|
-
},
|
487
|
-
type: 'button',
|
488
|
-
buttonOptions: {
|
489
|
-
onClick: () => { setIsOpenDetails(true); },
|
490
|
-
},
|
421
|
+
icon: _jsx(IconShow, { fontSize: 24 }),
|
422
|
+
disabled: !focusedItem?.DID && fromDTD?.archiveConstraint === ArchiveConstraints.OnlyMetadata,
|
423
|
+
visible: true,
|
424
|
+
isActive: false,
|
425
|
+
}
|
491
426
|
},
|
492
427
|
];
|
493
|
-
const getPanelMobile = () => {
|
494
|
-
if (showPreview)
|
495
|
-
return 'TMDcmtPreview';
|
496
|
-
if (showBoard)
|
497
|
-
return 'TMBlog';
|
498
|
-
if (showSysMetadata)
|
499
|
-
return 'TMSysMetadata';
|
500
|
-
return 'TMSearchResult';
|
501
|
-
};
|
502
428
|
return (_jsxs(StyledMultiViewPanel, { "$isVisible": isVisible, children: [_jsx(StyledMultiViewPanel, { "$isVisible": !isOpenDcmtForm && !isOpenDetails && !isOpenMaster, style: {
|
503
429
|
display: 'flex',
|
504
430
|
flexDirection: isMobile ? 'column' : 'row',
|
@@ -506,9 +432,9 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
506
432
|
gap: SDKUI_Globals.userSettings.themeSettings.gutters,
|
507
433
|
width: '100%',
|
508
434
|
height: '100%',
|
509
|
-
}, 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: _jsx(
|
435
|
+
}, 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: _jsx(TMPanelManagerContextProvider, { panels: panels, initialMobilePanelId: "TMSearchResult", children: _jsx(TMSearchResultPanelContent, { showSearchResultSidebar: showSearchResultSidebar, isMobile: isMobile, panelTMSearchResult: renderTMSearchResult, panelTMBlog: renderTMBlog, panelTMSysMetadata: renderTMSysMetadata, panelTMDcmtPreview: renderTMDcmtPreview }) }) }) }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDetails, children: isOpenDetails && _jsx(TMMasterDetailDcmts, { deviceType: deviceType, isForMaster: false, inputDcmts: getSelectionDcmtInfo(), allowNavigation: focusedItem && selectedItems.length <= 0, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onBack: () => setIsOpenDetails(false) }) }), _jsxs(StyledMultiViewPanel, { "$isVisible": isOpenMaster, children: [isOpenMaster && _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: getSelectionDcmtInfo(), isForMaster: true, allowNavigation: focusedItem && selectedItems.length <= 0, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onBack: () => setIsOpenMaster(false), appendMasterDcmts: handleAddItem }), secondaryMasterDcmts.length > 0 && secondaryMasterDcmts.map((dcmt, index) => {
|
510
436
|
return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: [dcmt], isForMaster: true, allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID), appendMasterDcmts: handleAddItem }) }, `${index}-${dcmt.DID}`));
|
511
|
-
})] }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: isOpenDcmtForm && _jsx(TMDcmtForm, { TID: focusedItem?.TID, DID: focusedItem?.DID, layoutMode: dcmtFormLayoutMode, showPreview: deviceType !== DeviceType.MOBILE, count: visibleItems.length, itemIndex: visibleItems.findIndex(o => o.rowIndex === focusedItem?.rowIndex) + 1, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onClose: () => { setIsOpenDcmtForm(false); }, onSavedAsyncCallback: async (tid, did) => { await refreshFocusedDataRowAsync(tid, did, true); } }) })] }));
|
437
|
+
})] }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: isOpenDcmtForm && _jsx(TMDcmtForm, { isModal: openDcmtFormAsModal, titleModal: fromDTD?.name ?? '', TID: focusedItem?.TID, DID: focusedItem?.DID, layoutMode: dcmtFormLayoutMode, showPreview: deviceType !== DeviceType.MOBILE, count: visibleItems.length, itemIndex: visibleItems.findIndex(o => o.rowIndex === focusedItem?.rowIndex) + 1, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onClose: () => { setIsOpenDcmtForm(false); }, onSavedAsyncCallback: async (tid, did) => { await refreshFocusedDataRowAsync(tid, did, true); } }) })] }));
|
512
438
|
};
|
513
439
|
export default TMSearchResult;
|
514
440
|
const renderDcmtIcon = (cellData) => _jsx(TMDcmtIcon, { fileExtension: cellData.data.FILEEXT, fileCount: cellData.data.FILECOUNT, isLexProt: cellData.data.IsLexProt, isMail: cellData.data.ISMAIL, isShared: cellData.data.ISSHARED, isSigned: cellData.data.ISSIGNED });
|
@@ -772,3 +698,84 @@ const TMSearchResultSelector = ({ searchResults = [], onSelectionChanged }) => {
|
|
772
698
|
};
|
773
699
|
return (_jsx("div", { style: { height: '100%', width: '100%', overflow: 'auto' }, children: sortedCategories.map((category) => (_jsxs("div", { children: [_jsxs(StyledGroupTemplate, { onClick: () => toggleCategory(category), children: [activeCategories.includes(category) ? _jsx(IconChevronDown, {}) : _jsx(IconChevronDown, { transform: 'scale(-1, 1)' }), renderGroupTemplate(category)] }, category), activeCategories.includes(category) && (_jsx("div", { style: { padding: '5px' }, children: groupedResults[category].map((result, index) => (_jsx(StyledItemTemplate, { "$isSelected": selectedResult === result, onClick: () => handleSelect(result), children: renderItemTemplate(result) }, index))) }))] }, category))) }));
|
774
700
|
};
|
701
|
+
const TMSearchResultPanelContent = ({ isMobile, showSearchResultSidebar, panelTMSearchResult, panelTMBlog, panelTMSysMetadata, panelTMDcmtPreview }) => {
|
702
|
+
const gutters = SDKUI_Globals.userSettings.themeSettings.gutters;
|
703
|
+
const { visibility, maximizedPanelId, getPanelDimensions, togglePanel, toggleMaximizePanel, setPanelDisabledById, setPanelVisibility, hasVisiblePanels } = useTMPanelContext();
|
704
|
+
const containerRef = useRef(null);
|
705
|
+
const { onMouseDown } = useResizablePanels(containerRef);
|
706
|
+
const { width: widthPanel1, height: heightPanel1 } = getPanelDimensions('TMSearchResult');
|
707
|
+
const { width: widthPanel2, height: heightPanel2 } = getPanelDimensions('TMBlog');
|
708
|
+
const { width: widthPanel3, height: heightPanel3 } = getPanelDimensions('TMSysMetadata');
|
709
|
+
const { width: widthPanel4, height: heightPanel4 } = getPanelDimensions('TMDcmtPreview');
|
710
|
+
return (_jsxs("div", { style: { display: 'flex', height: '100%', width: '100%', flexDirection: isMobile ? 'column' : 'row', gap: gutters }, children: [_jsx("div", { style: {
|
711
|
+
display: 'flex',
|
712
|
+
flexGrow: 1,
|
713
|
+
width: `calc(100% - ${isMobile ? 0 : 70}px)`,
|
714
|
+
height: `calc(100% - ${isMobile ? 55 : 0}px)`,
|
715
|
+
flexDirection: 'row'
|
716
|
+
}, children: _jsxs("div", { style: { width: '100%', height: '100%' }, children: [_jsxs("div", { ref: containerRef, style: {
|
717
|
+
display: hasVisiblePanels() ? 'flex' : 'none',
|
718
|
+
width: '100%',
|
719
|
+
height: '100%',
|
720
|
+
}, children: [_jsx("div", { style: {
|
721
|
+
display: visibility.TMSearchResult ? 'block' : 'none',
|
722
|
+
width: widthPanel1,
|
723
|
+
height: heightPanel1,
|
724
|
+
overflow: 'hidden',
|
725
|
+
}, children: panelTMSearchResult() }), visibility.TMSearchResult && visibility.TMBlog && maximizedPanelId === null && (_jsx("div", { style: {
|
726
|
+
background: 'transparent',
|
727
|
+
cursor: 'col-resize',
|
728
|
+
width: `${gutters}px`,
|
729
|
+
height: '100%',
|
730
|
+
userSelect: 'none',
|
731
|
+
}, onMouseDown: (e) => onMouseDown(e, 'TMSearchResult', 'TMBlog', true) })), _jsx("div", { style: {
|
732
|
+
display: visibility.TMBlog ? 'block' : 'none',
|
733
|
+
width: widthPanel2,
|
734
|
+
height: heightPanel2,
|
735
|
+
overflow: 'hidden',
|
736
|
+
}, children: _jsx(TMPanel, { title: SDKUI_Localizator.BlogCase, onClose: () => togglePanel('TMBlog'), onMaximize: () => toggleMaximizePanel('TMBlog'), onHeaderDoubleClick: () => toggleMaximizePanel('TMBlog'), allowMaximize: !isMobile, children: panelTMBlog() }) }), visibility.TMBlog && visibility.TMSysMetadata && maximizedPanelId === null && (_jsx("div", { style: {
|
737
|
+
background: 'transparent',
|
738
|
+
cursor: 'col-resize',
|
739
|
+
width: `${gutters}px`,
|
740
|
+
height: '100%',
|
741
|
+
userSelect: 'none',
|
742
|
+
}, onMouseDown: (e) => onMouseDown(e, 'TMBlog', 'TMSysMetadata', true) })), _jsx("div", { style: {
|
743
|
+
display: visibility.TMSysMetadata ? 'block' : 'none',
|
744
|
+
width: widthPanel3,
|
745
|
+
height: heightPanel3,
|
746
|
+
overflow: 'hidden',
|
747
|
+
}, children: _jsx(TMPanel, { title: SDKUI_Localizator.MetadataSystem, onClose: () => togglePanel('TMSysMetadata'), onMaximize: () => toggleMaximizePanel('TMSysMetadata'), onHeaderDoubleClick: () => toggleMaximizePanel('TMSysMetadata'), allowMaximize: !isMobile, children: panelTMSysMetadata() }) }), visibility.TMSysMetadata && visibility.TMDcmtPreview && maximizedPanelId === null && (_jsx("div", { style: {
|
748
|
+
background: 'transparent',
|
749
|
+
cursor: 'col-resize',
|
750
|
+
width: `${gutters}px`,
|
751
|
+
height: '100%',
|
752
|
+
userSelect: 'none',
|
753
|
+
}, onMouseDown: (e) => onMouseDown(e, 'TMSysMetadata', 'TMDcmtPreview', true) })), _jsx("div", { style: {
|
754
|
+
display: visibility.TMDcmtPreview ? 'block' : 'none',
|
755
|
+
width: widthPanel4,
|
756
|
+
height: heightPanel4,
|
757
|
+
overflow: 'hidden',
|
758
|
+
}, children: panelTMDcmtPreview(() => togglePanel('TMDcmtPreview')) })] }), _jsxs("div", { style: {
|
759
|
+
display: hasVisiblePanels() ? 'none' : 'flex',
|
760
|
+
flexDirection: 'column',
|
761
|
+
width: '100%',
|
762
|
+
height: '100%',
|
763
|
+
justifyContent: 'center',
|
764
|
+
alignItems: 'center',
|
765
|
+
fontSize: '1.5rem',
|
766
|
+
fontWeight: 'bold',
|
767
|
+
color: '#888',
|
768
|
+
backgroundColor: '#fff',
|
769
|
+
borderRadius: '10px'
|
770
|
+
}, children: [_jsx(IconInfo, { style: { fontSize: 50 } }), _jsx("div", { children: SDKUI_Localizator.NoPanelSelected })] })] }) }), showSearchResultSidebar && _jsx("div", { style: {
|
771
|
+
display: 'flex',
|
772
|
+
flexDirection: isMobile ? 'row' : 'column',
|
773
|
+
alignItems: 'center',
|
774
|
+
width: isMobile ? '100%' : '50px',
|
775
|
+
height: isMobile ? '50px' : 'max-content',
|
776
|
+
background: 'transparent linear-gradient(90deg, #CCE0F4 0%, #7EC1E7 14%, #39A6DB 28%, #1E9CD7 35%, #0075BE 78%, #005B97 99%) 0% 0% no-repeat padding-box',
|
777
|
+
borderRadius: isMobile ? '10px' : '10px 0px 0px 10px',
|
778
|
+
padding: '10px',
|
779
|
+
gap: '10px'
|
780
|
+
}, children: _jsx(TMPanelToolbar, {}) })] }));
|
781
|
+
};
|