@movalib/movalib-commons 1.0.18 → 1.0.20

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.
@@ -17,5 +17,10 @@ interface MovaLoginProps {
17
17
  alertSeverity?: AlertColor;
18
18
  loading?: boolean;
19
19
  }
20
+ /**
21
+ * Formulaire d'authentification Movalib (Garage / Utilisateur)
22
+ * ATTENTION : la page attendue pour le bouton "Mot de passe oublié" doit pointer vers "/forgot-password"
23
+ * ATTENTION : la page attendue pour le bouton "Créer mon compte" doit pointer vers "/signup"
24
+ */
20
25
  declare const MovaLogin: FunctionComponent<MovaLoginProps>;
21
26
  export default MovaLogin;
@@ -73,6 +73,11 @@ var initialFormState = {
73
73
  email: { value: '', isValid: true },
74
74
  password: { value: '', isValid: true },
75
75
  };
76
+ /**
77
+ * Formulaire d'authentification Movalib (Garage / Utilisateur)
78
+ * ATTENTION : la page attendue pour le bouton "Mot de passe oublié" doit pointer vers "/forgot-password"
79
+ * ATTENTION : la page attendue pour le bouton "Créer mon compte" doit pointer vers "/signup"
80
+ */
76
81
  var MovaLogin = function (_a) {
77
82
  var loading = _a.loading, movaAppType = _a.movaAppType, onSubmit = _a.onSubmit, alertMessage = _a.alertMessage, alertSeverity = _a.alertSeverity;
78
83
  var _b = (0, react_1.useState)(initialFormState), form = _b[0], setForm = _b[1];
@@ -128,7 +133,7 @@ var MovaLogin = function (_a) {
128
133
  display: 'flex',
129
134
  flexDirection: 'column',
130
135
  alignItems: 'center',
131
- } }, { children: [(0, jsx_runtime_1.jsx)("img", { src: getMovaLogo(), style: { width: '80%' } }), (0, jsx_runtime_1.jsx)("br", {})] })), (0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ component: "form", onSubmit: handleSubmit, noValidate: true, sx: { mt: 1 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { margin: "normal", required: true, fullWidth: true, id: "email", label: "Adresse email", name: "email", autoComplete: "email", autoFocus: true, onChange: function (e) { return handleInputChange(e); }, value: form.email.value, error: !form.email.isValid, helperText: form.email.error }), (0, jsx_runtime_1.jsx)(material_1.TextField, { margin: "normal", required: true, fullWidth: true, name: "password", label: "Mot de passe", type: "password", id: "password", autoComplete: "current-password", onChange: function (e) { return handleInputChange(e); }, value: form.password.value, error: !form.password.isValid, helperText: form.password.error }), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { value: "remember", color: "primary" }), label: "Se souvenir de moi" }), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, __assign({ loading: loading, type: "submit", fullWidth: true, variant: "contained", sx: { mt: 3, mb: 2 } }, { children: (0, jsx_runtime_1.jsx)("span", { children: "Se connecter" }) })), alertMessage && alertSeverity && (0, jsx_runtime_1.jsx)(material_1.Alert, __assign({ severity: alertSeverity, sx: { mb: 2 } }, { children: alertMessage })), (0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Link, __assign({ href: "/forgot-password", variant: "body2", color: "text.secondary" }, { children: "Mot de passe oubli\u00E9 ?" })) })), movaAppType === Enums_1.MovaAppType.USER && (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Link, __assign({ href: "/signup", variant: "body2", color: "text.secondary" }, { children: "Créer un compte" })) }))] }))] })), (0, jsx_runtime_1.jsx)(MovaCopyright_1.default, { sx: { mt: 8, mb: 4 } })] })), (0, jsx_runtime_1.jsx)("img", { src: leaf_pink_large_png_1.default, style: { position: 'fixed',
136
+ } }, { children: [(0, jsx_runtime_1.jsx)("img", { src: getMovaLogo(), style: { width: '80%' } }), (0, jsx_runtime_1.jsx)("br", {})] })), (0, jsx_runtime_1.jsxs)(material_1.Box, __assign({ component: "form", onSubmit: handleSubmit, noValidate: true, sx: { mt: 1 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { margin: "normal", required: true, fullWidth: true, id: "email", label: "Adresse email", name: "email", autoComplete: "email", autoFocus: true, onChange: function (e) { return handleInputChange(e); }, value: form.email.value, error: !form.email.isValid, helperText: form.email.error }), (0, jsx_runtime_1.jsx)(material_1.TextField, { margin: "normal", required: true, fullWidth: true, name: "password", label: "Mot de passe", type: "password", id: "password", autoComplete: "current-password", onChange: function (e) { return handleInputChange(e); }, value: form.password.value, error: !form.password.isValid, helperText: form.password.error }), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { value: "remember", color: "primary" }), label: "Se souvenir de moi" }), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, __assign({ loading: loading, type: "submit", fullWidth: true, variant: "contained", sx: { mt: 3, mb: 2 } }, { children: (0, jsx_runtime_1.jsx)("span", { children: "Se connecter" }) })), alertMessage && alertSeverity && (0, jsx_runtime_1.jsx)(material_1.Alert, __assign({ severity: alertSeverity, sx: { mb: 2 } }, { children: alertMessage })), (0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Link, __assign({ href: "/forgot-password", variant: "body2", color: "text.secondary" }, { children: "Mot de passe oubli\u00E9 ?" })) })), movaAppType === Enums_1.MovaAppType.USER && (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Link, __assign({ href: "/signup", variant: "body2", color: "text.secondary" }, { children: "Créer mon compte" })) }))] }))] })), (0, jsx_runtime_1.jsx)(MovaCopyright_1.default, { sx: { mt: 8, mb: 4 } })] })), (0, jsx_runtime_1.jsx)("img", { src: leaf_pink_large_png_1.default, style: { position: 'fixed',
132
137
  float: 'right',
133
138
  width: '250px',
134
139
  height: '400px',
@@ -1,6 +1,6 @@
1
1
  import { FunctionComponent } from "react";
2
2
  import { AlertColor } from "@mui/material";
3
- import { MovaLoginForm } from "./helpers/Types";
3
+ import { MovaUserSignUpForm } from "./helpers/Types";
4
4
  import { MovaAppType } from "./helpers/Enums";
5
5
  /**
6
6
  * Propriétés du composant
@@ -12,10 +12,14 @@ import { MovaAppType } from "./helpers/Enums";
12
12
  */
13
13
  interface MovaSignUpProps {
14
14
  movaAppType: MovaAppType;
15
- onSubmit: (form: MovaLoginForm) => void;
15
+ onSubmit: (form: MovaUserSignUpForm) => void;
16
16
  alertMessage?: string;
17
17
  alertSeverity?: AlertColor;
18
18
  loading?: boolean;
19
19
  }
20
+ /**
21
+ * Formulaire de création d'un compte Movalib (Garage / Utilisateur)
22
+ * ATTENTION : le lien de consultation des CGU doit pointer vers "/terms-and-conditions"
23
+ */
20
24
  declare const MovaLogin: FunctionComponent<MovaSignUpProps>;
21
25
  export default MovaLogin;
@@ -79,6 +79,10 @@ var initialUserFormState = {
79
79
  birthDate: { value: '', isValid: true },
80
80
  acceptsTerms: { value: false, isValid: true },
81
81
  };
82
+ /**
83
+ * Formulaire de création d'un compte Movalib (Garage / Utilisateur)
84
+ * ATTENTION : le lien de consultation des CGU doit pointer vers "/terms-and-conditions"
85
+ */
82
86
  var MovaLogin = function (_a) {
83
87
  var loading = _a.loading, movaAppType = _a.movaAppType, onSubmit = _a.onSubmit, alertMessage = _a.alertMessage, alertSeverity = _a.alertSeverity;
84
88
  var _b = (0, react_1.useState)(initialUserFormState), userForm = _b[0], setUserForm = _b[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "Bibliothèque d'objets communs à l'ensemble des projets React de Movalib",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,7 +8,7 @@
8
8
  "scripts": {
9
9
  "start": "webpack-dev-server --entry ./devIndex.tsx --open",
10
10
  "build": "rm -rf dist && tsc && npm run copy-assets",
11
- "copy-assets": "cp -r src/assets/ dist/assets/",
11
+ "copy-assets": "cp -r src/assets/ dist/src/assets/",
12
12
  "test": "echo \"Error: no test specified\" && exit 1",
13
13
  "clean": "rm -rf dist node_modules package-lock.json"
14
14
  },
package/src/MovaLogin.tsx CHANGED
@@ -40,6 +40,11 @@ interface MovaLoginProps {
40
40
  loading?: boolean
41
41
  }
42
42
 
43
+ /**
44
+ * Formulaire d'authentification Movalib (Garage / Utilisateur)
45
+ * ATTENTION : la page attendue pour le bouton "Mot de passe oublié" doit pointer vers "/forgot-password"
46
+ * ATTENTION : la page attendue pour le bouton "Créer mon compte" doit pointer vers "/signup"
47
+ */
43
48
  const MovaLogin: FunctionComponent<MovaLoginProps> = ({ loading, movaAppType, onSubmit, alertMessage, alertSeverity }) => {
44
49
 
45
50
  const [form, setForm] = useState<MovaLoginForm>(initialFormState);
@@ -169,7 +174,7 @@ const MovaLogin: FunctionComponent<MovaLoginProps> = ({ loading, movaAppType, on
169
174
  </Grid>
170
175
  {movaAppType === MovaAppType.USER && <Grid item>
171
176
  <Link href="/signup" variant="body2" color="text.secondary">
172
- {"Créer un compte"}
177
+ {"Créer mon compte"}
173
178
  </Link>
174
179
  </Grid>}
175
180
  </Grid>
@@ -6,7 +6,7 @@ import GreenLeafImage from "./assets/images/leaf_green_large.png";
6
6
  import PinkLeafImage from "./assets/images/leaf_pink_large.png";
7
7
  import { Alert, AlertColor, Box, Checkbox, Container, CssBaseline, FormControl, FormControlLabel, FormHelperText, Grid, Link, SelectChangeEvent, TextField, Typography } from "@mui/material";
8
8
  import MovaCopyright from "./MovaCopyright";
9
- import { MovaLoginForm, MovaFormField, MovaUserSignUpForm } from "./helpers/Types";
9
+ import { MovaFormField, MovaUserSignUpForm } from "./helpers/Types";
10
10
  import { MovaAppType } from "./helpers/Enums";
11
11
  import { validateEmail } from "./helpers/Validator";
12
12
  import GenderSelector from "./GenderSelector";
@@ -40,12 +40,16 @@ const initialUserFormState = {
40
40
  */
41
41
  interface MovaSignUpProps {
42
42
  movaAppType: MovaAppType,
43
- onSubmit: (form: MovaLoginForm) => void,
43
+ onSubmit: (form: MovaUserSignUpForm) => void,
44
44
  alertMessage?: string,
45
45
  alertSeverity?: AlertColor,
46
46
  loading?: boolean
47
47
  }
48
48
 
49
+ /**
50
+ * Formulaire de création d'un compte Movalib (Garage / Utilisateur)
51
+ * ATTENTION : le lien de consultation des CGU doit pointer vers "/terms-and-conditions"
52
+ */
49
53
  const MovaLogin: FunctionComponent<MovaSignUpProps> = ({ loading, movaAppType, onSubmit, alertMessage, alertSeverity }) => {
50
54
 
51
55
  const [userForm, setUserForm] = useState<MovaUserSignUpForm>(initialUserFormState);