@topconsultnpm/sdkui-react-beta 6.13.64 → 6.13.66
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/archive/TMArchive.js +130 -44
- package/lib/components/features/documents/TMDcmtForm.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtForm.js +156 -154
- package/lib/components/features/documents/TMDcmtPreview.d.ts +2 -0
- package/lib/components/features/documents/TMDcmtPreview.js +6 -6
- package/lib/components/features/documents/TMFileUploader.d.ts +1 -0
- package/lib/components/features/documents/TMFileUploader.js +2 -2
- package/lib/components/features/documents/TMMasterDetailDcmts.js +60 -22
- package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchResult.d.ts +0 -1
- package/lib/components/features/search/TMSearchResult.js +3 -8
- package/lib/components/grids/TMRecentsManager.js +1 -1
- package/lib/components/index.d.ts +0 -3
- package/lib/components/index.js +0 -3
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +2 -2
- package/lib/components/layout/panelManager/TMPanelWrapper.js +4 -1
- package/lib/components/layout/panelManager/types.d.ts +2 -0
- package/package.json +1 -1
- package/lib/components/base/TMPanelManager.d.ts +0 -11
- package/lib/components/base/TMPanelManager.js +0 -478
- package/lib/components/base/TMPanelManagerToolbar.d.ts +0 -23
- package/lib/components/base/TMPanelManagerToolbar.js +0 -109
- package/lib/components/base/TMPanelManagerUtils.d.ts +0 -37
- package/lib/components/base/TMPanelManagerUtils.js +0 -27
@@ -5,7 +5,7 @@ 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, IconShow, IconBoard, IconDcmtTypeSys, IconCheckFile, IconDetailDcmts, SDKUI_Localizator, svgToString, IconMail, IconDcmtTypeOnlyMetadata, IconCopy, IconMultipleSelection, IconMenuVertical, IconSearchCheck, IconDataList } from '../../../helper';
|
8
|
+
import { genUniqueId, getExceptionMessage, IconFolder, IconShow, IconBoard, IconDcmtTypeSys, IconCheckFile, IconDetailDcmts, SDKUI_Localizator, svgToString, IconMail, IconDcmtTypeOnlyMetadata, IconCopy, IconMultipleSelection, IconMenuVertical, IconSearchCheck, IconDataList, IconPreview } from '../../../helper';
|
9
9
|
import { hasDetailRelations } from '../../../helper/dcmtsHelper';
|
10
10
|
import { FormModes, SearchResultContext } from '../../../ts';
|
11
11
|
import { TMColors } from '../../../utils/theme';
|
@@ -22,7 +22,7 @@ import TMDataListItemViewer from '../../viewers/TMDataListItemViewer';
|
|
22
22
|
import { TMDcmtTypeTooltip } from '../../viewers/TMTidViewer';
|
23
23
|
import TMTreeView from '../../base/TMTreeView';
|
24
24
|
import TMDcmtIcon from './TMDcmtIcon';
|
25
|
-
import { TMPanelManagerProvider } from '../../layout/panelManager/TMPanelManagerContext';
|
25
|
+
import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
|
26
26
|
import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
|
27
27
|
let abortController = new AbortController();
|
28
28
|
const TMMasterDetailDcmts = ({ deviceType, inputDcmts, isForMaster, showCurrentDcmtIndicator = true, allowNavigation, canNext, canPrev, onNext, onPrev, onBack, appendMasterDcmts, onTaskCreateRequest }) => {
|
@@ -405,46 +405,66 @@ const TMMasterDetailDcmts = ({ deviceType, inputDcmts, isForMaster, showCurrentD
|
|
405
405
|
?
|
406
406
|
_jsx(TMNothingToShow, { text: getTitle(), secondText: SDKUI_Localizator.NoDataToDisplay, icon: isForMaster ? _jsx(IconDetailDcmts, { fontSize: 96, transform: 'scale(-1, 1)' }) : _jsx(IconDetailDcmts, { fontSize: 96 }) })
|
407
407
|
:
|
408
|
-
_jsx(
|
408
|
+
_jsx(TMTreeViewWrapper, { data: data, allowMultipleSelection: allowMultipleSelection, calculateItemsForNode: calculateItemsForNode, renderItem: renderItem, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectionChanged: handleSelectedItemsChanged, onDataChanged: (items) => setData(updateHiddenProperty(items)) }) }), [data, isLoading, focusedItem, selectedItems, allowMultipleSelection, isForMaster]);
|
409
409
|
const tmFormOrResult = useMemo(() => _jsx(_Fragment, { children: focusedItem?.isDcmt ?
|
410
|
-
_jsx(TMDcmtForm, { TID: focusedItem?.tid, DID: focusedItem.did, isClosable: deviceType !== DeviceType.MOBILE, allowNavigation: false, allowRelations: deviceType !== DeviceType.MOBILE, showDcmtFormSidebar: deviceType === DeviceType.MOBILE }) :
|
411
|
-
_jsx(TMSearchResult, { groupId: 'tmFormOrResult', context: SearchResultContext.
|
412
|
-
// onClose={() => { setShowDcmtForm(false); }}
|
413
|
-
onClosePreviewPanel: () => { }, onTaskCreateRequest: onTaskCreateRequest }) }), [focusedItem, deviceType]);
|
414
|
-
const allInitialPanelVisibility = {
|
415
|
-
'tmTreeView': true,
|
416
|
-
'tmFormOrResult': true,
|
417
|
-
'tmSearchResult': true,
|
418
|
-
'tmBlog': false,
|
419
|
-
'tmSysMetadata': false,
|
420
|
-
'tmDcmtPreview': false,
|
421
|
-
};
|
410
|
+
_jsx(TMDcmtForm, { groupId: 'tmFormOrResult', TID: focusedItem?.tid, DID: focusedItem.did, isClosable: deviceType !== DeviceType.MOBILE, allowNavigation: false, allowRelations: deviceType !== DeviceType.MOBILE, showDcmtFormSidebar: deviceType === DeviceType.MOBILE }) :
|
411
|
+
_jsx(TMSearchResult, { groupId: 'tmFormOrResult', isClosable: deviceType !== DeviceType.MOBILE, context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, allowRelations: false, openDcmtFormAsModal: true, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, onTaskCreateRequest: onTaskCreateRequest }) }), [focusedItem, deviceType]);
|
422
412
|
const initialPanelDimensions = {
|
423
413
|
'tmTreeView': { width: '50%', height: '100%' },
|
424
414
|
'tmFormOrResult': { width: '50%', height: '100%' },
|
415
|
+
'tmDcmtForm': { width: '25%', height: '100%' },
|
425
416
|
'tmSearchResult': { width: '25%', height: '100%' },
|
426
417
|
'tmBlog': { width: '25%', height: '100%' },
|
427
418
|
'tmSysMetadata': { width: '25%', height: '100%' },
|
428
419
|
'tmDcmtPreview': { width: '25%', height: '100%' },
|
429
420
|
};
|
421
|
+
const allInitialPanelVisibility = {
|
422
|
+
'tmTreeView': true,
|
423
|
+
'tmFormOrResult': true,
|
424
|
+
'tmDcmtForm': false,
|
425
|
+
'tmSearchResult': true,
|
426
|
+
'tmBlog': false,
|
427
|
+
'tmSysMetadata': false,
|
428
|
+
'tmDcmtPreview': false,
|
429
|
+
};
|
430
430
|
const initialPanels = useMemo(() => [
|
431
431
|
{
|
432
432
|
id: 'tmTreeView',
|
433
433
|
name: SDK_Localizator.Relations,
|
434
|
-
contentOptions: {
|
435
|
-
|
434
|
+
contentOptions: {
|
435
|
+
component: tmTreeView,
|
436
|
+
isClosable: false,
|
437
|
+
panelContainer: {
|
438
|
+
title: getTitle(),
|
439
|
+
toolbar: toolbar,
|
440
|
+
allowMaximize: !isMobile,
|
441
|
+
onBack: onBack
|
442
|
+
}
|
443
|
+
},
|
444
|
+
toolbarOptions: {
|
445
|
+
icon: _jsx(IconDataList, { fontSize: 24 }),
|
446
|
+
visible: true,
|
447
|
+
orderNumber: 1,
|
448
|
+
isActive: allInitialPanelVisibility['tmTreeView']
|
449
|
+
}
|
436
450
|
},
|
437
451
|
{
|
438
452
|
id: 'tmFormOrResult',
|
439
453
|
name: focusedItem?.isDcmt ? SDK_Localizator.Metadatas : SDKUI_Localizator.SearchResult,
|
440
454
|
contentOptions: {
|
441
|
-
component: tmFormOrResult
|
455
|
+
component: tmFormOrResult,
|
456
|
+
isClosable: false
|
442
457
|
},
|
443
458
|
children: [
|
459
|
+
{
|
460
|
+
id: 'tmDcmtForm',
|
461
|
+
name: SDK_Localizator.Metadatas,
|
462
|
+
toolbarOptions: { icon: _jsx(IconPreview, { fontSize: 24 }), visible: false, orderNumber: 1, isActive: allInitialPanelVisibility['tmDcmtForm'] }
|
463
|
+
},
|
444
464
|
{
|
445
465
|
id: 'tmSearchResult',
|
446
|
-
name:
|
447
|
-
toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible:
|
466
|
+
name: SDKUI_Localizator.SearchResult,
|
467
|
+
toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: false, orderNumber: 1, isActive: allInitialPanelVisibility['tmSearchResult'] }
|
448
468
|
},
|
449
469
|
{
|
450
470
|
id: 'tmBlog',
|
@@ -462,9 +482,9 @@ const TMMasterDetailDcmts = ({ deviceType, inputDcmts, isForMaster, showCurrentD
|
|
462
482
|
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible: true, orderNumber: 6, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
|
463
483
|
}
|
464
484
|
],
|
465
|
-
toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible:
|
485
|
+
toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: false, orderNumber: 2, isActive: allInitialPanelVisibility['tmFormOrResult'] }
|
466
486
|
}
|
467
|
-
], [tmTreeView, tmFormOrResult, focusedItem]);
|
487
|
+
], [tmTreeView, tmFormOrResult, focusedItem?.isDcmt]);
|
468
488
|
return (_jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, isCancelable: true, abortController: abortController, children: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmTreeView', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }));
|
469
489
|
};
|
470
490
|
export default TMMasterDetailDcmts;
|
@@ -545,3 +565,21 @@ const getDisplayValueByColumn = (col, value) => {
|
|
545
565
|
export function IconBackhandIndexPointingRight(props) {
|
546
566
|
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" }) })] }));
|
547
567
|
}
|
568
|
+
const TMTreeViewWrapper = ({ data, allowMultipleSelection, focusedItem, selectedItems, renderItem, calculateItemsForNode, onFocusedItemChanged, onSelectionChanged, onDataChanged }) => {
|
569
|
+
const { setPanelVisibilityById, setToolbarButtonVisibility } = useTMPanelManagerContext();
|
570
|
+
return (_jsx(TMTreeView, { dataSource: data, allowMultipleSelection: allowMultipleSelection, calculateItemsForNode: calculateItemsForNode, itemRender: renderItem, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: (item) => {
|
571
|
+
onFocusedItemChanged?.(item);
|
572
|
+
if (item?.isDcmt) {
|
573
|
+
setPanelVisibilityById('tmSearchResult', false);
|
574
|
+
setPanelVisibilityById('tmDcmtForm', true);
|
575
|
+
setToolbarButtonVisibility('tmSearchResult', false);
|
576
|
+
setToolbarButtonVisibility('tmDcmtForm', true);
|
577
|
+
}
|
578
|
+
else {
|
579
|
+
setPanelVisibilityById('tmSearchResult', true);
|
580
|
+
setPanelVisibilityById('tmDcmtForm', false);
|
581
|
+
setToolbarButtonVisibility('tmSearchResult', true);
|
582
|
+
setToolbarButtonVisibility('tmDcmtForm', false);
|
583
|
+
}
|
584
|
+
}, onSelectionChanged: onSelectionChanged, onDataChanged: onDataChanged }));
|
585
|
+
};
|
@@ -188,7 +188,7 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
188
188
|
{
|
189
189
|
id: 'TMRecentsManager',
|
190
190
|
name: SDKUI_Localizator.Shortcuts,
|
191
|
-
contentOptions: { component: tmRecentsManagerElement, panelContainer: { title: SDKUI_Localizator.Shortcuts } },
|
191
|
+
contentOptions: { component: tmRecentsManagerElement, panelContainer: { title: SDKUI_Localizator.Shortcuts, totalItems: mruTIDs.length } },
|
192
192
|
toolbarOptions: { icon: _jsx(IconRecentlyViewed, { fontSize: 24 }), visible: true, orderNumber: 2, isActive: allInitialPanelVisibility['TMRecentsManager'] }
|
193
193
|
},
|
194
194
|
{
|
@@ -203,7 +203,7 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
203
203
|
contentOptions: { component: tmSavedQuerySelectorElement, panelContainer: { title: SDK_Localizator.SavedQueries } },
|
204
204
|
toolbarOptions: { icon: _jsx(IconSavedQuery, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['TMSavedQuerySelector'] }
|
205
205
|
}
|
206
|
-
], [tmTreeSelectorElement, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement, fromDTD]);
|
206
|
+
], [tmTreeSelectorElement, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement, fromDTD, mruTIDs]);
|
207
207
|
return (_jsxs(_Fragment, { children: [_jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }), searchResult.length > 0 &&
|
208
208
|
_jsx(TMSearchResult, { isVisible: currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync: async () => {
|
209
209
|
setSearchResult(await refreshLastSearch(lastQdSearched) ?? []);
|
@@ -19,7 +19,6 @@ interface ITMSearchResultProps {
|
|
19
19
|
onSelectedTIDChanged?: (TID: number) => void;
|
20
20
|
onRefreshSearchAsync?: () => Promise<void>;
|
21
21
|
onRefreshAfterAddDcmtToFavs?: () => void;
|
22
|
-
onClosePreviewPanel?: () => void;
|
23
22
|
onTaskCreateRequest?: (taskContext: TaskContext) => void;
|
24
23
|
}
|
25
24
|
declare const TMSearchResult: React.FC<ITMSearchResultProps>;
|
@@ -49,12 +49,7 @@ const orderByName = (array) => {
|
|
49
49
|
return 1;
|
50
50
|
} return 0; });
|
51
51
|
};
|
52
|
-
const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showSelector = false, groupId,
|
53
|
-
// showDcmtForm = false,
|
54
|
-
// showBoard = false,
|
55
|
-
// showPreview = false,
|
56
|
-
// showSysMetadata = false,
|
57
|
-
title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onUpdate, onClose, onTaskCreateRequest }) => {
|
52
|
+
const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showSelector = false, groupId, title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onUpdate, onClose, onTaskCreateRequest }) => {
|
58
53
|
const [id, setID] = useState('');
|
59
54
|
const [showApprovePopup, setShowApprovePopup] = useState(false);
|
60
55
|
const [showRejectPopup, setShowRejectPopup] = useState(false);
|
@@ -703,6 +698,6 @@ const TMSearchResultSelector = ({ searchResults = [], onSelectionChanged }) => {
|
|
703
698
|
};
|
704
699
|
//#endregion TMSearchResultSelector
|
705
700
|
const TMDcmtPreviewWrapper = ({ currentDcmt }) => {
|
706
|
-
const { setPanelVisibilityById, toggleMaximize } = useTMPanelManagerContext();
|
707
|
-
return (_jsx(TMDcmtPreview, { onClosePanel: () => setPanelVisibilityById('tmDcmtPreview', false), onMaximizePanel: () => toggleMaximize('tmDcmtPreview'), dcmtData: currentDcmt }));
|
701
|
+
const { setPanelVisibilityById, toggleMaximize, isResizingActive } = useTMPanelManagerContext();
|
702
|
+
return (_jsx(TMDcmtPreview, { onClosePanel: () => setPanelVisibilityById('tmDcmtPreview', false), onMaximizePanel: () => toggleMaximize('tmDcmtPreview'), dcmtData: currentDcmt, isResizingActive: isResizingActive }));
|
708
703
|
};
|
@@ -14,9 +14,6 @@ export * from './base/TMToolbarCard';
|
|
14
14
|
export * from './base/TMRightSidebar';
|
15
15
|
export * from './base/TMTreeView';
|
16
16
|
export * from './base/TMPanel';
|
17
|
-
export { default as TMPanelManager } from './base/TMPanelManager';
|
18
|
-
export { default as TMPanelManagerToolbar } from './base/TMPanelManagerToolbar';
|
19
|
-
export * from './base/TMPanelManagerUtils';
|
20
17
|
export { default as CounterBar } from './base/TMCounterBar';
|
21
18
|
export { default as TMProgressBar } from './base/TMProgressBar';
|
22
19
|
export { default as TMSpinner } from './base/TMSpinner';
|
package/lib/components/index.js
CHANGED
@@ -15,9 +15,6 @@ export * from './base/TMToolbarCard';
|
|
15
15
|
export * from './base/TMRightSidebar';
|
16
16
|
export * from './base/TMTreeView';
|
17
17
|
export * from './base/TMPanel';
|
18
|
-
export { default as TMPanelManager } from './base/TMPanelManager';
|
19
|
-
export { default as TMPanelManagerToolbar } from './base/TMPanelManagerToolbar';
|
20
|
-
export * from './base/TMPanelManagerUtils';
|
21
18
|
export { default as CounterBar } from './base/TMCounterBar';
|
22
19
|
export { default as TMProgressBar } from './base/TMProgressBar';
|
23
20
|
export { default as TMSpinner } from './base/TMSpinner';
|
@@ -36,11 +36,11 @@ const TMPanelManagerToolbar = (props) => {
|
|
36
36
|
useEffect(() => {
|
37
37
|
// Flatten panels, filter visible leaf nodes, and sort by orderNumber
|
38
38
|
const visibleLeafPanelsSorted = flattenPanels(panels)
|
39
|
-
.filter(panel => panel.
|
39
|
+
.filter(panel => toolbarButtonsVisibility[panel.id] && !panel.children?.length)
|
40
40
|
.sort((a, b) => (a.toolbarOptions?.orderNumber ?? 0) - (b.toolbarOptions?.orderNumber ?? 0));
|
41
41
|
// Update state with the filtered and sorted leaf panels for the toolbar
|
42
42
|
setVisibleLeafPanels(visibleLeafPanelsSorted);
|
43
|
-
}, [
|
43
|
+
}, [toolbarButtonsVisibility]);
|
44
44
|
return (_jsx("div", { style: {
|
45
45
|
display: 'flex',
|
46
46
|
flexDirection: isMobile ? 'row' : 'column',
|
@@ -6,6 +6,9 @@ import TMPanel from '../../base/TMPanel';
|
|
6
6
|
const TMPanelWrapper = (props) => {
|
7
7
|
const { panel, children } = props;
|
8
8
|
const { panelVisibility, panelDimensions, togglePanelVisibility, maximizedPanels, toggleMaximize } = useTMPanelManagerContext();
|
9
|
+
// Default to true if isMaximizable or isClosable is undefined, ensuring safe and expected behavior
|
10
|
+
const isMaximizable = panel.contentOptions?.isMaximizable ?? true;
|
11
|
+
const isClosable = panel.contentOptions?.isClosable ?? true;
|
9
12
|
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook
|
10
13
|
const deviceType = useDeviceType();
|
11
14
|
// This avoids unnecessary re-renders by only recalculating when deviceType changes
|
@@ -30,6 +33,6 @@ const TMPanelWrapper = (props) => {
|
|
30
33
|
pointerEvents: 'auto',
|
31
34
|
};
|
32
35
|
return (_jsx("div", { "data-panel-id": panel.id, style: panelStyles, children: panel.contentOptions?.panelContainer ?
|
33
|
-
_jsx(TMPanel, { ...panel.contentOptions.panelContainer, allowMaximize: !isMobile, onHeaderDoubleClick: () => toggleMaximize(panel.id), onMaximize: () => toggleMaximize(panel.id), onClose: () => togglePanelVisibility(panel.id), children: children }) : children }));
|
36
|
+
_jsx(TMPanel, { ...panel.contentOptions.panelContainer, allowMaximize: !isMobile, onHeaderDoubleClick: isMaximizable ? () => toggleMaximize(panel.id) : undefined, onMaximize: isMaximizable ? () => toggleMaximize(panel.id) : undefined, onClose: isClosable ? () => togglePanelVisibility(panel.id) : undefined, children: children }) : children }));
|
34
37
|
};
|
35
38
|
export default TMPanelWrapper;
|
package/package.json
CHANGED
@@ -1,11 +0,0 @@
|
|
1
|
-
import { TMPanelItemConfig } from './TMPanelManagerUtils';
|
2
|
-
type TMPanelManagerProps = {
|
3
|
-
panels: Array<TMPanelItemConfig>;
|
4
|
-
initialMobilePanelId: string;
|
5
|
-
showToolbar?: boolean;
|
6
|
-
toolbarMode?: number;
|
7
|
-
gutters?: number;
|
8
|
-
minPanelPercent?: number;
|
9
|
-
};
|
10
|
-
declare const TMPanelManager: (props: TMPanelManagerProps) => import("react/jsx-runtime").JSX.Element;
|
11
|
-
export default TMPanelManager;
|