@topconsultnpm/sdkui-react-beta 6.6.45 → 6.6.47
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.
|
@@ -3,7 +3,7 @@ import { useState, useEffect, useRef } from 'react';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { StyledEditor, StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, editorColorManager } from './TMEditorStyled';
|
|
5
5
|
import { FontSize, TMColors } from '../../utils/theme';
|
|
6
|
-
import { genUniqueId, IconClearButton, IconHide, IconShow } from '../../helper';
|
|
6
|
+
import { genUniqueId, IconClearButton, IconHide, IconShow, useWindowWidth } from '../../helper';
|
|
7
7
|
import ShowAlert from '../base/TMAlert';
|
|
8
8
|
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
9
9
|
import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
|
|
@@ -38,7 +38,7 @@ const TMTextBox = ({ autoFocus, maxLength, precision, scale, showClearButton, va
|
|
|
38
38
|
const [formulaMenuItems, setFormulaMenuItems] = useState([]);
|
|
39
39
|
const [isFocused, setIsFocused] = useState(false);
|
|
40
40
|
const inputRef = useRef(null);
|
|
41
|
-
|
|
41
|
+
let screenWidth = useWindowWidth();
|
|
42
42
|
const [id, setID] = useState('');
|
|
43
43
|
useEffect(() => { setID(genUniqueId()); }, []);
|
|
44
44
|
useEffect(() => { setCurrentType(type); setInitialType(type); }, [type]);
|
|
@@ -140,7 +140,7 @@ const TMTextBox = ({ autoFocus, maxLength, precision, scale, showClearButton, va
|
|
|
140
140
|
if (!scale && (e.key == "." || e.key == ","))
|
|
141
141
|
e.preventDefault();
|
|
142
142
|
}
|
|
143
|
-
}, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$maxValue": maxValue, "$width": width, "$type": currentType }), initialType === 'password' && currentValue && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: showPasswordIcon() }), initialType !== 'password' &&
|
|
143
|
+
}, "$isMobile": screenWidth < 640, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$maxValue": maxValue, "$width": width, "$type": currentType }), initialType === 'password' && currentValue && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: showPasswordIcon() }), initialType !== 'password' &&
|
|
144
144
|
_jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: '6px', top: label.length > 0 ? '20px' : '7px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [showClearButton && currentValue &&
|
|
145
145
|
_jsx(StyledTextBoxEditorButton, { onClick: () => {
|
|
146
146
|
onValueChanged?.({ target: { value: undefined } });
|
|
@@ -3,7 +3,7 @@ import { useEffect, useState } from 'react';
|
|
|
3
3
|
import { SDK_Globals, AppModules } from '@topconsultnpm/sdk-ts-beta';
|
|
4
4
|
import TMQueryResult from './TMQueryResult';
|
|
5
5
|
import styled from 'styled-components';
|
|
6
|
-
import { IconApply, IconCloseOutline, IconUser, IconInfo, IconRefresh, IconSync, IconDownload, IconPreview, IconPrinter, IconCheckIn, IconEdit, IconStar, IconRecursiveOps, IconMail, IconDcmtTypeOnlyMetadata, IconCopy, IconRelation, IconSignature, IconDelete, IconUndo, IconCloseCircle, IconMenuVertical, IconArchiveDoc, IconDuplicate, IconSubstFile, IconConvertFilePdf, IconCheckFile, IconBatchUpdate, IconShare, IconSharedDcmt, IconSearch, IconExportTo, IconShow, IconSettings, IconActivityLog, SDKUI_Localizator
|
|
6
|
+
import { IconApply, IconCloseOutline, IconUser, IconInfo, IconRefresh, IconSync, IconDownload, IconPreview, IconPrinter, IconCheckIn, IconEdit, IconStar, IconRecursiveOps, IconMail, IconDcmtTypeOnlyMetadata, IconCopy, IconRelation, IconSignature, IconDelete, IconUndo, IconCloseCircle, IconMenuVertical, IconArchiveDoc, IconDuplicate, IconSubstFile, IconConvertFilePdf, IconCheckFile, IconBatchUpdate, IconShare, IconSharedDcmt, IconSearch, IconExportTo, IconShow, IconSettings, IconActivityLog, SDKUI_Localizator } from '../../helper';
|
|
7
7
|
import { FormModes } from '../../ts';
|
|
8
8
|
import { TMColors } from '../../utils/theme';
|
|
9
9
|
import { StyledBadge } from '../base/Styled';
|
|
@@ -221,29 +221,13 @@ const TMQueryResultForm = ({ onUpdate, isModal, onClose, context = SearchResultC
|
|
|
221
221
|
_jsxs(StyledTitleContainer, { children: [context === SearchResultContext.WORKFLOW_APPROVE ? _jsx(IconActivityLog, { fontSize: 14 }) : context === SearchResultContext.FAVORITES ? _jsx(IconStar, {}) : context === SearchResultContext.RECENT ? _jsx(IconRefresh, {}) : '', context === SearchResultContext.WORKFLOW_APPROVE ? SDKUI_Localizator.WorkflowApproval : context === SearchResultContext.FAVORITES ? SDKUI_Localizator.Favorites : context === SearchResultContext.RECENT ? SDKUI_Localizator.Recent : ''] }, context === SearchResultContext.WORKFLOW_APPROVE ? 'title2' : context === SearchResultContext.FAVORITES ? 'title0' : context === SearchResultContext.RECENT ? 'title1' : '')
|
|
222
222
|
];
|
|
223
223
|
const [toolbar, setToolbar] = useState(toolbarElements);
|
|
224
|
-
let width = useWindowWidth()
|
|
225
|
-
let isMobile = width <= MOBILE_WIDTH
|
|
226
|
-
useEffect(() => { if (isMobile) {
|
|
227
|
-
setCurrentSearchResult1(undefined);
|
|
228
|
-
setCurrentSearchResult2(undefined);
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
if (Array.isArray(result1)) {
|
|
232
|
-
setCurrentSearchResult1(orderByName(result1)[0]);
|
|
233
|
-
}
|
|
234
|
-
;
|
|
235
|
-
if (Array.isArray(result2)) {
|
|
236
|
-
setCurrentSearchResult2(orderByName(result2)[0]);
|
|
237
|
-
}
|
|
238
|
-
} }, [isMobile, result1, result2]);
|
|
224
|
+
// let width = useWindowWidth()
|
|
225
|
+
// let isMobile: boolean = width <= MOBILE_WIDTH
|
|
226
|
+
// useEffect(() => { if (isMobile) { setCurrentSearchResult1(undefined); setCurrentSearchResult2(undefined) } else { if (Array.isArray(result1)) { setCurrentSearchResult1(orderByName(result1)[0]) }; if (Array.isArray(result2)) { setCurrentSearchResult2(orderByName(result2)[0]) } } }, [ result1, result2])
|
|
239
227
|
useEffect(() => {
|
|
240
228
|
let arr = [...toolbarElements];
|
|
241
|
-
if (isMobile && hasBack) {
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
if (!isMobile || !hasBack) {
|
|
245
|
-
arr = arr.filter(item => item.key !== 'btn00');
|
|
246
|
-
}
|
|
229
|
+
// if (isMobile && hasBack) { arr.unshift(<TMButton key="btn00" caption={SDKUI_Localizator.Back} icon={<IconArrowLeft />} btnStyle='toolbar' color='tertiary' fontSize='1.3rem' onClick={() => { setSplitterSize(['100%', '0']); setHasBack(false); let arr = [...toolbar]; arr = arr.filter(item => item.key !== 'btn00'); }} />) }
|
|
230
|
+
// if (!isMobile || !hasBack) { arr = arr.filter(item => item.key !== 'btn00') }
|
|
247
231
|
if (context === SearchResultContext.METADATA_SEARCH) {
|
|
248
232
|
arr = arr.filter(item => item.key !== 'btn14');
|
|
249
233
|
arr = arr.filter(item => item.key !== 'btn5');
|
|
@@ -271,7 +255,7 @@ const TMQueryResultForm = ({ onUpdate, isModal, onClose, context = SearchResultC
|
|
|
271
255
|
arr = arr.filter(item => item.key !== 'title1');
|
|
272
256
|
}
|
|
273
257
|
setToolbar(arr);
|
|
274
|
-
}, [context, selectedItems,
|
|
258
|
+
}, [context, selectedItems, hasBack]);
|
|
275
259
|
useEffect(() => {
|
|
276
260
|
let c = 0;
|
|
277
261
|
if (Array.isArray(result1)) {
|
|
@@ -307,17 +291,14 @@ const TMQueryResultForm = ({ onUpdate, isModal, onClose, context = SearchResultC
|
|
|
307
291
|
// window.addEventListener('keydown', handleTabChange)
|
|
308
292
|
// return () => window.removeEventListener('keydown', handleTabChange)
|
|
309
293
|
// }, [selectedTabIndex])
|
|
310
|
-
return (_jsxs(TMApplyForm, { isModal: isModal, formMode: FormModes.None, showApply: false, showUndo: false, hasNavigation: false, onClose: onClose, showBack: context === SearchResultContext.METADATA_SEARCH, customToolbarElements: SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.ORCHESTRATOR ? [] :
|
|
294
|
+
return (_jsxs(TMApplyForm, { isModal: isModal, formMode: FormModes.None, showApply: false, showUndo: false, hasNavigation: false, onClose: onClose, showBack: context === SearchResultContext.METADATA_SEARCH, customToolbarElements: SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.ORCHESTRATOR ? [] : context !== SearchResultContext.METADATA_SEARCH && !hasBack ? mobileHeaderTitle : toolbar, children: [Array.isArray(result1)
|
|
311
295
|
?
|
|
312
|
-
_jsxs(TMSplitterLayout, {
|
|
296
|
+
_jsxs(TMSplitterLayout, { direction: 'horizontal', min: ['0', '0'], start: ['20%', '80%'], children: [_jsx(TMLayoutItem, { children: _jsxs("div", { style: { height: '100%', display: 'flex', flexDirection: 'column' }, children: [_jsx("div", { style: { width: '100%', height: 'calc(100% - 40px)' }, children: _jsx(TMListView, { orderBy: 'fromName', exprKey: 'fromTID', dataSource: selectedTabIndex === 0 ? result1 : result2 && Array.isArray(result2) ? result2 : [], customColor: '#0e7418', id: `workflow-approve-list-view${selectedTabIndex.toString()}`, itemTemplate: (data) => _jsx(WorfflowListItem, { data: data }), selectedItem: selectedTabIndex === 0 ? currentSearchResult1 : currentSearchResult2, onSelectionChanged: (e) => { if (selectedTabIndex === 0) {
|
|
313
297
|
setCurrentSearchResult1(e);
|
|
314
298
|
}
|
|
315
299
|
else {
|
|
316
300
|
setCurrentSearchResult2(e);
|
|
317
|
-
} ;
|
|
318
|
-
setSplitterSize(['0', '100%']);
|
|
319
|
-
setHasBack(true);
|
|
320
|
-
} }, onItemDblClick: (e) => alert(e.fromName), searchKeys: ['fromTID', 'fromName'] }) }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', gap: 10, alignItems: 'center', width: '100%', height: '40px', borderTop: '1px #e1e1e1 solid', borderBottom: '1px solid #e1e1e1' }, children: [_jsx(TabView, { clickable: result2 && Array.isArray(result2), count: tabCount1, icon: tabIcon1, onClick: () => setSelectedTabIndex(0), onMouseOut: () => setHoveredTab(undefined), onMouseOver: () => setHoveredTab(0), selectedTabBorderColor: selectedTabIndex === 0 ? '#0e7418' : hoveredTab === 0 ? '#c1c1c1' : 'transparent', title: tabTitle1 }), result2 && _jsx(TabView, { clickable: true, count: tabCount2, icon: tabIcon2, onClick: () => setSelectedTabIndex(1), onMouseOut: () => setHoveredTab(undefined), onMouseOver: () => setHoveredTab(1), selectedTabBorderColor: selectedTabIndex === 1 ? '#0e7418' : hoveredTab === 1 ? '#c1c1c1' : 'transparent', title: tabTitle2 })] })] }) }), _jsxs(TMLayoutItem, { children: [" ", _jsx(TMQueryResult, { onDblClick: () => alert('open form'), onSelectionChanged: (e) => setSelectedItems(e), result: selectedTabIndex === 0 ? currentSearchResult1 : currentSearchResult2, showHiddenSelectItems: showHiddenSelectItems, elapsedTime: elapsedTime, searchText: searchText })] })] })
|
|
301
|
+
} ; }, onItemDblClick: (e) => alert(e.fromName), searchKeys: ['fromTID', 'fromName'] }) }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', gap: 10, alignItems: 'center', width: '100%', height: '40px', borderTop: '1px #e1e1e1 solid', borderBottom: '1px solid #e1e1e1' }, children: [_jsx(TabView, { clickable: result2 && Array.isArray(result2), count: tabCount1, icon: tabIcon1, onClick: () => setSelectedTabIndex(0), onMouseOut: () => setHoveredTab(undefined), onMouseOver: () => setHoveredTab(0), selectedTabBorderColor: selectedTabIndex === 0 ? '#0e7418' : hoveredTab === 0 ? '#c1c1c1' : 'transparent', title: tabTitle1 }), result2 && _jsx(TabView, { clickable: true, count: tabCount2, icon: tabIcon2, onClick: () => setSelectedTabIndex(1), onMouseOut: () => setHoveredTab(undefined), onMouseOver: () => setHoveredTab(1), selectedTabBorderColor: selectedTabIndex === 1 ? '#0e7418' : hoveredTab === 1 ? '#c1c1c1' : 'transparent', title: tabTitle2 })] })] }) }), _jsxs(TMLayoutItem, { children: [" ", _jsx(TMQueryResult, { onDblClick: () => alert('open form'), onSelectionChanged: (e) => setSelectedItems(e), result: selectedTabIndex === 0 ? currentSearchResult1 : currentSearchResult2, showHiddenSelectItems: showHiddenSelectItems, elapsedTime: elapsedTime, searchText: searchText })] })] })
|
|
321
302
|
:
|
|
322
303
|
_jsx(TMQueryResult, { onSelectionChanged: (e) => setSelectedItems(e), result: result1, showHiddenSelectItems: showHiddenSelectItems, elapsedTime: elapsedTime, searchText: searchText }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { onUpdate: onUpdate, selectedItems: selectedItems, op: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { onUpdate: onUpdate, selectedItems: selectedItems, op: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { onUpdate: onUpdate, selectedItems: selectedItems, onClose: () => setShowReAssignPopup(false) })] }));
|
|
323
304
|
};
|