@topconsultnpm/sdkui-react-beta 6.11.57 → 6.11.59

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.
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { ITopMediaSession } from '@topconsultnpm/sdk-ts-beta';
3
3
  interface ChangePasswordProps {
4
4
  tmSession: ITopMediaSession;
5
+ hasBack?: boolean;
5
6
  onClose?: () => void;
6
7
  }
7
8
  declare const ChangePassword: React.FC<ChangePasswordProps>;
@@ -5,7 +5,7 @@ import ChangePasswordInputs from './ChangePasswordInputs';
5
5
  import { ChangePswDescriptor } from '@topconsultnpm/sdk-ts-beta';
6
6
  import { IconArrowLeft, SDKUI_Localizator } from '../../../helper';
7
7
  import TMButton from '../../base/TMButton';
8
- const ChangePassword = ({ onClose, tmSession }) => {
8
+ const ChangePassword = ({ onClose, tmSession, hasBack = true }) => {
9
9
  const [oldPassword, setOldPassword] = useState('');
10
10
  const cpd = useMemo(() => {
11
11
  let descriptor = new ChangePswDescriptor();
@@ -15,7 +15,7 @@ const ChangePassword = ({ onClose, tmSession }) => {
15
15
  descriptor.oldPassword = oldPassword;
16
16
  return descriptor;
17
17
  }, [tmSession, oldPassword]);
18
- return (_jsxs(Container, { children: [_jsx(ChangePasswordInputs, { tmSession: tmSession, cpd: cpd, changePassword: true, oldPassword: oldPassword, onOldPasswordChanged: (value) => setOldPassword(value), onClose: onClose }), _jsx(BackButtonWrapper, { children: _jsx(TMButton, { onClick: onClose, btnStyle: "icon", icon: _jsx(IconArrowLeft, { fontSize: 20 }), caption: SDKUI_Localizator.Back }) })] }));
18
+ return (_jsxs(Container, { children: [_jsx(ChangePasswordInputs, { tmSession: tmSession, cpd: cpd, changePassword: true, oldPassword: oldPassword, onOldPasswordChanged: (value) => setOldPassword(value), onClose: onClose }), hasBack && _jsx(BackButtonWrapper, { children: _jsx(TMButton, { onClick: onClose, btnStyle: "icon", icon: _jsx(IconArrowLeft, { fontSize: 20 }), caption: SDKUI_Localizator.Back }) })] }));
19
19
  };
20
20
  export default ChangePassword;
21
21
  const Container = styled.div ` width: 100%; background-color: white; position: absolute; top: 0; left: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 10px 65px; `;
@@ -11,6 +11,7 @@ import { TMColors, Colors } from '../../../utils/theme';
11
11
  import TMButton from '../../base/TMButton';
12
12
  import { TMMessageBoxManager, ButtonNames, TMExceptionBoxManager } from '../../base/TMPopUp';
13
13
  import TMTooltip from '../../base/TMTooltip';
14
+ import { LOGINLocalizator } from './LOGINLocalizator';
14
15
  const LOCAL_STORAGE_KEY = 'LOGIN_HISTORY';
15
16
  const RapidAccessLogin = ({ isMobile = false, onClose, onSelect }) => {
16
17
  let localRA = LocalStorageService.getItem(LOCAL_STORAGE_KEY);
@@ -168,7 +169,7 @@ const RapidAccessLogin = ({ isMobile = false, onClose, onSelect }) => {
168
169
  }, () => alert(SDKUI_Localizator.ErrorParsingFileContent));
169
170
  });
170
171
  };
171
- return (_jsxs(Wrapper, { children: [_jsx(BackButtonWrapper, { children: _jsx(TMButton, { onClick: onClose, btnStyle: "icon", icon: _jsx(IconArrowLeft, { fontSize: 20 }), caption: SDKUI_Localizator.Back }) }), _jsxs(ContentWrapper, { children: [_jsxs(ContentHeader, { children: [_jsx("h3", { style: { width: 'max-content' }, children: "Accessi Rapidi" }), _jsx("div", { style: { width: '50%' }, children: _jsx(TextBox, { value: searchValue, onValueChanged: (value) => setSearchValue(value), type: 'text', placeHolder: 'Cerca...', additionalIcons: additionalClearBtn }) })] }), _jsx(Divider, {}), _jsx(List, { children: searchedRapidAccesses.map((rapidAccess, index) => (_jsx(RapidAccessItem, { index: index, onRemove: remove, onSelect: select, onDefault: setDefault, onChangeName: changeName, rapidAccess: rapidAccess, isMobile: isMobile, onChangeColor: setColor, onChangeIcon: setIcon }, index * 2))) })] }), _jsxs(ToolbarWrapper, { children: [_jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconImport, {}), caption: SDKUI_Localizator.Import, color: 'tertiary', onClick: onImportCallback }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconExport, {}), caption: SDKUI_Localizator.Export, color: 'primary', onClick: onExportCallback })] })] }));
172
+ return (_jsxs(Wrapper, { children: [_jsx(BackButtonWrapper, { children: _jsx(TMButton, { onClick: onClose, btnStyle: "icon", icon: _jsx(IconArrowLeft, { fontSize: 20 }), caption: SDKUI_Localizator.Back }) }), _jsxs(ContentWrapper, { children: [_jsxs(ContentHeader, { children: [_jsx("h3", { style: { width: 'max-content' }, children: LOGINLocalizator.QuickAccess }), _jsx("div", { style: { width: '50%' }, children: _jsx(TextBox, { value: searchValue, onValueChanged: (value) => setSearchValue(value), type: 'text', placeHolder: 'Cerca...', additionalIcons: additionalClearBtn }) })] }), _jsx(Divider, {}), _jsx(List, { children: searchedRapidAccesses.map((rapidAccess, index) => (_jsx(RapidAccessItem, { index: index, onRemove: remove, onSelect: select, onDefault: setDefault, onChangeName: changeName, rapidAccess: rapidAccess, isMobile: isMobile, onChangeColor: setColor, onChangeIcon: setIcon }, index * 2))) })] }), _jsxs(ToolbarWrapper, { children: [_jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconImport, {}), caption: SDKUI_Localizator.Import, color: 'tertiary', onClick: onImportCallback }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconExport, {}), caption: SDKUI_Localizator.Export, color: 'primary', onClick: onExportCallback })] })] }));
172
173
  };
173
174
  export default RapidAccessLogin;
174
175
  const RapidAccessItem = ({ rapidAccess, isMobile = false, onRemove, onSelect, onDefault, onChangeName, onChangeColor, onChangeIcon, index = 0 }) => {
@@ -532,7 +532,7 @@ 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: [!isMobile && _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: "Surfer" })] })] })] }), _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 &&
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: [!isMobile && _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
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 &&
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 &&
@@ -46,6 +46,7 @@ export { default as TMSidebar } from "./sidebar/TMSidebar";
46
46
  export { default as TMSidebarItem } from "./sidebar/TMSidebarItem";
47
47
  export { default as TMSplitterLayout } from "./splitter/TMSplitterLayout";
48
48
  export { default as TMLoginForm } from "./forms/Login/TMLoginForm";
49
+ export { default as TMChangePassword } from "./forms/Login/ChangePassword";
49
50
  export { default as TMSaveForm } from "./forms/TMSaveForm";
50
51
  export { default as TMApplyForm } from "./forms/TMApplyForm";
51
52
  export { default as TMChooserForm } from "./forms/TMChooserForm";
@@ -54,6 +54,7 @@ export { default as TMSidebarItem } from "./sidebar/TMSidebarItem";
54
54
  export { default as TMSplitterLayout } from "./splitter/TMSplitterLayout";
55
55
  //form
56
56
  export { default as TMLoginForm } from "./forms/Login/TMLoginForm";
57
+ export { default as TMChangePassword } from "./forms/Login/ChangePassword";
57
58
  export { default as TMSaveForm } from "./forms/TMSaveForm";
58
59
  export { default as TMApplyForm } from "./forms/TMApplyForm";
59
60
  export { default as TMChooserForm } from "./forms/TMChooserForm";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.11.57",
3
+ "version": "6.11.59",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",