-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
1,324 additions
and
368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
packageExtensions: | ||
babel-preset-react-app@*: | ||
dependencies: | ||
"@babel/plugin-proposal-private-property-in-object": "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
module.exports = { | ||
presets: ["babel-preset-react-app"], | ||
plugins: ["react-hot-loader/babel"] | ||
plugins: [ | ||
"react-hot-loader/babel", | ||
["@babel/plugin-proposal-private-property-in-object", { loose: "true" }] | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 87 additions & 26 deletions
113
web/controller/components/controlBulletin/ControlBulletinFormStep1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import Typography from "@mui/material/Typography"; | ||
import { Autocomplete } from "@mui/material"; | ||
import TextField from "@mui/material/TextField"; | ||
import React from "react"; | ||
import Box from "@mui/material/Box"; | ||
import { createFilterOptions } from "@mui/material/Autocomplete"; | ||
|
||
export function DsfrAutocomplete({ | ||
field, | ||
fieldLabel, | ||
disabled, | ||
onChange, | ||
showErrors, | ||
options | ||
}) { | ||
const filterOptions = createFilterOptions({ | ||
matchFrom: "start" | ||
}); | ||
return ( | ||
<Box mb={"1.5rem"}> | ||
<Typography | ||
mb={0.5} | ||
className={!field && showErrors ? "fr-label--error" : "fr-label"} | ||
> | ||
{fieldLabel} {<sup style={{ color: "red" }}>*</sup>} | ||
</Typography> | ||
<Autocomplete | ||
disableClearable | ||
disabled={disabled} | ||
noOptionsText={"Aucune autre option disponible"} | ||
size="small" | ||
value={field || ""} | ||
options={options} | ||
onChange={onChange} | ||
filterOptions={filterOptions} | ||
renderInput={params => ( | ||
<TextField | ||
{...params} | ||
variant="filled" | ||
hiddenLabel | ||
error={!field && showErrors} | ||
/> | ||
)} | ||
/> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
export const DEPARTMENTS = [ | ||
{ code: "1", label: "AIN" }, | ||
{ code: "2", label: "AISNE" }, | ||
{ code: "3", label: "ALLIER" }, | ||
{ code: "4", label: "ALPES-DE-HAUTE-PROVENCE" }, | ||
{ code: "6", label: "ALPES-MARITIMES" }, | ||
{ code: "7", label: "ARDÈCHE" }, | ||
{ code: "8", label: "ARDENNES" }, | ||
{ code: "9", label: "ARIÈGE" }, | ||
{ code: "10", label: "AUBE" }, | ||
{ code: "11", label: "AUDE" }, | ||
{ code: "12", label: "AVEYRON" }, | ||
{ code: "67", label: "BAS-RHIN" }, | ||
{ code: "13", label: "BOUCHES-DU-RHÔNE" }, | ||
{ code: "14", label: "CALVADOS" }, | ||
{ code: "15", label: "CANTAL" }, | ||
{ code: "16", label: "CHARENTE" }, | ||
{ code: "17", label: "CHARENTE-MARITIME" }, | ||
{ code: "18", label: "CHER" }, | ||
{ code: "19", label: "CORRÈZE" }, | ||
{ code: "2A", label: "CORSE-DU-SUD" }, | ||
{ code: "21", label: "CÔTE-D'OR" }, | ||
{ code: "22", label: "CÔTES-D'ARMOR" }, | ||
{ code: "23", label: "CREUSE" }, | ||
{ code: "79", label: "DEUX-SÈVRES" }, | ||
{ code: "24", label: "DORDOGNE" }, | ||
{ code: "25", label: "DOUBS" }, | ||
{ code: "26", label: "DRÔME" }, | ||
{ code: "91", label: "ESSONNE" }, | ||
{ code: "27", label: "EURE" }, | ||
{ code: "28", label: "EURE-ET-LOIR" }, | ||
{ code: "29", label: "FINISTÈRE" }, | ||
{ code: "30", label: "GARD" }, | ||
{ code: "32", label: "GERS" }, | ||
{ code: "33", label: "GIRONDE" }, | ||
{ code: "971", label: "GUADELOUPE" }, | ||
{ code: "973", label: "GUYANE" }, | ||
{ code: "68", label: "HAUT-RHIN" }, | ||
{ code: "2B", label: "HAUTE-CORSE" }, | ||
{ code: "31", label: "HAUTE-GARONNE" }, | ||
{ code: "43", label: "HAUTE-LOIRE" }, | ||
{ code: "52", label: "HAUTE-MARNE" }, | ||
{ code: "70", label: "HAUTE-SAÔNE" }, | ||
{ code: "74", label: "HAUTE-SAVOIE" }, | ||
{ code: "87", label: "HAUTE-VIENNE" }, | ||
{ code: "5", label: "HAUTES-ALPES" }, | ||
{ code: "65", label: "HAUTES-PYRÉNÉES" }, | ||
{ code: "92", label: "HAUTS-DE-SEINE" }, | ||
{ code: "34", label: "HÉRAULT" }, | ||
{ code: "35", label: "ILLE-ET-VILAINE" }, | ||
{ code: "36", label: "INDRE" }, | ||
{ code: "37", label: "INDRE-ET-LOIRE" }, | ||
{ code: "38", label: "ISÈRE" }, | ||
{ code: "39", label: "JURA" }, | ||
{ code: "974", label: "LA RÉUNION" }, | ||
{ code: "40", label: "LANDES" }, | ||
{ code: "41", label: "LOIR-ET-CHER" }, | ||
{ code: "42", label: "LOIRE" }, | ||
{ code: "44", label: "LOIRE-ATLANTIQUE" }, | ||
{ code: "45", label: "LOIRET" }, | ||
{ code: "46", label: "LOT" }, | ||
{ code: "47", label: "LOT-ET-GARONNE" }, | ||
{ code: "48", label: "LOZÈRE" }, | ||
{ code: "49", label: "MAINE-ET-LOIRE" }, | ||
{ code: "50", label: "MANCHE" }, | ||
{ code: "51", label: "MARNE" }, | ||
{ code: "972", label: "MARTINIQUE" }, | ||
{ code: "53", label: "MAYENNE" }, | ||
{ code: "976", label: "MAYOTTE" }, | ||
{ code: "54", label: "MEURTHE-ET-MOSELLE" }, | ||
{ code: "55", label: "MEUSE" }, | ||
{ code: "56", label: "MORBIHAN" }, | ||
{ code: "57", label: "MOSELLE" }, | ||
{ code: "58", label: "NIÈVRE" }, | ||
{ code: "59", label: "NORD" }, | ||
{ code: "60", label: "OISE" }, | ||
{ code: "61", label: "ORNE" }, | ||
{ code: "75", label: "PARIS" }, | ||
{ code: "62", label: "PAS-DE-CALAIS" }, | ||
{ code: "63", label: "PUY-DE-DÔME" }, | ||
{ code: "64", label: "PYRÉNÉES-ATLANTIQUES" }, | ||
{ code: "66", label: "PYRÉNÉES-ORIENTALES" }, | ||
{ code: "69", label: "RHÔNE" }, | ||
{ code: "71", label: "SAÔNE-ET-LOIRE" }, | ||
{ code: "72", label: "SARTHE" }, | ||
{ code: "73", label: "SAVOIE" }, | ||
{ code: "77", label: "SEINE-ET-MARNE" }, | ||
{ code: "76", label: "SEINE-MARITIME" }, | ||
{ code: "93", label: "SEINE-SAINT-DENIS" }, | ||
{ code: "80", label: "SOMME" }, | ||
{ code: "81", label: "TARN" }, | ||
{ code: "82", label: "TARN-ET-GARONNE" }, | ||
{ code: "90", label: "TERRITOIRE DE BELFORT" }, | ||
{ code: "95", label: "VAL-D'OISE" }, | ||
{ code: "94", label: "VAL-DE-MARNE" }, | ||
{ code: "83", label: "VAR" }, | ||
{ code: "84", label: "VAUCLUSE" }, | ||
{ code: "85", label: "VENDÉE" }, | ||
{ code: "86", label: "VIENNE" }, | ||
{ code: "88", label: "VOSGES" }, | ||
{ code: "89", label: "YONNE" }, | ||
{ code: "78", label: "YVELINES" } | ||
]; |
Oops, something went wrong.