@topconsultnpm/sdkui-react-beta 6.6.111 → 6.6.114
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/TMButton.js +1 -0
- package/lib/components/base/TMClosableList.js +0 -1
- package/lib/components/base/TMPopUp.js +8 -6
- package/lib/components/base/TMTooltip.js +0 -2
- package/lib/components/editors/TMTextArea.js +0 -1
- package/lib/components/editors/TMTextBox.js +0 -1
- package/lib/components/forms/TMLoginForm.d.ts +3 -1
- package/lib/components/forms/TMLoginForm.js +9 -9
- package/lib/components/forms/TMSaveForm.d.ts +14 -1
- package/lib/components/forms/TMSaveForm.js +51 -2
- package/lib/components/pages/TMPage.js +0 -2
- package/lib/components/query/TMQueryResultForm.js +0 -1
- package/lib/components/sidebar/TMHeader.js +3 -4
- package/lib/helper/helpers.d.ts +3 -2
- package/lib/helper/helpers.js +7 -7
- package/package.json +1 -1
|
@@ -57,6 +57,7 @@ const StyledIconButton = styled.button.withConfig({ shouldForwardProp: prop => !
|
|
|
57
57
|
align-items: center;
|
|
58
58
|
justify-content: center;
|
|
59
59
|
cursor: ${props => !props.disabled && 'pointer'};
|
|
60
|
+
opacity: ${props => !props.disabled ? 1 : 0.4};
|
|
60
61
|
background-color: transparent;
|
|
61
62
|
color: ${props => !props.disabled ? getColor(props.color) : 'rgb(180, 180, 180)'};
|
|
62
63
|
user-select: none;
|
|
@@ -59,7 +59,6 @@ const StyledClosableItemsCount = styled.div `
|
|
|
59
59
|
`;
|
|
60
60
|
const TMClosableList = ({ dataSource, visibility = false, label, inline = false, hasPadding = true }) => {
|
|
61
61
|
const [status, setStatus] = useState(visibility);
|
|
62
|
-
// let width = useWindowWidth()
|
|
63
62
|
let devicrType = useDeviceType();
|
|
64
63
|
const renderedItems = () => {
|
|
65
64
|
return (dataSource.map((item, index) => (_jsx(StyledClosableItem, { children: item }, index))));
|
|
@@ -12,6 +12,7 @@ import { SDK_Globals } from '@topconsultnpm/sdk-ts-beta';
|
|
|
12
12
|
import TMLayoutContainer, { TMCard, TMLayoutItem } from './TMLayout';
|
|
13
13
|
import { Popup } from 'devextreme-react';
|
|
14
14
|
import TMTabGroup, { TMTab } from './TMTab';
|
|
15
|
+
import { useDeviceType } from './TMDeviceProvider';
|
|
15
16
|
let TOOLBAR_HEIGHT = 38;
|
|
16
17
|
export var ButtonNames;
|
|
17
18
|
(function (ButtonNames) {
|
|
@@ -79,8 +80,9 @@ const Message = ({ msg }) => {
|
|
|
79
80
|
const TMMessageBox = ({ resizable = false, onButtonClick, title = 'TopMedia', message = '', buttons }) => {
|
|
80
81
|
const [isVisible, setIsVisible] = useState(true);
|
|
81
82
|
const [btns, setBtns] = useState(buttons || []);
|
|
82
|
-
const [currentWidth, setCurrentWidth] = useState(window.innerWidth)
|
|
83
|
-
|
|
83
|
+
// const [currentWidth, setCurrentWidth] = useState<number>(window.innerWidth)
|
|
84
|
+
const deviceType = useDeviceType();
|
|
85
|
+
// useEffect(() => { window.addEventListener('resize', () => setCurrentWidth(window.innerWidth)); return () => window.removeEventListener('resize', () => setCurrentWidth(window.innerWidth)) })
|
|
84
86
|
useEffect(() => {
|
|
85
87
|
let arr = [];
|
|
86
88
|
if (buttons) {
|
|
@@ -93,7 +95,7 @@ const TMMessageBox = ({ resizable = false, onButtonClick, title = 'TopMedia', me
|
|
|
93
95
|
const MessageToolbar = () => {
|
|
94
96
|
return (_jsxs(StyledMessageToolbar, { children: [(btns.includes(ButtonNames.OK) || btns.includes(ButtonNames.YES)) && _jsx(TMButton, { fontSize: '1.1rem', color: 'primaryOutline', btnStyle: 'text', onClick: () => { onButtonClick && btns.includes(ButtonNames.YES) ? onButtonClick(ButtonNames.YES) : onButtonClick && onButtonClick(ButtonNames.OK); setIsVisible(false); }, caption: btns.includes(ButtonNames.YES) ? SDKUI_Localizator.Yes : 'OK', showTooltip: false }), btns.includes(ButtonNames.NO) && _jsx(TMButton, { fontSize: '1.1rem', btnStyle: 'text', onClick: () => { onButtonClick && onButtonClick(ButtonNames.NO); setIsVisible(false); }, caption: SDKUI_Localizator.No, showTooltip: false, color: 'error' }), btns.includes(ButtonNames.CANCEL) && _jsx(TMButton, { fontSize: '1.1rem', btnStyle: 'text', onClick: () => { onButtonClick && onButtonClick(ButtonNames.CANCEL); setIsVisible(false); }, caption: SDKUI_Localizator.Cancel, showTooltip: false, color: 'error' })] }));
|
|
95
97
|
};
|
|
96
|
-
return (_jsx(Popup, { resizeEnabled: resizable, visible: isVisible, showCloseButton: true, width: calcResponsiveSizes(
|
|
98
|
+
return (_jsx(Popup, { resizeEnabled: resizable, visible: isVisible, showCloseButton: true, width: calcResponsiveSizes(deviceType, '400px', '300px', '250px'), height: 'fit-content', title: title, onHidden: () => { setIsVisible(false); }, children: _jsxs(TMLayoutContainer, { children: [_jsx(TMLayoutItem, { height: 'calc(100% - 40px)', children: _jsx(TMCard, { showBorder: false, scrollY: true, children: _jsxs(TMLayoutContainer, { direction: 'horizontal', alignItems: 'center', justifyContent: 'center', gap: 10, children: [_jsx(TMLayoutItem, { width: 'fit-content', children: _jsx("img", { style: { transform: 'translateY(8px)' }, src: toppy, width: 60, height: 75, alt: "" }) }), _jsx(TMLayoutItem, { height: 'fit-content', children: _jsxs("div", { children: [" ", typeof message === 'string' ? _jsx(Message, { msg: message }) : message, " "] }) })] }) }) }), _jsx(TMLayoutItem, { height: '50px', children: _jsx(MessageToolbar, {}) })] }) }));
|
|
97
99
|
};
|
|
98
100
|
const TMExceptionBox = ({ resizable = false, exception, title = `${SDK_Globals.appModule} v. ${SDK_Globals.appVersion}` }) => {
|
|
99
101
|
const [isVisible, setIsVisible] = useState(true);
|
|
@@ -101,8 +103,8 @@ const TMExceptionBox = ({ resizable = false, exception, title = `${SDK_Globals.a
|
|
|
101
103
|
let dateString = d.getDate() + '/' + d.getMonth() + 1 + '/' + d.getFullYear();
|
|
102
104
|
let timeString = d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds() + ':' + d.getMilliseconds();
|
|
103
105
|
let message = exception.isApiException ? exception.response.title : exception.message;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
// useEffect(() => { window.addEventListener('resize', () => setCurrentWidth(window.innerWidth)); return () => window.removeEventListener('resize', () => setCurrentWidth(window.innerWidth)) })
|
|
107
|
+
const deviceType = useDeviceType();
|
|
106
108
|
const getFullMessage = () => {
|
|
107
109
|
let fullMessage = '';
|
|
108
110
|
fullMessage += `${d}\n${'-' + JSON.stringify(exception)}\n` + `-${SDK_Globals.appModule}: ${SDK_Globals.appVersion}\n` + `-SDKUI: ${SDK_Globals.sdkuiVersion}\n` + `-SDK: ${SDK_Globals.sdkVersion}\n`;
|
|
@@ -115,7 +117,7 @@ const TMExceptionBox = ({ resizable = false, exception, title = `${SDK_Globals.a
|
|
|
115
117
|
const ExceptionToolbar = () => {
|
|
116
118
|
return (_jsxs(StyledExeptionToolbar, { children: [_jsx(TMButton, { color: 'primaryOutline', btnStyle: 'text', onClick: () => copyToClipBoard(getFullMessage()), caption: SDKUI_Localizator.CopyToClipboard, showTooltip: false }), _jsx(TMButton, { btnStyle: 'text', onClick: () => setIsVisible(false), caption: SDKUI_Localizator.Close, showTooltip: false, color: 'error' })] }));
|
|
117
119
|
};
|
|
118
|
-
return (_jsx(Popup, { resizeEnabled: resizable, visible: isVisible, onHidden: () => setIsVisible(false), showCloseButton: true, width: calcResponsiveSizes(
|
|
120
|
+
return (_jsx(Popup, { resizeEnabled: resizable, visible: isVisible, onHidden: () => setIsVisible(false), showCloseButton: true, width: calcResponsiveSizes(deviceType, '600px', '400px', '350px'), height: '350px', title: title, children: _jsxs(TMLayoutContainer, { children: [_jsx(TMLayoutItem, { height: 'calc(100% - 50px)', children: _jsxs(TMTabGroup, { validationItems: [], children: [_jsxs(TMTab, { label: SDKUI_Localizator.Error, children: [_jsxs(TabContextContainer, { style: { height: 'calc(100% - 68px )', paddingRight: '40px' }, children: [_jsxs("p", { children: [" ", _jsx("span", { style: { color: TMColors.primary }, children: "Messaggio: " }), " ", message ? message : 'Message not found'] }), _jsx("div", { style: { display: 'flex', flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'flex-start', gap: '5px', marginTop: '5px' }, children: _jsxs("div", { children: [_jsxs("span", { style: { color: TMColors.primary }, children: [SDKUI_Localizator.Date, " ", SDKUI_Localizator.Time.toLowerCase(), ": "] }), d.toString()] }) })] }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(`Date: ${dateString}\nTime: ${timeString}\nMessage: ${message}`), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] }), _jsxs(TMTab, { label: SDKUI_Localizator.CompleteError, children: [_jsx(TabContextContainer, { style: { paddingRight: '40px' }, children: JSON.stringify(exception).replaceAll('{', '').replaceAll('}', '').split(`,"`).map((t, index) => (_jsxs("div", { style: { padding: '5px', borderBottom: '1px solid rgb(180,180,180)' }, children: ["\u261B", ' ' + (t.toLowerCase().includes('detail') ? (t.replaceAll(`"`, '').replaceAll(`:`, ': ').replaceAll(String.fromCharCode(92), '')) : (t.replaceAll(`"`, '').replaceAll(`:`, ': ')))] }, index))) }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(JSON.stringify(exception).replaceAll('{', '').replaceAll('}', '').replaceAll(',', '\n')), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] }), _jsxs(TMTab, { label: SDKUI_Localizator.Details, children: [_jsxs(TabContextContainer, { children: [_jsxs(StyledAppVersionText, { "$color": TMColors.primary, children: [SDK_Globals.appModule, " ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDK_Globals.appVersion })] }), _jsxs(StyledAppVersionText, { "$color": TMColors.tertiary, children: ["SDKUI: ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDK_Globals.sdkuiVersion })] }), _jsxs(StyledAppVersionText, { "$color": TMColors.success, children: ["SDK : ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDK_Globals.sdkVersion })] })] }), _jsxs(StyledCopyInclipBoardButtonContainer, { children: [" ", _jsx(TMButton, { color: 'primaryOutline', onClick: () => copyToClipBoard(`-${SDK_Globals.appModule}: ${SDK_Globals.appVersion}\n` + `-SDKUI: ${SDK_Globals.sdkuiVersion}\n` + `-SDK: ${SDK_Globals.sdkVersion}\n`), btnStyle: 'toolbar', icon: _jsx(IconCopy, { fontSize: 18 }), caption: SDKUI_Localizator.CopyToClipboard }), " "] })] })] }) }), _jsx(TMLayoutItem, { height: '40px', children: _jsx(ExceptionToolbar, {}) })] }) }));
|
|
119
121
|
};
|
|
120
122
|
class TMExceptionBoxManager {
|
|
121
123
|
static show({ title, exception }) {
|
|
@@ -11,8 +11,6 @@ const TMTooltip = ({ children, position, content, hideAfterDelay }) => {
|
|
|
11
11
|
window.addEventListener('click', () => setShowTooltip(false));
|
|
12
12
|
return () => window.removeEventListener('click', () => setShowTooltip(false));
|
|
13
13
|
}, []);
|
|
14
|
-
// const width = useWindowWidth();
|
|
15
|
-
// let isDesktop = width > TABLET_WIDTH;
|
|
16
14
|
const deviceType = useDeviceType();
|
|
17
15
|
return (_jsxs("div", { children: [_jsx("div", { id: `idContainerTooltip${id}`, style: { display: 'flex', alignItems: 'center', height: 'max-content', width: 'max-content' }, onMouseEnter: () => { setShowTooltip(true); }, onMouseLeave: () => { setShowTooltip(false); }, onClick: () => { if (deviceType === DeviceType.DESKTOP || !hideAfterDelay)
|
|
18
16
|
return; setTimeout(() => { setShowTooltip(false); }, 1500); }, children: children }), content &&
|
|
@@ -15,7 +15,6 @@ const TMTextArea = (props) => {
|
|
|
15
15
|
const [currentValue, setCurrentValue] = useState(value);
|
|
16
16
|
const [formulaMenuItems, setFormulaMenuItems] = useState([]);
|
|
17
17
|
const { clicked, setClicked, points, setPoints } = useContextMenu();
|
|
18
|
-
// let screenWidth = useWindowWidth();
|
|
19
18
|
const deviceType = useDeviceType();
|
|
20
19
|
useEffect(() => {
|
|
21
20
|
setCurrentValue(value);
|
|
@@ -39,7 +39,6 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, scale, showCle
|
|
|
39
39
|
const [formulaMenuItems, setFormulaMenuItems] = useState([]);
|
|
40
40
|
const [isFocused, setIsFocused] = useState(false);
|
|
41
41
|
const inputRef = useRef(null);
|
|
42
|
-
// let screenWidth = useWindowWidth();
|
|
43
42
|
const deviceType = useDeviceType();
|
|
44
43
|
const [id, setID] = useState('');
|
|
45
44
|
useEffect(() => { setID(genUniqueId()); }, []);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { AppModules, CultureIDs, ITopMediaSession, SessionDescriptor } from "@topconsultnpm/sdk-ts-beta";
|
|
3
|
+
import { DeviceType } from "../base/TMDeviceProvider";
|
|
3
4
|
export declare const onChangeLanguage: (cultureID: CultureIDs) => void;
|
|
4
5
|
export declare const useCultureID: ({ cultureID }: {
|
|
5
6
|
cultureID: CultureIDs;
|
|
@@ -22,7 +23,8 @@ export declare const cultureIDsDataSource: {
|
|
|
22
23
|
display: string;
|
|
23
24
|
}[];
|
|
24
25
|
declare const TMLoginForm: React.FunctionComponent<ITMLoginFormProps>;
|
|
25
|
-
export declare const TMChangePassword: ({ tmSession, username, onClose, enable, hasBack }: {
|
|
26
|
+
export declare const TMChangePassword: ({ deviceType, tmSession, username, onClose, enable, hasBack }: {
|
|
27
|
+
deviceType?: DeviceType | undefined;
|
|
26
28
|
hasBack?: boolean | undefined;
|
|
27
29
|
tmSession?: ITopMediaSession | undefined;
|
|
28
30
|
username: string;
|
|
@@ -10,7 +10,7 @@ import ptMessages from "devextreme/localization/messages/pt.json";
|
|
|
10
10
|
import { locale as dxlocale, loadMessages } from "devextreme/localization";
|
|
11
11
|
import backgroundLogin from '../../assets/login-bg.png';
|
|
12
12
|
import six from '../../assets/loading.png';
|
|
13
|
-
import { IconAccessPoint, IconArchive, IconLanguage, IconLogin, IconMail, IconPassword, IconSearch, IconUser, IconWeb, IconWifi, SDKUI_Localizator, calcResponsiveDirection, calcResponsiveSizes,
|
|
13
|
+
import { IconAccessPoint, IconArchive, IconLanguage, IconLogin, IconMail, IconPassword, IconSearch, IconUser, IconWeb, IconWifi, SDKUI_Localizator, calcResponsiveDirection, calcResponsiveSizes, IconArrowLeft, SDKUI_Globals } from "../../helper";
|
|
14
14
|
// import { TMColors } from "/utils/theme";
|
|
15
15
|
// import TMLayoutContainer, { TMCard, TMLayoutItem } from "../Layout/TMLayout";
|
|
16
16
|
import styled from "styled-components";
|
|
@@ -25,6 +25,7 @@ import TMTextBox from "../editors/TMTextBox";
|
|
|
25
25
|
import TMButton from "../base/TMButton";
|
|
26
26
|
import TMSummary from "../editors/TMSummary";
|
|
27
27
|
import TMDropDown from "../editors/TMDropDown";
|
|
28
|
+
import { DeviceType, useDeviceType } from "../base/TMDeviceProvider";
|
|
28
29
|
export const onChangeLanguage = (cultureID) => {
|
|
29
30
|
//localizzazione devexpress
|
|
30
31
|
switch (cultureID) {
|
|
@@ -78,6 +79,7 @@ const StyledLogoContainer = styled.div ` position: relative; width: ${props => p
|
|
|
78
79
|
export const cultureIDsDataSource = [{ value: CultureIDs.It_IT, display: "Italiano" }, { value: CultureIDs.Fr_FR, display: "Française" }, { value: CultureIDs.Pt_PT, display: "Português" }, { value: CultureIDs.En_US, display: "English" }, { value: CultureIDs.Es_ES, display: "Español" }, { value: CultureIDs.De_DE, display: "Deutsch" },];
|
|
79
80
|
const TMLoginForm = (props) => {
|
|
80
81
|
// const [currentCultureID, setCurrentCultureID] = useState<CultureIDs>(CultureIDs.It_IT);
|
|
82
|
+
const deviceType = useDeviceType();
|
|
81
83
|
const [endpoints, setEndpoints] = useState();
|
|
82
84
|
const [selectedEndpoint, setSelectedEndPoint] = useState();
|
|
83
85
|
const [selectedArchive, setSelectedArchive] = useState();
|
|
@@ -107,7 +109,6 @@ const TMLoginForm = (props) => {
|
|
|
107
109
|
const otp6Ref = useRef(null);
|
|
108
110
|
const [otpValues, setOtpValues] = useState(['', '', '', '', '', '']);
|
|
109
111
|
const [otpHasFilled, setOtpHasFilled] = useState([false, false, false, false, false, false]);
|
|
110
|
-
const size = useWindowWidth();
|
|
111
112
|
useEffect(() => {
|
|
112
113
|
let interval;
|
|
113
114
|
if (recoveryPasswordState.step === 2 && wait > 0) {
|
|
@@ -768,15 +769,15 @@ const TMLoginForm = (props) => {
|
|
|
768
769
|
setOtpValues(['', '', '', '', '', '']);
|
|
769
770
|
}
|
|
770
771
|
};
|
|
771
|
-
return (_jsx(StyledLoginContainer, { "$responsiveHeight": calcResponsiveSizes(
|
|
772
|
-
_jsx(StyledContainer, { children: _jsxs(TMLayoutContainer, { alignItems: "center", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "max-content", children: _jsx(StyledHeaderText, { children: SDKUI_Localizator.ForgetPassword }) }), _jsx(TMLayoutItem, { children: _jsx("div", { style: { padding: `0px ${calcResponsiveSizes(size, '40px', '40px', '10px')}` }, children: _jsx(TMCard, { showBorder: false, children: _jsxs(TMLayoutContainer, { children: [_jsx(TMLayoutItem, { height: "max-content", children: _jsxs("div", { style: { width: '100%', height: '5px', display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginTop: '20px' }, children: [_jsx("div", { style: { transform: 'translateX(-1px)', width: '15px', height: '15px', borderRadius: '20px', transition: '500ms ease', backgroundColor: TMColors.primary, zIndex: 300, color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: "1" }), _jsx("div", { style: { width: '15px', height: '15px', borderRadius: '20px', transition: '500ms ease', backgroundColor: recoveryPasswordState.step > 1 ? TMColors.primary : 'rgb(180,180,180)', zIndex: 300, color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: "2" }), _jsx("div", { style: { transform: 'translateX(1px)', width: '15px', height: '15px', borderRadius: '20px', transition: '500ms ease', backgroundColor: recoveryPasswordState.step > 2 ? TMColors.primary : 'rgb(180,180,180)', zIndex: 300, color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: "3" }), _jsx("div", { style: { width: '100%', height: '5px', backgroundColor: 'rgb(180,180,180)', position: 'absolute' } }), _jsx("div", { style: { width: recoveryPasswordState.step === 1 ? '0%' : recoveryPasswordState.step === 2 ? '50%' : '100%', transition: '500ms ease', height: '5px', backgroundColor: TMColors.primary, position: 'absolute' } })] }) }), recoveryPasswordState.step === 1 && _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "email", elementStyle: { marginTop: '30px' }, label: SDKUI_Localizator.InsertYourEmail, icon: _jsx(IconMail, {}), onValueChanged: (e) => setRecoveryPasswordState({ ...recoveryPasswordState, email: e.target.value }), value: recoveryPasswordState.email, validationItems: recoveryPasswordState.email?.length === 0 ? recoveryPasswordValidationItems.filter(item => item.PropertyName === 'recoveryPass_email') : recoveryPasswordValidationItems.filter(item => item.PropertyName === 'recoveryPass_notEmail') }) }), recoveryPasswordState.step === 2 && _jsx(TMLayoutItem, { children: _jsxs(StyledOTPContainer, { children: [_jsxs(StyledOTPLabel, { children: [" ", SDKUI_Localizator.InsertOTP, " ", otpHasFilled.find(input => input === true) && _jsx("strong", { style: { cursor: 'pointer' }, onClick: () => setOtpValues(['', '', '', '', '', '']), children: SDKUI_Localizator.ClearOTP }), " "] }), _jsxs(StyledOTPInputContainer, { children: [_jsx(StyledOTPInput, { ref: otp1Ref, type: "number", max: 9, min: 0, value: otpValues[0], onChange: (e) => { let arr = [...otpValues]; arr[0] = e.target.value; setOtpValues(arr); } }), _jsx(StyledOTPInput, { ref: otp2Ref, type: "number", max: 9, min: 0, value: otpValues[1], onChange: (e) => { let arr = [...otpValues]; arr[1] = e.target.value; setOtpValues(arr); } }), _jsx(StyledOTPInput, { ref: otp3Ref, type: "number", max: 9, min: 0, value: otpValues[2], onChange: (e) => { let arr = [...otpValues]; arr[2] = e.target.value; setOtpValues(arr); } }), _jsx(StyledOTPInput, { ref: otp4Ref, type: "number", max: 9, min: 0, value: otpValues[3], onChange: (e) => { let arr = [...otpValues]; arr[3] = e.target.value; setOtpValues(arr); } }), _jsx(StyledOTPInput, { ref: otp5Ref, type: "number", max: 9, min: 0, value: otpValues[4], onChange: (e) => { let arr = [...otpValues]; arr[4] = e.target.value; setOtpValues(arr); } }), _jsx(StyledOTPInput, { ref: otp6Ref, type: "number", max: 9, min: 0, value: otpValues[5], onChange: (e) => { let arr = [...otpValues]; arr[5] = e.target.value; setOtpValues(arr); } })] }), _jsxs(StyledOTPWaitPanel, { children: [_jsxs("em", { children: [" ", SDKUI_Localizator.OTPSent, " ", _jsx("strong", { children: recoveryPasswordState.email }), ". ", SDKUI_Localizator.OTPNewRequest, " ", _jsx("strong", { children: wait }), " ", SDKUI_Localizator.Seconds] }), ".", wait === 0 && _jsx(TMButton, { caption: SDKUI_Localizator.NewOTP, showTooltip: false, onClick: () => setWait(60) })] })] }) }), recoveryPasswordState.step === 3 && _jsxs(_Fragment, { children: [_jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "password", label: SDKUI_Localizator.NewPassword, icon: _jsx(IconPassword, {}), onValueChanged: (e) => setRecoveryPasswordState({ ...recoveryPasswordState, newPassword: e.target.value }), value: recoveryPasswordState.newPassword, validationItems: recoveryPasswordValidationItems.filter(item => item.PropertyName === 'recoveryPass_new' || item.PropertyName === 'recoveryPass_equalUsername' || item.PropertyName === 'recoveryPass_containUsername') }) }), _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "password", label: SDKUI_Localizator.ConfirmPassword, icon: _jsx(IconPassword, {}), onValueChanged: (e) => setRecoveryPasswordState({ ...recoveryPasswordState, confermPassword: e.target.value }), value: recoveryPasswordState.confermPassword, validationItems: recoveryPasswordValidationItems.filter(item => item.PropertyName === 'recoveryPass_confirm' || item.PropertyName === 'recoveryPass_notConfirmed') }) })] })] }) }) }) }), recoveryPasswordState.step === 3 && _jsx(TMPasswordManager, { operation: "recovery", validationItems: recoveryPasswordValidationItems }), _jsx(TMLayoutItem, { height: "fit-content", width: "fit-content", children: _jsx("p", { onClick: () => { recoveryPasswordBackClick(); }, tabIndex: isPasswordChangeEnable() ? 0 : undefined, onKeyDown: (e) => e.code === 'Space' && recoveryPasswordBackClick(), style: { userSelect: 'none', cursor: 'pointer', color: TMColors.primary, fontSize: '1rem' }, children: (recoveryPasswordState.step === 1 || recoveryPasswordState.step === 3) ? SDKUI_Localizator.Back : SDKUI_Localizator.Cancel }) }), _jsx(TMLayoutItem, { height: "fit-content", children: _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '20px 0' }, children: _jsx(TMButton, { width: calcResponsiveSizes(size, '150px', '150px', '300px'), height: calcResponsiveSizes(size, '30px', '40px', '40px'), fontSize: "1rem", disabled: recoveryPasswordValidationItems.filter(vil => vil.ResultType === ResultTypes.ERROR).length > 0, caption: recoveryPasswordState.step < 3 ? SDKUI_Localizator.Next : SDKUI_Localizator.Save, onClick: () => recoveryPasswordOnClickManager(), showTooltip: false }) }) })] }) }), togglePages.change && _jsx(TMChangePassword, { tmSession: getChangePswTmSession(), username: username, enable: isPasswordChangeEnable(), onClose: () => backToLogin() }), togglePages.endpoint && _jsx(StyledContainer, { children: _jsxs(TMLayoutContainer, { alignItems: "center", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "max-content", children: _jsx(StyledHeaderText, { children: SDKUI_Localizator.Endpoint }) }), _jsx(TMLayoutItem, { height: "fit-content", maxHeight: "70%", children: _jsx("div", { style: { height: '100%', padding: `0px ${calcResponsiveSizes(size, '40px', '40px', '10px')}` }, children: _jsx(TMCard, { showBorder: false, children: _jsxs(DataGrid, { height: '100%', elementAttr: { class: 'dx-custom-row' }, dataSource: endpoints, allowColumnResizing: true, columnResizingMode: "widget", columnAutoWidth: true, allowColumnReordering: true, keyExpr: "URL", showBorders: true, showColumnLines: SDKUI_Globals.dataGridShowColumnLines, showRowLines: SDKUI_Globals.dataGridShowRowLines, onSelectionChanged: (e) => setSelectedEndPoint(e.selectedRowsData[0]), onRowDblClick: () => { setEndpoint(selectedEndpoint); backToLogin(); setSelectedEndPoint(undefined); }, children: [_jsx(Selection, { mode: "single", showCheckBoxesMode: "onClick", selectAllMode: 'allPages' }), _jsx(ScrollBar, { width: 3 }), _jsx(Column, { dataField: "Description", caption: SDKUI_Localizator.Description, allowSorting: false }), _jsx(Column, { dataField: "URL", caption: 'URL', allowSorting: false }), _jsx(Column, { dataField: "isDefault", caption: 'Default', dataType: "boolean", allowSorting: false })] }) }) }) }), recoveryPasswordState.step === 3 && _jsx(TMPasswordManager, { operation: "recovery", validationItems: recoveryPasswordValidationItems }), _jsx(TMLayoutItem, { height: "fit-content", children: _jsxs("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '10px 0', gap: 10 }, children: [_jsx(TMButton, { caption: SDKUI_Localizator.Back, btnStyle: "icon", height: calcResponsiveSizes(size, '30px', '40px', '40px'), fontSize: "0.8rem", onClick: backToLogin, icon: _jsx(IconArrowLeft, {}) }), _jsx(TMButton, { width: calcResponsiveSizes(size, '150px', '150px', '300px'), height: calcResponsiveSizes(size, '30px', '40px', '40px'), fontSize: "1rem", disabled: !selectedEndpoint, caption: SDKUI_Localizator.Select, onClick: () => { setEndpoint(selectedEndpoint); backToLogin(); setSelectedEndPoint(undefined); }, showTooltip: false }), _jsx(TMButton, { caption: 'Ping', btnStyle: "icon", height: calcResponsiveSizes(size, '30px', '40px', '40px'), fontSize: "0.8rem", disabled: !selectedEndpoint, onClick: () => pingAsync(selectedEndpoint), icon: _jsx(IconWifi, {}) })] }) })] }) }), togglePages.archive && _jsx(StyledContainer, { children: _jsxs(TMLayoutContainer, { alignItems: "center", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "max-content", children: _jsx(StyledHeaderText, { children: SDKUI_Localizator.ArchiveID }) }), _jsx(TMLayoutItem, { height: "fit-content", maxHeight: "70%", children: _jsx("div", { style: { height: '100%', padding: `0px ${calcResponsiveSizes(size, '40px', '40px', '10px')}` }, children: _jsx(TMCard, { showBorder: false, children: _jsxs(DataGrid, { height: '100%', dataSource: archives, allowColumnResizing: true, columnResizingMode: "widget", columnAutoWidth: true, allowColumnReordering: true, keyExpr: "id", showBorders: true, showColumnLines: SDKUI_Globals.dataGridShowColumnLines, showRowLines: SDKUI_Globals.dataGridShowRowLines, onSelectionChanged: (e) => setSelectedArchive(e.selectedRowsData[0]), onRowDblClick: () => { setArchive(selectedArchive); backToLogin(); setSelectedArchive(undefined); }, children: [_jsx(Selection, { mode: "single", showCheckBoxesMode: "onClick", selectAllMode: 'allPages' }), _jsx(Column, { dataField: "id", caption: 'ID', allowSorting: false }), _jsx(Column, { dataField: "description", caption: SDKUI_Localizator.Description, allowSorting: false }), _jsx(Column, { dataField: "isDefault", caption: 'Default', dataType: "boolean", allowSorting: false })] }) }) }) }), recoveryPasswordState.step === 3 && _jsx(TMPasswordManager, { operation: "recovery", validationItems: recoveryPasswordValidationItems }), _jsx(TMLayoutItem, { height: "fit-content", children: _jsxs("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '20px 0', gap: 10 }, children: [_jsx(TMButton, { caption: SDKUI_Localizator.Back, btnStyle: "icon", height: calcResponsiveSizes(size, '30px', '40px', '40px'), fontSize: "0.8rem", onClick: backToLogin, icon: _jsx(IconArrowLeft, {}) }), _jsx(TMButton, { width: calcResponsiveSizes(size, '150px', '150px', '300px'), height: calcResponsiveSizes(size, '30px', '40px', '40px'), fontSize: "1rem", disabled: !selectedArchive, caption: SDKUI_Localizator.Select, onClick: () => { setArchive(selectedArchive); backToLogin(); setSelectedArchive(undefined); }, showTooltip: false })] }) })] }) }), (isLoginPage()) &&
|
|
773
|
-
_jsx(StyledContainer, { children: _jsxs(TMLayoutContainer, { alignItems: "center", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "max-content", children: _jsx(StyledHeaderText, { children: "Login" }) }), _jsx(TMLayoutItem, { children: _jsx("div", { style: { padding: `0px ${calcResponsiveSizes(
|
|
772
|
+
return (_jsx(StyledLoginContainer, { "$responsiveHeight": calcResponsiveSizes(deviceType, '75%', '96%', '98%'), "$responsiveWidth": calcResponsiveSizes(deviceType, '55%', '95%', '95%'), children: _jsxs(TMLayoutContainer, { direction: calcResponsiveDirection(deviceType, "horizontal", "vertical", "vertical"), children: [_jsx(TMLayoutItem, { width: calcResponsiveSizes(deviceType, "40%", "100%", "100%"), height: calcResponsiveSizes(deviceType, '100%', '20%', '20%'), children: _jsx("div", { style: { width: '100%', height: '100%', backgroundImage: `url(${backgroundLogin})`, backgroundRepeat: 'no-repeat', backgroundSize: 'cover', backgroundPosition: 'center', borderRadius: '10px' }, children: _jsx(StyledLogoContainer, { "$width": "100%", "$height": calcResponsiveSizes(deviceType, '21%', '50%', '50%'), "$top": '20%', children: _jsx("div", { style: { display: 'flex', height: '100%', alignItems: 'center', justifyContent: 'center', fontWeight: 'bolder', color: TMColors.secondary, fontStyle: 'italic' }, children: _jsxs("div", { style: { display: 'flex', alignItems: 'flex-end', gap: 10 }, children: [_jsx("img", { src: six, height: 40, alt: "" }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx("div", { style: { fontSize: '0.8rem', color: '#343434', fontWeight: 'lighter' }, children: "TopMedia" }), _jsx("div", { style: { fontSize: '2.5rem', lineHeight: 1 }, children: SDK_Globals.appModule })] })] }) }) }) }) }), _jsxs(TMLayoutItem, { width: calcResponsiveSizes(deviceType, "60%", "100%", "100%"), height: calcResponsiveSizes(deviceType, '100%', '80%', '80%'), children: [togglePages.recovery &&
|
|
773
|
+
_jsx(StyledContainer, { children: _jsxs(TMLayoutContainer, { alignItems: "center", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "max-content", children: _jsx(StyledHeaderText, { children: SDKUI_Localizator.ForgetPassword }) }), _jsx(TMLayoutItem, { children: _jsx("div", { style: { padding: `0px ${calcResponsiveSizes(deviceType, '40px', '40px', '10px')}` }, children: _jsx(TMCard, { showBorder: false, children: _jsxs(TMLayoutContainer, { children: [_jsx(TMLayoutItem, { height: "max-content", children: _jsxs("div", { style: { width: '100%', height: '5px', display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginTop: '20px' }, children: [_jsx("div", { style: { transform: 'translateX(-1px)', width: '15px', height: '15px', borderRadius: '20px', transition: '500ms ease', backgroundColor: TMColors.primary, zIndex: 300, color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: "1" }), _jsx("div", { style: { width: '15px', height: '15px', borderRadius: '20px', transition: '500ms ease', backgroundColor: recoveryPasswordState.step > 1 ? TMColors.primary : 'rgb(180,180,180)', zIndex: 300, color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: "2" }), _jsx("div", { style: { transform: 'translateX(1px)', width: '15px', height: '15px', borderRadius: '20px', transition: '500ms ease', backgroundColor: recoveryPasswordState.step > 2 ? TMColors.primary : 'rgb(180,180,180)', zIndex: 300, color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: "3" }), _jsx("div", { style: { width: '100%', height: '5px', backgroundColor: 'rgb(180,180,180)', position: 'absolute' } }), _jsx("div", { style: { width: recoveryPasswordState.step === 1 ? '0%' : recoveryPasswordState.step === 2 ? '50%' : '100%', transition: '500ms ease', height: '5px', backgroundColor: TMColors.primary, position: 'absolute' } })] }) }), recoveryPasswordState.step === 1 && _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "email", elementStyle: { marginTop: '30px' }, label: SDKUI_Localizator.InsertYourEmail, icon: _jsx(IconMail, {}), onValueChanged: (e) => setRecoveryPasswordState({ ...recoveryPasswordState, email: e.target.value }), value: recoveryPasswordState.email, validationItems: recoveryPasswordState.email?.length === 0 ? recoveryPasswordValidationItems.filter(item => item.PropertyName === 'recoveryPass_email') : recoveryPasswordValidationItems.filter(item => item.PropertyName === 'recoveryPass_notEmail') }) }), recoveryPasswordState.step === 2 && _jsx(TMLayoutItem, { children: _jsxs(StyledOTPContainer, { children: [_jsxs(StyledOTPLabel, { children: [" ", SDKUI_Localizator.InsertOTP, " ", otpHasFilled.find(input => input === true) && _jsx("strong", { style: { cursor: 'pointer' }, onClick: () => setOtpValues(['', '', '', '', '', '']), children: SDKUI_Localizator.ClearOTP }), " "] }), _jsxs(StyledOTPInputContainer, { children: [_jsx(StyledOTPInput, { ref: otp1Ref, type: "number", max: 9, min: 0, value: otpValues[0], onChange: (e) => { let arr = [...otpValues]; arr[0] = e.target.value; setOtpValues(arr); } }), _jsx(StyledOTPInput, { ref: otp2Ref, type: "number", max: 9, min: 0, value: otpValues[1], onChange: (e) => { let arr = [...otpValues]; arr[1] = e.target.value; setOtpValues(arr); } }), _jsx(StyledOTPInput, { ref: otp3Ref, type: "number", max: 9, min: 0, value: otpValues[2], onChange: (e) => { let arr = [...otpValues]; arr[2] = e.target.value; setOtpValues(arr); } }), _jsx(StyledOTPInput, { ref: otp4Ref, type: "number", max: 9, min: 0, value: otpValues[3], onChange: (e) => { let arr = [...otpValues]; arr[3] = e.target.value; setOtpValues(arr); } }), _jsx(StyledOTPInput, { ref: otp5Ref, type: "number", max: 9, min: 0, value: otpValues[4], onChange: (e) => { let arr = [...otpValues]; arr[4] = e.target.value; setOtpValues(arr); } }), _jsx(StyledOTPInput, { ref: otp6Ref, type: "number", max: 9, min: 0, value: otpValues[5], onChange: (e) => { let arr = [...otpValues]; arr[5] = e.target.value; setOtpValues(arr); } })] }), _jsxs(StyledOTPWaitPanel, { children: [_jsxs("em", { children: [" ", SDKUI_Localizator.OTPSent, " ", _jsx("strong", { children: recoveryPasswordState.email }), ". ", SDKUI_Localizator.OTPNewRequest, " ", _jsx("strong", { children: wait }), " ", SDKUI_Localizator.Seconds] }), ".", wait === 0 && _jsx(TMButton, { caption: SDKUI_Localizator.NewOTP, showTooltip: false, onClick: () => setWait(60) })] })] }) }), recoveryPasswordState.step === 3 && _jsxs(_Fragment, { children: [_jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "password", label: SDKUI_Localizator.NewPassword, icon: _jsx(IconPassword, {}), onValueChanged: (e) => setRecoveryPasswordState({ ...recoveryPasswordState, newPassword: e.target.value }), value: recoveryPasswordState.newPassword, validationItems: recoveryPasswordValidationItems.filter(item => item.PropertyName === 'recoveryPass_new' || item.PropertyName === 'recoveryPass_equalUsername' || item.PropertyName === 'recoveryPass_containUsername') }) }), _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "password", label: SDKUI_Localizator.ConfirmPassword, icon: _jsx(IconPassword, {}), onValueChanged: (e) => setRecoveryPasswordState({ ...recoveryPasswordState, confermPassword: e.target.value }), value: recoveryPasswordState.confermPassword, validationItems: recoveryPasswordValidationItems.filter(item => item.PropertyName === 'recoveryPass_confirm' || item.PropertyName === 'recoveryPass_notConfirmed') }) })] })] }) }) }) }), recoveryPasswordState.step === 3 && _jsx(TMPasswordManager, { operation: "recovery", validationItems: recoveryPasswordValidationItems }), _jsx(TMLayoutItem, { height: "fit-content", width: "fit-content", children: _jsx("p", { onClick: () => { recoveryPasswordBackClick(); }, tabIndex: isPasswordChangeEnable() ? 0 : undefined, onKeyDown: (e) => e.code === 'Space' && recoveryPasswordBackClick(), style: { userSelect: 'none', cursor: 'pointer', color: TMColors.primary, fontSize: '1rem' }, children: (recoveryPasswordState.step === 1 || recoveryPasswordState.step === 3) ? SDKUI_Localizator.Back : SDKUI_Localizator.Cancel }) }), _jsx(TMLayoutItem, { height: "fit-content", children: _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '20px 0' }, children: _jsx(TMButton, { width: calcResponsiveSizes(deviceType, '150px', '150px', '300px'), height: calcResponsiveSizes(deviceType, '30px', '40px', '40px'), fontSize: "1rem", disabled: recoveryPasswordValidationItems.filter(vil => vil.ResultType === ResultTypes.ERROR).length > 0, caption: recoveryPasswordState.step < 3 ? SDKUI_Localizator.Next : SDKUI_Localizator.Save, onClick: () => recoveryPasswordOnClickManager(), showTooltip: false }) }) })] }) }), togglePages.change && _jsx(TMChangePassword, { deviceType: deviceType, tmSession: getChangePswTmSession(), username: username, enable: isPasswordChangeEnable(), onClose: () => backToLogin() }), togglePages.endpoint && _jsx(StyledContainer, { children: _jsxs(TMLayoutContainer, { alignItems: "center", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "max-content", children: _jsx(StyledHeaderText, { children: SDKUI_Localizator.Endpoint }) }), _jsx(TMLayoutItem, { height: "fit-content", maxHeight: "70%", children: _jsx("div", { style: { height: '100%', padding: `0px ${calcResponsiveSizes(deviceType, '40px', '40px', '10px')}` }, children: _jsx(TMCard, { showBorder: false, children: _jsxs(DataGrid, { height: '100%', elementAttr: { class: 'dx-custom-row' }, dataSource: endpoints, allowColumnResizing: true, columnResizingMode: "widget", columnAutoWidth: true, allowColumnReordering: true, keyExpr: "URL", showBorders: true, showColumnLines: SDKUI_Globals.dataGridShowColumnLines, showRowLines: SDKUI_Globals.dataGridShowRowLines, onSelectionChanged: (e) => setSelectedEndPoint(e.selectedRowsData[0]), onRowDblClick: () => { setEndpoint(selectedEndpoint); backToLogin(); setSelectedEndPoint(undefined); }, children: [_jsx(Selection, { mode: "single", showCheckBoxesMode: "onClick", selectAllMode: 'allPages' }), _jsx(ScrollBar, { width: 3 }), _jsx(Column, { dataField: "Description", caption: SDKUI_Localizator.Description, allowSorting: false }), _jsx(Column, { dataField: "URL", caption: 'URL', allowSorting: false }), _jsx(Column, { dataField: "isDefault", caption: 'Default', dataType: "boolean", allowSorting: false })] }) }) }) }), recoveryPasswordState.step === 3 && _jsx(TMPasswordManager, { operation: "recovery", validationItems: recoveryPasswordValidationItems }), _jsx(TMLayoutItem, { height: "fit-content", children: _jsxs("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '10px 0', gap: 10 }, children: [_jsx(TMButton, { caption: SDKUI_Localizator.Back, btnStyle: "icon", height: calcResponsiveSizes(deviceType, '30px', '40px', '40px'), fontSize: "0.8rem", onClick: backToLogin, icon: _jsx(IconArrowLeft, {}) }), _jsx(TMButton, { width: calcResponsiveSizes(deviceType, '150px', '150px', '300px'), height: calcResponsiveSizes(deviceType, '30px', '40px', '40px'), fontSize: "1rem", disabled: !selectedEndpoint, caption: SDKUI_Localizator.Select, onClick: () => { setEndpoint(selectedEndpoint); backToLogin(); setSelectedEndPoint(undefined); }, showTooltip: false }), _jsx(TMButton, { caption: 'Ping', btnStyle: "icon", height: calcResponsiveSizes(deviceType, '30px', '40px', '40px'), fontSize: "0.8rem", disabled: !selectedEndpoint, onClick: () => pingAsync(selectedEndpoint), icon: _jsx(IconWifi, {}) })] }) })] }) }), togglePages.archive && _jsx(StyledContainer, { children: _jsxs(TMLayoutContainer, { alignItems: "center", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "max-content", children: _jsx(StyledHeaderText, { children: SDKUI_Localizator.ArchiveID }) }), _jsx(TMLayoutItem, { height: "fit-content", maxHeight: "70%", children: _jsx("div", { style: { height: '100%', padding: `0px ${calcResponsiveSizes(deviceType, '40px', '40px', '10px')}` }, children: _jsx(TMCard, { showBorder: false, children: _jsxs(DataGrid, { height: '100%', dataSource: archives, allowColumnResizing: true, columnResizingMode: "widget", columnAutoWidth: true, allowColumnReordering: true, keyExpr: "id", showBorders: true, showColumnLines: SDKUI_Globals.dataGridShowColumnLines, showRowLines: SDKUI_Globals.dataGridShowRowLines, onSelectionChanged: (e) => setSelectedArchive(e.selectedRowsData[0]), onRowDblClick: () => { setArchive(selectedArchive); backToLogin(); setSelectedArchive(undefined); }, children: [_jsx(Selection, { mode: "single", showCheckBoxesMode: "onClick", selectAllMode: 'allPages' }), _jsx(Column, { dataField: "id", caption: 'ID', allowSorting: false }), _jsx(Column, { dataField: "description", caption: SDKUI_Localizator.Description, allowSorting: false }), _jsx(Column, { dataField: "isDefault", caption: 'Default', dataType: "boolean", allowSorting: false })] }) }) }) }), recoveryPasswordState.step === 3 && _jsx(TMPasswordManager, { operation: "recovery", validationItems: recoveryPasswordValidationItems }), _jsx(TMLayoutItem, { height: "fit-content", children: _jsxs("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '20px 0', gap: 10 }, children: [_jsx(TMButton, { caption: SDKUI_Localizator.Back, btnStyle: "icon", height: calcResponsiveSizes(deviceType, '30px', '40px', '40px'), fontSize: "0.8rem", onClick: backToLogin, icon: _jsx(IconArrowLeft, {}) }), _jsx(TMButton, { width: calcResponsiveSizes(deviceType, '150px', '150px', '300px'), height: calcResponsiveSizes(deviceType, '30px', '40px', '40px'), fontSize: "1rem", disabled: !selectedArchive, caption: SDKUI_Localizator.Select, onClick: () => { setArchive(selectedArchive); backToLogin(); setSelectedArchive(undefined); }, showTooltip: false })] }) })] }) }), (isLoginPage()) &&
|
|
774
|
+
_jsx(StyledContainer, { children: _jsxs(TMLayoutContainer, { alignItems: "center", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "max-content", children: _jsx(StyledHeaderText, { children: "Login" }) }), _jsx(TMLayoutItem, { children: _jsx("div", { style: { padding: `0px ${calcResponsiveSizes(deviceType, '40px', '40px', '10px')}` }, children: _jsx(TMCard, { showBorder: false, children: _jsxs(TMLayoutContainer, { children: [_jsxs(TMLayoutItem, { children: [_jsx(TMSummary, { label: SDKUI_Localizator.Endpoint, icon: _jsx(IconAccessPoint, {}), showClearButton: true, onClearClick: () => setEndpoint(undefined), iconEditButton: _jsx(IconSearch, {}), template: _jsx("div", { children: endpoint?.Description }), buttons: [{ text: "Ping", icon: _jsx(IconWifi, { color: "gray" }), onClick: () => pingAsync(endpoint) }], validationItems: loginValidationItems.filter(item => item.PropertyName === 'endpoint'), onEditorClick: showEndpoints }), archives && archives.length > 0 ?
|
|
774
775
|
_jsx(TMSummary, { label: SDKUI_Localizator.ArchiveID, onClearClick: () => setArchive(undefined), iconEditButton: _jsx(IconSearch, {}), icon: _jsx(IconArchive, {}), template: _jsx("div", { children: archive ? archive.description : null }), validationItems: loginValidationItems.filter(item => item.PropertyName === 'archive'), onEditorClick: showArchives }) :
|
|
775
776
|
_jsx(TMTextBox, { label: SDKUI_Localizator.ArchiveID, icon: _jsx(IconArchive, {}), onValueChanged: (e) => setArchiveID(e.target.value), value: archiveID, validationItems: loginValidationItems.filter(item => item.PropertyName === 'archive') }), _jsx(TMDropDown, { dataSource: [{ display: 'TopMedia', value: AuthenticationModes.TopMedia }, { display: SDKUI_Localizator.AuthMode_OnBehalfOf, value: AuthenticationModes.TopMediaOnBehalfOf }, { display: 'MSAzure', value: AuthenticationModes.MSAzure }, { display: SDKUI_Localizator.AuthMode_WindowsViaTopMedia, value: AuthenticationModes.WindowsThroughTopMedia }], label: SDKUI_Localizator.AuthMode, value: authMode, icon: _jsx(IconLogin, {}), onValueChanged: (e) => { setAuthMode(e.target.value); }, validationItems: loginValidationItems.filter(item => item.PropertyName === 'authMode') })] }), (authMode === AuthenticationModes.TopMedia || authMode === AuthenticationModes.WindowsThroughTopMedia) && _jsx(TMLayoutItem, { children: authMode === AuthenticationModes.WindowsThroughTopMedia ?
|
|
776
777
|
_jsxs(_Fragment, { children: [_jsx(TMTextBox, { label: SDKUI_Localizator.Domain, icon: _jsx(IconWeb, {}), value: domainAlternative, onValueChanged: (e) => setDomainArternative(e.target.value), validationItems: loginValidationItems.filter(item => item.PropertyName === 'domain_alt') }), _jsx(TMTextBox, { validationItems: loginValidationItems.filter(item => item.PropertyName === 'username'), label: SDKUI_Localizator.UserName, icon: _jsx(IconUser, {}), value: username, onValueChanged: (e) => setUsername(e.target.value) }), _jsx(TMTextBox, { validationItems: loginValidationItems.filter(item => item.PropertyName === 'password'), type: "password", label: SDKUI_Localizator.Password, icon: _jsx(IconPassword, {}), value: password, onValueChanged: (e) => setPassword(e.target.value) })] })
|
|
777
778
|
:
|
|
778
779
|
_jsxs(_Fragment, { children: [_jsx(TMTextBox, { validationItems: loginValidationItems.filter(item => item.PropertyName === 'username'), label: SDKUI_Localizator.UserName, icon: _jsx(IconUser, {}), value: username, onValueChanged: (e) => setUsername(e.target.value) }), _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { validationItems: loginValidationItems.filter(item => item.PropertyName === 'password'), type: "password", label: SDKUI_Localizator.Password, icon: _jsx(IconPassword, {}), value: password, onValueChanged: (e) => setPassword(e.target.value) }) })] }) }), authMode === AuthenticationModes.TopMediaOnBehalfOf && _jsx(TMLayoutItem, { children: _jsxs(TMLayoutContainer, { direction: "horizontal", children: [_jsx(TMLayoutItem, { children: _jsxs(TMLayoutContainer, { children: [_jsx(TMLayoutItem, { children: _jsx(TMTextBox, { validationItems: loginValidationItems.filter(item => item.PropertyName === 'username'), label: SDKUI_Localizator.UserName, icon: _jsx(IconUser, {}), value: username, onValueChanged: (e) => setUsername(e.target.value) }) }), _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { validationItems: loginValidationItems.filter(item => item.PropertyName === 'password'), type: "password", label: SDKUI_Localizator.Password, icon: _jsx(IconPassword, {}), value: password, onValueChanged: (e) => setPassword(e.target.value) }) })] }) }), _jsx(TMLayoutItem, { children: _jsxs(TMLayoutContainer, { children: [_jsx(TMLayoutItem, { children: _jsx(TMTextBox, { label: SDKUI_Localizator.Domain, icon: _jsx(IconWeb, {}), value: domain, onValueChanged: (e) => setDomain(e.target.value), validationItems: loginValidationItems.filter(item => item.PropertyName === 'domain') }) }), _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { label: SDKUI_Localizator.UserName, icon: _jsx(IconUser, {}), value: onBehalfUsername, onValueChanged: (e) => setOnBeHalfUsername(e.target.value), validationItems: loginValidationItems.filter(item => item.PropertyName === 'onBeHalfUsername') }) })] }) })] }) }), authMode !== AuthenticationModes.TopMediaOnBehalfOf ? _jsx(TMLayoutItem, { children: _jsx(TMDropDown, { dataSource: cultureIDsDataSource, icon: _jsx(IconLanguage, {}), label: SDKUI_Localizator.CultureID, onValueChanged: (e) => props.onChangeLanguage && props.onChangeLanguage(e.target.value), value: props.cultureID, validationItems: loginValidationItems.filter(item => item.PropertyName === 'cultureId') }) }) :
|
|
779
|
-
_jsxs(TMLayoutContainer, { direction: "horizontal", children: [_jsx(TMLayoutItem, { children: _jsx(TMDropDown, { dataSource: cultureIDsDataSource, icon: _jsx(IconLanguage, {}), label: SDKUI_Localizator.CultureID, onValueChanged: (e) => props.onChangeLanguage && props.onChangeLanguage(e.target.value), value: props.cultureID, validationItems: loginValidationItems.filter(item => item.PropertyName === 'cultureId') }) }), _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "password", label: SDKUI_Localizator.Password, icon: _jsx(IconPassword, {}), value: onBeHalfPassword, onValueChanged: (e) => setOnBeHalfPassword(e.target.value), validationItems: loginValidationItems.filter(item => item.PropertyName === 'onBeHalfPassword') }) })] })] }) }) }) }), authMode === AuthenticationModes.TopMedia && _jsxs(TMLayoutItem, { height: "fit-content", width: "fit-content", children: [_jsx("p", { onClick: () => isPasswordChangeEnable() && setTogglePages({ recovery: false, change: true, archive: false, endpoint: false }), tabIndex: isPasswordChangeEnable() ? 0 : undefined, onKeyDown: (e) => e.code === 'Space' && setTogglePages({ recovery: false, change: true, archive: false, endpoint: false }), style: { userSelect: 'none', cursor: isPasswordChangeEnable() ? 'pointer' : 'default', color: isPasswordChangeEnable() ? TMColors.primary : 'rgb(180,180,180)', textAlign: 'center', fontSize: '0.9rem' }, children: SDKUI_Localizator.ChangePassword }), _jsx("p", { tabIndex: isPasswordChangeEnable() ? 0 : undefined, onKeyDown: (e) => e.code === 'Space' && showRecoveryPassword(), onClick: () => isPasswordChangeEnable() && showRecoveryPassword(), style: { userSelect: 'none', marginTop: '10px', cursor: isPasswordChangeEnable() ? 'pointer' : 'default', color: isPasswordChangeEnable() ? TMColors.primary : 'rgb(180,180,180)', fontSize: '0.9rem' }, children: SDKUI_Localizator.ForgetPassword })] }), _jsx(TMLayoutItem, { height: "fit-content", children: _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '20px 0' }, children: _jsx(TMButton, { width: calcResponsiveSizes(
|
|
780
|
+
_jsxs(TMLayoutContainer, { direction: "horizontal", children: [_jsx(TMLayoutItem, { children: _jsx(TMDropDown, { dataSource: cultureIDsDataSource, icon: _jsx(IconLanguage, {}), label: SDKUI_Localizator.CultureID, onValueChanged: (e) => props.onChangeLanguage && props.onChangeLanguage(e.target.value), value: props.cultureID, validationItems: loginValidationItems.filter(item => item.PropertyName === 'cultureId') }) }), _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "password", label: SDKUI_Localizator.Password, icon: _jsx(IconPassword, {}), value: onBeHalfPassword, onValueChanged: (e) => setOnBeHalfPassword(e.target.value), validationItems: loginValidationItems.filter(item => item.PropertyName === 'onBeHalfPassword') }) })] })] }) }) }) }), authMode === AuthenticationModes.TopMedia && _jsxs(TMLayoutItem, { height: "fit-content", width: "fit-content", children: [_jsx("p", { onClick: () => isPasswordChangeEnable() && setTogglePages({ recovery: false, change: true, archive: false, endpoint: false }), tabIndex: isPasswordChangeEnable() ? 0 : undefined, onKeyDown: (e) => e.code === 'Space' && setTogglePages({ recovery: false, change: true, archive: false, endpoint: false }), style: { userSelect: 'none', cursor: isPasswordChangeEnable() ? 'pointer' : 'default', color: isPasswordChangeEnable() ? TMColors.primary : 'rgb(180,180,180)', textAlign: 'center', fontSize: '0.9rem' }, children: SDKUI_Localizator.ChangePassword }), _jsx("p", { tabIndex: isPasswordChangeEnable() ? 0 : undefined, onKeyDown: (e) => e.code === 'Space' && showRecoveryPassword(), onClick: () => isPasswordChangeEnable() && showRecoveryPassword(), style: { userSelect: 'none', marginTop: '10px', cursor: isPasswordChangeEnable() ? 'pointer' : 'default', color: isPasswordChangeEnable() ? TMColors.primary : 'rgb(180,180,180)', fontSize: '0.9rem' }, children: SDKUI_Localizator.ForgetPassword })] }), _jsx(TMLayoutItem, { height: "fit-content", children: _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '20px 0' }, children: _jsx(TMButton, { width: calcResponsiveSizes(deviceType, '150px', '150px', '250px'), height: calcResponsiveSizes(deviceType, '30px', '40px', '40px'), fontSize: "1.1rem", caption: "Login", disabled: loginValidationItems.length > 0, onClick: login, showTooltip: false }) }) })] }) })] })] }) }));
|
|
780
781
|
};
|
|
781
782
|
const TMPasswordManager = ({ validationItems = [], operation = 'change' }) => {
|
|
782
783
|
const passwordStrength = () => {
|
|
@@ -801,11 +802,10 @@ const TMPasswordManager = ({ validationItems = [], operation = 'change' }) => {
|
|
|
801
802
|
};
|
|
802
803
|
return (_jsxs(TMLayoutItem, { height: "60%", children: [_jsx("div", { style: { width: 'calc(100% - 70px)', height: '5px', backgroundColor: 'white', margin: '0px 0px 10px 45px', borderRadius: '2px', overflow: 'hidden' }, children: _jsx("div", { style: { width: passwordStrength().width, height: '100%', backgroundColor: passwordStrength().color, transition: 'ease 300ms' } }) }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', gap: 2, padding: '0 45px 10px 45px' }, children: [_jsxs(TMLayoutContainer, { alignItems: "center", direction: "horizontal", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "fit-content", children: _jsx("div", { style: { width: '7px', height: '7px', borderRadius: '10px', backgroundColor: validationItems.find(item => item.PropertyName === `${operation}Pass_length`) ? 'red' : 'green' }, children: " " }) }), _jsx(TMLayoutItem, { width: "max-content", height: "fit-content", children: _jsx("p", { style: { fontSize: '0.9rem', color: validationItems.find(item => item.PropertyName === `${operation}Pass_length`) ? 'red' : 'green' }, children: SDKUI_Localizator.PasswordLengthError }) })] }), _jsxs(TMLayoutContainer, { alignItems: "center", direction: "horizontal", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "fit-content", children: _jsx("div", { style: { width: '7px', height: '7px', borderRadius: '10px', backgroundColor: validationItems.find(item => item.PropertyName === `${operation}Pass_hasNotLower`) ? 'red' : 'green' }, children: " " }) }), _jsx(TMLayoutItem, { width: "max-content", height: "fit-content", children: _jsx("p", { style: { fontSize: '0.9rem', color: validationItems.find(item => item.PropertyName === `${operation}Pass_hasNotLower`) ? 'red' : 'green' }, children: SDKUI_Localizator.PasswordLowercaseError }) })] }), _jsxs(TMLayoutContainer, { alignItems: "center", direction: "horizontal", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "fit-content", children: _jsx("div", { style: { width: '7px', height: '7px', borderRadius: '10px', backgroundColor: validationItems.find(item => item.PropertyName === `${operation}Pass_hasNotUpper`) ? 'red' : 'green' }, children: " " }) }), _jsx(TMLayoutItem, { width: "max-content", height: "fit-content", children: _jsx("p", { style: { fontSize: '0.9rem', color: validationItems.find(item => item.PropertyName === `${operation}Pass_hasNotUpper`) ? 'red' : 'green' }, children: SDKUI_Localizator.PasswordUppercaseError }) })] }), _jsxs(TMLayoutContainer, { alignItems: "center", direction: "horizontal", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "fit-content", children: _jsx("div", { style: { width: '7px', height: '7px', borderRadius: '10px', backgroundColor: validationItems.find(item => item.PropertyName === `${operation}Pass_hasNotNumber`) ? 'red' : 'green' }, children: " " }) }), _jsx(TMLayoutItem, { width: "max-content", height: "fit-content", children: _jsx("p", { style: { fontSize: '0.9rem', color: validationItems.find(item => item.PropertyName === `${operation}Pass_hasNotNumber`) ? 'red' : 'green' }, children: SDKUI_Localizator.PasswordNumberError }) })] }), _jsxs(TMLayoutContainer, { alignItems: "center", direction: "horizontal", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "fit-content", children: _jsx("div", { style: { width: '7px', height: '7px', borderRadius: '10px', backgroundColor: validationItems.find(item => item.PropertyName === `${operation}Pass_hasNotSymbol`) ? 'red' : 'green' }, children: " " }) }), _jsx(TMLayoutItem, { width: "max-content", height: "fit-content", children: _jsxs("p", { style: { fontSize: '0.9rem', color: validationItems.find(item => item.PropertyName === `${operation}Pass_hasNotSymbol`) ? 'red' : 'green' }, children: [SDKUI_Localizator.PasswordSymbolError, " "] }) })] })] })] }));
|
|
803
804
|
};
|
|
804
|
-
export const TMChangePassword = ({ tmSession, username, onClose, enable, hasBack = true }) => {
|
|
805
|
+
export const TMChangePassword = ({ deviceType = DeviceType.DESKTOP, tmSession, username, onClose, enable, hasBack = true }) => {
|
|
805
806
|
const [changePasswordState, setChangePasswordState] = useState({ confermPassword: '', newPassword: '', oldPassword: '' });
|
|
806
807
|
const [changePasswordValidationItems, setChangePasswordValidationItems] = useState([]);
|
|
807
808
|
useEffect(() => { changePasswordValidator(); }, [changePasswordState.oldPassword, changePasswordState.newPassword, changePasswordState.confermPassword, username]);
|
|
808
|
-
const size = useWindowWidth();
|
|
809
809
|
const changePasswordValidator = () => {
|
|
810
810
|
let arr = [...changePasswordValidationItems];
|
|
811
811
|
let char_upperCase = new RegExp(/([A-Z])/g);
|
|
@@ -991,6 +991,6 @@ export const TMChangePassword = ({ tmSession, username, onClose, enable, hasBack
|
|
|
991
991
|
}
|
|
992
992
|
};
|
|
993
993
|
const back = () => { onClose && onClose(); setChangePasswordState({ confermPassword: '', newPassword: '', oldPassword: '' }); };
|
|
994
|
-
return (_jsx(StyledContainer, { children: _jsxs(TMLayoutContainer, { alignItems: "center", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "max-content", children: _jsx(StyledHeaderText, { children: SDKUI_Localizator.ChangePassword }) }), _jsx(TMLayoutItem, { children: _jsx("div", { style: { padding: `0px ${calcResponsiveSizes(
|
|
994
|
+
return (_jsx(StyledContainer, { children: _jsxs(TMLayoutContainer, { alignItems: "center", children: [_jsx(TMLayoutItem, { width: "fit-content", height: "max-content", children: _jsx(StyledHeaderText, { children: SDKUI_Localizator.ChangePassword }) }), _jsx(TMLayoutItem, { children: _jsx("div", { style: { padding: `0px ${calcResponsiveSizes(deviceType, '40px', '40px', '10px')}` }, children: _jsx(TMCard, { showBorder: false, children: _jsxs(TMLayoutContainer, { children: [_jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "password", label: SDKUI_Localizator.OldPassword, icon: _jsx(IconPassword, {}), onValueChanged: (e) => setChangePasswordState({ ...changePasswordState, oldPassword: e.target.value }), value: changePasswordState.oldPassword, validationItems: changePasswordValidationItems.filter(item => item.PropertyName === 'changePass_old') }) }), _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "password", label: SDKUI_Localizator.NewPassword, icon: _jsx(IconPassword, {}), onValueChanged: (e) => setChangePasswordState({ ...changePasswordState, newPassword: e.target.value }), value: changePasswordState.newPassword, validationItems: changePasswordValidationItems.filter(item => item.PropertyName === 'changePass_new' || item.PropertyName === 'changePass_equalUsername' || item.PropertyName === 'changePass_containUsername') }) }), _jsx(TMLayoutItem, { children: _jsx(TMTextBox, { type: "password", label: SDKUI_Localizator.ConfirmPassword, icon: _jsx(IconPassword, {}), onValueChanged: (e) => setChangePasswordState({ ...changePasswordState, confermPassword: e.target.value }), value: changePasswordState.confermPassword, validationItems: changePasswordValidationItems.filter(item => item.PropertyName === 'changePass_confirm' || item.PropertyName === 'changePass_notConfirmed') }) })] }) }) }) }), _jsx(TMPasswordManager, { operation: "change", validationItems: changePasswordValidationItems }), hasBack && _jsx(TMLayoutItem, { height: "fit-content", width: "fit-content", children: _jsx("p", { onClick: back, tabIndex: enable ? 0 : undefined, onKeyDown: (e) => e.code === 'Space' && back(), style: { userSelect: 'none', cursor: enable ? 'pointer' : 'default', color: enable ? TMColors.primary : 'rgb(180,180,180)', fontSize: '1rem' }, children: SDKUI_Localizator.Back }) }), _jsx(TMLayoutItem, { height: "fit-content", children: _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '20px 0' }, children: _jsx(TMButton, { width: calcResponsiveSizes(deviceType, '150px', '150px', '300px'), height: calcResponsiveSizes(deviceType, '30px', '40px', '40px'), fontSize: "1rem", caption: SDKUI_Localizator.Save, disabled: changePasswordValidationItems.length > 0, onClick: () => { changePasswordAsync(); }, showTooltip: false }) }) })] }) }));
|
|
995
995
|
};
|
|
996
996
|
export default TMLoginForm;
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ITMSaveFormBaseProps } from '../../ts/types';
|
|
2
|
+
import { FormModes, ITMSaveFormBaseProps } from '../../ts/types';
|
|
3
3
|
declare const TMSaveForm: React.FC<ITMSaveFormBaseProps>;
|
|
4
4
|
export default TMSaveForm;
|
|
5
|
+
export declare const TMSaveFormStandardToolbar: ({ btnStyle, formMode, hasNavigation, isModified, errorsCount, onNext, onPrev, canNext, canPrev, onSaveAsync, onUndo }: {
|
|
6
|
+
btnStyle: 'normal' | 'toolbar' | 'icon' | 'text';
|
|
7
|
+
formMode: FormModes;
|
|
8
|
+
hasNavigation: boolean;
|
|
9
|
+
isModified: boolean;
|
|
10
|
+
errorsCount: number;
|
|
11
|
+
onNext?: (() => void) | undefined;
|
|
12
|
+
onPrev?: (() => void) | undefined;
|
|
13
|
+
canNext?: boolean | undefined;
|
|
14
|
+
canPrev?: boolean | undefined;
|
|
15
|
+
onSaveAsync?: (() => Promise<void>) | undefined;
|
|
16
|
+
onUndo?: (() => void) | undefined;
|
|
17
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,8 +14,6 @@ import { DeviceType, useDeviceType } from '../base/TMDeviceProvider';
|
|
|
14
14
|
const TMSaveForm = ({ id, formMode = FormModes.Update, showToolbar = true, skipIsModifiedCheck = false, title, children, isModal, exception, customToolbarElements, hasNavigation, showBackButton, onClose, onSaveAsync, onNext, onPrev, canNext, canPrev, isModified, onShowList, validationItems = [], onUndo, onCancel, width, height }) => {
|
|
15
15
|
const [showList, setShowList] = useState(true);
|
|
16
16
|
const [showErrorGrid, setShowErrorGrid] = useState(false);
|
|
17
|
-
// let windowWidth = useWindowWidth()
|
|
18
|
-
// let isMobile: boolean = windowWidth <= MOBILE_WIDTH;
|
|
19
17
|
const deviceType = useDeviceType();
|
|
20
18
|
const doSaveAsync = async () => { try {
|
|
21
19
|
await onSaveAsync?.();
|
|
@@ -107,3 +105,54 @@ const TMSaveForm = ({ id, formMode = FormModes.Update, showToolbar = true, skipI
|
|
|
107
105
|
: renderSaveForm() }));
|
|
108
106
|
};
|
|
109
107
|
export default TMSaveForm;
|
|
108
|
+
export const TMSaveFormStandardToolbar = ({ btnStyle, formMode, hasNavigation, isModified, errorsCount, onNext, onPrev, canNext, canPrev, onSaveAsync, onUndo }) => {
|
|
109
|
+
const doSaveAsync = async () => { try {
|
|
110
|
+
await onSaveAsync?.();
|
|
111
|
+
}
|
|
112
|
+
catch (ex) {
|
|
113
|
+
TMExceptionBoxManager.show({ exception: ex });
|
|
114
|
+
} };
|
|
115
|
+
const doNext = () => {
|
|
116
|
+
if (!isModified) {
|
|
117
|
+
onNext?.();
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
TMMessageBoxManager.show({
|
|
121
|
+
message: SDKUI_Localizator.SaveQuestion, buttons: [ButtonNames.YES, ButtonNames.NO, ButtonNames.CANCEL],
|
|
122
|
+
onButtonClick: async (e) => {
|
|
123
|
+
try {
|
|
124
|
+
if (e == ButtonNames.CANCEL)
|
|
125
|
+
return;
|
|
126
|
+
if (e == ButtonNames.YES)
|
|
127
|
+
await onSaveAsync?.();
|
|
128
|
+
onNext?.();
|
|
129
|
+
}
|
|
130
|
+
catch (ex) {
|
|
131
|
+
TMExceptionBoxManager.show({ exception: ex });
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
const doPrev = () => {
|
|
137
|
+
if (!isModified) {
|
|
138
|
+
onPrev?.();
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
TMMessageBoxManager.show({
|
|
142
|
+
message: SDKUI_Localizator.SaveQuestion, buttons: [ButtonNames.YES, ButtonNames.NO, ButtonNames.CANCEL],
|
|
143
|
+
onButtonClick: async (e) => {
|
|
144
|
+
try {
|
|
145
|
+
if (e == ButtonNames.CANCEL)
|
|
146
|
+
return;
|
|
147
|
+
if (e == ButtonNames.YES)
|
|
148
|
+
await onSaveAsync?.();
|
|
149
|
+
onPrev?.();
|
|
150
|
+
}
|
|
151
|
+
catch (ex) {
|
|
152
|
+
TMExceptionBoxManager.show({ exception: ex });
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: btnStyle, caption: SDKUI_Localizator.Save, icon: _jsx(IconSave, { color: btnStyle === 'icon' ? 'white' : undefined }), keyGesture: "alt+s", backgroundColor: errorsCount > 0 ? TMColors.error : isModified ? TMColors.success : TMColors.disabled, onClick: doSaveAsync, color: "success", disabled: !(isModified && errorsCount <= 0) }), hasNavigation && _jsx(TMButton, { btnStyle: btnStyle, caption: SDKUI_Localizator.Previous, icon: _jsx(IconArrowUp, { color: btnStyle === 'icon' ? 'white' : undefined }), disabled: !canPrev || isModified || formMode == FormModes.Create || formMode == FormModes.Duplicate, onClick: doPrev }), hasNavigation && _jsx(TMButton, { btnStyle: btnStyle, caption: SDKUI_Localizator.Next, icon: _jsx(IconArrowDown, { color: btnStyle === 'icon' ? 'white' : undefined }), disabled: !canNext || isModified || formMode == FormModes.Create || formMode == FormModes.Duplicate, onClick: doNext }), _jsx(TMButton, { btnStyle: btnStyle, caption: SDKUI_Localizator.Undo, icon: _jsx(IconUndo, { color: btnStyle === 'icon' ? 'white' : undefined }), keyGesture: "alt+z", color: "tertiary", disabled: !isModified, onClick: onUndo })] }));
|
|
158
|
+
};
|
|
@@ -17,8 +17,6 @@ const TMToolbarButton = ({ showTooltip = true, color = 'primary', icon, caption
|
|
|
17
17
|
return (_jsx(TMButton, { keyGesture: keyGesture, color: color, disabled: disabled, caption: caption, onClick: () => { onClick && onClick(); }, icon: icon, showTooltip: showTooltip, btnStyle: 'toolbar' }));
|
|
18
18
|
};
|
|
19
19
|
const TMPage = ({ id, objClass = ObjectClasses.None, objType, listInsteadOfContent, detailInsteadOfContent, routePage, customButtons, customColumns, searchText, detailForm, detailTitlePathKeys, deps, abortSignal, onProgressChanged, onSelectionChanged, onCountersChanged }) => {
|
|
20
|
-
// let width = useWindowWidth();
|
|
21
|
-
// let isMobile: boolean = width <= MOBILE_WIDTH;
|
|
22
20
|
const deviceType = useDeviceType();
|
|
23
21
|
let gridInstance;
|
|
24
22
|
const [showId, setShowId] = useState(false);
|
|
@@ -222,7 +222,6 @@ const TMQueryResultForm = ({ onUpdate, isModal, onClose, context = SearchResultC
|
|
|
222
222
|
_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' : '')
|
|
223
223
|
];
|
|
224
224
|
const [toolbar, setToolbar] = useState(toolbarElements);
|
|
225
|
-
// let width = useWindowWidth()
|
|
226
225
|
const deviceType = useDeviceType();
|
|
227
226
|
let isMobile = deviceType === DeviceType.MOBILE;
|
|
228
227
|
useEffect(() => { if (isMobile) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect, useRef } from 'react';
|
|
3
3
|
import six from '../../assets/loading.png';
|
|
4
|
-
import { IconBxInfo, IconCloseOutline, IconLogout, IconPassword, IconSearch, IconSettings, IconUserProfile,
|
|
4
|
+
import { IconBxInfo, IconCloseOutline, IconLogout, IconPassword, IconSearch, IconSettings, IconUserProfile, SDKUI_Localizator } from '../../helper';
|
|
5
5
|
import styled from 'styled-components';
|
|
6
6
|
import { SDK_Globals, AuthenticationModes } from '@topconsultnpm/sdk-ts-beta';
|
|
7
7
|
import { FontSize, TMColors } from '../../utils/theme';
|
|
@@ -35,7 +35,6 @@ const StyledChaBotBtnWrapper = styled.div ` position: relative; cursor: pointer;
|
|
|
35
35
|
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; `;
|
|
36
36
|
const StyledToppyImage = styled.div ` display: flex; align-items: center; justify-content: center; width: 25px; height: 25px; border-radius: 50px; overflow: hidden; background-color: white; `;
|
|
37
37
|
export const TMSearchBar = ({ searchValue, onSearchValueChanged, maxWidth, marginLeft }) => {
|
|
38
|
-
// const size = useWindowWidth()
|
|
39
38
|
const deviceType = useDeviceType();
|
|
40
39
|
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 } })] }));
|
|
41
40
|
};
|
|
@@ -50,8 +49,8 @@ const TMHeader = ({ showSearchBar = true, clearSearchJobValue, clearSearchQEValu
|
|
|
50
49
|
const [isChatbot, setIsChatbot] = useState(false);
|
|
51
50
|
const menuRef = useRef(null);
|
|
52
51
|
const userIcon = useRef(null);
|
|
53
|
-
|
|
54
|
-
let isMobile =
|
|
52
|
+
const deviceType = useDeviceType();
|
|
53
|
+
let isMobile = deviceType == DeviceType.MOBILE;
|
|
55
54
|
useEffect(() => { clearSearchJobValue && setSearchJobsValue(''); }, [clearSearchJobValue]);
|
|
56
55
|
useEffect(() => { clearSearchQEValue && setSearchQEValue(''); }, [clearSearchQEValue]);
|
|
57
56
|
useEffect(() => {
|
package/lib/helper/helpers.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Colors as ColorsType } from "../components/base/TMEditorBase";
|
|
2
|
+
import { DeviceType } from "../components";
|
|
2
3
|
import { AppModules, DataColumnDescriptor, ITopMediaSession, QueryDescriptor, SearchResultDescriptor } from "@topconsultnpm/sdk-ts-beta";
|
|
3
4
|
import { FormModes } from "../ts";
|
|
4
5
|
declare const TABLET_WIDTH = 1024;
|
|
5
6
|
declare const MOBILE_WIDTH = 640;
|
|
6
|
-
declare const calcResponsiveDirection: (
|
|
7
|
+
declare const calcResponsiveDirection: (deviceType: DeviceType, desktopDir: 'horizontal' | 'vertical', tabletDir: 'horizontal' | 'vertical', mobileDir: 'horizontal' | 'vertical') => 'horizontal' | 'vertical';
|
|
7
8
|
declare const openApps: (appModule: AppModules, tmSession: ITopMediaSession, appRoutes?: any[]) => Promise<void>;
|
|
8
9
|
export declare const setSDK_GlobalsInfoAsync: (tms: ITopMediaSession | undefined) => Promise<ITopMediaSession>;
|
|
9
|
-
declare const calcResponsiveSizes: (
|
|
10
|
+
declare const calcResponsiveSizes: (deviceType: DeviceType | undefined, desktopSize: string, tabletSize: string, mobileSize: string) => string;
|
|
10
11
|
declare const useWindowWidth: () => number;
|
|
11
12
|
declare const getColor: (color: ColorsType) => string;
|
|
12
13
|
declare const makeID: (length: number) => string;
|
package/lib/helper/helpers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useLayoutEffect, useState } from "react";
|
|
2
2
|
import { Colors } from "../utils/theme";
|
|
3
|
-
import { ButtonNames, TMExceptionBoxManager, TMMessageBoxManager, TMSpinner } from "../components";
|
|
3
|
+
import { ButtonNames, DeviceType, TMExceptionBoxManager, TMMessageBoxManager, TMSpinner } from "../components";
|
|
4
4
|
import { SDK_Globals, SystemMIDsAsNumber, TopMediaServer } from "@topconsultnpm/sdk-ts-beta";
|
|
5
5
|
import { Buffer } from 'buffer';
|
|
6
6
|
import { FormModes } from "../ts";
|
|
@@ -8,10 +8,10 @@ import { SDKUI_Localizator } from "./SDKUI_Localizator";
|
|
|
8
8
|
//#region Responsive Helpers
|
|
9
9
|
const TABLET_WIDTH = 1024;
|
|
10
10
|
const MOBILE_WIDTH = 640;
|
|
11
|
-
const calcResponsiveDirection = (
|
|
12
|
-
if (
|
|
11
|
+
const calcResponsiveDirection = (deviceType, desktopDir, tabletDir, mobileDir) => {
|
|
12
|
+
if (deviceType === DeviceType.DESKTOP)
|
|
13
13
|
return desktopDir;
|
|
14
|
-
if (
|
|
14
|
+
if (deviceType === DeviceType.TABLET)
|
|
15
15
|
return tabletDir;
|
|
16
16
|
return mobileDir;
|
|
17
17
|
};
|
|
@@ -51,10 +51,10 @@ export const setSDK_GlobalsInfoAsync = async (tms) => {
|
|
|
51
51
|
}
|
|
52
52
|
return tmSessionNew;
|
|
53
53
|
};
|
|
54
|
-
const calcResponsiveSizes = (
|
|
55
|
-
if (
|
|
54
|
+
const calcResponsiveSizes = (deviceType, desktopSize, tabletSize, mobileSize) => {
|
|
55
|
+
if (deviceType === DeviceType.DESKTOP)
|
|
56
56
|
return desktopSize;
|
|
57
|
-
if (
|
|
57
|
+
if (deviceType === DeviceType.TABLET)
|
|
58
58
|
return tabletSize;
|
|
59
59
|
return mobileSize;
|
|
60
60
|
};
|