@digitaldefiance/express-suite-react-components 5.0.1 → 5.0.2
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/LICENSE +21 -0
- package/package.json +3 -4
- package/src/auth/AdminRoute.tsx +54 -0
- package/src/auth/Private.tsx +17 -0
- package/src/auth/PrivateRoute.tsx +28 -0
- package/src/auth/UnAuth.tsx +16 -0
- package/src/auth/UnAuthRoute.tsx +30 -0
- package/src/auth/{index.d.ts → index.ts} +2 -3
- package/src/components/ApiAccess.tsx +175 -0
- package/src/components/BackupCodeLoginForm.tsx +489 -0
- package/src/components/BackupCodesForm.tsx +287 -0
- package/src/components/CategoryMenu.tsx +155 -0
- package/src/components/ChangePasswordForm.tsx +273 -0
- package/src/components/ConfirmationDialog.tsx +48 -0
- package/src/components/CurrencyCodeSelector.tsx +60 -0
- package/src/components/CurrencyInput.tsx +80 -0
- package/src/components/DashboardPage.tsx +24 -0
- package/src/components/DropdownMenu.tsx +105 -0
- package/src/components/ExpirationSecondsSelector.tsx +60 -0
- package/src/components/FakeEmailAdminPanel.tsx +374 -0
- package/src/components/Flag.tsx +52 -0
- package/src/components/ForgotPasswordForm.tsx +174 -0
- package/src/components/LoginForm.tsx +468 -0
- package/src/components/LogoutPage.tsx +21 -0
- package/src/components/RegisterForm.tsx +1169 -0
- package/src/components/ResetPasswordForm.tsx +247 -0
- package/src/components/SideMenu.tsx +46 -0
- package/src/components/SideMenuListItem.tsx +75 -0
- package/src/components/T.tsx +24 -0
- package/src/components/TDiv.tsx +26 -0
- package/src/components/TImgAlt.tsx +28 -0
- package/src/components/TopMenu.tsx +252 -0
- package/src/components/TotpSetupForm.tsx +188 -0
- package/src/components/TotpVerificationForm.tsx +148 -0
- package/src/components/TranslatedTitle.tsx +31 -0
- package/src/components/UserLanguageSelector.tsx +45 -0
- package/src/components/UserMenu.tsx +15 -0
- package/src/components/UserSettingsForm.tsx +904 -0
- package/src/components/VerifyEmailPage.tsx +222 -0
- package/src/components/__tests__/RegisterForm.totp.spec.tsx +377 -0
- package/src/components/__tests__/TotpSetupForm.spec.tsx +258 -0
- package/src/components/__tests__/TotpVerificationForm.spec.tsx +259 -0
- package/src/components/__tests__/UserSettingsForm.totp.spec.tsx +396 -0
- package/src/components/{index.d.ts → index.ts} +1 -1
- package/src/contexts/AuthProvider.spec.tsx +1284 -0
- package/src/contexts/AuthProvider.tsx +977 -0
- package/src/contexts/I18nProvider.tsx +164 -0
- package/src/contexts/MenuContext.tsx +426 -0
- package/src/contexts/SuiteConfigProvider.tsx +93 -0
- package/src/contexts/ThemeProvider.tsx +67 -0
- package/src/contexts/{index.d.ts → index.ts} +0 -1
- package/src/hooks/{index.d.ts → index.ts} +0 -1
- package/src/hooks/useAuthenticatedApi.tsx +67 -0
- package/src/hooks/useBackupCodes.ts +105 -0
- package/src/hooks/useEmailVerification.ts +54 -0
- package/src/hooks/useExpiringValue.ts +78 -0
- package/src/hooks/useLocalStorage.ts +18 -0
- package/src/hooks/useUserSettings.ts +271 -0
- package/src/{index.d.ts → index.ts} +1 -1
- package/src/interfaces/IAppConfig.ts +7 -0
- package/src/interfaces/ICategoryConfig.ts +41 -0
- package/src/interfaces/IMenuConfig.ts +28 -0
- package/src/interfaces/IMenuOption.ts +79 -0
- package/src/interfaces/{index.d.ts → index.ts} +0 -1
- package/src/services/__mocks__/authService.ts +14 -0
- package/src/services/__tests__/authService.totp.property.spec.ts +360 -0
- package/src/services/__tests__/authService.totp.spec.ts +439 -0
- package/src/services/api.ts +13 -0
- package/src/services/authService.ts +692 -0
- package/src/services/authenticatedApi.ts +17 -0
- package/src/services/index.ts +3 -0
- package/src/types/MenuType.ts +15 -0
- package/src/types/expirationSeconds.ts +18 -0
- package/src/types/index.ts +1 -0
- package/src/types/translation.ts +20 -0
- package/src/wrappers/BackupCodeLoginWrapper.tsx +34 -0
- package/src/wrappers/BackupCodesWrapper.tsx +28 -0
- package/src/wrappers/ChangePasswordFormWrapper.tsx +34 -0
- package/src/wrappers/ForgotPasswordFormWrapper.tsx +45 -0
- package/src/wrappers/LoginFormWrapper.tsx +108 -0
- package/src/wrappers/LogoutPageWrapper.tsx +30 -0
- package/src/wrappers/RegisterFormWrapper.tsx +109 -0
- package/src/wrappers/ResetPasswordFormWrapper.tsx +57 -0
- package/src/wrappers/UserSettingsFormWrapper.tsx +140 -0
- package/src/wrappers/VerifyEmailPageWrapper.tsx +27 -0
- package/src/wrappers/__tests__/LoginFormWrapper.totp.spec.tsx +339 -0
- package/src/wrappers/{index.d.ts → index.tsx} +10 -1
- package/src/auth/AdminRoute.d.ts +0 -8
- package/src/auth/AdminRoute.d.ts.map +0 -1
- package/src/auth/AdminRoute.js +0 -28
- package/src/auth/Private.d.ts +0 -6
- package/src/auth/Private.d.ts.map +0 -1
- package/src/auth/Private.js +0 -14
- package/src/auth/PrivateRoute.d.ts +0 -8
- package/src/auth/PrivateRoute.d.ts.map +0 -1
- package/src/auth/PrivateRoute.js +0 -23
- package/src/auth/UnAuth.d.ts +0 -6
- package/src/auth/UnAuth.d.ts.map +0 -1
- package/src/auth/UnAuth.js +0 -14
- package/src/auth/UnAuthRoute.d.ts +0 -8
- package/src/auth/UnAuthRoute.d.ts.map +0 -1
- package/src/auth/UnAuthRoute.js +0 -22
- package/src/auth/index.d.ts.map +0 -1
- package/src/auth/index.js +0 -12
- package/src/components/ApiAccess.d.ts +0 -16
- package/src/components/ApiAccess.d.ts.map +0 -1
- package/src/components/ApiAccess.js +0 -77
- package/src/components/BackupCodeLoginForm.d.ts +0 -43
- package/src/components/BackupCodeLoginForm.d.ts.map +0 -1
- package/src/components/BackupCodeLoginForm.js +0 -139
- package/src/components/BackupCodesForm.d.ts +0 -26
- package/src/components/BackupCodesForm.d.ts.map +0 -1
- package/src/components/BackupCodesForm.js +0 -120
- package/src/components/CategoryMenu.d.ts +0 -17
- package/src/components/CategoryMenu.d.ts.map +0 -1
- package/src/components/CategoryMenu.js +0 -65
- package/src/components/ChangePasswordForm.d.ts +0 -26
- package/src/components/ChangePasswordForm.d.ts.map +0 -1
- package/src/components/ChangePasswordForm.js +0 -78
- package/src/components/ConfirmationDialog.d.ts +0 -13
- package/src/components/ConfirmationDialog.d.ts.map +0 -1
- package/src/components/ConfirmationDialog.js +0 -10
- package/src/components/CurrencyCodeSelector.d.ts +0 -9
- package/src/components/CurrencyCodeSelector.d.ts.map +0 -1
- package/src/components/CurrencyCodeSelector.js +0 -31
- package/src/components/CurrencyInput.d.ts +0 -13
- package/src/components/CurrencyInput.d.ts.map +0 -1
- package/src/components/CurrencyInput.js +0 -22
- package/src/components/DashboardPage.d.ts +0 -8
- package/src/components/DashboardPage.d.ts.map +0 -1
- package/src/components/DashboardPage.js +0 -10
- package/src/components/DropdownMenu.d.ts +0 -13
- package/src/components/DropdownMenu.d.ts.map +0 -1
- package/src/components/DropdownMenu.js +0 -63
- package/src/components/ExpirationSecondsSelector.d.ts +0 -13
- package/src/components/ExpirationSecondsSelector.d.ts.map +0 -1
- package/src/components/ExpirationSecondsSelector.js +0 -32
- package/src/components/FakeEmailAdminPanel.d.ts +0 -23
- package/src/components/FakeEmailAdminPanel.d.ts.map +0 -1
- package/src/components/FakeEmailAdminPanel.js +0 -147
- package/src/components/Flag.d.ts +0 -20
- package/src/components/Flag.d.ts.map +0 -1
- package/src/components/Flag.js +0 -43
- package/src/components/ForgotPasswordForm.d.ts +0 -18
- package/src/components/ForgotPasswordForm.d.ts.map +0 -1
- package/src/components/ForgotPasswordForm.js +0 -61
- package/src/components/LoginForm.d.ts +0 -44
- package/src/components/LoginForm.d.ts.map +0 -1
- package/src/components/LoginForm.js +0 -123
- package/src/components/LogoutPage.d.ts +0 -8
- package/src/components/LogoutPage.d.ts.map +0 -1
- package/src/components/LogoutPage.js +0 -16
- package/src/components/RegisterForm.d.ts +0 -100
- package/src/components/RegisterForm.d.ts.map +0 -1
- package/src/components/RegisterForm.js +0 -306
- package/src/components/ResetPasswordForm.d.ts +0 -23
- package/src/components/ResetPasswordForm.d.ts.map +0 -1
- package/src/components/ResetPasswordForm.js +0 -78
- package/src/components/SideMenu.d.ts +0 -8
- package/src/components/SideMenu.d.ts.map +0 -1
- package/src/components/SideMenu.js +0 -25
- package/src/components/SideMenuListItem.d.ts +0 -13
- package/src/components/SideMenuListItem.d.ts.map +0 -1
- package/src/components/SideMenuListItem.js +0 -44
- package/src/components/T.d.ts +0 -7
- package/src/components/T.d.ts.map +0 -1
- package/src/components/T.js +0 -13
- package/src/components/TDiv.d.ts +0 -9
- package/src/components/TDiv.d.ts.map +0 -1
- package/src/components/TDiv.js +0 -14
- package/src/components/TImgAlt.d.ts +0 -10
- package/src/components/TImgAlt.d.ts.map +0 -1
- package/src/components/TImgAlt.js +0 -14
- package/src/components/TopMenu.d.ts +0 -50
- package/src/components/TopMenu.d.ts.map +0 -1
- package/src/components/TopMenu.js +0 -79
- package/src/components/TotpSetupForm.d.ts +0 -24
- package/src/components/TotpSetupForm.d.ts.map +0 -1
- package/src/components/TotpSetupForm.js +0 -82
- package/src/components/TotpVerificationForm.d.ts +0 -23
- package/src/components/TotpVerificationForm.d.ts.map +0 -1
- package/src/components/TotpVerificationForm.js +0 -66
- package/src/components/TranslatedTitle.d.ts +0 -8
- package/src/components/TranslatedTitle.d.ts.map +0 -1
- package/src/components/TranslatedTitle.js +0 -15
- package/src/components/UserLanguageSelector.d.ts +0 -4
- package/src/components/UserLanguageSelector.d.ts.map +0 -1
- package/src/components/UserLanguageSelector.js +0 -31
- package/src/components/UserMenu.d.ts +0 -4
- package/src/components/UserMenu.d.ts.map +0 -1
- package/src/components/UserMenu.js +0 -12
- package/src/components/UserSettingsForm.d.ts +0 -113
- package/src/components/UserSettingsForm.d.ts.map +0 -1
- package/src/components/UserSettingsForm.js +0 -269
- package/src/components/VerifyEmailPage.d.ts +0 -24
- package/src/components/VerifyEmailPage.d.ts.map +0 -1
- package/src/components/VerifyEmailPage.js +0 -81
- package/src/components/index.d.ts.map +0 -1
- package/src/components/index.js +0 -35
- package/src/contexts/AuthProvider.d.ts +0 -186
- package/src/contexts/AuthProvider.d.ts.map +0 -1
- package/src/contexts/AuthProvider.js +0 -515
- package/src/contexts/I18nProvider.d.ts +0 -27
- package/src/contexts/I18nProvider.d.ts.map +0 -1
- package/src/contexts/I18nProvider.js +0 -60
- package/src/contexts/MenuContext.d.ts +0 -20
- package/src/contexts/MenuContext.d.ts.map +0 -1
- package/src/contexts/MenuContext.js +0 -275
- package/src/contexts/SuiteConfigProvider.d.ts +0 -44
- package/src/contexts/SuiteConfigProvider.d.ts.map +0 -1
- package/src/contexts/SuiteConfigProvider.js +0 -43
- package/src/contexts/ThemeProvider.d.ts +0 -15
- package/src/contexts/ThemeProvider.d.ts.map +0 -1
- package/src/contexts/ThemeProvider.js +0 -36
- package/src/contexts/index.d.ts.map +0 -1
- package/src/contexts/index.js +0 -8
- package/src/hooks/index.d.ts.map +0 -1
- package/src/hooks/index.js +0 -9
- package/src/hooks/useAuthenticatedApi.d.ts +0 -34
- package/src/hooks/useAuthenticatedApi.d.ts.map +0 -1
- package/src/hooks/useAuthenticatedApi.js +0 -46
- package/src/hooks/useBackupCodes.d.ts +0 -15
- package/src/hooks/useBackupCodes.d.ts.map +0 -1
- package/src/hooks/useBackupCodes.js +0 -74
- package/src/hooks/useEmailVerification.d.ts +0 -10
- package/src/hooks/useEmailVerification.d.ts.map +0 -1
- package/src/hooks/useEmailVerification.js +0 -40
- package/src/hooks/useExpiringValue.d.ts +0 -14
- package/src/hooks/useExpiringValue.d.ts.map +0 -1
- package/src/hooks/useExpiringValue.js +0 -53
- package/src/hooks/useLocalStorage.d.ts +0 -2
- package/src/hooks/useLocalStorage.d.ts.map +0 -1
- package/src/hooks/useLocalStorage.js +0 -15
- package/src/hooks/useUserSettings.d.ts +0 -48
- package/src/hooks/useUserSettings.d.ts.map +0 -1
- package/src/hooks/useUserSettings.js +0 -171
- package/src/index.d.ts.map +0 -1
- package/src/index.js +0 -12
- package/src/interfaces/IAppConfig.d.ts +0 -8
- package/src/interfaces/IAppConfig.d.ts.map +0 -1
- package/src/interfaces/IAppConfig.js +0 -2
- package/src/interfaces/ICategoryConfig.d.ts +0 -41
- package/src/interfaces/ICategoryConfig.d.ts.map +0 -1
- package/src/interfaces/ICategoryConfig.js +0 -2
- package/src/interfaces/IMenuConfig.d.ts +0 -28
- package/src/interfaces/IMenuConfig.d.ts.map +0 -1
- package/src/interfaces/IMenuConfig.js +0 -2
- package/src/interfaces/IMenuOption.d.ts +0 -82
- package/src/interfaces/IMenuOption.d.ts.map +0 -1
- package/src/interfaces/IMenuOption.js +0 -2
- package/src/interfaces/index.d.ts.map +0 -1
- package/src/interfaces/index.js +0 -7
- package/src/services/__mocks__/authService.d.ts +0 -21
- package/src/services/__mocks__/authService.d.ts.map +0 -1
- package/src/services/__mocks__/authService.js +0 -15
- package/src/services/api.d.ts +0 -3
- package/src/services/api.d.ts.map +0 -1
- package/src/services/api.js +0 -14
- package/src/services/authService.d.ts +0 -126
- package/src/services/authService.d.ts.map +0 -1
- package/src/services/authService.js +0 -471
- package/src/services/authenticatedApi.d.ts +0 -3
- package/src/services/authenticatedApi.d.ts.map +0 -1
- package/src/services/authenticatedApi.js +0 -18
- package/src/services/index.d.ts +0 -4
- package/src/services/index.d.ts.map +0 -1
- package/src/services/index.js +0 -6
- package/src/types/MenuType.d.ts +0 -11
- package/src/types/MenuType.d.ts.map +0 -1
- package/src/types/MenuType.js +0 -12
- package/src/types/expirationSeconds.d.ts +0 -3
- package/src/types/expirationSeconds.d.ts.map +0 -1
- package/src/types/expirationSeconds.js +0 -17
- package/src/types/index.d.ts +0 -2
- package/src/types/index.d.ts.map +0 -1
- package/src/types/index.js +0 -4
- package/src/types/translation.d.ts +0 -10
- package/src/types/translation.d.ts.map +0 -1
- package/src/types/translation.js +0 -9
- package/src/wrappers/BackupCodeLoginWrapper.d.ts +0 -8
- package/src/wrappers/BackupCodeLoginWrapper.d.ts.map +0 -1
- package/src/wrappers/BackupCodeLoginWrapper.js +0 -20
- package/src/wrappers/BackupCodesWrapper.d.ts +0 -7
- package/src/wrappers/BackupCodesWrapper.d.ts.map +0 -1
- package/src/wrappers/BackupCodesWrapper.js +0 -17
- package/src/wrappers/ChangePasswordFormWrapper.d.ts +0 -8
- package/src/wrappers/ChangePasswordFormWrapper.d.ts.map +0 -1
- package/src/wrappers/ChangePasswordFormWrapper.js +0 -21
- package/src/wrappers/ForgotPasswordFormWrapper.d.ts +0 -8
- package/src/wrappers/ForgotPasswordFormWrapper.d.ts.map +0 -1
- package/src/wrappers/ForgotPasswordFormWrapper.js +0 -29
- package/src/wrappers/LoginFormWrapper.d.ts +0 -21
- package/src/wrappers/LoginFormWrapper.d.ts.map +0 -1
- package/src/wrappers/LoginFormWrapper.js +0 -72
- package/src/wrappers/LogoutPageWrapper.d.ts +0 -9
- package/src/wrappers/LogoutPageWrapper.d.ts.map +0 -1
- package/src/wrappers/LogoutPageWrapper.js +0 -21
- package/src/wrappers/RegisterFormWrapper.d.ts +0 -20
- package/src/wrappers/RegisterFormWrapper.d.ts.map +0 -1
- package/src/wrappers/RegisterFormWrapper.js +0 -51
- package/src/wrappers/ResetPasswordFormWrapper.d.ts +0 -9
- package/src/wrappers/ResetPasswordFormWrapper.d.ts.map +0 -1
- package/src/wrappers/ResetPasswordFormWrapper.js +0 -34
- package/src/wrappers/UserSettingsFormWrapper.d.ts +0 -29
- package/src/wrappers/UserSettingsFormWrapper.d.ts.map +0 -1
- package/src/wrappers/UserSettingsFormWrapper.js +0 -95
- package/src/wrappers/VerifyEmailPageWrapper.d.ts +0 -8
- package/src/wrappers/VerifyEmailPageWrapper.d.ts.map +0 -1
- package/src/wrappers/VerifyEmailPageWrapper.js +0 -21
- package/src/wrappers/index.d.ts.map +0 -1
- package/src/wrappers/index.js +0 -24
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResetPasswordForm = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const suite_core_lib_1 = require("@digitaldefiance/suite-core-lib");
|
|
7
|
-
const material_1 = require("@mui/material");
|
|
8
|
-
const formik_1 = require("formik");
|
|
9
|
-
const react_1 = require("react");
|
|
10
|
-
const Yup = tslib_1.__importStar(require("yup"));
|
|
11
|
-
const contexts_1 = require("../contexts");
|
|
12
|
-
const ResetPasswordForm = ({ token, onSubmit, passwordValidation, confirmPasswordValidation, labels = {}, }) => {
|
|
13
|
-
const { tComponent } = (0, contexts_1.useI18n)();
|
|
14
|
-
const [success, setSuccess] = (0, react_1.useState)(false);
|
|
15
|
-
const [apiError, setApiError] = (0, react_1.useState)('');
|
|
16
|
-
const validation = {
|
|
17
|
-
password: passwordValidation ||
|
|
18
|
-
Yup.string()
|
|
19
|
-
.min(suite_core_lib_1.Constants.PasswordMinLength, tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_PasswordMinLengthTemplate))
|
|
20
|
-
.required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required)),
|
|
21
|
-
confirmPassword: confirmPasswordValidation ||
|
|
22
|
-
Yup.string()
|
|
23
|
-
.oneOf([Yup.ref('password')], tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_PasswordMatch))
|
|
24
|
-
.required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required)),
|
|
25
|
-
};
|
|
26
|
-
const translatedLabels = {
|
|
27
|
-
title: labels.title ||
|
|
28
|
-
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.PasswordReset_Title),
|
|
29
|
-
password: labels.password ||
|
|
30
|
-
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_NewPassword),
|
|
31
|
-
confirmPassword: labels.confirmPassword ||
|
|
32
|
-
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_ConfirmNewPassword),
|
|
33
|
-
resetButton: labels.resetButton ||
|
|
34
|
-
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.PasswordReset_Button),
|
|
35
|
-
successMessage: labels.successMessage ||
|
|
36
|
-
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.PasswordReset_Success),
|
|
37
|
-
invalidToken: labels.invalidToken ||
|
|
38
|
-
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.ForgotPassword_InvalidToken),
|
|
39
|
-
};
|
|
40
|
-
const formik = (0, formik_1.useFormik)({
|
|
41
|
-
initialValues: {
|
|
42
|
-
password: '',
|
|
43
|
-
confirmPassword: '',
|
|
44
|
-
},
|
|
45
|
-
validationSchema: Yup.object({
|
|
46
|
-
password: validation.password,
|
|
47
|
-
confirmPassword: validation.confirmPassword,
|
|
48
|
-
}),
|
|
49
|
-
onSubmit: async (values) => {
|
|
50
|
-
if (!token) {
|
|
51
|
-
setApiError(translatedLabels.invalidToken);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
try {
|
|
55
|
-
await onSubmit(token, values.password);
|
|
56
|
-
setSuccess(true);
|
|
57
|
-
setApiError('');
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
const err = error;
|
|
61
|
-
setApiError(err.response?.data?.message ||
|
|
62
|
-
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Error_PasswordChange));
|
|
63
|
-
setSuccess(false);
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
});
|
|
67
|
-
if (!token) {
|
|
68
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Container, { maxWidth: "sm", children: (0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "error", sx: { mt: 4 }, children: translatedLabels.invalidToken }) }));
|
|
69
|
-
}
|
|
70
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Container, { maxWidth: "sm", children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
71
|
-
mt: 8,
|
|
72
|
-
display: 'flex',
|
|
73
|
-
flexDirection: 'column',
|
|
74
|
-
alignItems: 'center',
|
|
75
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h4", component: "h1", gutterBottom: true, children: translatedLabels.title }), (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "form", onSubmit: formik.handleSubmit, sx: { mt: 1, width: '100%' }, children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, id: "password", name: "password", label: translatedLabels.password, type: "password", value: formik.values.password, onChange: formik.handleChange, onBlur: formik.handleBlur, error: Boolean(formik.touched.password && formik.errors.password), helperText: formik.touched.password && formik.errors.password, margin: "normal" }), (0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, id: "confirmPassword", name: "confirmPassword", label: translatedLabels.confirmPassword, type: "password", value: formik.values.confirmPassword, onChange: formik.handleChange, onBlur: formik.handleBlur, error: Boolean(formik.touched.confirmPassword && formik.errors.confirmPassword), helperText: formik.touched.confirmPassword && formik.errors.confirmPassword, margin: "normal" }), apiError && ((0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "error", sx: { mt: 2, mb: 2 }, children: apiError })), success && ((0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "success", sx: { mt: 2, mb: 2 }, children: translatedLabels.successMessage })), (0, jsx_runtime_1.jsx)(material_1.Button, { type: "submit", fullWidth: true, variant: "contained", color: "primary", sx: { mt: 3, mb: 2 }, disabled: formik.isSubmitting, children: translatedLabels.resetButton })] })] }) }));
|
|
76
|
-
};
|
|
77
|
-
exports.ResetPasswordForm = ResetPasswordForm;
|
|
78
|
-
exports.default = exports.ResetPasswordForm;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SideMenu.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/SideMenu.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAO3B,UAAU,aAAa;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA8BtC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SideMenu = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const material_1 = require("@mui/material");
|
|
6
|
-
const react_router_1 = require("react-router");
|
|
7
|
-
const MenuContext_1 = require("../contexts/MenuContext");
|
|
8
|
-
const MenuType_1 = require("../types/MenuType");
|
|
9
|
-
const SideMenuListItem_1 = require("./SideMenuListItem");
|
|
10
|
-
const SideMenu = ({ isOpen, onClose }) => {
|
|
11
|
-
const { getMenuOptions } = (0, MenuContext_1.useMenu)();
|
|
12
|
-
const navigate = (0, react_router_1.useNavigate)();
|
|
13
|
-
const menuOptions = getMenuOptions(MenuType_1.MenuTypes.SideMenu, true);
|
|
14
|
-
const handleNavigate = (link) => {
|
|
15
|
-
if (typeof link === 'string') {
|
|
16
|
-
navigate(link);
|
|
17
|
-
}
|
|
18
|
-
else if (link.pathname) {
|
|
19
|
-
navigate(link.pathname, { state: link.state });
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Drawer, { anchor: "left", open: isOpen, onClose: onClose, children: (0, jsx_runtime_1.jsx)(material_1.List, { children: menuOptions.map((item) => ((0, jsx_runtime_1.jsx)(SideMenuListItem_1.SideMenuListItem, { menuItem: item, onClose: onClose, onNavigate: handleNavigate }, item.id))) }) }));
|
|
23
|
-
};
|
|
24
|
-
exports.SideMenu = SideMenu;
|
|
25
|
-
exports.default = exports.SideMenu;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { IMenuOption } from '../interfaces';
|
|
3
|
-
export interface SideMenuListItemProps {
|
|
4
|
-
menuItem: IMenuOption;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
onNavigate?: (link: string | Partial<{
|
|
7
|
-
pathname: string;
|
|
8
|
-
state?: unknown;
|
|
9
|
-
}>) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare const SideMenuListItem: FC<SideMenuListItemProps>;
|
|
12
|
-
export default SideMenuListItem;
|
|
13
|
-
//# sourceMappingURL=SideMenuListItem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SideMenuListItem.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/SideMenuListItem.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,EAAE,EAAe,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,CACX,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,KAC1D,IAAI,CAAC;CACX;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAuDtD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SideMenuListItem = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const material_1 = require("@mui/material");
|
|
6
|
-
const react_1 = require("react");
|
|
7
|
-
const SideMenuListItem = ({ menuItem, onClose, onNavigate, }) => {
|
|
8
|
-
const handleMenuItemClick = (0, react_1.useCallback)((option) => (event) => {
|
|
9
|
-
event.stopPropagation();
|
|
10
|
-
if (option.action) {
|
|
11
|
-
option.action();
|
|
12
|
-
}
|
|
13
|
-
else if (option.link !== undefined && onNavigate) {
|
|
14
|
-
if (typeof option.link === 'string') {
|
|
15
|
-
onNavigate(option.link);
|
|
16
|
-
}
|
|
17
|
-
else if (typeof option.link === 'object' &&
|
|
18
|
-
'pathname' in option.link &&
|
|
19
|
-
option.link.pathname) {
|
|
20
|
-
onNavigate({
|
|
21
|
-
pathname: option.link.pathname,
|
|
22
|
-
state: 'state' in option.link ? option.link.state : undefined,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
onClose();
|
|
27
|
-
}, [onNavigate, onClose]);
|
|
28
|
-
if (menuItem.divider) {
|
|
29
|
-
return (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: { ...menuItem.sideSx } }, menuItem.id);
|
|
30
|
-
}
|
|
31
|
-
else if (menuItem.link) {
|
|
32
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, { onClick: handleMenuItemClick(menuItem), sx: { ...menuItem.sideSx }, children: [menuItem.icon && (0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { sx: { ...menuItem.sideIconSx }, children: menuItem.icon }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: menuItem.label, sx: { ...menuItem.sideTextSx } })] }, menuItem.id));
|
|
33
|
-
}
|
|
34
|
-
else if (menuItem.action) {
|
|
35
|
-
const action = menuItem.action;
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, { onClick: async () => {
|
|
37
|
-
await action();
|
|
38
|
-
onClose();
|
|
39
|
-
}, sx: { ...menuItem.sideSx }, children: [menuItem.icon && (0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { sx: { ...menuItem.sideIconSx }, children: menuItem.icon }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: menuItem.label, sx: { ...menuItem.sideTextSx } })] }, menuItem.id));
|
|
40
|
-
}
|
|
41
|
-
return null;
|
|
42
|
-
};
|
|
43
|
-
exports.SideMenuListItem = SideMenuListItem;
|
|
44
|
-
exports.default = exports.SideMenuListItem;
|
package/src/components/T.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
interface FCParams<TEnum extends string> {
|
|
2
|
-
stringKey: TEnum;
|
|
3
|
-
vars?: Record<string, string | number>;
|
|
4
|
-
}
|
|
5
|
-
export declare const Tbranded: <TEnum extends string>({ stringKey, vars, }: FCParams<TEnum>) => string | undefined;
|
|
6
|
-
export default Tbranded;
|
|
7
|
-
//# sourceMappingURL=T.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"T.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/T.tsx"],"names":[],"mappings":"AAKA,UAAU,QAAQ,CAAC,KAAK,SAAS,MAAM;IACrC,SAAS,EAAE,KAAK,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,QAAQ,GAAI,KAAK,SAAS,MAAM,EAAE,sBAG5C,QAAQ,CAAC,KAAK,CAAC,KAAG,MAAM,GAAG,SAQ7B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/src/components/T.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// src/app/components/T.tsx
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Tbranded = void 0;
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const contexts_1 = require("../contexts");
|
|
7
|
-
const Tbranded = ({ stringKey, vars, }) => {
|
|
8
|
-
const { currentLanguage, tBranded } = (0, contexts_1.useI18n)();
|
|
9
|
-
const translated = (0, react_1.useMemo)(() => tBranded(stringKey, vars, currentLanguage), [tBranded, stringKey, vars, currentLanguage]);
|
|
10
|
-
return translated;
|
|
11
|
-
};
|
|
12
|
-
exports.Tbranded = Tbranded;
|
|
13
|
-
exports.default = exports.Tbranded;
|
package/src/components/TDiv.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { DetailedHTMLProps, HTMLAttributes, ReactElement } from 'react';
|
|
2
|
-
interface FCParams<TEnum extends string> {
|
|
3
|
-
stringKey: TEnum;
|
|
4
|
-
vars?: Record<string, string | number>;
|
|
5
|
-
divOptions?: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
6
|
-
}
|
|
7
|
-
export declare const TDivBranded: <TEnum extends string>({ stringKey, vars, divOptions, }: FCParams<TEnum>) => ReactElement;
|
|
8
|
-
export default TDivBranded;
|
|
9
|
-
//# sourceMappingURL=TDiv.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TDiv.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TDiv.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAGjF,UAAU,QAAQ,CAAC,KAAK,SAAS,MAAM;IACrC,SAAS,EAAE,KAAK,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,CAAC;CAChF;AAED,eAAO,MAAM,WAAW,GAAI,KAAK,SAAS,MAAM,EAAE,kCAI/C,QAAQ,CAAC,KAAK,CAAC,KAAG,YAQpB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
package/src/components/TDiv.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TDivBranded = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
// src/app/components/TDiv.tsx
|
|
6
|
-
const react_1 = require("react");
|
|
7
|
-
const contexts_1 = require("../contexts");
|
|
8
|
-
const TDivBranded = ({ stringKey, vars, divOptions, }) => {
|
|
9
|
-
const { currentLanguage, tBranded } = (0, contexts_1.useI18n)();
|
|
10
|
-
const translated = (0, react_1.useMemo)(() => tBranded(stringKey, vars, currentLanguage), [tBranded, stringKey, vars, currentLanguage]);
|
|
11
|
-
return (0, jsx_runtime_1.jsx)("div", { ...divOptions, children: translated });
|
|
12
|
-
};
|
|
13
|
-
exports.TDivBranded = TDivBranded;
|
|
14
|
-
exports.default = exports.TDivBranded;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { DetailedHTMLProps, ImgHTMLAttributes, ReactElement } from 'react';
|
|
2
|
-
interface FCParams<TEnum extends string> {
|
|
3
|
-
src: string;
|
|
4
|
-
stringKey: TEnum;
|
|
5
|
-
vars?: Record<string, string | number>;
|
|
6
|
-
imgOptions?: DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
|
|
7
|
-
}
|
|
8
|
-
export declare const TImgAlt: <TEnum extends string>({ src, stringKey, vars, imgOptions, }: FCParams<TEnum>) => ReactElement;
|
|
9
|
-
export default TImgAlt;
|
|
10
|
-
//# sourceMappingURL=TImgAlt.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TImgAlt.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TImgAlt.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAGpF,UAAU,QAAQ,CAAC,KAAK,SAAS,MAAM;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,KAAK,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,CAAC;CACvF;AAED,eAAO,MAAM,OAAO,GAAI,KAAK,SAAS,MAAM,EAAE,uCAK3C,QAAQ,CAAC,KAAK,CAAC,KAAG,YAQpB,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TImgAlt = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
// src/app/components/TImgAlt.tsx
|
|
6
|
-
const react_1 = require("react");
|
|
7
|
-
const contexts_1 = require("../contexts");
|
|
8
|
-
const TImgAlt = ({ src, stringKey, vars, imgOptions, }) => {
|
|
9
|
-
const { currentLanguage, tBranded } = (0, contexts_1.useI18n)();
|
|
10
|
-
const translated = (0, react_1.useMemo)(() => tBranded(stringKey, vars, currentLanguage), [tBranded, stringKey, vars, currentLanguage]);
|
|
11
|
-
return (0, jsx_runtime_1.jsx)("img", { src: src, ...imgOptions, alt: translated });
|
|
12
|
-
};
|
|
13
|
-
exports.TImgAlt = TImgAlt;
|
|
14
|
-
exports.default = exports.TImgAlt;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { IConstants } from '@digitaldefiance/suite-core-lib';
|
|
2
|
-
import React, { FC, ReactElement } from 'react';
|
|
3
|
-
import { ICategoryConfig } from '../interfaces/ICategoryConfig';
|
|
4
|
-
import { MenuType } from '../types/MenuType';
|
|
5
|
-
declare global {
|
|
6
|
-
interface Window {
|
|
7
|
-
APP_CONFIG?: {
|
|
8
|
-
hostname: string;
|
|
9
|
-
siteTitle: string;
|
|
10
|
-
server: string;
|
|
11
|
-
[key: string]: unknown;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export interface AdditionalDropdownMenu {
|
|
16
|
-
menuType: MenuType;
|
|
17
|
-
menuIcon: ReactElement;
|
|
18
|
-
priority?: number;
|
|
19
|
-
/** Optional callback invoked when the icon button is clicked. */
|
|
20
|
-
action?: () => void;
|
|
21
|
-
/** When true, the menu icon is hidden if there are no sub-options. Defaults to false. */
|
|
22
|
-
hideWhenEmpty?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Optional category id. When the TopMenu is given matching `categories`,
|
|
25
|
-
* this menu is rendered inside that category's popover instead of inline.
|
|
26
|
-
*/
|
|
27
|
-
category?: string;
|
|
28
|
-
/** Optional label used for tile captions and tooltips. */
|
|
29
|
-
label?: string;
|
|
30
|
-
}
|
|
31
|
-
export interface TopMenuProps {
|
|
32
|
-
Logo: React.ReactNode;
|
|
33
|
-
additionalMenus?: Array<AdditionalDropdownMenu>;
|
|
34
|
-
/**
|
|
35
|
-
* Optional category configurations. When provided, any menu (whether
|
|
36
|
-
* registered via `MenuContext` or passed in `additionalMenus`) whose
|
|
37
|
-
* `category` matches a category `id` is rendered as a tile inside that
|
|
38
|
-
* category's mega-menu popover. Menus without a matching category render
|
|
39
|
-
* inline in the AppBar exactly as before, so this is backwards compatible:
|
|
40
|
-
* omit `categories` (or use empty array) for the original layout.
|
|
41
|
-
*/
|
|
42
|
-
categories?: ICategoryConfig[];
|
|
43
|
-
/** Custom action elements rendered in the toolbar after menu dropdowns (e.g. notification bell). Only shown when authenticated. */
|
|
44
|
-
actions?: React.ReactNode;
|
|
45
|
-
constants?: IConstants;
|
|
46
|
-
showTitle?: boolean;
|
|
47
|
-
}
|
|
48
|
-
export declare const TopMenu: FC<TopMenuProps>;
|
|
49
|
-
export default TopMenu;
|
|
50
|
-
//# sourceMappingURL=TopMenu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TopMenu.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TopMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAIX,MAAM,iCAAiC,CAAC;AAUzC,OAAO,KAAK,EAAE,EAEZ,EAAE,EACF,YAAY,EAIb,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAQ7C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,CAAC,EAAE;YACX,QAAQ,EAAE,MAAM,CAAC;YACjB,SAAS,EAAE,MAAM,CAAC;YAClB,MAAM,EAAE,MAAM,CAAC;YACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;SACxB,CAAC;KACH;CACF;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,yFAAyF;IACzF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,eAAe,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAChD;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;IAC/B,mIAAmI;IACnI,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAsKpC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TopMenu = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const suite_core_lib_1 = require("@digitaldefiance/suite-core-lib");
|
|
7
|
-
const Menu_1 = tslib_1.__importDefault(require("@mui/icons-material/Menu"));
|
|
8
|
-
const material_1 = require("@mui/material");
|
|
9
|
-
const react_1 = require("react");
|
|
10
|
-
const react_router_1 = require("react-router");
|
|
11
|
-
const AuthProvider_1 = require("../contexts/AuthProvider");
|
|
12
|
-
const I18nProvider_1 = require("../contexts/I18nProvider");
|
|
13
|
-
const MenuContext_1 = require("../contexts/MenuContext");
|
|
14
|
-
const CategoryMenu_1 = require("./CategoryMenu");
|
|
15
|
-
const DropdownMenu_1 = require("./DropdownMenu");
|
|
16
|
-
const SideMenu_1 = require("./SideMenu");
|
|
17
|
-
const UserLanguageSelector_1 = require("./UserLanguageSelector");
|
|
18
|
-
const UserMenu_1 = require("./UserMenu");
|
|
19
|
-
const TopMenu = ({ Logo, additionalMenus, categories, actions, constants, showTitle, }) => {
|
|
20
|
-
const { isAuthenticated } = (0, react_1.useContext)(AuthProvider_1.AuthContext);
|
|
21
|
-
const { getTopMenus } = (0, MenuContext_1.useMenu)();
|
|
22
|
-
const [isSideMenuOpen, setIsSideMenuOpen] = (0, react_1.useState)(false);
|
|
23
|
-
const handleOpenSideMenu = () => setIsSideMenuOpen(true);
|
|
24
|
-
const handleCloseSideMenu = () => setIsSideMenuOpen(false);
|
|
25
|
-
const { tComponent } = (0, I18nProvider_1.useI18n)();
|
|
26
|
-
// When constants are explicitly provided, pass Site as a template variable
|
|
27
|
-
// override. Otherwise let the i18n engine resolve {Site} from its registered
|
|
28
|
-
// constants (which the consuming app sets up via createI18nSetup).
|
|
29
|
-
const siteTitle = tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_SiteTemplate, constants ? { Site: constants.Site } : undefined);
|
|
30
|
-
const allMenus = (0, react_1.useMemo)(() => {
|
|
31
|
-
const contextMenus = getTopMenus();
|
|
32
|
-
if (!additionalMenus || additionalMenus.length === 0) {
|
|
33
|
-
return contextMenus;
|
|
34
|
-
}
|
|
35
|
-
const additional = additionalMenus.map((m) => ({
|
|
36
|
-
...m,
|
|
37
|
-
options: [],
|
|
38
|
-
isUserMenu: false,
|
|
39
|
-
}));
|
|
40
|
-
return [...contextMenus, ...additional].sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
41
|
-
}, [getTopMenus, additionalMenus]);
|
|
42
|
-
// Split menus into those that belong to a configured category vs. those
|
|
43
|
-
// that should render inline in the AppBar (default, backwards-compatible
|
|
44
|
-
// behaviour). The user menu is always inline.
|
|
45
|
-
const { inlineMenus, menusByCategory, orderedCategories } = (0, react_1.useMemo)(() => {
|
|
46
|
-
const hasCategories = !!categories && categories.length > 0;
|
|
47
|
-
const categoryIds = new Set(hasCategories ? categories.map((c) => c.id) : []);
|
|
48
|
-
const byCategory = new Map();
|
|
49
|
-
const inline = [];
|
|
50
|
-
for (const menu of allMenus) {
|
|
51
|
-
const cat = menu.category;
|
|
52
|
-
if (!menu.isUserMenu && hasCategories && cat && categoryIds.has(cat)) {
|
|
53
|
-
const list = byCategory.get(cat) ?? [];
|
|
54
|
-
list.push(menu);
|
|
55
|
-
byCategory.set(cat, list);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
inline.push(menu);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
const ordered = hasCategories
|
|
62
|
-
? [...categories].sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0))
|
|
63
|
-
: [];
|
|
64
|
-
return {
|
|
65
|
-
inlineMenus: inline,
|
|
66
|
-
menusByCategory: byCategory,
|
|
67
|
-
orderedCategories: ordered,
|
|
68
|
-
};
|
|
69
|
-
}, [allMenus, categories]);
|
|
70
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.AppBar, { position: "fixed", sx: { top: 10 }, children: [(0, jsx_runtime_1.jsxs)(material_1.Toolbar, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "large", edge: "start", color: "inherit", "aria-label": "menu", sx: { mr: 2 }, onClick: handleOpenSideMenu, children: (0, jsx_runtime_1.jsx)(Menu_1.default, {}) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
71
|
-
height: 40,
|
|
72
|
-
width: 'auto',
|
|
73
|
-
marginRight: 2,
|
|
74
|
-
display: 'flex',
|
|
75
|
-
alignItems: 'center',
|
|
76
|
-
}, children: Logo }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h6", component: "div", sx: { flexGrow: 1 }, children: showTitle !== false ? siteTitle : '\u00A0' }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: 'flex', alignItems: 'center' }, children: [isAuthenticated ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { color: "inherit", component: react_router_1.Link, to: "/dashboard", children: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Dashboard) }), inlineMenus.map((menu, index) => menu.isUserMenu ? ((0, jsx_runtime_1.jsx)(UserMenu_1.UserMenu, {}, `user-menu`)) : ((0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu, { menuType: menu.menuType, menuIcon: menu.menuIcon, action: menu.action, hideWhenEmpty: menu.hideWhenEmpty }, `menu-${index}`))), orderedCategories.map((category) => ((0, jsx_runtime_1.jsx)(CategoryMenu_1.CategoryMenu, { category: category, menus: menusByCategory.get(category.id) ?? [] }, `category-${category.id}`)))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { color: "inherit", component: react_router_1.Link, to: "/login", children: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Login_LoginButton) }), (0, jsx_runtime_1.jsx)(material_1.Button, { color: "inherit", component: react_router_1.Link, to: "/register", children: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.RegisterButton) })] })), isAuthenticated && actions, (0, jsx_runtime_1.jsx)(UserLanguageSelector_1.UserLanguageSelector, {})] })] }), (0, jsx_runtime_1.jsx)(SideMenu_1.SideMenu, { isOpen: isSideMenuOpen, onClose: handleCloseSideMenu })] }));
|
|
77
|
-
};
|
|
78
|
-
exports.TopMenu = TopMenu;
|
|
79
|
-
exports.default = exports.TopMenu;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
export interface TotpSetupFormValues {
|
|
3
|
-
code: string;
|
|
4
|
-
}
|
|
5
|
-
export interface TotpSetupFormProps {
|
|
6
|
-
provisioningUri: string;
|
|
7
|
-
secret: string;
|
|
8
|
-
onConfirm: (code: string) => Promise<{
|
|
9
|
-
success: boolean;
|
|
10
|
-
} | {
|
|
11
|
-
error: string;
|
|
12
|
-
}>;
|
|
13
|
-
labels?: {
|
|
14
|
-
title?: string;
|
|
15
|
-
qrCodeAlt?: string;
|
|
16
|
-
secretLabel?: string;
|
|
17
|
-
codeLabel?: string;
|
|
18
|
-
confirmButton?: string;
|
|
19
|
-
errorMessage?: string;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export declare const TotpSetupForm: FC<TotpSetupFormProps>;
|
|
23
|
-
export default TotpSetupForm;
|
|
24
|
-
//# sourceMappingURL=TotpSetupForm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TotpSetupForm.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TotpSetupForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAGrC,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,CACT,IAAI,EAAE,MAAM,KACT,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvD,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAiBD,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAgJhD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TotpSetupForm = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const material_1 = require("@mui/material");
|
|
7
|
-
const formik_1 = require("formik");
|
|
8
|
-
const qrcode_react_1 = require("qrcode.react");
|
|
9
|
-
const react_1 = require("react");
|
|
10
|
-
const Yup = tslib_1.__importStar(require("yup"));
|
|
11
|
-
const defaultLabels = {
|
|
12
|
-
title: 'Set Up Two-Factor Authentication',
|
|
13
|
-
qrCodeAlt: 'QR code for TOTP authenticator app setup',
|
|
14
|
-
secretLabel: 'Manual entry key',
|
|
15
|
-
codeLabel: 'Confirmation code',
|
|
16
|
-
confirmButton: 'Confirm',
|
|
17
|
-
errorMessage: 'An unexpected error occurred',
|
|
18
|
-
};
|
|
19
|
-
const totpCodeSchema = Yup.object({
|
|
20
|
-
code: Yup.string()
|
|
21
|
-
.required('Confirmation code is required')
|
|
22
|
-
.matches(/^\d{6}$/, 'Code must be exactly 6 digits'),
|
|
23
|
-
});
|
|
24
|
-
const TotpSetupForm = ({ provisioningUri, secret, onConfirm, labels = {}, }) => {
|
|
25
|
-
const [confirmError, setConfirmError] = (0, react_1.useState)(null);
|
|
26
|
-
const resolvedLabels = {
|
|
27
|
-
title: labels.title ?? defaultLabels.title,
|
|
28
|
-
qrCodeAlt: labels.qrCodeAlt ?? defaultLabels.qrCodeAlt,
|
|
29
|
-
secretLabel: labels.secretLabel ?? defaultLabels.secretLabel,
|
|
30
|
-
codeLabel: labels.codeLabel ?? defaultLabels.codeLabel,
|
|
31
|
-
confirmButton: labels.confirmButton ?? defaultLabels.confirmButton,
|
|
32
|
-
errorMessage: labels.errorMessage ?? defaultLabels.errorMessage,
|
|
33
|
-
};
|
|
34
|
-
const formik = (0, formik_1.useFormik)({
|
|
35
|
-
initialValues: {
|
|
36
|
-
code: '',
|
|
37
|
-
},
|
|
38
|
-
validationSchema: totpCodeSchema,
|
|
39
|
-
onSubmit: async (values, { setSubmitting }) => {
|
|
40
|
-
try {
|
|
41
|
-
setConfirmError(null);
|
|
42
|
-
const result = await onConfirm(values.code);
|
|
43
|
-
if ('error' in result) {
|
|
44
|
-
setConfirmError(result.error);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
setConfirmError(resolvedLabels.errorMessage);
|
|
49
|
-
}
|
|
50
|
-
finally {
|
|
51
|
-
setSubmitting(false);
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
const errorId = 'totp-setup-error';
|
|
56
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Container, { component: "main", maxWidth: "xs", children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
57
|
-
marginTop: 8,
|
|
58
|
-
display: 'flex',
|
|
59
|
-
flexDirection: 'column',
|
|
60
|
-
alignItems: 'center',
|
|
61
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { component: "h1", variant: "h5", children: resolvedLabels.title }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { mt: 3, display: 'flex', justifyContent: 'center' }, children: (0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeSVG, { value: provisioningUri, size: 200, role: "img", "aria-label": resolvedLabels.qrCodeAlt, "data-testid": "qr-code-svg" }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
62
|
-
mt: 2,
|
|
63
|
-
p: 2,
|
|
64
|
-
bgcolor: 'grey.100',
|
|
65
|
-
borderRadius: 1,
|
|
66
|
-
width: '100%',
|
|
67
|
-
textAlign: 'center',
|
|
68
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "subtitle2", gutterBottom: true, children: resolvedLabels.secretLabel }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", sx: {
|
|
69
|
-
fontFamily: 'monospace',
|
|
70
|
-
wordBreak: 'break-all',
|
|
71
|
-
userSelect: 'all',
|
|
72
|
-
}, children: secret })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "form", onSubmit: formik.handleSubmit, sx: { mt: 2, width: '100%' }, children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { margin: "normal", required: true, fullWidth: true, id: "code", name: "code", label: resolvedLabels.codeLabel, inputProps: {
|
|
73
|
-
'aria-label': resolvedLabels.codeLabel,
|
|
74
|
-
inputMode: 'numeric',
|
|
75
|
-
maxLength: 6,
|
|
76
|
-
pattern: '\\d{6}',
|
|
77
|
-
...(confirmError ? { 'aria-describedby': errorId } : {}),
|
|
78
|
-
}, autoComplete: "one-time-code", autoFocus: true, value: formik.values.code, onChange: formik.handleChange, onBlur: formik.handleBlur, error: (formik.touched.code && Boolean(formik.errors.code)) ||
|
|
79
|
-
Boolean(confirmError), helperText: formik.touched.code && formik.errors.code }), confirmError && ((0, jsx_runtime_1.jsx)(material_1.Typography, { id: errorId, color: "error", variant: "body2", sx: { mt: 1 }, role: "alert", children: confirmError })), (0, jsx_runtime_1.jsx)(material_1.Button, { type: "submit", fullWidth: true, variant: "contained", sx: { mt: 3, mb: 2 }, disabled: formik.isSubmitting, children: resolvedLabels.confirmButton })] })] }) }));
|
|
80
|
-
};
|
|
81
|
-
exports.TotpSetupForm = TotpSetupForm;
|
|
82
|
-
exports.default = exports.TotpSetupForm;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { IRequestUserDTO } from '@digitaldefiance/suite-core-lib';
|
|
3
|
-
export interface TotpVerificationFormValues {
|
|
4
|
-
code: string;
|
|
5
|
-
}
|
|
6
|
-
export interface TotpVerificationFormProps {
|
|
7
|
-
pendingTotpToken: string;
|
|
8
|
-
onSubmit: (code: string, pendingTotpToken: string) => Promise<{
|
|
9
|
-
token: string;
|
|
10
|
-
user: IRequestUserDTO;
|
|
11
|
-
} | {
|
|
12
|
-
error: string;
|
|
13
|
-
}>;
|
|
14
|
-
labels?: {
|
|
15
|
-
title?: string;
|
|
16
|
-
codeLabel?: string;
|
|
17
|
-
submitButton?: string;
|
|
18
|
-
errorMessage?: string;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export declare const TotpVerificationForm: FC<TotpVerificationFormProps>;
|
|
22
|
-
export default TotpVerificationForm;
|
|
23
|
-
//# sourceMappingURL=TotpVerificationForm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TotpVerificationForm.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TotpVerificationForm.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,yBAAyB;IACxC,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,gBAAgB,EAAE,MAAM,KACrB,OAAO,CACV;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,eAAe,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAC7D,CAAC;IACF,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAeD,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CA0G9D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TotpVerificationForm = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const material_1 = require("@mui/material");
|
|
7
|
-
const formik_1 = require("formik");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const Yup = tslib_1.__importStar(require("yup"));
|
|
10
|
-
const defaultLabels = {
|
|
11
|
-
title: 'Two-Factor Authentication',
|
|
12
|
-
codeLabel: 'Authentication code',
|
|
13
|
-
submitButton: 'Verify',
|
|
14
|
-
errorMessage: 'An unexpected error occurred',
|
|
15
|
-
};
|
|
16
|
-
const totpCodeSchema = Yup.object({
|
|
17
|
-
code: Yup.string()
|
|
18
|
-
.required('Authentication code is required')
|
|
19
|
-
.matches(/^\d{6}$/, 'Code must be exactly 6 digits'),
|
|
20
|
-
});
|
|
21
|
-
const TotpVerificationForm = ({ pendingTotpToken, onSubmit, labels = {}, }) => {
|
|
22
|
-
const [submitError, setSubmitError] = (0, react_1.useState)(null);
|
|
23
|
-
const resolvedLabels = {
|
|
24
|
-
title: labels.title ?? defaultLabels.title,
|
|
25
|
-
codeLabel: labels.codeLabel ?? defaultLabels.codeLabel,
|
|
26
|
-
submitButton: labels.submitButton ?? defaultLabels.submitButton,
|
|
27
|
-
errorMessage: labels.errorMessage ?? defaultLabels.errorMessage,
|
|
28
|
-
};
|
|
29
|
-
const formik = (0, formik_1.useFormik)({
|
|
30
|
-
initialValues: {
|
|
31
|
-
code: '',
|
|
32
|
-
},
|
|
33
|
-
validationSchema: totpCodeSchema,
|
|
34
|
-
onSubmit: async (values, { setSubmitting }) => {
|
|
35
|
-
try {
|
|
36
|
-
setSubmitError(null);
|
|
37
|
-
const result = await onSubmit(values.code, pendingTotpToken);
|
|
38
|
-
if ('error' in result) {
|
|
39
|
-
setSubmitError(result.error);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
catch {
|
|
43
|
-
setSubmitError(resolvedLabels.errorMessage);
|
|
44
|
-
}
|
|
45
|
-
finally {
|
|
46
|
-
setSubmitting(false);
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
const errorId = 'totp-verification-error';
|
|
51
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Container, { component: "main", maxWidth: "xs", children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
52
|
-
marginTop: 8,
|
|
53
|
-
display: 'flex',
|
|
54
|
-
flexDirection: 'column',
|
|
55
|
-
alignItems: 'center',
|
|
56
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { component: "h1", variant: "h5", children: resolvedLabels.title }), (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "form", onSubmit: formik.handleSubmit, sx: { mt: 2, width: '100%' }, children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { margin: "normal", required: true, fullWidth: true, id: "code", name: "code", label: resolvedLabels.codeLabel, inputProps: {
|
|
57
|
-
'aria-label': resolvedLabels.codeLabel,
|
|
58
|
-
inputMode: 'numeric',
|
|
59
|
-
maxLength: 6,
|
|
60
|
-
pattern: '\\d{6}',
|
|
61
|
-
...(submitError ? { 'aria-describedby': errorId } : {}),
|
|
62
|
-
}, autoComplete: "one-time-code", autoFocus: true, value: formik.values.code, onChange: formik.handleChange, onBlur: formik.handleBlur, error: (formik.touched.code && Boolean(formik.errors.code)) ||
|
|
63
|
-
Boolean(submitError), helperText: formik.touched.code && formik.errors.code }), submitError && ((0, jsx_runtime_1.jsx)(material_1.Typography, { id: errorId, color: "error", variant: "body2", sx: { mt: 1 }, role: "alert", children: submitError })), (0, jsx_runtime_1.jsx)(material_1.Button, { type: "submit", fullWidth: true, variant: "contained", sx: { mt: 3, mb: 2 }, disabled: formik.isSubmitting, children: resolvedLabels.submitButton })] })] }) }));
|
|
64
|
-
};
|
|
65
|
-
exports.TotpVerificationForm = TotpVerificationForm;
|
|
66
|
-
exports.default = exports.TotpVerificationForm;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
interface FCParams<TEnum extends string> {
|
|
2
|
-
componentId: string;
|
|
3
|
-
stringKey: TEnum;
|
|
4
|
-
vars?: Record<string, string | number>;
|
|
5
|
-
}
|
|
6
|
-
export declare const TranslatedTitle: <TEnum extends string>({ componentId, stringKey, vars, }: FCParams<TEnum>) => null;
|
|
7
|
-
export default TranslatedTitle;
|
|
8
|
-
//# sourceMappingURL=TranslatedTitle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TranslatedTitle.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TranslatedTitle.tsx"],"names":[],"mappings":"AAKA,UAAU,QAAQ,CAAC,KAAK,SAAS,MAAM;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,KAAK,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,eAAe,GAAI,KAAK,SAAS,MAAM,EAAE,mCAInD,QAAQ,CAAC,KAAK,CAAC,KAAG,IAapB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|