@movalib/movalib-commons 1.1.39 → 1.1.41
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/devIndex.tsx +30 -1
- package/dist/devIndex.js +25 -1
- package/dist/src/AddressFields.d.ts +0 -1
- package/dist/src/AddressFields.js +1 -1
- package/package.json +1 -1
- package/src/AddressFields.tsx +3 -5
package/devIndex.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React, { CSSProperties, Fragment, useEffect, useState } from 'react';
|
|
|
2
2
|
import { createRoot } from 'react-dom/client';
|
|
3
3
|
// Import des composants de la bibliothèque
|
|
4
4
|
import MovaLogin from './src/MovaLogin';
|
|
5
|
-
import { MovaLoginForm } from './src/helpers/Types';
|
|
5
|
+
import { AddressFieldName, MovaLoginForm } from './src/helpers/Types';
|
|
6
6
|
import { MovaAppType } from './src/helpers/Enums';
|
|
7
7
|
import { ThemeProvider, darken } from '@mui/material/styles';
|
|
8
8
|
import theme from './theme'; // Import du thème personnalisé
|
|
@@ -23,6 +23,7 @@ import { flexCenter } from './src/helpers/Tools';
|
|
|
23
23
|
import AccountValidation from './src/AccountValidation';
|
|
24
24
|
import VehiclePlateField from './src/VehiclePlateField';
|
|
25
25
|
import GaragePLV from './src/GaragePLV';
|
|
26
|
+
import AddressFields from './src/AddressFields';
|
|
26
27
|
|
|
27
28
|
const App = () => {
|
|
28
29
|
|
|
@@ -150,6 +151,34 @@ const App = () => {
|
|
|
150
151
|
/>
|
|
151
152
|
</div>
|
|
152
153
|
|
|
154
|
+
<Box sx={{width:'50%'}}>
|
|
155
|
+
|
|
156
|
+
<AddressFields form={{
|
|
157
|
+
streetName: {
|
|
158
|
+
value: undefined,
|
|
159
|
+
error: undefined,
|
|
160
|
+
isValid: undefined
|
|
161
|
+
},
|
|
162
|
+
additional: {
|
|
163
|
+
value: undefined,
|
|
164
|
+
error: undefined,
|
|
165
|
+
isValid: undefined
|
|
166
|
+
},
|
|
167
|
+
postalCode: {
|
|
168
|
+
value: undefined,
|
|
169
|
+
error: undefined,
|
|
170
|
+
isValid: undefined
|
|
171
|
+
},
|
|
172
|
+
cityName: {
|
|
173
|
+
value: undefined,
|
|
174
|
+
error: undefined,
|
|
175
|
+
isValid: undefined
|
|
176
|
+
}
|
|
177
|
+
}} size={'small'} handleChange={function (fieldName: AddressFieldName, newValue: any, save?: boolean | undefined): void {
|
|
178
|
+
throw new Error('Function not implemented.');
|
|
179
|
+
} } />
|
|
180
|
+
</Box>
|
|
181
|
+
|
|
153
182
|
|
|
154
183
|
</Box>
|
|
155
184
|
|
package/dist/devIndex.js
CHANGED
|
@@ -60,6 +60,7 @@ var Tools_1 = require("./src/helpers/Tools");
|
|
|
60
60
|
var AccountValidation_1 = __importDefault(require("./src/AccountValidation"));
|
|
61
61
|
var VehiclePlateField_1 = __importDefault(require("./src/VehiclePlateField"));
|
|
62
62
|
var GaragePLV_1 = __importDefault(require("./src/GaragePLV"));
|
|
63
|
+
var AddressFields_1 = __importDefault(require("./src/AddressFields"));
|
|
63
64
|
var App = function () {
|
|
64
65
|
Logger_1.default.enableLogging();
|
|
65
66
|
// Chargement de données garage de test
|
|
@@ -128,7 +129,30 @@ var App = function () {
|
|
|
128
129
|
throw new Error('Function not implemented.');
|
|
129
130
|
} }), (0, jsx_runtime_1.jsx)(MovaSignUp_1.default, { headerText: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(material_1.Alert, __assign({ severity: 'success', icon: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), style: Tools_1.flexCenter, sx: { width: '100%', textTransform: 'none', textAlign: 'center' } }, { children: (0, jsx_runtime_1.jsx)("b", { children: "NOUVEAU COMPTE UTILISATEUR" }) })) }), darkMode: false, movaAppType: Enums_1.MovaAppType.INDIVIDUAL, onSubmit: function (form) {
|
|
130
131
|
alert('Form Submitted !');
|
|
131
|
-
} }), (0, jsx_runtime_1.jsx)(GaragePLV_1.default, { url: getQRCodeData() }), (0, jsx_runtime_1.jsx)(QRCode_1.default, { data: getQRCodeData(), showDownload: true, size: 400 }), (0, jsx_runtime_1.jsx)("div", { style: { marginTop: '40px' } }), (0, jsx_runtime_1.jsx)("div", __assign({ style: Tools_1.flexCenter }, { children: (0, jsx_runtime_1.jsx)(ScheduleFields_1.default, { schedules: garage === null || garage === void 0 ? void 0 : garage.schedules, size: "small", timePickerStep: 30, onChange: handleScheduleChange }) }))
|
|
132
|
+
} }), (0, jsx_runtime_1.jsx)(GaragePLV_1.default, { url: getQRCodeData() }), (0, jsx_runtime_1.jsx)(QRCode_1.default, { data: getQRCodeData(), showDownload: true, size: 400 }), (0, jsx_runtime_1.jsx)("div", { style: { marginTop: '40px' } }), (0, jsx_runtime_1.jsx)("div", __assign({ style: Tools_1.flexCenter }, { children: (0, jsx_runtime_1.jsx)(ScheduleFields_1.default, { schedules: garage === null || garage === void 0 ? void 0 : garage.schedules, size: "small", timePickerStep: 30, onChange: handleScheduleChange }) })), (0, jsx_runtime_1.jsx)(material_1.Box, __assign({ sx: { width: '50%' } }, { children: (0, jsx_runtime_1.jsx)(AddressFields_1.default, { form: {
|
|
133
|
+
streetName: {
|
|
134
|
+
value: undefined,
|
|
135
|
+
error: undefined,
|
|
136
|
+
isValid: undefined
|
|
137
|
+
},
|
|
138
|
+
additional: {
|
|
139
|
+
value: undefined,
|
|
140
|
+
error: undefined,
|
|
141
|
+
isValid: undefined
|
|
142
|
+
},
|
|
143
|
+
postalCode: {
|
|
144
|
+
value: undefined,
|
|
145
|
+
error: undefined,
|
|
146
|
+
isValid: undefined
|
|
147
|
+
},
|
|
148
|
+
cityName: {
|
|
149
|
+
value: undefined,
|
|
150
|
+
error: undefined,
|
|
151
|
+
isValid: undefined
|
|
152
|
+
}
|
|
153
|
+
}, size: 'small', handleChange: function (fieldName, newValue, save) {
|
|
154
|
+
throw new Error('Function not implemented.');
|
|
155
|
+
} }) }))] })), (0, jsx_runtime_1.jsx)(material_1.Box, __assign({ style: Tools_1.flexCenter }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, __assign({ onClick: function () { return setOpenAccountValidation(!openAccountValidation); } }, { children: "Validation de compte" })) })), openAccountValidation && (0, jsx_runtime_1.jsx)(AccountValidation_1.default, { movaAppType: Enums_1.MovaAppType.GARAGE, onSubmit: function (success, message) {
|
|
132
156
|
throw new Error('Function not implemented.');
|
|
133
157
|
} })] })) })) }));
|
|
134
158
|
};
|
|
@@ -15,6 +15,6 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
15
15
|
var material_1 = require("@mui/material");
|
|
16
16
|
var AddressFields = function (_a) {
|
|
17
17
|
var form = _a.form, size = _a.size, handleChange = _a.handleChange;
|
|
18
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { id: "address-streetName", label: "RUE", value: form.streetName.value, required: true, size: size, onBlur: function (e) { return handleChange('streetName', e.target.value, true); }, onChange: function (e) { return handleChange('streetName', e.target.value, false); }, sx: { width: '
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { id: "address-streetName", label: "RUE", value: form.streetName.value, required: true, size: size, onBlur: function (e) { return handleChange('streetName', e.target.value, true); }, onChange: function (e) { return handleChange('streetName', e.target.value, false); }, sx: { width: '100%', mt: 2.5 } }), (0, jsx_runtime_1.jsx)(material_1.TextField, { id: "address-additionnalInfo", label: "COMPL\u00C9MENT", size: size, value: form.additional.value, onBlur: function (e) { return handleChange('additional', e.target.value, true); }, onChange: function (e) { return handleChange('additional', e.target.value, false); }, sx: { width: '100%', mt: 2.5 } }), (0, jsx_runtime_1.jsx)(material_1.TextField, { id: "address-postalCode", label: "CODE POSTAL", value: form.postalCode.value, required: true, size: size, onBlur: function (e) { return handleChange('postalCode', e.target.value, true); }, onChange: function (e) { return handleChange('postalCode', e.target.value, false); }, sx: { width: '40%', mt: 2.5, pr: 2 } }), (0, jsx_runtime_1.jsx)(material_1.TextField, { id: "address-cityName", label: "VILLE", value: form.cityName.value, required: true, size: size, onBlur: function (e) { return handleChange('cityName', e.target.value, true); }, onChange: function (e) { return handleChange('cityName', e.target.value, false); }, sx: { width: '60%', mt: 2.5 } })] })));
|
|
19
19
|
};
|
|
20
20
|
exports.default = AddressFields;
|
package/package.json
CHANGED
package/src/AddressFields.tsx
CHANGED
|
@@ -2,9 +2,7 @@ import React, { FunctionComponent } from "react";
|
|
|
2
2
|
import { Grid, TextField, Typography } from "@mui/material";
|
|
3
3
|
import { AddressFieldName, MovaFormField } from "./helpers/Types";
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
type Form = {
|
|
7
|
-
streetNumber: MovaFormField,
|
|
8
6
|
streetName: MovaFormField,
|
|
9
7
|
additional: MovaFormField,
|
|
10
8
|
postalCode: MovaFormField,
|
|
@@ -27,7 +25,7 @@ const AddressFields: FunctionComponent<AddressFieldsProps> = ({ form, size, hand
|
|
|
27
25
|
size={size}
|
|
28
26
|
onBlur={(e) => handleChange('streetName', e.target.value, true)}
|
|
29
27
|
onChange={(e) => handleChange('streetName', e.target.value, false)}
|
|
30
|
-
sx={{ width: '
|
|
28
|
+
sx={{ width: '100%', mt: 2.5 }}
|
|
31
29
|
>
|
|
32
30
|
</TextField>
|
|
33
31
|
<TextField
|
|
@@ -37,7 +35,7 @@ const AddressFields: FunctionComponent<AddressFieldsProps> = ({ form, size, hand
|
|
|
37
35
|
value={form.additional.value}
|
|
38
36
|
onBlur={(e) => handleChange('additional', e.target.value, true)}
|
|
39
37
|
onChange={(e) => handleChange('additional', e.target.value, false)}
|
|
40
|
-
sx={{ width: '
|
|
38
|
+
sx={{ width: '100%', mt: 2.5 }}
|
|
41
39
|
>
|
|
42
40
|
</TextField>
|
|
43
41
|
<TextField
|
|
@@ -59,7 +57,7 @@ const AddressFields: FunctionComponent<AddressFieldsProps> = ({ form, size, hand
|
|
|
59
57
|
size={size}
|
|
60
58
|
onBlur={(e) => handleChange('cityName', e.target.value, true)}
|
|
61
59
|
onChange={(e) => handleChange('cityName', e.target.value, false)}
|
|
62
|
-
sx={{ width: '
|
|
60
|
+
sx={{ width: '60%', mt: 2.5 }}
|
|
63
61
|
>
|
|
64
62
|
</TextField>
|
|
65
63
|
</Grid>
|