@topconsultnpm/sdkui-react-beta 6.13.24 → 6.13.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assets/icomoon.svg +96 -96
- package/lib/assets/italy.svg +16 -16
- package/lib/assets/topmedia-six.svg +65 -65
- package/lib/assets/topmeida-six-bianco.svg +65 -65
- package/lib/components/features/archive/TMArchive.js +22 -14
- package/lib/components/features/documents/TMBatchUpdateForm.js +4 -5
- package/lib/components/features/documents/TMDcmtForm.d.ts +2 -2
- package/lib/components/features/documents/TMDcmtForm.js +76 -53
- package/lib/components/features/documents/TMDcmtPreview.js +7 -8
- package/lib/components/features/documents/TMFileUploader.js +2 -2
- package/lib/components/features/documents/TMMasterDetailDcmts.js +26 -18
- package/lib/components/features/search/TMSearch.js +85 -156
- package/lib/components/features/search/TMSearchResult.js +63 -41
- package/lib/components/grids/TMRecentsManager.js +1 -1
- package/lib/components/sidebar/TMCommandsPanel.d.ts +16 -0
- package/lib/components/sidebar/TMCommandsPanel.js +25 -0
- package/package.json +2 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
import { jsx as _jsx,
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
2
|
import { useCallback, useEffect, useState } from 'react';
|
3
3
|
import { SavedQueryCacheService, DcmtTypeListCacheService, SDK_Localizator } from '@topconsultnpm/sdk-ts-beta';
|
4
4
|
import TMSavedQuerySelector from './TMSavedQuerySelector';
|
@@ -6,12 +6,14 @@ import TMTreeSelector from './TMTreeSelector';
|
|
6
6
|
import { TabPanel, Item } from 'devextreme-react/tab-panel';
|
7
7
|
import TMSearchQueryPanel, { refreshLastSearch } from './TMSearchQueryPanel';
|
8
8
|
import { getSysAllDcmtsSQD, IconProgressReady, IconSavedQuery, IconSearch, IconTree, SDKUI_Globals, SDKUI_Localizator } from '../../../helper';
|
9
|
+
import { TMLayoutItem, TMSplitterLayout } from '../../base/TMLayout';
|
10
|
+
import TMPanel from '../../base/TMPanel';
|
9
11
|
import TMSearchResult from './TMSearchResult';
|
10
12
|
import TMRecentsManager from '../../grids/TMRecentsManager';
|
11
13
|
import { SearchResultContext } from '../../../ts';
|
12
14
|
import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
13
15
|
import { StyledMultiViewPanel } from '../../base/Styled';
|
14
|
-
import
|
16
|
+
import TMCommandsPanel from '../../sidebar/TMCommandsPanel';
|
15
17
|
var TMSearchViews;
|
16
18
|
(function (TMSearchViews) {
|
17
19
|
TMSearchViews[TMSearchViews["None"] = 0] = "None";
|
@@ -27,158 +29,13 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
27
29
|
const [searchResult, setSearchResult] = useState([]);
|
28
30
|
const [mruTIDs, setMruTIDs] = useState([]);
|
29
31
|
const [currentSearchView, setCurrentSearchView] = useState(TMSearchViews.None);
|
32
|
+
const [showDistinctValuesPanel, setShowDistinctValuesPanel] = useState(false);
|
33
|
+
const [showTreesPanel, setShowTreesPanel] = useState(true);
|
34
|
+
const [showRecentsPanel, setShowRecentsPanel] = useState(true);
|
35
|
+
const [showSavedQueryPanel, setShowSavedQueryPanel] = useState(true);
|
30
36
|
const [currentSQDMode, setCurrentSQDMode] = useState(1);
|
31
37
|
const [lastQdSearched, setLastQdSearched] = useState();
|
32
38
|
const deviceType = useDeviceType();
|
33
|
-
const panelMatrixMap = new Map([
|
34
|
-
[
|
35
|
-
"column-0",
|
36
|
-
{
|
37
|
-
width: "20%",
|
38
|
-
rows: [
|
39
|
-
{
|
40
|
-
id: 'treeSelector',
|
41
|
-
height: '100%',
|
42
|
-
width: '100%',
|
43
|
-
content: (togglePanelVisibility) => _jsx(TMTreeSelector, { onClose: () => togglePanelVisibility({
|
44
|
-
id: 'toolbar-item-treeSelector',
|
45
|
-
icon: 'optionsgear',
|
46
|
-
tooltipName: SDK_Localizator.Trees,
|
47
|
-
panelManagerMatrixRowId: 'treeSelector',
|
48
|
-
}), onSelectedTIDChanged: (tid) => {
|
49
|
-
setCurrentTID(tid);
|
50
|
-
if (tid && mruTIDs.includes(tid))
|
51
|
-
setCurrentMruTID(tid);
|
52
|
-
else
|
53
|
-
setCurrentMruTID(0);
|
54
|
-
} }),
|
55
|
-
hidden: false
|
56
|
-
}
|
57
|
-
],
|
58
|
-
}
|
59
|
-
],
|
60
|
-
[
|
61
|
-
"column-1",
|
62
|
-
{
|
63
|
-
width: "20%",
|
64
|
-
rows: [
|
65
|
-
{
|
66
|
-
id: 'recentsManager',
|
67
|
-
height: '100%',
|
68
|
-
width: '100%',
|
69
|
-
content: (togglePanelVisibility) => _jsx(TMRecentsManager, { mruTIDs: mruTIDs, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: (tid) => {
|
70
|
-
setCurrentMruTID(tid);
|
71
|
-
setCurrentTID(tid);
|
72
|
-
togglePanelVisibility({
|
73
|
-
id: 'toolbar-item-searchQueryPanel',
|
74
|
-
icon: _jsx(IconSearch, {}),
|
75
|
-
tooltipName: SDKUI_Localizator.Search,
|
76
|
-
panelManagerMatrixRowId: 'searchQueryPanel',
|
77
|
-
// visible: deviceType === DeviceType.MOBILE
|
78
|
-
});
|
79
|
-
}, onDeletedTID: (tid) => {
|
80
|
-
let newMruTIDS = mruTIDs.slice();
|
81
|
-
let index = newMruTIDS.findIndex(o => o == tid);
|
82
|
-
if (index >= 0)
|
83
|
-
newMruTIDS.splice(index, 1);
|
84
|
-
SDKUI_Globals.userSettings.searchSettings.mruTIDs = newMruTIDS.filter(tid => tid != undefined && tid != null);
|
85
|
-
setMruTIDs(newMruTIDS);
|
86
|
-
} }),
|
87
|
-
hidden: false,
|
88
|
-
panel: {
|
89
|
-
title: "Scorciatoie",
|
90
|
-
totalItems: mruTIDs.length
|
91
|
-
}
|
92
|
-
}
|
93
|
-
],
|
94
|
-
}
|
95
|
-
],
|
96
|
-
[
|
97
|
-
"column-2",
|
98
|
-
{
|
99
|
-
width: "40%",
|
100
|
-
rows: [
|
101
|
-
{
|
102
|
-
id: 'searchQueryPanel',
|
103
|
-
height: '100%',
|
104
|
-
width: '100%',
|
105
|
-
content: _jsx(TMSearchQueryPanel, { isExpertMode: isExpertMode, fromDTD: fromDTD, SQD: currentSQD, onBack: deviceType !== DeviceType.DESKTOP ? () => { setCurrentTID(0); } : undefined, onSearchCompleted: (searchResult, qd) => {
|
106
|
-
setSearchResult(searchResult);
|
107
|
-
if (searchResult.length <= 0)
|
108
|
-
return;
|
109
|
-
setLastQdSearched(qd);
|
110
|
-
setCurrentSearchView(TMSearchViews.Result);
|
111
|
-
// Salvataggio ultimi 10 TIDs
|
112
|
-
let fromTID = searchResult?.[0].fromTID;
|
113
|
-
let newMruTIDS = mruTIDs.slice();
|
114
|
-
let index = newMruTIDS.findIndex(o => o == fromTID);
|
115
|
-
if (index >= 0)
|
116
|
-
newMruTIDS.splice(index, 1);
|
117
|
-
if (newMruTIDS.length >= 10)
|
118
|
-
newMruTIDS.splice(0, 1);
|
119
|
-
newMruTIDS.push(fromTID);
|
120
|
-
setMruTIDs(newMruTIDS);
|
121
|
-
setCurrentMruTID(fromTID);
|
122
|
-
SDKUI_Globals.userSettings.searchSettings.mruTIDs = newMruTIDS.filter(tid => tid != undefined && tid != null);
|
123
|
-
}, onSqdSaved: async (newSqd) => {
|
124
|
-
await loadDataSQDsAsync(true, newSqd.masterTID);
|
125
|
-
await setSQDAsync(newSqd);
|
126
|
-
} }),
|
127
|
-
hidden: false
|
128
|
-
}
|
129
|
-
],
|
130
|
-
}
|
131
|
-
],
|
132
|
-
[
|
133
|
-
"column-4",
|
134
|
-
{
|
135
|
-
width: "20%",
|
136
|
-
rows: [
|
137
|
-
{
|
138
|
-
id: 'savedQuery',
|
139
|
-
height: '100%',
|
140
|
-
width: '100%',
|
141
|
-
content: _jsxs(TabPanel, { width: "100%", height: "100%", showNavButtons: true, repaintChangesOnly: true, selectedIndex: currentSQDMode, onSelectedIndexChange: (index) => setCurrentSQDMode(index), children: [(currentTID || currentSQD) ? _jsx(Item, { title: fromDTD?.nameLoc, children: _jsx(TMSavedQuerySelector, { allowShowSearch: false, items: filteredByTIDSQDs, selectedId: currentSQD?.id, onRefreshData: () => { loadDataSQDsAsync(true); }, onItemClick: (sqd) => onSQDItemClick(sqd, setSQDAsync), onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? filteredByTIDSQDs.find(o => o.id == 1) : currentSQD, setSQDAsync) }) }) : _jsx(_Fragment, {}), _jsx(Item, { title: SDKUI_Localizator.Alls2, children: _jsx(TMSavedQuerySelector, { allowShowSearch: true, items: allSQDs, manageDefault: false,
|
142
|
-
// selectedId={currentSQD?.id}
|
143
|
-
onItemClick: (sqd) => onSQDItemClick(sqd, setSQDAsync), onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? undefined : currentSQD, setSQDAsync) }) })] }),
|
144
|
-
hidden: false,
|
145
|
-
panel: {
|
146
|
-
title: SDK_Localizator.SavedQueries
|
147
|
-
}
|
148
|
-
}
|
149
|
-
],
|
150
|
-
}
|
151
|
-
]
|
152
|
-
]);
|
153
|
-
const toolbar = {
|
154
|
-
items: [
|
155
|
-
{
|
156
|
-
id: 'toolbar-item-treeSelector',
|
157
|
-
icon: _jsx(IconTree, {}),
|
158
|
-
tooltipName: SDK_Localizator.Trees,
|
159
|
-
panelManagerMatrixRowId: 'treeSelector',
|
160
|
-
},
|
161
|
-
{
|
162
|
-
id: 'toolbar-item-recentsManager',
|
163
|
-
icon: _jsx(IconProgressReady, {}),
|
164
|
-
tooltipName: "Scorciatoie",
|
165
|
-
panelManagerMatrixRowId: 'recentsManager',
|
166
|
-
},
|
167
|
-
{
|
168
|
-
id: 'toolbar-item-searchQueryPanel',
|
169
|
-
icon: _jsx(IconSearch, {}),
|
170
|
-
tooltipName: SDKUI_Localizator.Search,
|
171
|
-
panelManagerMatrixRowId: 'searchQueryPanel',
|
172
|
-
visible: deviceType === DeviceType.MOBILE
|
173
|
-
},
|
174
|
-
{
|
175
|
-
id: 'toolbar-item-savedQuery',
|
176
|
-
icon: _jsx(IconSavedQuery, {}),
|
177
|
-
tooltipName: SDK_Localizator.SavedQueries,
|
178
|
-
panelManagerMatrixRowId: 'savedQuery',
|
179
|
-
}
|
180
|
-
]
|
181
|
-
};
|
182
39
|
useEffect(() => {
|
183
40
|
setMruTIDs(SDKUI_Globals.userSettings.searchSettings.mruTIDs);
|
184
41
|
loadDataSQDsAsync(false);
|
@@ -266,10 +123,82 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
266
123
|
if (sqdToBeSet)
|
267
124
|
await setSqdAsync?.(sqdToBeSet);
|
268
125
|
}, []);
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
126
|
+
const isMobile = deviceType === DeviceType.MOBILE;
|
127
|
+
return (_jsxs(_Fragment, { children: [_jsxs(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.None, style: {
|
128
|
+
display: 'flex',
|
129
|
+
flexDirection: isMobile ? 'column' : 'row',
|
130
|
+
justifyContent: 'space-between',
|
131
|
+
gap: SDKUI_Globals.userSettings.themeSettings.gutters,
|
132
|
+
width: '100%',
|
133
|
+
height: '100%',
|
134
|
+
}, children: [_jsx("div", { style: { flex: 1, minWidth: 0, height: '100%' }, children: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, separatorActiveColor: 'transparent', separatorColor: 'transparent', showSeparator: deviceType !== DeviceType.MOBILE && showTreesPanel, min: ['0', '0'], start: (deviceType === DeviceType.MOBILE) ? ['100%', '0%'] : showTreesPanel ? ['20%', '80%'] : ['0%', '100%'], children: [deviceType !== DeviceType.MOBILE &&
|
135
|
+
_jsx(TMTreeSelector, { onClose: () => setShowTreesPanel(false), onSelectedTIDChanged: (tid) => {
|
136
|
+
setCurrentTID(tid);
|
137
|
+
if (tid && mruTIDs.includes(tid))
|
138
|
+
setCurrentMruTID(tid);
|
139
|
+
else
|
140
|
+
setCurrentMruTID(0);
|
141
|
+
} }), _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', showSeparator: deviceType !== DeviceType.MOBILE && showSavedQueryPanel && !showDistinctValuesPanel, separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, separatorColor: 'transparent', separatorActiveColor: 'transparent', min: ['0', '0'], start: (deviceType === DeviceType.MOBILE || showDistinctValuesPanel) ? ['100%', '0%'] : ((showSavedQueryPanel) ? ['70%', '30%'] : ['100%', '0%']), children: [_jsx(TMLayoutItem, { children: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', showSeparator: deviceType !== DeviceType.MOBILE && showRecentsPanel, separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, separatorColor: 'transparent', separatorActiveColor: 'transparent', min: ['0', '0'], start: deviceType === DeviceType.DESKTOP ? (showRecentsPanel ? ['30%', '70%'] : ['0%', '100%']) : (currentTID ? ['0%', '100%'] : ['100%', '0%']), children: [_jsx(TMPanel, { title: "Scorciatoie", totalItems: mruTIDs.length, onClose: () => setShowRecentsPanel(false), children: _jsx(TMRecentsManager, { mruTIDs: mruTIDs, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: (tid) => { setCurrentMruTID(tid); setCurrentTID(tid); }, onDeletedTID: (tid) => {
|
142
|
+
let newMruTIDS = mruTIDs.slice();
|
143
|
+
let index = newMruTIDS.findIndex(o => o == tid);
|
144
|
+
if (index >= 0)
|
145
|
+
newMruTIDS.splice(index, 1);
|
146
|
+
SDKUI_Globals.userSettings.searchSettings.mruTIDs = newMruTIDS.filter(tid => tid != undefined && tid != null);
|
147
|
+
setMruTIDs(newMruTIDS);
|
148
|
+
} }) }), _jsx(TMSearchQueryPanel, { isExpertMode: isExpertMode, fromDTD: fromDTD, SQD: currentSQD, onBack: deviceType !== DeviceType.DESKTOP ? () => { setCurrentTID(0); } : undefined, onSearchCompleted: (searchResult, qd) => {
|
149
|
+
setSearchResult(searchResult);
|
150
|
+
if (searchResult.length <= 0)
|
151
|
+
return;
|
152
|
+
setLastQdSearched(qd);
|
153
|
+
setCurrentSearchView(TMSearchViews.Result);
|
154
|
+
// Salvataggio ultimi 10 TIDs
|
155
|
+
let fromTID = searchResult?.[0].fromTID;
|
156
|
+
let newMruTIDS = mruTIDs.slice();
|
157
|
+
let index = newMruTIDS.findIndex(o => o == fromTID);
|
158
|
+
if (index >= 0)
|
159
|
+
newMruTIDS.splice(index, 1);
|
160
|
+
if (newMruTIDS.length >= 10)
|
161
|
+
newMruTIDS.splice(0, 1);
|
162
|
+
newMruTIDS.push(fromTID);
|
163
|
+
setMruTIDs(newMruTIDS);
|
164
|
+
setCurrentMruTID(fromTID);
|
165
|
+
SDKUI_Globals.userSettings.searchSettings.mruTIDs = newMruTIDS.filter(tid => tid != undefined && tid != null);
|
166
|
+
}, onSqdSaved: async (newSqd) => {
|
167
|
+
await loadDataSQDsAsync(true, newSqd.masterTID);
|
168
|
+
await setSQDAsync(newSqd);
|
169
|
+
} })] }) }), _jsx(StyledMultiViewPanel, { "$isVisible": showSavedQueryPanel, children: _jsx(TMPanel, { title: SDK_Localizator.SavedQueries, onClose: () => setShowSavedQueryPanel(false), children: _jsxs(TabPanel, { width: "100%", height: "100%", showNavButtons: true, repaintChangesOnly: true, selectedIndex: currentSQDMode, onSelectedIndexChange: (index) => setCurrentSQDMode(index), children: [(currentTID || currentSQD) ? _jsx(Item, { title: fromDTD?.nameLoc, children: _jsx(TMSavedQuerySelector, { allowShowSearch: false, items: filteredByTIDSQDs, selectedId: currentSQD?.id, onRefreshData: () => { loadDataSQDsAsync(true); }, onItemClick: (sqd) => onSQDItemClick(sqd, setSQDAsync), onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? filteredByTIDSQDs.find(o => o.id == 1) : currentSQD, setSQDAsync) }) }) : _jsx(_Fragment, {}), _jsx(Item, { title: SDKUI_Localizator.Alls2, children: _jsx(TMSavedQuerySelector, { allowShowSearch: true, items: allSQDs, manageDefault: false,
|
170
|
+
// selectedId={currentSQD?.id}
|
171
|
+
onItemClick: (sqd) => onSQDItemClick(sqd, setSQDAsync), onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? undefined : currentSQD, setSQDAsync) }) })] }) }) })] })] }) }), _jsx(TMCommandsPanel, { isMobile: isMobile, items: [
|
172
|
+
{
|
173
|
+
icon: _jsx(IconTree, { fontSize: 20 }),
|
174
|
+
selected: showTreesPanel,
|
175
|
+
onClick: () => setShowTreesPanel(!showTreesPanel),
|
176
|
+
},
|
177
|
+
{
|
178
|
+
icon: _jsx(IconProgressReady, { fontSize: 20 }),
|
179
|
+
selected: showRecentsPanel,
|
180
|
+
onClick: () => setShowRecentsPanel(!showRecentsPanel),
|
181
|
+
},
|
182
|
+
{
|
183
|
+
icon: _jsx(IconSavedQuery, { fontSize: 20 }),
|
184
|
+
selected: showSavedQueryPanel,
|
185
|
+
onClick: () => setShowSavedQueryPanel(!showSavedQueryPanel),
|
186
|
+
},
|
187
|
+
...(searchResult.length > 0 ? [{
|
188
|
+
icon: _jsx(IconSearch, { fontSize: 20 }),
|
189
|
+
disabled: searchResult.length <= 0,
|
190
|
+
onClick: () => {
|
191
|
+
if (searchResult.length > 0) {
|
192
|
+
setCurrentSearchView(currentSearchView === TMSearchViews.None
|
193
|
+
? TMSearchViews.Result
|
194
|
+
: TMSearchViews.None);
|
195
|
+
}
|
196
|
+
},
|
197
|
+
}] : []),
|
198
|
+
] })] }), searchResult.length > 0 &&
|
199
|
+
_jsx(TMSearchResult, { isVisible: currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync: async () => {
|
200
|
+
// setSearchResult([]);
|
201
|
+
setSearchResult(await refreshLastSearch(lastQdSearched) ?? []);
|
202
|
+
}, onTaskCreateRequest: onTaskCreateRequest, onClose: () => { setCurrentSearchView(TMSearchViews.None); } })] }));
|
274
203
|
};
|
275
204
|
export default TMSearch;
|
@@ -4,7 +4,7 @@ import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, M
|
|
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, IconTag, IconDetails, IconCommand, IconDelete, IconRefresh, IconMenuVertical, IconDownload, IconSignature, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, IconArchive, IconActivityLog, IconStar, IconFreeSearch, IconChevronDown, searchResultToMetadataValues } from '../../../helper';
|
7
|
+
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconTag, IconDetails, IconCommand, IconDelete, IconRefresh, IconMenuVertical, IconDownload, IconSignature, deepCompare, getDataColumnName, searchResultDescriptorToSimpleArray, IconArchive, IconActivityLog, IconStar, IconFreeSearch, IconChevronDown, searchResultToMetadataValues, SDKUI_Globals } 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';
|
@@ -17,7 +17,6 @@ import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
|
17
17
|
import { TMSplitterLayout, TMLayoutItem } from '../../base/TMLayout';
|
18
18
|
import { CustomListViewHeader } from '../../base/TMListView';
|
19
19
|
import { TMMessageBoxManager, ButtonNames } from '../../base/TMPopUp';
|
20
|
-
import TMToolbarCard from '../../base/TMToolbarCard';
|
21
20
|
import TMTooltip from '../../base/TMTooltip';
|
22
21
|
import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
23
22
|
import { TMUserIdViewer } from '../../choosers/TMUserChooser';
|
@@ -34,6 +33,8 @@ import TMBatchUpdateForm from '../../features/documents/TMBatchUpdateForm';
|
|
34
33
|
import TMDcmtForm from '../documents/TMDcmtForm';
|
35
34
|
import TMDcmtBlog from '../documents/TMDcmtBlog';
|
36
35
|
import TMDcmtIcon from '../documents/TMDcmtIcon';
|
36
|
+
import TMPanel from '../../base/TMPanel';
|
37
|
+
import TMCommandsPanel from '../../sidebar/TMCommandsPanel';
|
37
38
|
//#endregion region Interfaces, Types and Enums
|
38
39
|
//#region Styled Components
|
39
40
|
const StyledContainer = styled.div ` overflow: hidden; background-color: #ffffff; width: calc(100%); height: calc(100%); display: flex; gap: 10px; `;
|
@@ -82,7 +83,6 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
82
83
|
const [currentDcmt, setCurrentDcmt] = useState();
|
83
84
|
const [currentMetadataValues, setCurrentMetadataValues] = useState([]);
|
84
85
|
const [dcmtFormLayoutMode, setDcmtFormLayoutMode] = useState(LayoutModes.Update);
|
85
|
-
// const [allowMultipleSelection, setAllowMultipleSelection] = useState<boolean>(false);
|
86
86
|
const [isModifiedBatchUpdate, setIsModifiedBatchUpdate] = useState(false);
|
87
87
|
const [confirmFormat, ConfirmFormatDialog] = useInputCvtFormatDialog();
|
88
88
|
const { openConfirmAttachmentsDialog, ConfirmAttachmentsDialog } = useInputAttachmentsDialog();
|
@@ -140,14 +140,6 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
140
140
|
useEffect(() => { setIsOpenSysMetadata(showSysMetadata); }, [showSysMetadata]);
|
141
141
|
useEffect(() => { setIsOpenDcmtForm(showDcmtForm); }, [showDcmtForm]);
|
142
142
|
useEffect(() => { setIsOpenPreview(showPreview); }, [showPreview]);
|
143
|
-
const sideBarItems = [
|
144
|
-
{ icon: _jsx(IconShow, {}), id: 'Preview', visibleName: 'Anteprima', isActive: isOpenPreview, onClick: () => { setIsOpenPreview(!isOpenPreview); }, disabled: isOpenBatchUpdate || fromDTD?.archiveConstraint === ArchiveConstraints.OnlyMetadata },
|
145
|
-
{ icon: _jsx(IconBoard, {}), id: 'Board', visibleName: 'Bacheca', beginGroup: true, isActive: isOpenBoard, disabled: isOpenBatchUpdate, onClick: () => { closeMiddlePanel(); setIsOpenBoard(!isOpenBoard); } },
|
146
|
-
{ icon: _jsx(IconDcmtTypeSys, {}), id: 'SystemMetadata', visibleName: 'Metadati di sistema', isActive: isOpenSysMetadata, disabled: isOpenBatchUpdate, onClick: () => { closeMiddlePanel(); setIsOpenSysMetadata(!isOpenSysMetadata); } },
|
147
|
-
{ icon: _jsx(IconDetailDcmts, { fontSize: 20, transform: 'scale(-1, 1)' }), id: 'Master', beginGroup: true, visible: currentTIDHasMasterRelations, visibleName: SDKUI_Localizator.DcmtsMaster, disabled: isOpenBatchUpdate || !focusedItem?.DID, isActive: isOpenMaster, onClick: () => { setIsOpenMaster(!isOpenMaster); } },
|
148
|
-
{ icon: _jsx(IconDetailDcmts, { fontSize: 20 }), id: 'Details', visibleName: SDKUI_Localizator.DcmtsDetail, disabled: isOpenBatchUpdate || (!focusedItem?.DID && selectedItems.length <= 0), isActive: isOpenDetails, visible: currentTIDHasDetailRelations, onClick: () => { setIsOpenDetails(!isOpenDetails); } },
|
149
|
-
// { icon: <IconBatchUpdate fontSize={18} />, id: 'BatchUpdate', visibleName: "Modifica multipla", disabled: selectedItems.length <= 0, isActive: isOpenBatchUpdate, onClick: () => { setIsOpenBatchUpdate(!isOpenBatchUpdate) } }
|
150
|
-
];
|
151
143
|
const openFormHandler = (layoutMode) => { setIsOpenDcmtForm(true); setDcmtFormLayoutMode(layoutMode); };
|
152
144
|
const openTaskFormHandler = (value) => {
|
153
145
|
if (selectedItems.length > 1)
|
@@ -430,37 +422,67 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
430
422
|
};
|
431
423
|
if (!searchResults || searchResults.length <= 0)
|
432
424
|
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 })] });
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
? _jsx(TMLayoutItem, { children: _jsx(TMToolbarCard, { padding: '0',
|
452
|
-
// color={TMColors.primaryColor}
|
453
|
-
// backgroundColor={`${TMColors.primaryColor}25`}
|
454
|
-
title: titleText(), toolbar: middlePanelToolbar, onClose: () => closeMiddlePanel(), children: (!focusedItem?.DID)
|
455
|
-
?
|
456
|
-
_jsx(TMNothingToShow, { text: 'Nessun documento selezionato.', secondText: notAvalableMsg, icon: notAvalableIcon })
|
425
|
+
const isPreviewDisabled = isOpenBatchUpdate || fromDTD?.archiveConstraint === ArchiveConstraints.OnlyMetadata;
|
426
|
+
const isBoardDisabled = isOpenBatchUpdate;
|
427
|
+
const isSysMetadataDisabled = isOpenBatchUpdate || !focusedItem?.DID;
|
428
|
+
const isDetailsDisabled = isOpenBatchUpdate || !focusedItem?.DID;
|
429
|
+
const isMasterDisabled = isOpenBatchUpdate || (!focusedItem?.DID && selectedItems.length <= 0);
|
430
|
+
const isMobile = deviceType === DeviceType.MOBILE;
|
431
|
+
return (_jsx(StyledMultiViewPanel, { "$isVisible": isVisible, children: _jsxs("div", { style: {
|
432
|
+
display: 'flex',
|
433
|
+
flexDirection: isMobile ? 'column' : 'row',
|
434
|
+
justifyContent: 'space-between',
|
435
|
+
gap: SDKUI_Globals.userSettings.themeSettings.gutters,
|
436
|
+
width: '100%',
|
437
|
+
height: '100%',
|
438
|
+
}, children: [_jsx("div", { style: { flex: 1, minWidth: 0, height: '100%' }, 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: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, separatorActiveColor: 'transparent', separatorColor: 'transparent', showSeparator: (isOpenPreview || isOpenMiddlePanel() || isOpenBatchUpdate) && deviceType !== DeviceType.MOBILE, start: getPrimarySplitterStartLayout(), min: deviceType !== DeviceType.MOBILE && isOpenDcmtForm ? ['150px', '0'] : ['0', '0'], children: [_jsx(TMLayoutItem, { children: _jsxs(TMPanel, { toolbar: _jsxs(_Fragment, { children: [context !== SearchResultContext.METADATA_SEARCH && fromDTD?.templateTID === TemplateTIDs.WF_WIApprView && _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 }), (dcmtsReturned != dcmtsFound) && _jsx("p", { style: { backgroundColor: `white`, color: TMColors.primaryColor, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${dcmtsReturned}/${dcmtsFound} restituiti` }), context === SearchResultContext.FAVORITES_AND_RECENTS &&
|
439
|
+
_jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconDelete, { color: 'white' }), caption: "Rimuovi da " + (selectedSearchResult?.category === "Favorites" ? '"Preferiti"' : '"Recenti"'), disabled: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length <= 0, onClick: removeDcmtFromFavsOrRecents }) }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconRefresh, { color: 'white' }), caption: SDKUI_Localizator.Refresh, onClick: onRefreshSearchAsync }), _jsx(IconMenuVertical, { id: `commands-header-${id}`, color: 'white', cursor: 'pointer' }), _jsx(CommandsContextMenu, { target: `#commands-header-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler) })] }), onBack: !isClosable && allowBackButton() ? onBack : undefined, onClose: isClosable && allowBackButton() ? onBack : undefined,
|
440
|
+
// items={showSearchResultSidebar ? sideBarItems : undefined}
|
441
|
+
title: getTitleHeader(), showHeader: showToolbarHeader, 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 ?
|
442
|
+
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, onSelectionChanged: onSearchResultSelectionChanged }) })
|
457
443
|
:
|
458
|
-
_jsxs(
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
444
|
+
_jsx(_Fragment, {}), _jsxs(TMLayoutItem, { children: [_jsx(TMSearchResultGrid
|
445
|
+
// allowMultipleSelection={allowMultipleSelection}
|
446
|
+
, {
|
447
|
+
// allowMultipleSelection={allowMultipleSelection}
|
448
|
+
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 &&
|
449
|
+
_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) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {})] }) }), isOpenBatchUpdate ?
|
450
|
+
_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMBatchUpdateForm, { inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => setIsOpenBatchUpdate(false), onSavedCallbackAsync: async () => {
|
451
|
+
setIsOpenBatchUpdate(false);
|
452
|
+
setIsModifiedBatchUpdate(false);
|
453
|
+
await refreshSelectionDataRowsAsync();
|
454
|
+
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }) })
|
455
|
+
:
|
456
|
+
isOpenPreview || isOpenMiddlePanel()
|
457
|
+
? _jsx(TMLayoutItem, { children: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, separatorActiveColor: 'transparent', separatorColor: 'transparent', showSeparator: deviceType !== DeviceType.MOBILE && (isOpenPreview && isOpenMiddlePanel()), start: getSecondarySplitterStartLayout(), min: ['0', '0'], children: [isOpenMiddlePanel()
|
458
|
+
? _jsx(TMLayoutItem, { children: _jsx(TMPanel, { padding: '0',
|
459
|
+
// color={TMColors.primaryColor}
|
460
|
+
// backgroundColor={`${TMColors.primaryColor}25`}
|
461
|
+
title: titleText(), toolbar: middlePanelToolbar, onClose: () => closeMiddlePanel(), children: (!focusedItem?.DID)
|
462
|
+
?
|
463
|
+
_jsx(TMNothingToShow, { text: 'Nessun documento selezionato.', secondText: notAvalableMsg, icon: notAvalableIcon })
|
464
|
+
:
|
465
|
+
_jsxs(StyledContainer, { children: [isOpenBoard && _jsx(TMDcmtBlog, { tid: focusedItem?.TID, did: focusedItem?.DID }), isOpenSysMetadata &&
|
466
|
+
_jsx(TMMetadataValues, { layoutMode: LayoutModes.Update, openChooserBySingleClick: !isOpenDistinctValues, 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: [] })] }) }) })
|
467
|
+
: _jsx(_Fragment, {}), isOpenPreview
|
468
|
+
? _jsx(TMLayoutItem, { children: _jsx(TMDcmtPreview, { onClose: () => { setIsOpenPreview(false); onClosePreview?.(); }, dcmtData: currentDcmt, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev') }) })
|
469
|
+
: _jsx(_Fragment, {})] }) })
|
470
|
+
: _jsx(_Fragment, {})] }) }) }), showSearchResultSidebar && _jsx(TMCommandsPanel, { isMobile: deviceType === DeviceType.MOBILE, items: [
|
471
|
+
{ icon: _jsx(IconShow, { fontSize: 20 }), selected: isOpenPreview, disabled: isPreviewDisabled, onClick: () => { if (!isPreviewDisabled)
|
472
|
+
setIsOpenPreview(!isOpenPreview); } },
|
473
|
+
{ icon: _jsx(IconBoard, { fontSize: 20 }), selected: isOpenBoard, disabled: isBoardDisabled, onClick: () => { if (!isBoardDisabled) {
|
474
|
+
closeMiddlePanel();
|
475
|
+
setIsOpenBoard(!isOpenBoard);
|
476
|
+
} } },
|
477
|
+
{ icon: _jsx(IconDcmtTypeSys, { fontSize: 20 }), selected: isOpenSysMetadata, disabled: isSysMetadataDisabled, onClick: () => { if (!isSysMetadataDisabled) {
|
478
|
+
closeMiddlePanel();
|
479
|
+
setIsOpenSysMetadata(!isOpenSysMetadata);
|
480
|
+
} } },
|
481
|
+
...(currentTIDHasMasterRelations ? [{ icon: _jsx(IconDetailDcmts, { fontSize: 20 }), selected: isOpenMaster, disabled: isMasterDisabled, onClick: () => { if (!isMasterDisabled)
|
482
|
+
setIsOpenMaster(!isOpenMaster); } }] : []),
|
483
|
+
...(currentTIDHasDetailRelations ? [{ icon: _jsx(IconDetailDcmts, { fontSize: 20, transform: 'scale(-1, 1)' }), selected: isOpenDetails, disabled: isDetailsDisabled, onClick: () => { if (!isDetailsDisabled)
|
484
|
+
setIsOpenDetails(!isOpenDetails); } }] : []),
|
485
|
+
] }), isOpenDetails &&
|
464
486
|
_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _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) }) }), isOpenMaster &&
|
465
487
|
_jsxs(StyledModalContainer, { style: { backgroundColor: 'white' }, children: [_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) => {
|
466
488
|
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}`));
|
@@ -30,7 +30,7 @@ const StyledRecentTidItem = styled.div `
|
|
30
30
|
const iconDelete = () => ReactDOMServer.renderToString(_jsx(IconDelete, {}));
|
31
31
|
const TMRecentsManager = ({ deviceType, mruTIDs, currentMruTID, onSelectedTID, onDeletedTID }) => {
|
32
32
|
const [showDcmtTypeChooser, setShowDcmtTypeChooser] = useState(false);
|
33
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { style: { overflowY: deviceType === DeviceType.MOBILE ? 'auto' : undefined, display: 'flex', flexDirection: 'column', padding: '5px' }, children: [_jsx(StyledRecentTidItem, { id: `tid-${0}`, onClick: () => { setShowDcmtTypeChooser(true); }, children: _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%' }, children: _jsx("p", { style: {
|
33
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { style: { overflowY: deviceType === DeviceType.MOBILE ? 'auto' : undefined, display: 'flex', flexDirection: 'column', padding: '5px', width: '100%' }, children: [_jsx(StyledRecentTidItem, { id: `tid-${0}`, onClick: () => { setShowDcmtTypeChooser(true); }, children: _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%' }, children: _jsx("p", { style: {
|
34
34
|
color: TMColors.primaryColor,
|
35
35
|
fontSize: '1rem',
|
36
36
|
fontWeight: 600,
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
export declare const StyledCommandsPanel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
3
|
+
$isMobile?: boolean;
|
4
|
+
}>> & string;
|
5
|
+
export interface TMCommandItemProps {
|
6
|
+
icon: React.ReactNode;
|
7
|
+
selected?: boolean;
|
8
|
+
disabled?: boolean;
|
9
|
+
onClick?: () => void;
|
10
|
+
}
|
11
|
+
interface TMCommandsPanelProps {
|
12
|
+
isMobile?: boolean;
|
13
|
+
items: TMCommandItemProps[];
|
14
|
+
}
|
15
|
+
declare const TMCommandsPanel: React.FC<TMCommandsPanelProps>;
|
16
|
+
export default TMCommandsPanel;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import styled from 'styled-components';
|
3
|
+
export const StyledCommandsPanel = styled.div `
|
4
|
+
display: flex;
|
5
|
+
flex-direction: ${({ $isMobile }) => ($isMobile ? 'row' : 'column')};
|
6
|
+
width: ${({ $isMobile }) => ($isMobile ? '100%' : '40px')};
|
7
|
+
height: ${({ $isMobile }) => ($isMobile ? '40px' : 'max-content')};
|
8
|
+
background: transparent linear-gradient(90deg, #E03A8B 9%, #C2388B 34%, #A63B8D 60%, #943C8D 83%, #8F3C8D 100%) 0% 0% no-repeat padding-box;
|
9
|
+
border-radius: ${({ $isMobile }) => ($isMobile ? '10px 10px 0 0' : '10px 0px 0px 10px')};
|
10
|
+
padding: 10px;
|
11
|
+
gap: 10px;
|
12
|
+
`;
|
13
|
+
const TMCommandsPanel = ({ isMobile, items }) => (_jsx(StyledCommandsPanel, { "$isMobile": isMobile, children: items.map((iconProps, idx) => (_jsx("span", { style: {
|
14
|
+
background: iconProps.selected ? 'white' : 'transparent',
|
15
|
+
borderRadius: '6px',
|
16
|
+
color: iconProps.selected ? '#E03A8B' : 'white',
|
17
|
+
opacity: iconProps.disabled ? 0.4 : 1,
|
18
|
+
cursor: iconProps.disabled ? 'not-allowed' : 'pointer',
|
19
|
+
display: 'flex',
|
20
|
+
alignItems: 'center',
|
21
|
+
justifyContent: 'center',
|
22
|
+
height: '24px',
|
23
|
+
width: '24px',
|
24
|
+
}, onClick: iconProps.disabled ? undefined : iconProps.onClick, children: iconProps.icon }, idx))) }));
|
25
|
+
export default TMCommandsPanel;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@topconsultnpm/sdkui-react-beta",
|
3
|
-
"version": "6.13.
|
3
|
+
"version": "6.13.25",
|
4
4
|
"description": "",
|
5
5
|
"scripts": {
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
@@ -42,7 +42,7 @@
|
|
42
42
|
"lib"
|
43
43
|
],
|
44
44
|
"dependencies": {
|
45
|
-
"@topconsultnpm/sdk-ts-beta": "
|
45
|
+
"@topconsultnpm/sdk-ts-beta": "6.13.4",
|
46
46
|
"buffer": "^6.0.3",
|
47
47
|
"devextreme": "24.2.6",
|
48
48
|
"devextreme-react": "24.2.6",
|