@topconsultnpm/sdkui-react-beta 6.6.1 → 6.6.3
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/base/TMContextMenu.d.ts +20 -21
- package/lib/components/base/TMContextMenu.js +101 -48
- package/lib/components/base/TMContextMenuOLD.d.ts +26 -0
- package/lib/components/base/TMContextMenuOLD.js +56 -0
- package/lib/components/base/TMListView.d.ts +22 -21
- package/lib/components/base/TMListView.js +245 -282
- package/lib/components/base/TMListViewOLD.d.ts +24 -0
- package/lib/components/base/TMListViewOLD.js +321 -0
- package/lib/components/editors/TMTextArea.js +1 -1
- package/lib/components/editors/TMTextBox.js +1 -1
- package/lib/components/index.d.ts +3 -1
- package/lib/components/index.js +3 -1
- package/lib/components/query/TMQueryEditor.d.ts +38 -2
- package/lib/components/query/TMQueryEditor.js +189 -178
- package/lib/components/query/TMQueryResult.d.ts +4 -2
- package/lib/components/query/TMQueryResult.js +8 -9
- package/lib/components/query/TMQueryResultForm.d.ts +33 -0
- package/lib/components/query/TMQueryResultForm.js +362 -0
- package/lib/components/sidebar/TMHeader.d.ts +3 -1
- package/lib/components/sidebar/TMHeader.js +22 -106
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ import styled from 'styled-components';
|
|
|
6
6
|
import { SDK_Globals, AuthenticationModes } from '@topconsultnpm/sdk-ts-beta';
|
|
7
7
|
import { FontSize, TMColors } from '../../utils/theme';
|
|
8
8
|
import { ButtonNames, TMMessageBoxManager } from '../base/TMPopUp';
|
|
9
|
+
import Logo from '../../assets/Toppy-generico.png';
|
|
9
10
|
export var TMSearchContext;
|
|
10
11
|
(function (TMSearchContext) {
|
|
11
12
|
TMSearchContext["JOBS"] = "jobs";
|
|
@@ -15,112 +16,25 @@ export var TMSearchContext;
|
|
|
15
16
|
TMSearchContext["PLATFORM"] = "OrchestrationPlatform";
|
|
16
17
|
TMSearchContext["QE"] = "QueryEditor";
|
|
17
18
|
})(TMSearchContext || (TMSearchContext = {}));
|
|
18
|
-
const StyledHeaderContainer = styled.div `
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
`;
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
height: fit-content;
|
|
36
|
-
padding: 10px 20px;
|
|
37
|
-
border: 1px solid #2459A420;
|
|
38
|
-
background: #E2E9EF 0% 0% no-repeat padding-box;
|
|
39
|
-
z-index: 20000022;
|
|
40
|
-
display: flex;
|
|
41
|
-
flex-direction: column;
|
|
42
|
-
justify-content: flex-start;
|
|
43
|
-
align-items: flex-start;
|
|
44
|
-
gap: 10px;
|
|
45
|
-
border: 1px solid #c9c9c9;
|
|
46
|
-
border-top: none;
|
|
47
|
-
`;
|
|
48
|
-
const StyledMenuItem = styled.p `
|
|
49
|
-
font-size: ${props => props.$fontSize};
|
|
50
|
-
display: flex;
|
|
51
|
-
flex-direction: row;
|
|
52
|
-
justify-content: flex-start;
|
|
53
|
-
align-items: center;
|
|
54
|
-
gap: 2px;
|
|
55
|
-
cursor: pointer;
|
|
56
|
-
color: gray;
|
|
57
|
-
&:hover{
|
|
58
|
-
color: ${TMColors.primary};
|
|
59
|
-
transition: color 100ms ease;
|
|
60
|
-
}
|
|
61
|
-
`;
|
|
62
|
-
const StyledHeaderIcon = styled.div `
|
|
63
|
-
width: 50px;
|
|
64
|
-
height: 50px;
|
|
65
|
-
margin-left: 10px;
|
|
66
|
-
display: flex;
|
|
67
|
-
align-items: center;
|
|
68
|
-
justify-content: center;
|
|
69
|
-
color: ${props => props.$isSelected ? '#135596' : '#ffffff'};
|
|
70
|
-
transition: color ease 100ms;
|
|
71
|
-
background-color: ${props => props.$isSelected && '#ffffff'};
|
|
72
|
-
cursor: pointer;
|
|
73
|
-
&:hover {
|
|
74
|
-
color: #ffffff;
|
|
75
|
-
background-color: #0d3862;
|
|
76
|
-
transition: color ease 100ms;
|
|
77
|
-
}
|
|
78
|
-
`;
|
|
79
|
-
const StyledSettingsMenuContainer = styled.div `
|
|
80
|
-
display: flex;
|
|
81
|
-
flex-direction: column;
|
|
82
|
-
justify-content: center;
|
|
83
|
-
align-items: flex-start;
|
|
84
|
-
font-size: ${FontSize.defaultFontSize};
|
|
85
|
-
`;
|
|
86
|
-
const StyledSettingsMenuItem = styled.div `
|
|
87
|
-
display: flex;
|
|
88
|
-
flex-direction: row;
|
|
89
|
-
justify-content: center;
|
|
90
|
-
align-items: center;
|
|
91
|
-
`;
|
|
92
|
-
const StyledSettingsMenuItemTitle = styled.div `
|
|
93
|
-
margin-right: 5px;
|
|
94
|
-
`;
|
|
95
|
-
const StyledSettingsMenuItemCircle = styled.span `
|
|
96
|
-
margin-right: 5px;
|
|
97
|
-
font-size: 1.1rem;
|
|
98
|
-
`;
|
|
99
|
-
const StyledSettingsMenuItemVersion = styled.div `
|
|
100
|
-
font-weight: bold;
|
|
101
|
-
`;
|
|
102
|
-
const StyledSearchBarContainer = styled.div `
|
|
103
|
-
position: relative;
|
|
104
|
-
height:30px;
|
|
105
|
-
width: 100%;
|
|
106
|
-
max-width: ${props => props.$isMobile ? 'unset' : '650px'};
|
|
107
|
-
margin-left: ${props => props.$isMobile ? '10px' : '50px'};
|
|
108
|
-
`;
|
|
109
|
-
const StyledSearchBar = styled.input `
|
|
110
|
-
background: #FFFFFF 0% 0% no-repeat padding-box;
|
|
111
|
-
border: 1px solid #dbdbdb;
|
|
112
|
-
border-radius: 5px;
|
|
113
|
-
padding: 5px 30px;
|
|
114
|
-
width:100%;
|
|
115
|
-
transition: 100ms linear;
|
|
116
|
-
&:focus{
|
|
117
|
-
outline: none;
|
|
118
|
-
border-bottom: 2px solid ${TMColors.primary};
|
|
119
|
-
}
|
|
120
|
-
`;
|
|
121
|
-
export const TMSearchBar = ({ searchValue, onSearchValueChanged }) => {
|
|
19
|
+
const StyledHeaderContainer = styled.div ` width: 100%; height: 50px; /* background: #E85C36 0% 0% no-repeat padding-box; */ background: ${props => props.$appName === 'ORCHESTRATOR' ? 'linear-gradient(90deg, #f0f4fa, #135596)' : props.$appName === 'SURFER' ? 'linear-gradient(90deg, #f0f4fa, #0e7418)' : 'linear-gradient(90deg, #f0f4fa, #b51678)'}; opacity: 1; display: flex; flex-direction: row; width: 100%; justify-content: space-between; align-items: center; `;
|
|
20
|
+
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; `;
|
|
21
|
+
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; } `;
|
|
22
|
+
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; } `;
|
|
23
|
+
const StyledSettingsMenuContainer = styled.div ` display: flex; flex-direction: column; justify-content: center; align-items: flex-start; font-size: ${FontSize.defaultFontSize}; `;
|
|
24
|
+
const StyledSettingsMenuItem = styled.div ` display: flex; flex-direction: row; justify-content: center; align-items: center; `;
|
|
25
|
+
const StyledSettingsMenuItemTitle = styled.div ` margin-right: 5px; `;
|
|
26
|
+
const StyledSettingsMenuItemCircle = styled.span ` margin-right: 5px; font-size: 1.1rem; `;
|
|
27
|
+
const StyledSettingsMenuItemVersion = styled.div ` font-weight: bold; `;
|
|
28
|
+
const StyledSearchBarContainer = styled.div ` position: relative; height:30px; width: 100%; max-width: ${props => props.$isMobile ? '65%' : '650px'}; margin-left: ${props => props.$isMobile ? '10px' : '50px'}; `;
|
|
29
|
+
const StyledSearchBar = styled.input ` background: #FFFFFF 0% 0% no-repeat padding-box; border: 1px solid #dbdbdb; border-radius: 5px; padding: 5px 30px; width:100%; transition: 100ms linear; &:focus{ outline: none; border-bottom: 2px solid ${TMColors.primary}; } `;
|
|
30
|
+
const StyledChatBotWrapper = styled.div ` `;
|
|
31
|
+
const StyledChatBotcloseButton = styled.div ` cursor: pointer; font-size: 16px; color: white; width: 299px; height: 20px; display: flex; flex-direction: row; justify-content: flex-end; align-items: center; padding: 5px; background-color: orange; `;
|
|
32
|
+
const StyledChaBotBtnWrapper = styled.div ` position: relative; cursor: pointer; display: flex; flex-direction: row; padding: 0 10px; width: 150px; height: 30px; border-radius: 10px; justify-content: flex-end; background-color: orange;align-items: center; gap: 5px; `;
|
|
33
|
+
const StyledChatBotToppyContainer = styled.div ` background-color: orange; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50px; position: absolute; left: -10px; `;
|
|
34
|
+
const StyledToppyImage = styled.div ` display: flex; align-items: center; justify-content: center; width: 25px; height: 25px; border-radius: 50px; overflow: hidden; background-color: white; `;
|
|
35
|
+
export const TMSearchBar = ({ searchValue, onSearchValueChanged, maxWidth, marginLeft }) => {
|
|
122
36
|
const size = useWindowWidth();
|
|
123
|
-
return (_jsxs(StyledSearchBarContainer, { "$isMobile": size <= 640, 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 } })] }));
|
|
37
|
+
return (_jsxs(StyledSearchBarContainer, { style: { maxWidth: maxWidth ? maxWidth : size <= 640 ? '65%' : '650px', marginLeft: marginLeft ? marginLeft : size <= 640 ? '10px' : '50px' }, "$isMobile": size <= 640, 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 } })] }));
|
|
124
38
|
};
|
|
125
39
|
const TMHeader = ({ showSearchBar = true, clearSearchJobValue, clearSearchQEValue, searchContext = TMSearchContext.JOBS, onChangePassword, onLogout, settingsMenuContext, onSeacrhJobsValueChange, onSeacrhJobslistValueChange, onSeacrhProcessMonitorValueChange, onSeacrhProcessValueChange, onSeacrhPlatformValueChange, onSeacrhQEValueChange, onSettingsClick }) => {
|
|
126
40
|
const [menuStatus, setMenuStatus] = useState(false);
|
|
@@ -130,6 +44,7 @@ const TMHeader = ({ showSearchBar = true, clearSearchJobValue, clearSearchQEValu
|
|
|
130
44
|
const [searchProcessMonitorValue, setSearchProcessMonitorValue] = useState('');
|
|
131
45
|
const [searchPlatformValue, setSearchPlatformValue] = useState('');
|
|
132
46
|
const [searchQEValue, setSearchQEValue] = useState('');
|
|
47
|
+
const [isChatbot, setIsChatbot] = useState(false);
|
|
133
48
|
const menuRef = useRef(null);
|
|
134
49
|
const userIcon = useRef(null);
|
|
135
50
|
let width = useWindowWidth();
|
|
@@ -223,6 +138,7 @@ const TMHeader = ({ showSearchBar = true, clearSearchJobValue, clearSearchQEValu
|
|
|
223
138
|
const AboutApp = () => {
|
|
224
139
|
return (_jsxs(StyledSettingsMenuContainer, { children: [_jsxs(StyledSettingsMenuItem, { children: [_jsxs(StyledSettingsMenuItemTitle, { children: [_jsx(StyledSettingsMenuItemCircle, { style: { color: TMColors.info }, children: "\u25CF" }), " ", SDK_Globals.appModule] }), _jsx(StyledSettingsMenuItemVersion, { style: { color: TMColors.info }, children: versionAndBuildtypeInfo(moduleTypes.APP) })] }), _jsxs(StyledSettingsMenuItem, { children: [_jsxs(StyledSettingsMenuItemTitle, { children: [_jsx(StyledSettingsMenuItemCircle, { style: { color: TMColors.error }, children: "\u25CF" }), " SDKUI-REACT"] }), _jsx(StyledSettingsMenuItemVersion, { style: { color: TMColors.error }, children: versionAndBuildtypeInfo(moduleTypes.SDKUI) })] }), _jsxs(StyledSettingsMenuItem, { children: [_jsxs(StyledSettingsMenuItemTitle, { children: [_jsx(StyledSettingsMenuItemCircle, { style: { color: TMColors.success }, children: "\u25CF" }), " SDK-TS"] }), _jsx(StyledSettingsMenuItemVersion, { style: { color: TMColors.success }, children: versionAndBuildtypeInfo(moduleTypes.SDK) })] }), _jsxs(StyledSettingsMenuItem, { children: [_jsxs(StyledSettingsMenuItemTitle, { children: [_jsx(StyledSettingsMenuItemCircle, { style: { color: TMColors.info }, children: "\u25CF" }), " WEBSDK"] }), _jsx(StyledSettingsMenuItemVersion, { style: { color: TMColors.info }, children: versionAndBuildtypeInfo(moduleTypes.WEBSDK) })] })] }));
|
|
225
140
|
};
|
|
226
|
-
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(
|
|
141
|
+
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(StyledChatBotWrapper, { children: [isChatbot &&
|
|
142
|
+
_jsxs("div", { style: { position: 'fixed', top: '50px', right: isMobile ? '5px' : '100px', zIndex: 1000000000 }, children: [_jsx(StyledChatBotcloseButton, { onClick: () => setIsChatbot(false), children: _jsx(IconCloseOutline, { color: 'white' }) }), _jsx("iframe", { allow: "microphone;", width: "300", height: "400", src: "https://console.dialogflow.com/api-client/demo/embedded/ee1ed045-bbf6-4740-8f2c-314cbc857dd8" })] }), _jsxs(StyledChaBotBtnWrapper, { style: { width: isMobile ? '0' : '150px', backgroundColor: isMobile ? 'transparent' : 'orange' }, onClick: () => setIsChatbot(true), children: [_jsxs(StyledChatBotToppyContainer, { style: { backgroundColor: isMobile ? 'transparent' : 'orange' }, children: [" ", _jsx(StyledToppyImage, { children: _jsx("img", { style: { cursor: 'pointer', transform: 'translateY(3px)' }, src: Logo, width: 20, alt: '', onClick: () => setIsChatbot(true) }) }), " "] }), !isMobile && _jsx("p", { style: { color: 'white', fontWeight: 'bold' }, children: "Chiedimi qualcosa" })] })] }), _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(AboutApp, {}) }); }, style: { fontSize: FontSize.defaultFontSize }, children: [" ", _jsx("span", { children: _jsx(IconBxInfo, {}) }), " ", _jsx("span", { children: "About" }), " "] })] })] }));
|
|
227
143
|
};
|
|
228
144
|
export default TMHeader;
|