@digitaldefiance/express-suite-react-components 5.0.2 → 5.0.4
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/package.json +5 -4
- package/src/auth/AdminRoute.d.ts +8 -0
- package/src/auth/AdminRoute.d.ts.map +1 -0
- package/src/auth/AdminRoute.js +28 -0
- package/src/auth/Private.d.ts +6 -0
- package/src/auth/Private.d.ts.map +1 -0
- package/src/auth/Private.js +14 -0
- package/src/auth/PrivateRoute.d.ts +8 -0
- package/src/auth/PrivateRoute.d.ts.map +1 -0
- package/src/auth/PrivateRoute.js +23 -0
- package/src/auth/UnAuth.d.ts +6 -0
- package/src/auth/UnAuth.d.ts.map +1 -0
- package/src/auth/UnAuth.js +14 -0
- package/src/auth/UnAuthRoute.d.ts +8 -0
- package/src/auth/UnAuthRoute.d.ts.map +1 -0
- package/src/auth/UnAuthRoute.js +22 -0
- package/src/auth/{index.ts → index.d.ts} +3 -2
- package/src/auth/index.d.ts.map +1 -0
- package/src/auth/index.js +12 -0
- package/src/components/ApiAccess.d.ts +16 -0
- package/src/components/ApiAccess.d.ts.map +1 -0
- package/src/components/ApiAccess.js +77 -0
- package/src/components/BackupCodeLoginForm.d.ts +43 -0
- package/src/components/BackupCodeLoginForm.d.ts.map +1 -0
- package/src/components/BackupCodeLoginForm.js +139 -0
- package/src/components/BackupCodesForm.d.ts +26 -0
- package/src/components/BackupCodesForm.d.ts.map +1 -0
- package/src/components/BackupCodesForm.js +120 -0
- package/src/components/CategoryMenu.d.ts +17 -0
- package/src/components/CategoryMenu.d.ts.map +1 -0
- package/src/components/CategoryMenu.js +65 -0
- package/src/components/ChangePasswordForm.d.ts +26 -0
- package/src/components/ChangePasswordForm.d.ts.map +1 -0
- package/src/components/ChangePasswordForm.js +78 -0
- package/src/components/ConfirmationDialog.d.ts +13 -0
- package/src/components/ConfirmationDialog.d.ts.map +1 -0
- package/src/components/ConfirmationDialog.js +10 -0
- package/src/components/CurrencyCodeSelector.d.ts +9 -0
- package/src/components/CurrencyCodeSelector.d.ts.map +1 -0
- package/src/components/CurrencyCodeSelector.js +31 -0
- package/src/components/CurrencyInput.d.ts +13 -0
- package/src/components/CurrencyInput.d.ts.map +1 -0
- package/src/components/CurrencyInput.js +22 -0
- package/src/components/DashboardPage.d.ts +8 -0
- package/src/components/DashboardPage.d.ts.map +1 -0
- package/src/components/DashboardPage.js +10 -0
- package/src/components/DropdownMenu.d.ts +13 -0
- package/src/components/DropdownMenu.d.ts.map +1 -0
- package/src/components/DropdownMenu.js +63 -0
- package/src/components/ExpirationSecondsSelector.d.ts +13 -0
- package/src/components/ExpirationSecondsSelector.d.ts.map +1 -0
- package/src/components/ExpirationSecondsSelector.js +32 -0
- package/src/components/FakeEmailAdminPanel.d.ts +23 -0
- package/src/components/FakeEmailAdminPanel.d.ts.map +1 -0
- package/src/components/FakeEmailAdminPanel.js +147 -0
- package/src/components/Flag.d.ts +20 -0
- package/src/components/Flag.d.ts.map +1 -0
- package/src/components/Flag.js +43 -0
- package/src/components/ForgotPasswordForm.d.ts +18 -0
- package/src/components/ForgotPasswordForm.d.ts.map +1 -0
- package/src/components/ForgotPasswordForm.js +61 -0
- package/src/components/LoginForm.d.ts +44 -0
- package/src/components/LoginForm.d.ts.map +1 -0
- package/src/components/LoginForm.js +123 -0
- package/src/components/LogoutPage.d.ts +8 -0
- package/src/components/LogoutPage.d.ts.map +1 -0
- package/src/components/LogoutPage.js +16 -0
- package/src/components/RegisterForm.d.ts +100 -0
- package/src/components/RegisterForm.d.ts.map +1 -0
- package/src/components/RegisterForm.js +306 -0
- package/src/components/ResetPasswordForm.d.ts +23 -0
- package/src/components/ResetPasswordForm.d.ts.map +1 -0
- package/src/components/ResetPasswordForm.js +78 -0
- package/src/components/SideMenu.d.ts +8 -0
- package/src/components/SideMenu.d.ts.map +1 -0
- package/src/components/SideMenu.js +25 -0
- package/src/components/SideMenuListItem.d.ts +13 -0
- package/src/components/SideMenuListItem.d.ts.map +1 -0
- package/src/components/SideMenuListItem.js +44 -0
- package/src/components/T.d.ts +7 -0
- package/src/components/T.d.ts.map +1 -0
- package/src/components/T.js +13 -0
- package/src/components/TDiv.d.ts +9 -0
- package/src/components/TDiv.d.ts.map +1 -0
- package/src/components/TDiv.js +14 -0
- package/src/components/TImgAlt.d.ts +10 -0
- package/src/components/TImgAlt.d.ts.map +1 -0
- package/src/components/TImgAlt.js +14 -0
- package/src/components/TopMenu.d.ts +50 -0
- package/src/components/TopMenu.d.ts.map +1 -0
- package/src/components/TopMenu.js +79 -0
- package/src/components/TotpSetupForm.d.ts +24 -0
- package/src/components/TotpSetupForm.d.ts.map +1 -0
- package/src/components/TotpSetupForm.js +82 -0
- package/src/components/TotpVerificationForm.d.ts +23 -0
- package/src/components/TotpVerificationForm.d.ts.map +1 -0
- package/src/components/TotpVerificationForm.js +66 -0
- package/src/components/TranslatedTitle.d.ts +8 -0
- package/src/components/TranslatedTitle.d.ts.map +1 -0
- package/src/components/TranslatedTitle.js +15 -0
- package/src/components/UserLanguageSelector.d.ts +4 -0
- package/src/components/UserLanguageSelector.d.ts.map +1 -0
- package/src/components/UserLanguageSelector.js +31 -0
- package/src/components/UserMenu.d.ts +4 -0
- package/src/components/UserMenu.d.ts.map +1 -0
- package/src/components/UserMenu.js +12 -0
- package/src/components/UserSettingsForm.d.ts +113 -0
- package/src/components/UserSettingsForm.d.ts.map +1 -0
- package/src/components/UserSettingsForm.js +269 -0
- package/src/components/VerifyEmailPage.d.ts +24 -0
- package/src/components/VerifyEmailPage.d.ts.map +1 -0
- package/src/components/VerifyEmailPage.js +81 -0
- package/src/components/{index.ts → index.d.ts} +1 -1
- package/src/components/index.d.ts.map +1 -0
- package/src/components/index.js +35 -0
- package/src/contexts/AuthProvider.d.ts +19 -0
- package/src/contexts/AuthProvider.d.ts.map +1 -0
- package/src/contexts/AuthProvider.js +514 -0
- package/src/contexts/I18nProvider.d.ts +27 -0
- package/src/contexts/I18nProvider.d.ts.map +1 -0
- package/src/contexts/I18nProvider.js +60 -0
- package/src/contexts/MenuContext.d.ts +28 -0
- package/src/contexts/MenuContext.d.ts.map +1 -0
- package/src/contexts/MenuContext.js +307 -0
- package/src/contexts/SuiteConfigProvider.d.ts +44 -0
- package/src/contexts/SuiteConfigProvider.d.ts.map +1 -0
- package/src/contexts/SuiteConfigProvider.js +43 -0
- package/src/contexts/ThemeProvider.d.ts +15 -0
- package/src/contexts/ThemeProvider.d.ts.map +1 -0
- package/src/contexts/ThemeProvider.js +36 -0
- package/src/contexts/auth-context.d.ts +172 -0
- package/src/contexts/auth-context.d.ts.map +1 -0
- package/src/contexts/auth-context.js +13 -0
- package/src/contexts/{index.ts → index.d.ts} +1 -0
- package/src/contexts/index.d.ts.map +1 -0
- package/src/contexts/index.js +8 -0
- package/src/hooks/{index.ts → index.d.ts} +1 -0
- package/src/hooks/index.d.ts.map +1 -0
- package/src/hooks/index.js +9 -0
- package/src/hooks/useAuthenticatedApi.d.ts +34 -0
- package/src/hooks/useAuthenticatedApi.d.ts.map +1 -0
- package/src/hooks/useAuthenticatedApi.js +46 -0
- package/src/hooks/useBackupCodes.d.ts +15 -0
- package/src/hooks/useBackupCodes.d.ts.map +1 -0
- package/src/hooks/useBackupCodes.js +74 -0
- package/src/hooks/useEmailVerification.d.ts +10 -0
- package/src/hooks/useEmailVerification.d.ts.map +1 -0
- package/src/hooks/useEmailVerification.js +40 -0
- package/src/hooks/useExpiringValue.d.ts +14 -0
- package/src/hooks/useExpiringValue.d.ts.map +1 -0
- package/src/hooks/useExpiringValue.js +53 -0
- package/src/hooks/useLocalStorage.d.ts +2 -0
- package/src/hooks/useLocalStorage.d.ts.map +1 -0
- package/src/hooks/useLocalStorage.js +15 -0
- package/src/hooks/useUserSettings.d.ts +48 -0
- package/src/hooks/useUserSettings.d.ts.map +1 -0
- package/src/hooks/useUserSettings.js +171 -0
- package/src/{index.ts → index.d.ts} +1 -1
- package/src/index.d.ts.map +1 -0
- package/src/index.js +12 -0
- package/src/interfaces/IAppConfig.d.ts +8 -0
- package/src/interfaces/IAppConfig.d.ts.map +1 -0
- package/src/interfaces/IAppConfig.js +2 -0
- package/src/interfaces/ICategoryConfig.d.ts +41 -0
- package/src/interfaces/ICategoryConfig.d.ts.map +1 -0
- package/src/interfaces/ICategoryConfig.js +2 -0
- package/src/interfaces/IMenuConfig.d.ts +28 -0
- package/src/interfaces/IMenuConfig.d.ts.map +1 -0
- package/src/interfaces/IMenuConfig.js +2 -0
- package/src/interfaces/IMenuOption.d.ts +82 -0
- package/src/interfaces/IMenuOption.d.ts.map +1 -0
- package/src/interfaces/IMenuOption.js +2 -0
- package/src/interfaces/{index.ts → index.d.ts} +1 -0
- package/src/interfaces/index.d.ts.map +1 -0
- package/src/interfaces/index.js +7 -0
- package/src/services/__mocks__/authService.d.ts +21 -0
- package/src/services/__mocks__/authService.d.ts.map +1 -0
- package/src/services/__mocks__/authService.js +15 -0
- package/src/services/api.d.ts +3 -0
- package/src/services/api.d.ts.map +1 -0
- package/src/services/api.js +14 -0
- package/src/services/authService.d.ts +126 -0
- package/src/services/authService.d.ts.map +1 -0
- package/src/services/authService.js +471 -0
- package/src/services/authenticatedApi.d.ts +3 -0
- package/src/services/authenticatedApi.d.ts.map +1 -0
- package/src/services/authenticatedApi.js +18 -0
- package/src/services/index.d.ts +4 -0
- package/src/services/index.d.ts.map +1 -0
- package/src/services/index.js +6 -0
- package/src/types/MenuType.d.ts +11 -0
- package/src/types/MenuType.d.ts.map +1 -0
- package/src/types/MenuType.js +12 -0
- package/src/types/expirationSeconds.d.ts +3 -0
- package/src/types/expirationSeconds.d.ts.map +1 -0
- package/src/types/expirationSeconds.js +17 -0
- package/src/types/index.d.ts +2 -0
- package/src/types/index.d.ts.map +1 -0
- package/src/types/index.js +4 -0
- package/src/types/translation.d.ts +10 -0
- package/src/types/translation.d.ts.map +1 -0
- package/src/types/translation.js +9 -0
- package/src/wrappers/BackupCodeLoginWrapper.d.ts +8 -0
- package/src/wrappers/BackupCodeLoginWrapper.d.ts.map +1 -0
- package/src/wrappers/BackupCodeLoginWrapper.js +20 -0
- package/src/wrappers/BackupCodesWrapper.d.ts +7 -0
- package/src/wrappers/BackupCodesWrapper.d.ts.map +1 -0
- package/src/wrappers/BackupCodesWrapper.js +17 -0
- package/src/wrappers/ChangePasswordFormWrapper.d.ts +8 -0
- package/src/wrappers/ChangePasswordFormWrapper.d.ts.map +1 -0
- package/src/wrappers/ChangePasswordFormWrapper.js +21 -0
- package/src/wrappers/ForgotPasswordFormWrapper.d.ts +8 -0
- package/src/wrappers/ForgotPasswordFormWrapper.d.ts.map +1 -0
- package/src/wrappers/ForgotPasswordFormWrapper.js +29 -0
- package/src/wrappers/LoginFormWrapper.d.ts +21 -0
- package/src/wrappers/LoginFormWrapper.d.ts.map +1 -0
- package/src/wrappers/LoginFormWrapper.js +72 -0
- package/src/wrappers/LogoutPageWrapper.d.ts +9 -0
- package/src/wrappers/LogoutPageWrapper.d.ts.map +1 -0
- package/src/wrappers/LogoutPageWrapper.js +21 -0
- package/src/wrappers/RegisterFormWrapper.d.ts +20 -0
- package/src/wrappers/RegisterFormWrapper.d.ts.map +1 -0
- package/src/wrappers/RegisterFormWrapper.js +51 -0
- package/src/wrappers/ResetPasswordFormWrapper.d.ts +9 -0
- package/src/wrappers/ResetPasswordFormWrapper.d.ts.map +1 -0
- package/src/wrappers/ResetPasswordFormWrapper.js +34 -0
- package/src/wrappers/UserSettingsFormWrapper.d.ts +29 -0
- package/src/wrappers/UserSettingsFormWrapper.d.ts.map +1 -0
- package/src/wrappers/UserSettingsFormWrapper.js +95 -0
- package/src/wrappers/VerifyEmailPageWrapper.d.ts +8 -0
- package/src/wrappers/VerifyEmailPageWrapper.d.ts.map +1 -0
- package/src/wrappers/VerifyEmailPageWrapper.js +21 -0
- package/src/wrappers/{index.tsx → index.d.ts} +1 -10
- package/src/wrappers/index.d.ts.map +1 -0
- package/src/wrappers/index.js +24 -0
- package/LICENSE +0 -21
- package/src/auth/AdminRoute.tsx +0 -54
- package/src/auth/Private.tsx +0 -17
- package/src/auth/PrivateRoute.tsx +0 -28
- package/src/auth/UnAuth.tsx +0 -16
- package/src/auth/UnAuthRoute.tsx +0 -30
- package/src/components/ApiAccess.tsx +0 -175
- package/src/components/BackupCodeLoginForm.tsx +0 -489
- package/src/components/BackupCodesForm.tsx +0 -287
- package/src/components/CategoryMenu.tsx +0 -155
- package/src/components/ChangePasswordForm.tsx +0 -273
- package/src/components/ConfirmationDialog.tsx +0 -48
- package/src/components/CurrencyCodeSelector.tsx +0 -60
- package/src/components/CurrencyInput.tsx +0 -80
- package/src/components/DashboardPage.tsx +0 -24
- package/src/components/DropdownMenu.tsx +0 -105
- package/src/components/ExpirationSecondsSelector.tsx +0 -60
- package/src/components/FakeEmailAdminPanel.tsx +0 -374
- package/src/components/Flag.tsx +0 -52
- package/src/components/ForgotPasswordForm.tsx +0 -174
- package/src/components/LoginForm.tsx +0 -468
- package/src/components/LogoutPage.tsx +0 -21
- package/src/components/RegisterForm.tsx +0 -1169
- package/src/components/ResetPasswordForm.tsx +0 -247
- package/src/components/SideMenu.tsx +0 -46
- package/src/components/SideMenuListItem.tsx +0 -75
- package/src/components/T.tsx +0 -24
- package/src/components/TDiv.tsx +0 -26
- package/src/components/TImgAlt.tsx +0 -28
- package/src/components/TopMenu.tsx +0 -252
- package/src/components/TotpSetupForm.tsx +0 -188
- package/src/components/TotpVerificationForm.tsx +0 -148
- package/src/components/TranslatedTitle.tsx +0 -31
- package/src/components/UserLanguageSelector.tsx +0 -45
- package/src/components/UserMenu.tsx +0 -15
- package/src/components/UserSettingsForm.tsx +0 -904
- package/src/components/VerifyEmailPage.tsx +0 -222
- package/src/components/__tests__/RegisterForm.totp.spec.tsx +0 -377
- package/src/components/__tests__/TotpSetupForm.spec.tsx +0 -258
- package/src/components/__tests__/TotpVerificationForm.spec.tsx +0 -259
- package/src/components/__tests__/UserSettingsForm.totp.spec.tsx +0 -396
- package/src/contexts/AuthProvider.spec.tsx +0 -1284
- package/src/contexts/AuthProvider.tsx +0 -977
- package/src/contexts/I18nProvider.tsx +0 -164
- package/src/contexts/MenuContext.tsx +0 -426
- package/src/contexts/SuiteConfigProvider.tsx +0 -93
- package/src/contexts/ThemeProvider.tsx +0 -67
- package/src/hooks/useAuthenticatedApi.tsx +0 -67
- package/src/hooks/useBackupCodes.ts +0 -105
- package/src/hooks/useEmailVerification.ts +0 -54
- package/src/hooks/useExpiringValue.ts +0 -78
- package/src/hooks/useLocalStorage.ts +0 -18
- package/src/hooks/useUserSettings.ts +0 -271
- package/src/interfaces/IAppConfig.ts +0 -7
- package/src/interfaces/ICategoryConfig.ts +0 -41
- package/src/interfaces/IMenuConfig.ts +0 -28
- package/src/interfaces/IMenuOption.ts +0 -79
- package/src/services/__mocks__/authService.ts +0 -14
- package/src/services/__tests__/authService.totp.property.spec.ts +0 -360
- package/src/services/__tests__/authService.totp.spec.ts +0 -439
- package/src/services/api.ts +0 -13
- package/src/services/authService.ts +0 -692
- package/src/services/authenticatedApi.ts +0 -17
- package/src/services/index.ts +0 -3
- package/src/types/MenuType.ts +0 -15
- package/src/types/expirationSeconds.ts +0 -18
- package/src/types/index.ts +0 -1
- package/src/types/translation.ts +0 -20
- package/src/wrappers/BackupCodeLoginWrapper.tsx +0 -34
- package/src/wrappers/BackupCodesWrapper.tsx +0 -28
- package/src/wrappers/ChangePasswordFormWrapper.tsx +0 -34
- package/src/wrappers/ForgotPasswordFormWrapper.tsx +0 -45
- package/src/wrappers/LoginFormWrapper.tsx +0 -108
- package/src/wrappers/LogoutPageWrapper.tsx +0 -30
- package/src/wrappers/RegisterFormWrapper.tsx +0 -109
- package/src/wrappers/ResetPasswordFormWrapper.tsx +0 -57
- package/src/wrappers/UserSettingsFormWrapper.tsx +0 -140
- package/src/wrappers/VerifyEmailPageWrapper.tsx +0 -27
- package/src/wrappers/__tests__/LoginFormWrapper.totp.spec.tsx +0 -339
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BackupCodesForm = 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 BackupCodesForm = ({ onSubmit, backupCodesRemaining = null, mnemonicValidation, passwordValidation, labels = {}, }) => {
|
|
13
|
+
const { tComponent } = (0, contexts_1.useI18n)();
|
|
14
|
+
const [apiError, setApiError] = (0, react_1.useState)(null);
|
|
15
|
+
const [apiSuccess, setApiSuccess] = (0, react_1.useState)(null);
|
|
16
|
+
const [backupCodes, setBackupCodes] = (0, react_1.useState)(null);
|
|
17
|
+
const validation = {
|
|
18
|
+
mnemonic: mnemonicValidation ||
|
|
19
|
+
Yup.string()
|
|
20
|
+
.trim()
|
|
21
|
+
.matches(suite_core_lib_1.Constants.MnemonicRegex, tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_MnemonicRegex))
|
|
22
|
+
.optional(),
|
|
23
|
+
password: passwordValidation ||
|
|
24
|
+
Yup.string()
|
|
25
|
+
.trim()
|
|
26
|
+
.matches(suite_core_lib_1.Constants.PasswordRegex, tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_PasswordRegexErrorTemplate))
|
|
27
|
+
.optional(),
|
|
28
|
+
};
|
|
29
|
+
const translatedLabels = {
|
|
30
|
+
codesRemaining: labels.codesRemaining ||
|
|
31
|
+
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.BackupCodeRecovery_CodesRemainingTemplate),
|
|
32
|
+
mnemonic: labels.mnemonic ||
|
|
33
|
+
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Mnemonic),
|
|
34
|
+
password: labels.password ||
|
|
35
|
+
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Password),
|
|
36
|
+
generateButton: labels.generateButton ||
|
|
37
|
+
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.BackupCodeRecovery_GenerateNewCodes),
|
|
38
|
+
successTitle: labels.successTitle ||
|
|
39
|
+
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.BackupCodeRecovery_YourNewCodes),
|
|
40
|
+
xorError: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_MnemonicOrPasswordRequired),
|
|
41
|
+
unexpectedError: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_UnexpectedError),
|
|
42
|
+
};
|
|
43
|
+
const validationSchema = Yup.object({
|
|
44
|
+
mnemonic: validation.mnemonic,
|
|
45
|
+
password: validation.password,
|
|
46
|
+
})
|
|
47
|
+
.test('xor-mnemonic-password-mnemonic', translatedLabels.xorError, function (value) {
|
|
48
|
+
const mnemonic = value?.mnemonic?.trim() ?? '';
|
|
49
|
+
const password = value?.password?.trim() ?? '';
|
|
50
|
+
const hasMnemonic = mnemonic.length > 0;
|
|
51
|
+
const hasPassword = password.length > 0;
|
|
52
|
+
if (!hasMnemonic && !hasPassword) {
|
|
53
|
+
return this.createError({
|
|
54
|
+
path: 'mnemonic',
|
|
55
|
+
message: translatedLabels.xorError,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (hasMnemonic && hasPassword) {
|
|
59
|
+
return this.createError({
|
|
60
|
+
path: 'mnemonic',
|
|
61
|
+
message: translatedLabels.xorError,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
})
|
|
66
|
+
.test('xor-mnemonic-password-password', translatedLabels.xorError, function (value) {
|
|
67
|
+
const mnemonic = value?.mnemonic?.trim() ?? '';
|
|
68
|
+
const password = value?.password?.trim() ?? '';
|
|
69
|
+
const hasMnemonic = mnemonic.length > 0;
|
|
70
|
+
const hasPassword = password.length > 0;
|
|
71
|
+
if (!hasMnemonic && !hasPassword) {
|
|
72
|
+
return this.createError({
|
|
73
|
+
path: 'password',
|
|
74
|
+
message: translatedLabels.xorError,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (hasMnemonic && hasPassword) {
|
|
78
|
+
return this.createError({
|
|
79
|
+
path: 'password',
|
|
80
|
+
message: translatedLabels.xorError,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return true;
|
|
84
|
+
});
|
|
85
|
+
const formik = (0, formik_1.useFormik)({
|
|
86
|
+
initialValues: {
|
|
87
|
+
password: '',
|
|
88
|
+
mnemonic: '',
|
|
89
|
+
},
|
|
90
|
+
validationSchema,
|
|
91
|
+
onSubmit: async (values, { setSubmitting }) => {
|
|
92
|
+
try {
|
|
93
|
+
const result = await onSubmit(values);
|
|
94
|
+
if (result && result.backupCodes) {
|
|
95
|
+
setApiSuccess(translatedLabels.successTitle);
|
|
96
|
+
setBackupCodes(result.backupCodes);
|
|
97
|
+
}
|
|
98
|
+
if (result && result.message) {
|
|
99
|
+
setApiSuccess(result.message);
|
|
100
|
+
}
|
|
101
|
+
setApiError(null);
|
|
102
|
+
}
|
|
103
|
+
catch (e) {
|
|
104
|
+
setApiSuccess(null);
|
|
105
|
+
const error = e;
|
|
106
|
+
setApiError(error.response?.data?.message ?? translatedLabels.unexpectedError);
|
|
107
|
+
}
|
|
108
|
+
finally {
|
|
109
|
+
setSubmitting(false);
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Container, { component: "main", maxWidth: "xs", children: [(0, jsx_runtime_1.jsx)(material_1.Box, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, { component: "h1", variant: "h5", children: translatedLabels.codesRemaining.replace('{count}', String(backupCodesRemaining ?? 0)) }) }), (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, { margin: "normal", fullWidth: true, id: "mnemonic", label: translatedLabels.mnemonic, type: "password", name: "mnemonic", autoComplete: "mnemonic", autoFocus: true, value: formik.values.mnemonic, onChange: formik.handleChange, onBlur: formik.handleBlur, error: (formik.touched.mnemonic || formik.submitCount > 0) &&
|
|
114
|
+
Boolean(formik.errors.mnemonic), helperText: (formik.touched.mnemonic || formik.submitCount > 0) &&
|
|
115
|
+
formik.errors.mnemonic }), (0, jsx_runtime_1.jsx)(material_1.TextField, { margin: "normal", fullWidth: true, name: "password", label: translatedLabels.password, type: "password", id: "password", value: formik.values.password, onChange: formik.handleChange, onBlur: formik.handleBlur, error: (formik.touched.password || formik.submitCount > 0) &&
|
|
116
|
+
Boolean(formik.errors.password), helperText: (formik.touched.password || formik.submitCount > 0) &&
|
|
117
|
+
formik.errors.password }), (0, jsx_runtime_1.jsx)(material_1.Button, { type: "submit", fullWidth: true, variant: "contained", sx: { mt: 2 }, children: translatedLabels.generateButton })] }), apiError && ((0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "error", sx: { mt: 2, mb: 2 }, children: apiError })), backupCodes && apiSuccess && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { mt: 2, mb: 2 }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { component: "h2", variant: "h6", children: apiSuccess }), (0, jsx_runtime_1.jsx)("ul", { children: backupCodes.map((code, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)("pre", { children: code }) }, index))) })] }))] }));
|
|
118
|
+
};
|
|
119
|
+
exports.BackupCodesForm = BackupCodesForm;
|
|
120
|
+
exports.default = exports.BackupCodesForm;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ICategoryConfig } from '../interfaces/ICategoryConfig';
|
|
3
|
+
import { IMenuConfig } from '../interfaces/IMenuConfig';
|
|
4
|
+
export interface CategoryMenuProps {
|
|
5
|
+
category: ICategoryConfig;
|
|
6
|
+
menus: IMenuConfig[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Renders an AppBar icon button that opens a popover containing a grid of
|
|
10
|
+
* icon tiles. Each tile is a {@link DropdownMenu} for one of the supplied
|
|
11
|
+
* `menus`, preserving its existing sub-menu behaviour. Use this together with
|
|
12
|
+
* `IMenuConfig.category` to collapse many top-bar icons into a small number
|
|
13
|
+
* of category containers (a "mega-menu" pattern).
|
|
14
|
+
*/
|
|
15
|
+
export declare const CategoryMenu: FC<CategoryMenuProps>;
|
|
16
|
+
export default CategoryMenu;
|
|
17
|
+
//# sourceMappingURL=CategoryMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CategoryMenu.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/CategoryMenu.tsx"],"names":[],"mappings":"AAQA,OAAO,EACL,EAAE,EAMH,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAwH9C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CategoryMenu = 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 DropdownMenu_1 = require("./DropdownMenu");
|
|
8
|
+
/**
|
|
9
|
+
* Renders an AppBar icon button that opens a popover containing a grid of
|
|
10
|
+
* icon tiles. Each tile is a {@link DropdownMenu} for one of the supplied
|
|
11
|
+
* `menus`, preserving its existing sub-menu behaviour. Use this together with
|
|
12
|
+
* `IMenuConfig.category` to collapse many top-bar icons into a small number
|
|
13
|
+
* of category containers (a "mega-menu" pattern).
|
|
14
|
+
*/
|
|
15
|
+
const CategoryMenu = ({ category, menus }) => {
|
|
16
|
+
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
17
|
+
const handleOpen = (0, react_1.useCallback)((event) => {
|
|
18
|
+
setAnchorEl(event.currentTarget);
|
|
19
|
+
}, []);
|
|
20
|
+
const handleClose = (0, react_1.useCallback)(() => {
|
|
21
|
+
setAnchorEl(null);
|
|
22
|
+
}, []);
|
|
23
|
+
const columns = category.columns ?? 3;
|
|
24
|
+
const showLabels = category.showLabels ?? true;
|
|
25
|
+
const showHeader = category.showHeader ?? false;
|
|
26
|
+
const hideWhenEmpty = category.hideWhenEmpty ?? true;
|
|
27
|
+
const visibleMenus = (0, react_1.useMemo)(() => menus.filter((m) => !m.isUserMenu), [menus]);
|
|
28
|
+
if (visibleMenus.length === 0 && hideWhenEmpty) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
const trigger = ((0, jsx_runtime_1.jsx)(material_1.IconButton, { color: "inherit", onClick: handleOpen, "aria-label": category.label ?? category.id, "aria-haspopup": "true", "aria-expanded": Boolean(anchorEl) || undefined, children: category.icon }));
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [category.label ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: category.label, children: trigger })) : (trigger), (0, jsx_runtime_1.jsx)(material_1.Popover, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, transformOrigin: { vertical: 'top', horizontal: 'right' }, TransitionComponent: material_1.Fade, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { p: 1.5, minWidth: 64 * columns + 24 }, children: [showHeader && (category.header || category.label) && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "overline", sx: {
|
|
33
|
+
display: 'block',
|
|
34
|
+
px: 1,
|
|
35
|
+
pb: 1,
|
|
36
|
+
color: 'text.secondary',
|
|
37
|
+
lineHeight: 1.2,
|
|
38
|
+
}, children: category.header ?? category.label })), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
39
|
+
display: 'grid',
|
|
40
|
+
gridTemplateColumns: `repeat(${columns}, minmax(72px, 1fr))`,
|
|
41
|
+
gap: 1,
|
|
42
|
+
}, children: visibleMenus.map((menu, index) => {
|
|
43
|
+
const tileLabel = menu.label ?? String(menu.menuType);
|
|
44
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
45
|
+
display: 'flex',
|
|
46
|
+
flexDirection: 'column',
|
|
47
|
+
alignItems: 'center',
|
|
48
|
+
justifyContent: 'flex-start',
|
|
49
|
+
px: 0.5,
|
|
50
|
+
py: 0.5,
|
|
51
|
+
borderRadius: 1,
|
|
52
|
+
'&:hover': {
|
|
53
|
+
backgroundColor: 'action.hover',
|
|
54
|
+
},
|
|
55
|
+
}, children: [(0, jsx_runtime_1.jsx)(DropdownMenu_1.DropdownMenu, { menuType: menu.menuType, menuIcon: menu.menuIcon, action: menu.action, hideWhenEmpty: menu.hideWhenEmpty }), showLabels && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", sx: {
|
|
56
|
+
mt: -0.5,
|
|
57
|
+
textAlign: 'center',
|
|
58
|
+
lineHeight: 1.1,
|
|
59
|
+
color: 'text.primary',
|
|
60
|
+
userSelect: 'none',
|
|
61
|
+
}, children: tileLabel }))] }, `${category.id}-tile-${menu.menuType}-${index}`));
|
|
62
|
+
}) })] }) })] }));
|
|
63
|
+
};
|
|
64
|
+
exports.CategoryMenu = CategoryMenu;
|
|
65
|
+
exports.default = exports.CategoryMenu;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import * as Yup from 'yup';
|
|
3
|
+
export interface ChangePasswordFormValues {
|
|
4
|
+
currentPassword: string;
|
|
5
|
+
newPassword: string;
|
|
6
|
+
confirmPassword: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ChangePasswordFormProps {
|
|
9
|
+
onSubmit: (values: ChangePasswordFormValues) => Promise<{
|
|
10
|
+
success?: boolean;
|
|
11
|
+
error?: string;
|
|
12
|
+
}>;
|
|
13
|
+
titleText?: string;
|
|
14
|
+
currentPasswordLabel?: string;
|
|
15
|
+
newPasswordLabel?: string;
|
|
16
|
+
confirmPasswordLabel?: string;
|
|
17
|
+
submitButtonText?: string;
|
|
18
|
+
submittingButtonText?: string;
|
|
19
|
+
successMessage?: string;
|
|
20
|
+
currentPasswordValidation?: Yup.StringSchema;
|
|
21
|
+
newPasswordValidation?: Yup.StringSchema;
|
|
22
|
+
confirmPasswordValidation?: Yup.StringSchema;
|
|
23
|
+
}
|
|
24
|
+
export declare const ChangePasswordForm: FC<ChangePasswordFormProps>;
|
|
25
|
+
export default ChangePasswordForm;
|
|
26
|
+
//# sourceMappingURL=ChangePasswordForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangePasswordForm.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/ChangePasswordForm.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAG3B,MAAM,WAAW,wBAAwB;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,CACR,MAAM,EAAE,wBAAwB,KAC7B,OAAO,CAAC;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yBAAyB,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC;IAC7C,qBAAqB,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC;IACzC,yBAAyB,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC;CAC9C;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAqO1D,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChangePasswordForm = 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 ChangePasswordForm = ({ onSubmit, titleText, currentPasswordLabel, newPasswordLabel, confirmPasswordLabel, submitButtonText, submittingButtonText, successMessage, currentPasswordValidation, newPasswordValidation, confirmPasswordValidation, }) => {
|
|
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
|
+
currentPassword: currentPasswordValidation ||
|
|
18
|
+
Yup.string().required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required)),
|
|
19
|
+
newPassword: newPasswordValidation ||
|
|
20
|
+
Yup.string()
|
|
21
|
+
.min(suite_core_lib_1.Constants.PasswordMinLength, tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_PasswordMinLengthTemplate))
|
|
22
|
+
.required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required)),
|
|
23
|
+
confirmPassword: confirmPasswordValidation ||
|
|
24
|
+
Yup.string()
|
|
25
|
+
.oneOf([Yup.ref('newPassword')], tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_PasswordMatch))
|
|
26
|
+
.required(tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Validation_Required)),
|
|
27
|
+
};
|
|
28
|
+
const labels = {
|
|
29
|
+
title: titleText ||
|
|
30
|
+
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_ChangePassword),
|
|
31
|
+
currentPassword: currentPasswordLabel ||
|
|
32
|
+
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_CurrentPassword),
|
|
33
|
+
newPassword: newPasswordLabel ||
|
|
34
|
+
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_NewPassword),
|
|
35
|
+
confirmPassword: confirmPasswordLabel ||
|
|
36
|
+
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_ConfirmNewPassword),
|
|
37
|
+
submitButton: submitButtonText ||
|
|
38
|
+
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_ChangePassword),
|
|
39
|
+
submittingButton: submittingButtonText ||
|
|
40
|
+
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_ChangingPassword),
|
|
41
|
+
success: successMessage ||
|
|
42
|
+
tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.PasswordChange_Success),
|
|
43
|
+
};
|
|
44
|
+
const formik = (0, formik_1.useFormik)({
|
|
45
|
+
initialValues: {
|
|
46
|
+
currentPassword: '',
|
|
47
|
+
newPassword: '',
|
|
48
|
+
confirmPassword: '',
|
|
49
|
+
},
|
|
50
|
+
validationSchema: Yup.object({
|
|
51
|
+
currentPassword: validation.currentPassword,
|
|
52
|
+
newPassword: validation.newPassword,
|
|
53
|
+
confirmPassword: validation.confirmPassword,
|
|
54
|
+
}),
|
|
55
|
+
onSubmit: async (values, { resetForm }) => {
|
|
56
|
+
const result = await onSubmit(values);
|
|
57
|
+
if ('success' in result) {
|
|
58
|
+
setSuccess(true);
|
|
59
|
+
setApiError('');
|
|
60
|
+
resetForm();
|
|
61
|
+
}
|
|
62
|
+
else if ('error' in result && result.error) {
|
|
63
|
+
setApiError(result.error);
|
|
64
|
+
setSuccess(false);
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Container, { maxWidth: "sm", children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
69
|
+
mt: 8,
|
|
70
|
+
display: 'flex',
|
|
71
|
+
flexDirection: 'column',
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h4", component: "h1", gutterBottom: true, children: labels.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: "currentPassword", name: "currentPassword", label: labels.currentPassword, type: "password", value: formik.values.currentPassword, onChange: formik.handleChange, onBlur: formik.handleBlur, error: Boolean(formik.touched.currentPassword && formik.errors.currentPassword), helperText: formik.touched.currentPassword && formik.errors.currentPassword, margin: "normal" }), (0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, id: "newPassword", name: "newPassword", label: labels.newPassword, type: "password", value: formik.values.newPassword, onChange: formik.handleChange, onBlur: formik.handleBlur, error: Boolean(formik.touched.newPassword && formik.errors.newPassword), helperText: formik.touched.newPassword && formik.errors.newPassword, margin: "normal" }), (0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, id: "confirmPassword", name: "confirmPassword", label: labels.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: labels.success })), (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: formik.isSubmitting
|
|
74
|
+
? labels.submittingButton
|
|
75
|
+
: labels.submitButton })] })] }) }));
|
|
76
|
+
};
|
|
77
|
+
exports.ChangePasswordForm = ChangePasswordForm;
|
|
78
|
+
exports.default = exports.ChangePasswordForm;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ConfirmationDialogProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
title: string;
|
|
5
|
+
message: string;
|
|
6
|
+
confirmText?: string;
|
|
7
|
+
cancelText?: string;
|
|
8
|
+
onConfirm: () => void;
|
|
9
|
+
onCancel: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const ConfirmationDialog: React.FC<ConfirmationDialogProps>;
|
|
12
|
+
export default ConfirmationDialog;
|
|
13
|
+
//# sourceMappingURL=ConfirmationDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmationDialog.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/ConfirmationDialog.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAyBhE,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConfirmationDialog = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const ConfirmationDialog = ({ open, title, message, confirmText = 'Confirm', cancelText = 'Cancel', onConfirm, onCancel, }) => {
|
|
7
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Dialog, { open: open, onClose: onCancel, children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: title }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: message }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: onCancel, color: "primary", children: cancelText }), (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: onConfirm, color: "primary", children: confirmText })] })] }));
|
|
8
|
+
};
|
|
9
|
+
exports.ConfirmationDialog = ConfirmationDialog;
|
|
10
|
+
exports.default = exports.ConfirmationDialog;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface CurrencyCodeSelectorProps {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
onCurrencyChange?: (code: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const CurrencyCodeSelector: FC<CurrencyCodeSelectorProps>;
|
|
8
|
+
export default CurrencyCodeSelector;
|
|
9
|
+
//# sourceMappingURL=CurrencyCodeSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurrencyCodeSelector.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/CurrencyCodeSelector.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,EAAE,EAAE,MAAM,OAAO,CAAC;AAExC,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AAED,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CA8C9D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CurrencyCodeSelector = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const i18n_lib_1 = require("@digitaldefiance/i18n-lib");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const formik_1 = require("formik");
|
|
8
|
+
const CurrencyCodeSelector = ({ name, label, onCurrencyChange, }) => {
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(formik_1.Field, { name: name, children: ({ field, form }) => ((0, jsx_runtime_1.jsx)(material_1.TextField, { select: true, fullWidth: true, label: label, ...field, onChange: (event) => {
|
|
10
|
+
const selectedCode = event.target.value;
|
|
11
|
+
form.setFieldValue(name, selectedCode);
|
|
12
|
+
onCurrencyChange?.(selectedCode);
|
|
13
|
+
}, error: form.touched[name] && Boolean(form.errors[name]), helperText: form.touched[name] && form.errors[name], sx: {
|
|
14
|
+
'& .MuiSelect-select': {
|
|
15
|
+
paddingRight: '32px',
|
|
16
|
+
},
|
|
17
|
+
'& .MuiOutlinedInput-root': {
|
|
18
|
+
'& fieldset': {
|
|
19
|
+
borderColor: 'rgba(0, 0, 0, 0.23)',
|
|
20
|
+
},
|
|
21
|
+
'&:hover fieldset': {
|
|
22
|
+
borderColor: 'rgba(0, 0, 0, 0.87)',
|
|
23
|
+
},
|
|
24
|
+
'&.Mui-focused fieldset': {
|
|
25
|
+
borderColor: 'primary.main',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
}, children: i18n_lib_1.CurrencyCode.getAll().map((code) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: code, children: code }, code))) })) }));
|
|
29
|
+
};
|
|
30
|
+
exports.CurrencyCodeSelector = CurrencyCodeSelector;
|
|
31
|
+
exports.default = exports.CurrencyCodeSelector;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface CurrencyInputProps {
|
|
2
|
+
value: number;
|
|
3
|
+
onChange: (value: number) => void;
|
|
4
|
+
currencyCode?: string;
|
|
5
|
+
locale?: string;
|
|
6
|
+
label: string;
|
|
7
|
+
error?: boolean;
|
|
8
|
+
helperText?: string;
|
|
9
|
+
name: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const CurrencyInput: React.FC<CurrencyInputProps>;
|
|
12
|
+
export default CurrencyInput;
|
|
13
|
+
//# sourceMappingURL=CurrencyInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurrencyInput.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/CurrencyInput.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA8DtD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CurrencyInput = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const react_number_format_1 = require("react-number-format");
|
|
7
|
+
const i18n_lib_1 = require("@digitaldefiance/i18n-lib");
|
|
8
|
+
const CurrencyInput = ({ value, onChange, currencyCode = 'USD', locale = 'en-US', label, error, helperText, name, }) => {
|
|
9
|
+
const format = (0, i18n_lib_1.getCurrencyFormat)(locale, currencyCode);
|
|
10
|
+
if (format.position === 'infix') {
|
|
11
|
+
const [whole, decimal] = value.toString().split('.');
|
|
12
|
+
const displayValue = `${whole}${format.symbol}${format.decimalSeparator}${decimal || '00'}`;
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(react_number_format_1.NumericFormat, { customInput: material_1.TextField, fullWidth: true, margin: "normal", label: label, value: displayValue, thousandSeparator: format.groupSeparator, decimalSeparator: format.decimalSeparator, decimalScale: 2, fixedDecimalScale: true, valueIsNumericString: true, onValueChange: (values) => {
|
|
14
|
+
onChange(values.floatValue || 0);
|
|
15
|
+
}, error: error, helperText: helperText, name: name }));
|
|
16
|
+
}
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(react_number_format_1.NumericFormat, { customInput: material_1.TextField, fullWidth: true, margin: "normal", label: label, value: value, thousandSeparator: format.groupSeparator, decimalSeparator: format.decimalSeparator, decimalScale: 2, fixedDecimalScale: true, prefix: format.position === 'prefix' ? format.symbol + ' ' : undefined, suffix: format.position === 'postfix' ? ' ' + format.symbol : undefined, valueIsNumericString: true, onValueChange: (values) => {
|
|
18
|
+
onChange(values.floatValue || 0);
|
|
19
|
+
}, error: error, helperText: helperText, name: name }));
|
|
20
|
+
};
|
|
21
|
+
exports.CurrencyInput = CurrencyInput;
|
|
22
|
+
exports.default = exports.CurrencyInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardPage.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/DashboardPage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAahD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DashboardPage = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const DashboardPage = ({ title = 'Dashboard', children }) => {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Container, { maxWidth: "md", children: (0, jsx_runtime_1.jsxs)(material_1.Box, { my: 4, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h4", component: "h1", gutterBottom: true, align: "center", children: title }), (0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", justifyContent: "center", mt: 3, children: children })] }) }));
|
|
8
|
+
};
|
|
9
|
+
exports.DashboardPage = DashboardPage;
|
|
10
|
+
exports.default = exports.DashboardPage;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC, ReactElement } from 'react';
|
|
2
|
+
import { MenuType } from '../types/MenuType';
|
|
3
|
+
interface DropdownMenuProps {
|
|
4
|
+
menuType: MenuType;
|
|
5
|
+
menuIcon: ReactElement;
|
|
6
|
+
/** When true, the entire icon button is hidden if there are no menu options. Defaults to false. */
|
|
7
|
+
hideWhenEmpty?: boolean;
|
|
8
|
+
/** Optional callback invoked when the icon button is clicked. When provided alongside menu options, the action fires first and the dropdown still opens. When there are no menu options, only the action fires. */
|
|
9
|
+
action?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const DropdownMenu: FC<DropdownMenuProps>;
|
|
12
|
+
export default DropdownMenu;
|
|
13
|
+
//# sourceMappingURL=DropdownMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/DropdownMenu.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAc,YAAY,EAAyB,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C,UAAU,iBAAiB;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,mGAAmG;IACnG,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mNAAmN;IACnN,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAsF9C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DropdownMenu = 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 react_router_1 = require("react-router");
|
|
8
|
+
const MenuContext_1 = require("../contexts/MenuContext");
|
|
9
|
+
const DropdownMenu = ({ menuType, menuIcon, hideWhenEmpty = false, action }) => {
|
|
10
|
+
const { getMenuOptions } = (0, MenuContext_1.useMenu)();
|
|
11
|
+
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
12
|
+
const navigate = (0, react_router_1.useNavigate)();
|
|
13
|
+
const handleClose = (0, react_1.useCallback)(() => {
|
|
14
|
+
setAnchorEl(null);
|
|
15
|
+
}, []);
|
|
16
|
+
const handleMenuItemClick = (0, react_1.useCallback)((option) => (event) => {
|
|
17
|
+
event.stopPropagation();
|
|
18
|
+
if (option.action) {
|
|
19
|
+
option.action();
|
|
20
|
+
}
|
|
21
|
+
else if (option.link !== undefined) {
|
|
22
|
+
if (typeof option.link === 'object' &&
|
|
23
|
+
'pathname' in option.link &&
|
|
24
|
+
'state' in option.link) {
|
|
25
|
+
navigate(option.link.pathname, { state: option.link.state });
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
navigate(option.link);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
handleClose(); // Call handleClose after handling the click
|
|
32
|
+
}, [navigate, handleClose]);
|
|
33
|
+
const menuItems = getMenuOptions(menuType, false);
|
|
34
|
+
const hasItems = menuItems.length > 0;
|
|
35
|
+
const handleClick = (0, react_1.useCallback)((event) => {
|
|
36
|
+
if (action) {
|
|
37
|
+
action();
|
|
38
|
+
}
|
|
39
|
+
if (hasItems) {
|
|
40
|
+
setAnchorEl(event.currentTarget);
|
|
41
|
+
}
|
|
42
|
+
}, [action, hasItems]);
|
|
43
|
+
if (!hasItems && hideWhenEmpty) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { color: "inherit", onClick: (hasItems || action) ? handleClick : undefined, children: menuIcon }), hasItems && ((0, jsx_runtime_1.jsx)(material_1.Menu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, TransitionComponent: material_1.Fade, sx: {
|
|
47
|
+
'& .MuiPopover-paper': {
|
|
48
|
+
opacity: 0.5,
|
|
49
|
+
overflow: 'visible',
|
|
50
|
+
},
|
|
51
|
+
}, children: menuItems.map((option) => ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, { component: "li", onClick: handleMenuItemClick(option), sx: {
|
|
52
|
+
display: 'flex',
|
|
53
|
+
alignItems: 'center',
|
|
54
|
+
'& > svg': {
|
|
55
|
+
marginRight: 2,
|
|
56
|
+
width: 24,
|
|
57
|
+
height: 24,
|
|
58
|
+
},
|
|
59
|
+
...option.additionalSx
|
|
60
|
+
}, children: [option.icon, option.label] }, option.id))) }))] }));
|
|
61
|
+
};
|
|
62
|
+
exports.DropdownMenu = DropdownMenu;
|
|
63
|
+
exports.default = exports.DropdownMenu;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FormikProps } from 'formik';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
export interface ExpirationSecondsSelectorProps<T = Record<string, unknown>> {
|
|
4
|
+
name: string;
|
|
5
|
+
label: string;
|
|
6
|
+
formik: FormikProps<T>;
|
|
7
|
+
optionValues: number[];
|
|
8
|
+
optionNames: string[];
|
|
9
|
+
onChange?: (value: number) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const ExpirationSecondsSelector: FC<ExpirationSecondsSelectorProps<Record<string, unknown>>>;
|
|
12
|
+
export default ExpirationSecondsSelector;
|
|
13
|
+
//# sourceMappingURL=ExpirationSecondsSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpirationSecondsSelector.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/ExpirationSecondsSelector.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAe,EAAE,EAAE,MAAM,OAAO,CAAC;AAExC,MAAM,WAAW,8BAA8B,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,eAAO,MAAM,yBAAyB,EAAE,EAAE,CACxC,8BAA8B,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA2CxD,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExpirationSecondsSelector = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const ExpirationSecondsSelector = ({ name, label, formik, optionValues, optionNames, onChange }) => {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)(material_1.TextField, { select: true, fullWidth: true, label: label, name: name, value: formik.values[name] ?? '', onChange: (event) => {
|
|
8
|
+
const selectedValue = event.target.value;
|
|
9
|
+
formik.setFieldValue(name, selectedValue);
|
|
10
|
+
if (onChange) {
|
|
11
|
+
onChange(parseInt(selectedValue));
|
|
12
|
+
}
|
|
13
|
+
}, error: formik.touched[name] && Boolean(formik.errors[name]), helperText: formik.touched[name] && formik.errors[name], sx: {
|
|
14
|
+
mt: 1,
|
|
15
|
+
'& .MuiSelect-select': {
|
|
16
|
+
paddingRight: '32px',
|
|
17
|
+
},
|
|
18
|
+
'& .MuiOutlinedInput-root': {
|
|
19
|
+
'& fieldset': {
|
|
20
|
+
borderColor: 'rgba(0, 0, 0, 0.23)',
|
|
21
|
+
},
|
|
22
|
+
'&:hover fieldset': {
|
|
23
|
+
borderColor: 'rgba(0, 0, 0, 0.87)',
|
|
24
|
+
},
|
|
25
|
+
'&.Mui-focused fieldset': {
|
|
26
|
+
borderColor: 'primary.main',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
}, children: optionNames.map((name, index) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: optionValues[index], children: name }, name))) }));
|
|
30
|
+
};
|
|
31
|
+
exports.ExpirationSecondsSelector = ExpirationSecondsSelector;
|
|
32
|
+
exports.default = exports.ExpirationSecondsSelector;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
/** Shape of a single captured email as returned by AdminEmailRouter */
|
|
3
|
+
export interface CapturedEmailInfo {
|
|
4
|
+
to: string;
|
|
5
|
+
subject: string;
|
|
6
|
+
text: string;
|
|
7
|
+
html: string;
|
|
8
|
+
timestamp: string;
|
|
9
|
+
}
|
|
10
|
+
/** Shape of a recipient summary as returned by GET /api/admin/emails */
|
|
11
|
+
export interface RecipientSummary {
|
|
12
|
+
address: string;
|
|
13
|
+
count: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const FakeEmailAdminPanel: FC;
|
|
16
|
+
export default FakeEmailAdminPanel;
|
|
17
|
+
export interface FakeEmailAdminButtonsProps {
|
|
18
|
+
onRefresh: () => void;
|
|
19
|
+
onClear: () => void;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const FakeEmailAdminButtons: FC<FakeEmailAdminButtonsProps>;
|
|
23
|
+
//# sourceMappingURL=FakeEmailAdminPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FakeEmailAdminPanel.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/FakeEmailAdminPanel.tsx"],"names":[],"mappings":"AAkCA,OAAO,EAAE,EAAE,EAA4C,MAAM,OAAO,CAAC;AAQrE,uEAAuE;AACvE,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wEAAwE;AACxE,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAiRD,eAAO,MAAM,mBAAmB,EAAE,EAIjC,CAAC;AAEF,eAAe,mBAAmB,CAAC;AAGnC,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CA8BhE,CAAC"}
|