@topconsultnpm/sdkui-react-beta 6.11.62 → 6.11.63
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.
|
@@ -277,9 +277,9 @@ const TMLoginForm = (props) => {
|
|
|
277
277
|
let currentHeight = window.innerHeight;
|
|
278
278
|
if (!currentHeight)
|
|
279
279
|
return WindowHeight.LARGE;
|
|
280
|
-
if (currentHeight >
|
|
280
|
+
if (currentHeight > 730)
|
|
281
281
|
return WindowHeight.LARGE;
|
|
282
|
-
if (currentHeight <=
|
|
282
|
+
if (currentHeight <= 730 && currentHeight > 680)
|
|
283
283
|
return WindowHeight.MEDIUM;
|
|
284
284
|
return WindowHeight.SMALL;
|
|
285
285
|
}, []);
|
|
@@ -532,9 +532,9 @@ const TMLoginForm = (props) => {
|
|
|
532
532
|
const showVersionPopup = () => {
|
|
533
533
|
TMMessageBoxManager.show({ buttons: [ButtonNames.OK], title: `About. ${SDK_Globals.appModule}`, message: _jsx(TMAboutApp, { app: true, skdui: true, sdk: true, websdk: false }) });
|
|
534
534
|
};
|
|
535
|
-
return (_jsxs(StyledWrapper, { children: [!isMobile && _jsxs(StyledVersionContainer, { children: [_jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.primary }, children: "\u25CF" }), SDK_Globals.appModule] }), _jsxs("p", { children: ["v.", SDK_Globals.appVersion] })] }), _jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.tertiary }, children: "\u25CF" }), "SDKUI"] }), _jsxs("p", { children: ["v.", SDK_Globals.sdkuiVersion] })] }), _jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.error }, children: "\u25CF" }), "SDK"] }), _jsxs("p", { children: ["v.", SDK_Globals.sdkVersion] })] })] }), _jsxs(StyledLoginContainer, { "$isMobile": isMobile, children: [_jsxs(StyledLeftSection, { "$isMobile": isMobile, children: [isMobile && _jsxs(StyledTopBar, { children: [_jsx(StyledTitle, { children: SDKUI_Localizator.WelcomeTo.replaceParams('') + ' ' + SDK_Globals.appModule }), _jsx(StyledMobileVersionIcon, { onClick: showVersionPopup, children: _jsx(IconInfo, { fontSize: 20, color: TMColors.primary }) })] }), _jsxs(StyledOverlay, { "$isMobile": isMobile, children: [" ", _jsx("img", { src: showDefaultLogo ? '/logo-default.svg' : '/logo-custom.svg', onError: () => setShowDefaultLogo(true), alt: "Logo", width: isMobile ? 110 : 180 }), " "] }), (windowHeight === WindowHeight.LARGE || !isMobile) && _jsxs(StyledPoweredByContainer, { "$isMobile": isMobile, children: [" ", showDefaultLogo ? 'Powered by TopConsult' : _jsx("img", { src: "/logo-default.svg", alt: "Logo", width: isMobile ? 50 : 100 }), " "] })] }), _jsxs(StyledRightSection, { "$isMobile": isMobile, children: [
|
|
535
|
+
return (_jsxs(StyledWrapper, { children: [!isMobile && _jsxs(StyledVersionContainer, { children: [_jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.primary }, children: "\u25CF" }), SDK_Globals.appModule] }), _jsxs("p", { children: ["v.", SDK_Globals.appVersion] })] }), _jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.tertiary }, children: "\u25CF" }), "SDKUI"] }), _jsxs("p", { children: ["v.", SDK_Globals.sdkuiVersion] })] }), _jsxs(StyledVersion, { children: [_jsxs(StyledVersionName, { children: [_jsx("span", { style: { color: TMColors.error }, children: "\u25CF" }), "SDK"] }), _jsxs("p", { children: ["v.", SDK_Globals.sdkVersion] })] })] }), _jsxs(StyledLoginContainer, { "$isMobile": isMobile, children: [_jsxs(StyledLeftSection, { "$isMobile": isMobile, children: [isMobile && _jsxs(StyledTopBar, { children: [_jsx(StyledTitle, { children: SDKUI_Localizator.WelcomeTo.replaceParams('') + ' ' + SDK_Globals.appModule }), _jsx(StyledMobileVersionIcon, { onClick: showVersionPopup, children: _jsx(IconInfo, { fontSize: 20, color: TMColors.primary }) })] }), _jsxs(StyledOverlay, { "$isMobile": isMobile, children: [" ", _jsx("img", { src: showDefaultLogo ? '/logo-default.svg' : '/logo-custom.svg', onError: () => setShowDefaultLogo(true), alt: "Logo", width: isMobile ? 110 : 180 }), " "] }), (windowHeight === WindowHeight.LARGE || !isMobile) && _jsxs(StyledPoweredByContainer, { "$isMobile": isMobile, children: [" ", showDefaultLogo ? 'Powered by TopConsult' : _jsx("img", { src: "/logo-default.svg", alt: "Logo", width: isMobile ? 50 : 100 }), " "] })] }), _jsxs(StyledRightSection, { "$isMobile": isMobile, children: [(((getDeviceType() === 'desktop' || isDesktop) && windowHeight !== WindowHeight.SMALL) || isTablet) && _jsxs(StyledLogoContainer, { "$isMobile": isMobile, children: [_jsx(StyledWelcomeText, { children: SDKUI_Localizator.WelcomeTo.replaceParams('') }), _jsxs(StyledLogo, { children: [_jsx("img", { src: six, alt: "six", width: 40 }), _jsxs(StyledLogoTextContainer, { children: [_jsx("div", { style: { fontWeight: 'lighter', color: 'black', fontSize: '0.9rem' }, children: "TopMedia" }), _jsx("div", { style: { fontSize: '1.3rem', color: TMColors.secondary, fontStyle: 'italic', fontWeight: 'bolder', textTransform: 'uppercase', letterSpacing: '6px' }, children: SDK_Globals.appModule })] })] })] }), _jsxs(StyledToolbarContainer, { children: [_jsx(StyledLanguageChooser, { onClick: () => setShowCultureIDs(true), children: _jsx(TMTooltip, { content: SDKUI_Localizator.CultureID, children: _jsx("img", { src: getCultureIDImg(), alt: "Lang", width: 25, height: 25 }) }) }), loginStep !== 3 && _jsx(TMButton, { btnStyle: "icon", onClick: () => setShowRapidAccess(true), icon: _jsx(IconFastAccess, { fontSize: 20 }), caption: LOGINLocalizator.QuickAccess }), showPasswordOperations && _jsx(TMButton, { disabled: disablePasswordOperations, btnStyle: "icon", onClick: () => setShowChangePassword(true), icon: _jsx(IconPasswordOutline, { fontSize: 19 }), caption: SDKUI_Localizator.ChangePassword })] }), _jsxs(StyledFormContainer, { "$isMobile": isMobile, "$windowHeight": windowHeight, children: [loginStep === 1 &&
|
|
536
536
|
_jsxs(StyledStepContainer, { children: [_jsx(Chooser, { isDropDown: isDesktop, dataSource: props.endpoints, value: 'Description', columns: accessPointChooserColumns, additionalIcons: accessPointAdditionalIcons, icon: _jsx(IconAccessPoint, {}), label: SDKUI_Localizator.Endpoint, onSelectionChanged: (ep) => { setEndpoint(ep); setDcmtArchive(undefined); }, validationItems: fieldValidations('endpoint'), selectedRow: endpoint ?? undefined }), _jsx(Chooser, { isDropDown: isDesktop, dataSource: dcmtArchives, value: 'description', columns: dcmtArchiveChooserColumns, icon: _jsx(IconArchiveDoc, {}), label: SDKUI_Localizator.ArchiveID, onSelectionChanged: (arch) => setDcmtArchive(arch), validationItems: fieldValidations('dcmtArchive'), disabled: !endpoint, selectedRow: dcmtArchive ?? undefined })] }), loginStep === 2 &&
|
|
537
|
-
_jsxs(StyledStepContainer, { style: { marginTop: '20px' }, children: [_jsxs(StyledSummaryContainer, { style: { position: 'absolute', top: getTopOffset(windowHeight, isMobile, isTablet), left: '50%', transform: 'translateX(-50%)', width: 'max-content' }, children: [_jsxs(StyledDescription, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.Endpoint, children: _jsx(IconAccessPoint, { color: TMColors.primary, fontSize: 16 }) }), _jsx("p", { children: endpoint?.Description })] }), _jsxs(StyledDescription, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.ArchiveID, children: _jsx(IconArchiveDoc, { color: TMColors.primary, fontSize: 16 }) }), _jsx("p", { children: dcmtArchive?.description })] })] }), _jsx(SelectBox, { value: authMode, options: authModeOptions, onValueChanged: (value) => setAuthMode(value), validationItems: fieldValidations('authenticationMode'), icon: _jsx(IconLogin, {}), label: SDKUI_Localizator.AuthMode }), _jsxs(StyledCredentialWrapper, { children: [authMode === AuthenticationModes.WindowsThroughTopMedia && _jsx(TextBox, { ref: authDomainRef, value: authDomain, onValueChanged: (e) => setAuthDomain(e), validationItems: fieldValidations('authDomain'), type: "text", icon: _jsx(IconWeb, {}), label: SDKUI_Localizator.Domain }), authMode !== AuthenticationModes.MSAzure && _jsx(CeredentialContainer, { isMobile: isMobile, ref: usernameRef, secondaryRef: passwordRef, usernameValidator: fieldValidations('username'), passwordValidator: fieldValidations('password'), authMode: authMode, username: username, password: password, onUsernameChanged: (un) => setUsername(un), onPasswordChanged: (ps) => setPassword(ps) }), authMode === AuthenticationModes.TopMediaOnBehalfOf &&
|
|
537
|
+
_jsxs(StyledStepContainer, { "$windowHeight": windowHeight, style: { marginTop: '20px' }, children: [_jsxs(StyledSummaryContainer, { style: { position: 'absolute', top: getTopOffset(windowHeight, isMobile, isTablet), left: '50%', transform: 'translateX(-50%)', width: 'max-content' }, children: [_jsxs(StyledDescription, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.Endpoint, children: _jsx(IconAccessPoint, { color: TMColors.primary, fontSize: 16 }) }), _jsx("p", { children: endpoint?.Description })] }), _jsxs(StyledDescription, { children: [_jsx(TMTooltip, { content: SDKUI_Localizator.ArchiveID, children: _jsx(IconArchiveDoc, { color: TMColors.primary, fontSize: 16 }) }), _jsx("p", { children: dcmtArchive?.description })] })] }), _jsx(SelectBox, { value: authMode, options: authModeOptions, onValueChanged: (value) => setAuthMode(value), validationItems: fieldValidations('authenticationMode'), icon: _jsx(IconLogin, {}), label: SDKUI_Localizator.AuthMode }), _jsxs(StyledCredentialWrapper, { children: [authMode === AuthenticationModes.WindowsThroughTopMedia && _jsx(TextBox, { ref: authDomainRef, value: authDomain, onValueChanged: (e) => setAuthDomain(e), validationItems: fieldValidations('authDomain'), type: "text", icon: _jsx(IconWeb, {}), label: SDKUI_Localizator.Domain }), authMode !== AuthenticationModes.MSAzure && _jsx(CeredentialContainer, { isMobile: isMobile, ref: usernameRef, secondaryRef: passwordRef, usernameValidator: fieldValidations('username'), passwordValidator: fieldValidations('password'), authMode: authMode, username: username, password: password, onUsernameChanged: (un) => setUsername(un), onPasswordChanged: (ps) => setPassword(ps) }), authMode === AuthenticationModes.TopMediaOnBehalfOf &&
|
|
538
538
|
_jsxs(StyledCredentialWrapper, { children: [_jsx(TextBox, { value: authDomain, ref: authDomainRef, onValueChanged: (e) => setAuthDomain(e), validationItems: fieldValidations('authDomain'), type: "text", icon: _jsx(IconWeb, {}), label: SDKUI_Localizator.Domain }), _jsx(CeredentialContainer, { isMobile: isMobile, ref: usernameOnBehalfOfRef, secondaryRef: passwordOnBehalfOfRRef, usernameValidator: fieldValidations('usernameOnBehalfOf'), passwordValidator: fieldValidations('passwordOnBehalfOf'), authMode: AuthenticationModes.TopMediaOnBehalfOf, username: usernameOnBehalf, password: passwordOnBehalf, onUsernameChanged: (un) => setUsernameOnBehalf(un), onPasswordChanged: (ps) => setPasswordOnBehalf(ps) })] })] }), authMode !== AuthenticationModes.TopMediaWithMFA &&
|
|
539
539
|
_jsx(RapidAccessContainer, { isSaveEnable: saveLoginEnable, name: saveLoginName, nameValidationItems: fieldValidations('rapidAccessName'), onEnableSaveChange: () => setSaveLoginEnable(!saveLoginEnable), onNameChange: (name) => setSaveLoginName(name) })] }), loginStep === 3 &&
|
|
540
540
|
_jsxs(StyledStepThreeContainer, { "$isMobile": isMobile, children: [_jsx(OTPReader, { isMobile: isMobile, digits: otpCode, onChange: handleDigitChange, onFullChange: handleFullChange, text: _jsxs("div", { children: [" ", LOGINLocalizator.EnterOtpInstructions, " "] }), header: '', additionalButtons: [
|
|
@@ -564,23 +564,23 @@ const CeredentialContainer = forwardRef(({ isMobile = false, authMode = Authenti
|
|
|
564
564
|
const RapidAccessContainer = ({ isSaveEnable, name, nameValidationItems, onEnableSaveChange, onNameChange }) => {
|
|
565
565
|
return (_jsxs(StyledRapidLoginSave, { children: [_jsx(TMCheckBox, { label: LOGINLocalizator.CreateNewQuickAccess, onValueChanged: () => onEnableSaveChange(), value: isSaveEnable, labelColor: "#313131" }), isSaveEnable && _jsx(TextBox, { validationItems: nameValidationItems, disabled: !isSaveEnable, type: "text", value: name, onValueChanged: (value) => onNameChange(value), placeHolder: "Es: Admin risorse umane" })] }));
|
|
566
566
|
};
|
|
567
|
+
const getDeviceType = () => {
|
|
568
|
+
const ua = navigator.userAgent;
|
|
569
|
+
const isTouch = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
|
570
|
+
if (/Mobi|Android/i.test(ua))
|
|
571
|
+
return 'mobile';
|
|
572
|
+
if (/iPad|Tablet/i.test(ua) || (isTouch && /Macintosh/i.test(ua)))
|
|
573
|
+
return 'tablet';
|
|
574
|
+
return 'desktop';
|
|
575
|
+
};
|
|
567
576
|
const getTopOffset = (windowHeight, isMobile, isTablet) => {
|
|
568
|
-
const getDeviceType = () => {
|
|
569
|
-
const ua = navigator.userAgent;
|
|
570
|
-
const isTouch = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
|
571
|
-
if (/Mobi|Android/i.test(ua))
|
|
572
|
-
return 'mobile';
|
|
573
|
-
if (/iPad|Tablet/i.test(ua) || (isTouch && /Macintosh/i.test(ua)))
|
|
574
|
-
return 'tablet';
|
|
575
|
-
return 'desktop';
|
|
576
|
-
};
|
|
577
577
|
if (windowHeight === WindowHeight.LARGE) {
|
|
578
578
|
if (isMobile)
|
|
579
579
|
return '70px';
|
|
580
580
|
if (isTablet)
|
|
581
581
|
return '130px';
|
|
582
582
|
if (getDeviceType() !== 'desktop')
|
|
583
|
-
return '
|
|
583
|
+
return '120px';
|
|
584
584
|
return '180px';
|
|
585
585
|
}
|
|
586
586
|
if (windowHeight === WindowHeight.MEDIUM) {
|
|
@@ -632,7 +632,7 @@ const StyledSummaryContainer = styled.div ` display: flex; align-items: center;
|
|
|
632
632
|
const StyledCredentialContainer = styled.div ` width: '100%'; display: flex; flex-direction: ${props => getFlexDirection(props.$isMobile, props.$authMode)}; gap: 10px; `;
|
|
633
633
|
const StyledCredentialWrapper = styled.div ` width: 100%; display: flex; flex-direction: column; gap: 10px; `;
|
|
634
634
|
const StyledToolbarContainer = styled.div ` display: flex; gap: 10px; align-items: center; position: absolute; top: 20px; right: 20px; `;
|
|
635
|
-
const StyledStepContainer = styled.div ` width: 100%; display: flex; flex-direction: column; gap: 10px; overflow: auto;
|
|
635
|
+
const StyledStepContainer = styled.div ` width: 100%; display: flex; flex-direction: column; gap: 10px; overflow: auto; padding-right: ${props => props.$windowHeight === WindowHeight.LARGE ? '0' : '5px'};`;
|
|
636
636
|
const StyledStepThreeContainer = styled.div ` width: 100%; display: flex; flex-direction: column; gap: 10px; padding: 10px ${props => props.$isMobile ? '0' : '60px'}; `;
|
|
637
637
|
const StyledRapidAccessWrapper = styled.div `width:100%; margin-top:${props => props.$isMobile ? '0' : '30px'};`;
|
|
638
638
|
const StyledMenuItemContainer = styled.div `display:flex;align-items:center;gap:10px;padding:5px;`;
|