@topconsultnpm/sdkui-react-beta 6.12.6 → 6.12.8
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/editors/TMHtmlContentDisplay.d.ts +2 -0
- package/lib/components/editors/TMHtmlContentDisplay.js +14 -2
- package/lib/components/editors/TMHtmlEditor.d.ts +2 -0
- package/lib/components/editors/TMHtmlEditor.js +10 -11
- package/lib/components/forms/TMSaveForm.js +2 -2
- package/lib/components/sidebar/TMHeader.d.ts +2 -0
- package/lib/components/sidebar/TMHeader.js +3 -3
- package/lib/components/sidebar/TMSidebar.d.ts +1 -0
- package/lib/components/sidebar/TMSidebar.js +2 -2
- package/lib/ts/types.d.ts +1 -0
- package/package.json +1 -1
@@ -7,8 +7,20 @@ const Wrapper = styled.div `
|
|
7
7
|
ol li {
|
8
8
|
list-style-position: inside;
|
9
9
|
}
|
10
|
+
.highlight {
|
11
|
+
background-color: ${(props) => props.$backgroundColor || 'yellow'};
|
12
|
+
}
|
10
13
|
`;
|
11
|
-
const
|
12
|
-
|
14
|
+
const highlightSearchText = (markup, searchText) => {
|
15
|
+
if (!searchText.trim())
|
16
|
+
return markup;
|
17
|
+
// Escape regex special characters in searchText
|
18
|
+
const escapedText = searchText.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
19
|
+
const regex = new RegExp(`(${escapedText})`, 'gi');
|
20
|
+
return markup.replace(regex, '<span class="highlight">$1</span>');
|
21
|
+
};
|
22
|
+
const TMHtmlContentDisplay = ({ markup, searchText, highlightColor }) => {
|
23
|
+
const highlightedMarkup = searchText ? highlightSearchText(markup, searchText) : markup;
|
24
|
+
return (_jsx(Wrapper, { "$backgroundColor": highlightColor, children: _jsx("div", { dangerouslySetInnerHTML: { __html: highlightedMarkup } }) }));
|
13
25
|
};
|
14
26
|
export default TMHtmlContentDisplay;
|
@@ -24,6 +24,8 @@ export interface ITMHtmlEditor {
|
|
24
24
|
}>;
|
25
25
|
/** List of validation rules or checks to apply to the editor content */
|
26
26
|
validationItems?: Array<ValidationItem>;
|
27
|
+
/** If true, enables rich text editing mode */
|
28
|
+
isEditorEnabled?: boolean;
|
27
29
|
}
|
28
30
|
declare const TMHtmlEditor: (props: ITMHtmlEditor) => import("react/jsx-runtime").JSX.Element;
|
29
31
|
export default TMHtmlEditor;
|
@@ -2,12 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
3
3
|
import HtmlEditor, { Toolbar, Item } from 'devextreme-react/html-editor';
|
4
4
|
import TMVilViewer from '../base/TMVilViewer';
|
5
|
-
import TMTooltip from '../base/TMTooltip';
|
6
|
-
import TMButton from '../base/TMButton';
|
7
5
|
const TMHtmlEditor = (props) => {
|
8
|
-
const { width = "100%", height = "100%", readOnly = false, value = "", mentionsConfig, onValueChanged, validationItems } = props;
|
6
|
+
const { width = "100%", height = "100%", readOnly = false, value = "", mentionsConfig, onValueChanged, validationItems = [], isEditorEnabled: isEditorEnabledProp = false } = props;
|
9
7
|
const editorRef = useRef(null); // Create a ref for the HtmlEditor
|
10
8
|
const [isEditorEnabled, setIsEditorEnabled] = useState(false);
|
9
|
+
const [markup, setMarkup] = useState(value);
|
11
10
|
const handlePaste = (e) => {
|
12
11
|
const clipboardData = e.clipboardData || window.clipboardData;
|
13
12
|
const pastedText = clipboardData.getData('text/plain'); // Get the plain text
|
@@ -28,7 +27,10 @@ const TMHtmlEditor = (props) => {
|
|
28
27
|
}
|
29
28
|
};
|
30
29
|
}, []);
|
31
|
-
|
30
|
+
useEffect(() => {
|
31
|
+
// Initialize is editor enabled with the value prop
|
32
|
+
setIsEditorEnabled(isEditorEnabledProp);
|
33
|
+
}, [isEditorEnabledProp]);
|
32
34
|
useEffect(() => {
|
33
35
|
// Initialize markup with the value prop
|
34
36
|
setMarkup(value);
|
@@ -49,18 +51,15 @@ const TMHtmlEditor = (props) => {
|
|
49
51
|
const hasValidationErrors = useMemo(() => {
|
50
52
|
return validationItems && validationItems.length > 0;
|
51
53
|
}, [validationItems]);
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
return (_jsxs("div", { children: [_jsx("div", { style: { position: 'absolute', top: '10px', right: '10px', zIndex: 10 }, children: _jsx(TMTooltip, { content: isEditorEnabled ? "Nascondi opzioni di formattazione" : "Mostra opzioni di formattazione", children: _jsx(TMButton, { btnStyle: "toolbar", onClick: toggleEditorMode, icon: isEditorEnabled ? _jsx("i", { className: 'dx-icon-eyeclose' }) : _jsx("i", { className: 'dx-icon-eyeopen' }) }) }) }), _jsx("div", { style: { borderWidth: '1px', borderStyle: 'solid', borderColor: hasValidationErrors ? "red" : "#e0e0e0 #e0e0e0 #616161", }, children: !isEditorEnabled ? (_jsx("textarea", { placeholder: "Digita un messaggio...", value: markup, onChange: (e) => onValueChangeCallback(e.target.value), maxLength: 1000, style: {
|
56
|
-
width,
|
57
|
-
height,
|
54
|
+
return (_jsxs("div", { style: { height: validationItems.length > 0 ? `calc(${width} - 30px)` : "100%", width: width }, children: [_jsx("div", { style: { borderWidth: '1px', borderStyle: 'solid', borderColor: hasValidationErrors ? "red" : "#e0e0e0 #e0e0e0 #616161", width: "100%", height: "100%" }, children: !isEditorEnabled ? (_jsx("textarea", { placeholder: "Digita un messaggio...", value: markup, onChange: (e) => onValueChangeCallback(e.target.value), maxLength: 1000, style: {
|
55
|
+
width: "100%",
|
56
|
+
height: "100%",
|
58
57
|
border: '1px solid #ddd',
|
59
58
|
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',
|
60
59
|
resize: 'none',
|
61
60
|
padding: '10px',
|
62
61
|
outline: 'none',
|
63
62
|
paddingRight: "40px"
|
64
|
-
} })) : (_jsx(HtmlEditor, { ref: editorRef, width:
|
63
|
+
} })) : (_jsx(HtmlEditor, { ref: editorRef, width: "100%", height: "100%", value: markup, onValueChange: onValueChangeCallback, readOnly: readOnly, mentions: mentionsConfig, style: { overflow: 'hidden', outline: "none" }, children: !readOnly && (_jsxs(Toolbar, { multiline: false, children: [_jsx(Item, { name: "undo" }), _jsx(Item, { name: "redo" }), _jsx(Item, { name: "separator" }), _jsx(Item, { name: "separator" }), _jsx(Item, { name: "bold" }), _jsx(Item, { name: "italic" }), _jsx(Item, { name: "underline" }), _jsx(Item, { name: "separator" }), _jsx(Item, { name: "alignLeft" }), _jsx(Item, { name: "alignCenter" }), _jsx(Item, { name: "alignRight" }), _jsx(Item, { name: "alignJustify" }), _jsx(Item, { name: "separator" }), _jsx(Item, { name: "orderedList" }), _jsx(Item, { name: "bulletList" }), _jsx(Item, { name: "separator" }), _jsx(Item, { name: "color" }), _jsx(Item, { name: "background" }), _jsx(Item, { name: "separator" }), _jsx(Item, { name: "link" })] })) })) }), _jsx("div", { style: { width: "100%", height: validationItems.length > 0 ? "30px" : '0px' }, children: _jsx(TMVilViewer, { vil: validationItems }) })] }));
|
65
64
|
};
|
66
65
|
export default TMHtmlEditor;
|
@@ -12,7 +12,7 @@ import TMValidationItemsList from '../grids/TMValidationItemsList';
|
|
12
12
|
import TMModal from '../base/TMModal';
|
13
13
|
import { DeviceType, useDeviceType } from '../base/TMDeviceProvider';
|
14
14
|
import toppy from '../../assets/Toppy-generico.png';
|
15
|
-
const TMSaveForm = ({ id, formMode = FormModes.Update, showToolbar = true, skipIsModifiedCheck = false, title, children, isModal, exception, customToolbarElements, hasNavigation, showBackButton, showWarningsCount = true, showErrorCount = true, onClose, onSaveAsync, onNext, onPrev, canNext, canPrev, isModified, onShowList, validationItems = [], onUndo, onCancel, width, height }) => {
|
15
|
+
const TMSaveForm = ({ id, formMode = FormModes.Update, showToolbar = true, skipIsModifiedCheck = false, title, children, isModal, exception, customToolbarElements, hasNavigation, showBackButton, showWarningsCount = true, showErrorCount = true, showUndoButton = true, onClose, onSaveAsync, onNext, onPrev, canNext, canPrev, isModified, onShowList, validationItems = [], onUndo, onCancel, width, height }) => {
|
16
16
|
const [showList, setShowList] = useState(true);
|
17
17
|
const [showErrorGrid, setShowErrorGrid] = useState(false);
|
18
18
|
const [showConfirmForClose, setShowConfirmForClose] = useState(false);
|
@@ -111,7 +111,7 @@ const TMSaveForm = ({ id, formMode = FormModes.Update, showToolbar = true, skipI
|
|
111
111
|
const warningsCount = validationItems.filter(o => o.ResultType == ResultTypes.WARNING).length;
|
112
112
|
const errorsCount = validationItems.filter(o => o.ResultType == ResultTypes.ERROR).length;
|
113
113
|
const renderSaveForm = () => {
|
114
|
-
return (_jsxs(TMLayoutContainer, { direction: 'vertical', children: [showToolbar && _jsx(TMLayoutItem, { height: 'max-content', children: _jsxs(StyledToolbarForm, { children: [showBackButton && _jsx(TMButton, { btnStyle: 'toolbar', color: 'tertiary', caption: SDKUI_Localizator.Back, icon: _jsx(IconArrowLeft, {}), elementStyle: { marginRight: '10px' }, onClick: () => { doClose(); } }), _jsx(TMButton, { caption: SDKUI_Localizator.Save, icon: _jsx(IconSave, {}), keyGesture: "alt+s", backgroundColor: errorsCount > 0 ? TMColors.error : isModified ? TMColors.success : TMColors.disabled, onClick: doSaveAsync, color: "success", btnStyle: "toolbar", disabled: !(isModified && errorsCount <= 0) }), hasNavigation && _jsx(TMButton, { caption: SDKUI_Localizator.Previous, icon: _jsx(IconArrowUp, {}), btnStyle: "toolbar", disabled: !canPrev || isModified || formMode == FormModes.Create || formMode == FormModes.Duplicate, onClick: doPrev }), hasNavigation && _jsx(TMButton, { caption: SDKUI_Localizator.Next, icon: _jsx(IconArrowDown, {}), btnStyle: "toolbar", disabled: !canNext || isModified || formMode == FormModes.Create || formMode == FormModes.Duplicate, onClick: doNext }), _jsx(TMButton, { caption: SDKUI_Localizator.Undo, icon: _jsx(IconUndo, {}), keyGesture: "alt+z", color: "tertiary", btnStyle: "toolbar", disabled: isModified ? false : true, onClick: onUndo }), customToolbarElements, Boolean(showWarningsCount && warningsCount > 0) &&
|
114
|
+
return (_jsxs(TMLayoutContainer, { direction: 'vertical', children: [showToolbar && _jsx(TMLayoutItem, { height: 'max-content', children: _jsxs(StyledToolbarForm, { children: [showBackButton && _jsx(TMButton, { btnStyle: 'toolbar', color: 'tertiary', caption: SDKUI_Localizator.Back, icon: _jsx(IconArrowLeft, {}), elementStyle: { marginRight: '10px' }, onClick: () => { doClose(); } }), _jsx(TMButton, { caption: SDKUI_Localizator.Save, icon: _jsx(IconSave, {}), keyGesture: "alt+s", backgroundColor: errorsCount > 0 ? TMColors.error : isModified ? TMColors.success : TMColors.disabled, onClick: doSaveAsync, color: "success", btnStyle: "toolbar", disabled: !(isModified && errorsCount <= 0) }), hasNavigation && _jsx(TMButton, { caption: SDKUI_Localizator.Previous, icon: _jsx(IconArrowUp, {}), btnStyle: "toolbar", disabled: !canPrev || isModified || formMode == FormModes.Create || formMode == FormModes.Duplicate, onClick: doPrev }), hasNavigation && _jsx(TMButton, { caption: SDKUI_Localizator.Next, icon: _jsx(IconArrowDown, {}), btnStyle: "toolbar", disabled: !canNext || isModified || formMode == FormModes.Create || formMode == FormModes.Duplicate, onClick: doNext }), showUndoButton && _jsx(TMButton, { caption: SDKUI_Localizator.Undo, icon: _jsx(IconUndo, {}), keyGesture: "alt+z", color: "tertiary", btnStyle: "toolbar", disabled: isModified ? false : true, onClick: onUndo }), customToolbarElements, Boolean(showWarningsCount && warningsCount > 0) &&
|
115
115
|
_jsx(TMLayoutItem, { width: 'fit-content', height: '90%', children: _jsxs(StyledResultTypeContainer, { style: { marginLeft: '10px' }, onClick: () => setShowErrorGrid(!showErrorGrid), "$resultType": ResultTypes.WARNING, children: [" ", _jsx(IconWarning, { fontSize: 16 }), " ", _jsx("span", { children: warningsCount })] }) }), Boolean(showErrorCount && errorsCount > 0) &&
|
116
116
|
_jsx(TMLayoutItem, { width: 'fit-content', height: '90%', children: _jsxs(StyledResultTypeContainer, { style: { marginLeft: warningsCount <= 0 ? '10px' : '0' }, onClick: () => setShowErrorGrid(!showErrorGrid), "$resultType": ResultTypes.ERROR, children: [" ", _jsx(IconCloseCircle, { fontSize: 16 }), " ", _jsx("span", { children: errorsCount })] }) }), onShowList &&
|
117
117
|
_jsx("div", { style: { right: '10px', position: 'absolute' }, children: deviceType !== DeviceType.MOBILE && _jsx(TMButton, { caption: showList ? SDKUI_Localizator.List_Hide : SDKUI_Localizator.List_Show, icon: showList ? _jsx(IconHide, {}) : _jsx(IconShow, {}), keyGesture: "alt+h", onClick: () => { setShowList(!showList); onShowList?.(!showList); }, btnStyle: 'toolbar' }) }), (formMode == FormModes.Create || formMode == FormModes.Duplicate) &&
|
@@ -17,7 +17,7 @@ export var TMSearchContext;
|
|
17
17
|
TMSearchContext["PLATFORM"] = "OrchestrationPlatform";
|
18
18
|
TMSearchContext["QE"] = "QueryEditor";
|
19
19
|
})(TMSearchContext || (TMSearchContext = {}));
|
20
|
-
const StyledHeaderContainer = styled.div ` width: 100%; height: 50px;
|
20
|
+
const StyledHeaderContainer = styled.div ` width: 100%; height: 50px; background: ${props => props.$isConnector ? TMColors.primaryColor : `linear-gradient(90deg, #f0f4fa, ${() => TMColors.primaryColor})`} ; opacity: 1; display: flex; flex-direction: row; width: 100%; justify-content: space-between; align-items: center; `;
|
21
21
|
const StyledMenu = styled.div ` position: absolute; top: 50px; right: 0px; width: fit-content; height: fit-content; padding: 10px 20px; border: 1px solid #2459A420; background: #E2E9EF 0% 0% no-repeat padding-box; z-index: 20000022; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 10px; border: 1px solid #c9c9c9; border-top: none; `;
|
22
22
|
const StyledMenuItem = styled.p ` font-size: ${props => props.$fontSize}; display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: 2px; cursor: pointer; color: gray; &:hover{ color: ${TMColors.primary}; transition: color 100ms ease; } `;
|
23
23
|
const StyledHeaderIcon = styled.div ` width: 50px; height: 50px; margin-left: 10px; display: flex; align-items: center; justify-content: center; color: ${props => props.$isSelected ? '#135596' : '#ffffff'}; transition: color ease 100ms; background-color: ${props => props.$isSelected && '#ffffff'}; cursor: pointer; &:hover { color: #ffffff; background-color: #0d3862; transition: color ease 100ms; } `;
|
@@ -27,7 +27,7 @@ export const TMSearchBar = ({ searchValue, onSearchValueChanged, maxWidth, margi
|
|
27
27
|
const deviceType = useDeviceType();
|
28
28
|
return (_jsxs(StyledSearchBarContainer, { style: { maxWidth: maxWidth ? maxWidth : deviceType === DeviceType.MOBILE ? '65%' : '650px', marginLeft: marginLeft ? marginLeft : deviceType === DeviceType.MOBILE ? '10px' : '50px' }, "$isMobile": deviceType === DeviceType.MOBILE, children: [_jsx(IconSearch, { fontSize: 12, color: '#00000060', style: { position: 'absolute', width: '20px', height: '20px', left: '5px', top: '5px', zIndex: 1 } }), _jsx(StyledSearchBar, { placeholder: SDKUI_Localizator.Search + '...', type: "text", value: searchValue, onChange: (e) => onSearchValueChanged(e.target.value) }), searchValue.length > 0 && _jsx(IconCloseOutline, { onClick: () => onSearchValueChanged(''), color: '#00000060', style: { cursor: 'pointer', position: 'absolute', width: '20px', height: '20px', right: '5px', top: '5px', zIndex: 1 } })] }));
|
29
29
|
};
|
30
|
-
const TMHeader = ({ showSearchBar = true, clearSearchJobValue, clearSearchQEValue, searchContext = TMSearchContext.JOBS, onChangePassword, onLogout, settingsMenuContext, onSeacrhJobsValueChange, onSeacrhJobslistValueChange, onSeacrhProcessMonitorValueChange, onSeacrhProcessValueChange, onSeacrhPlatformValueChange, onSeacrhQEValueChange, onSettingsClick }) => {
|
30
|
+
const TMHeader = ({ isConnector = false, showSettingsMenu = true, showSearchBar = true, clearSearchJobValue, clearSearchQEValue, searchContext = TMSearchContext.JOBS, onChangePassword, onLogout, settingsMenuContext, onSeacrhJobsValueChange, onSeacrhJobslistValueChange, onSeacrhProcessMonitorValueChange, onSeacrhProcessValueChange, onSeacrhPlatformValueChange, onSeacrhQEValueChange, onSettingsClick }) => {
|
31
31
|
const [menuStatus, setMenuStatus] = useState(false);
|
32
32
|
const [searchJobListValue, setSearchJobListValue] = useState('');
|
33
33
|
const [searchJobsValue, setSearchJobsValue] = useState('');
|
@@ -74,6 +74,6 @@ const TMHeader = ({ showSearchBar = true, clearSearchJobValue, clearSearchQEValu
|
|
74
74
|
document.addEventListener('click', handleClickOutside);
|
75
75
|
return () => document.removeEventListener('click', handleClickOutside);
|
76
76
|
}, [menuRef, userIcon, menuStatus]);
|
77
|
-
return (_jsxs(StyledHeaderContainer, { "$appName": SDK_Globals.appModule, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', width: '100%' }, children: [_jsx("div", { style: { width: '50px', height: '50px', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: _jsx("img", { src: six, height: 30, alt: "" }) }), !isMobile && _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'flex-start', justifyContent: 'flex-start', gap: '1px', fontSize: '14px' }, children: [_jsx("div", { style: { userSelect: 'none', color: '#135596' }, children: "TopMedia" }), _jsx("div", { style: { userSelect: 'none', color: '#135596' }, children: SDK_Globals.appModule })] }), showSearchBar && _jsxs(_Fragment, { children: [searchContext === TMSearchContext.JOBS_LIST && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchJobListValue(e), searchValue: searchJobListValue }), searchContext === TMSearchContext.JOBS && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchJobsValue(e), searchValue: searchJobsValue }), searchContext === TMSearchContext.PROCESSES && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchProcessesValue(e), searchValue: searchProcessesValue }), searchContext === TMSearchContext.PROCESS_MONITOR && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchProcessMonitorValue(e), searchValue: searchProcessMonitorValue }), searchContext === TMSearchContext.PLATFORM && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchPlatformValue(e), searchValue: searchPlatformValue }), searchContext === TMSearchContext.QE && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchQEValue(e), searchValue: searchQEValue })] })] }), _jsxs(StyledHeaderIcon, { onClick: () => onSettingsClick?.(), children: [" ", _jsx(IconSettings, { fontSize: 20 }), " "] }), _jsxs(StyledHeaderIcon, { "$isSelected": menuStatus, ref: userIcon, onClick: () => setMenuStatus(!menuStatus), children: [" ", _jsx(IconUserProfile, { fontSize: 20 }), " "] }), menuStatus && _jsxs(StyledMenu, { ref: menuRef, children: [SDK_Globals.tmSession?.SessionDescr?.authenticationMode === AuthenticationModes.TopMedia && _jsxs(StyledMenuItem, { "$fontSize": FontSize.defaultFontSize, onClick: () => { setMenuStatus(false); onChangePassword && onChangePassword(); }, style: { fontSize: FontSize.defaultFontSize }, children: [" ", _jsx("span", { children: _jsx(IconPassword, {}) }), " ", _jsx("span", { children: SDKUI_Localizator.ChangePassword }), " "] }), _jsxs(StyledMenuItem, { "$fontSize": FontSize.defaultFontSize, onClick: () => { setMenuStatus(false); onLogout && onLogout(); }, children: [_jsx("span", { children: _jsx(IconLogout, {}) }), " ", _jsx("span", { children: "Logout" }), " "] }), _jsx("div", { style: { width: '100%', height: '1px', backgroundColor: 'gray' } }), _jsxs(StyledMenuItem, { "$fontSize": FontSize.defaultFontSize, onClick: () => { setMenuStatus(false); TMMessageBoxManager.show({ buttons: [ButtonNames.OK], title: `About. ${SDK_Globals.appModule}`, message: _jsx(TMAboutApp, { app: true, skdui: true, sdk: true, websdk: true }) }); }, style: { fontSize: FontSize.defaultFontSize }, children: [" ", _jsx("span", { children: _jsx(IconBxInfo, {}) }), " ", _jsx("span", { children: "About" }), " "] })] })] }));
|
77
|
+
return (_jsxs(StyledHeaderContainer, { "$appName": SDK_Globals.appModule, "$isConnector": isConnector, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', width: '100%' }, children: [_jsx("div", { style: { width: '50px', height: '50px', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: _jsx("img", { src: six, height: 30, alt: "" }) }), !isMobile && _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'flex-start', justifyContent: 'flex-start', gap: '1px', fontSize: '14px' }, children: [_jsx("div", { style: { userSelect: 'none', color: '#135596' }, children: "TopMedia" }), _jsx("div", { style: { userSelect: 'none', color: '#135596' }, children: SDK_Globals.appModule })] }), showSearchBar && _jsxs(_Fragment, { children: [searchContext === TMSearchContext.JOBS_LIST && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchJobListValue(e), searchValue: searchJobListValue }), searchContext === TMSearchContext.JOBS && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchJobsValue(e), searchValue: searchJobsValue }), searchContext === TMSearchContext.PROCESSES && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchProcessesValue(e), searchValue: searchProcessesValue }), searchContext === TMSearchContext.PROCESS_MONITOR && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchProcessMonitorValue(e), searchValue: searchProcessMonitorValue }), searchContext === TMSearchContext.PLATFORM && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchPlatformValue(e), searchValue: searchPlatformValue }), searchContext === TMSearchContext.QE && _jsx(TMSearchBar, { onSearchValueChanged: (e) => setSearchQEValue(e), searchValue: searchQEValue })] })] }), showSettingsMenu && _jsxs(StyledHeaderIcon, { onClick: () => onSettingsClick?.(), children: [" ", _jsx(IconSettings, { fontSize: 20 }), " "] }), _jsxs(StyledHeaderIcon, { "$isSelected": menuStatus, ref: userIcon, onClick: () => setMenuStatus(!menuStatus), children: [" ", _jsx(IconUserProfile, { fontSize: 20 }), " "] }), menuStatus && _jsxs(StyledMenu, { ref: menuRef, children: [SDK_Globals.tmSession?.SessionDescr?.authenticationMode === AuthenticationModes.TopMedia && _jsxs(StyledMenuItem, { "$fontSize": FontSize.defaultFontSize, onClick: () => { setMenuStatus(false); onChangePassword && onChangePassword(); }, style: { fontSize: FontSize.defaultFontSize }, children: [" ", _jsx("span", { children: _jsx(IconPassword, {}) }), " ", _jsx("span", { children: SDKUI_Localizator.ChangePassword }), " "] }), _jsxs(StyledMenuItem, { "$fontSize": FontSize.defaultFontSize, onClick: () => { setMenuStatus(false); onLogout && onLogout(); }, children: [_jsx("span", { children: _jsx(IconLogout, {}) }), " ", _jsx("span", { children: "Logout" }), " "] }), _jsx("div", { style: { width: '100%', height: '1px', backgroundColor: 'gray' } }), _jsxs(StyledMenuItem, { "$fontSize": FontSize.defaultFontSize, onClick: () => { setMenuStatus(false); TMMessageBoxManager.show({ buttons: [ButtonNames.OK], title: `About. ${SDK_Globals.appModule}`, message: _jsx(TMAboutApp, { app: true, skdui: true, sdk: true, websdk: true }) }); }, style: { fontSize: FontSize.defaultFontSize }, children: [" ", _jsx("span", { children: _jsx(IconBxInfo, {}) }), " ", _jsx("span", { children: "About" }), " "] })] })] }));
|
78
78
|
};
|
79
79
|
export default TMHeader;
|
@@ -8,7 +8,7 @@ const StyledTMSidebarContainer = styled.div `
|
|
8
8
|
left: ${props => props.$left || '0px'};
|
9
9
|
width: ${props => props.$width || '50px'};
|
10
10
|
height: ${props => props.$height || 'calc(100% - 88px)'};
|
11
|
-
background: ${() => TMColors.primaryColor} 0% 0% no-repeat padding-box;
|
11
|
+
background: ${props => props.$isConnector ? TMColors.primaryColor : `${() => TMColors.primaryColor} 0% 0% no-repeat padding-box`};
|
12
12
|
box-shadow: 0px 3px 6px #00000029;
|
13
13
|
border-radius: 0;
|
14
14
|
opacity: 1;
|
@@ -29,7 +29,7 @@ const FixedBottomContainer = styled.div `
|
|
29
29
|
position: relative;
|
30
30
|
bottom: 10px;
|
31
31
|
`;
|
32
|
-
const TMSidebar = ({ items, height, borderRightRadius, left, top, width }) => {
|
32
|
+
const TMSidebar = ({ items, height, borderRightRadius, left, top, width, isConnector }) => {
|
33
33
|
return (_jsxs(StyledTMSidebarContainer, { "$borderRightRadius": borderRightRadius, "$left": left, "$top": top, "$width": width, "$appName": SDK_Globals.appModule, "$height": height, children: [_jsx(ScrollView, { height: "100%", width: "100%", style: { padding: "5px 0 0 5px" }, useNative: true, children: items.filter(item => item.props.type !== 'app') }), _jsx(FixedBottomContainer, { children: items.filter(item => item.props.type === 'app') })] }));
|
34
34
|
};
|
35
35
|
export default TMSidebar;
|
package/lib/ts/types.d.ts
CHANGED