Co-authored-by: Cursor <[email protected]>
This commit is contained in:
lejay
2026-05-28 07:20:38 +02:00
co-authored by Cursor
parent 6923c319a1
commit 6c0d7e47b8
81 changed files with 21780 additions and 2986 deletions
+119 -3
View File
@@ -12,6 +12,13 @@ export default function MaterialModal({ material, collections, onClose, onSave }
width_mm: '',
height_mm: '',
thickness_mm: '',
diameter_mm: '',
length_mm: '',
bore_diameter_mm: '',
bore_depth_base_mm: '',
bore_depth_piece_mm: '',
price_chf: '',
price_unit: '',
formex_url: ''
});
@@ -27,6 +34,13 @@ export default function MaterialModal({ material, collections, onClose, onSave }
width_mm: material.width_mm?.toString() || '',
height_mm: material.height_mm?.toString() || '',
thickness_mm: material.thickness_mm?.toString() || '',
diameter_mm: material.diameter_mm?.toString() || '',
length_mm: material.length_mm?.toString() || '',
bore_diameter_mm: material.bore_diameter_mm?.toString() || '',
bore_depth_base_mm: material.bore_depth_base_mm?.toString() || '',
bore_depth_piece_mm: material.bore_depth_piece_mm?.toString() || '',
price_chf: material.price_chf?.toString() || '',
price_unit: material.price_unit || '',
formex_url: material.formex_url || ''
});
}
@@ -56,7 +70,14 @@ export default function MaterialModal({ material, collections, onClose, onSave }
collection: formData.collection.trim(),
width_mm: formData.width_mm ? parseInt(formData.width_mm, 10) : null,
height_mm: formData.height_mm ? parseInt(formData.height_mm, 10) : null,
thickness_mm: formData.thickness_mm ? parseInt(formData.thickness_mm, 10) : null,
thickness_mm: formData.thickness_mm ? parseFloat(formData.thickness_mm) : null,
diameter_mm: formData.diameter_mm ? parseFloat(formData.diameter_mm) : null,
length_mm: formData.length_mm ? parseFloat(formData.length_mm) : null,
bore_diameter_mm: formData.bore_diameter_mm ? parseFloat(formData.bore_diameter_mm) : null,
bore_depth_base_mm: formData.bore_depth_base_mm ? parseFloat(formData.bore_depth_base_mm) : null,
bore_depth_piece_mm: formData.bore_depth_piece_mm ? parseFloat(formData.bore_depth_piece_mm) : null,
price_chf: formData.price_chf ? parseFloat(formData.price_chf) : null,
price_unit: formData.price_unit.trim() || null,
formex_url: formData.formex_url.trim() || null
};
@@ -174,15 +195,110 @@ export default function MaterialModal({ material, collections, onClose, onSave }
</div>
</div>
<div className={styles.row}>
<div className={styles.field}>
<label htmlFor="diameter_mm">Ø Diamètre (mm)</label>
<input
type="number"
id="diameter_mm"
name="diameter_mm"
value={formData.diameter_mm}
onChange={handleChange}
placeholder="8"
step="0.1"
/>
</div>
<div className={styles.field}>
<label htmlFor="length_mm">Longueur (mm)</label>
<input
type="number"
id="length_mm"
name="length_mm"
value={formData.length_mm}
onChange={handleChange}
placeholder="55"
step="0.1"
/>
</div>
</div>
<fieldset className={styles.fieldset}>
<legend>Perçage</legend>
<div className={styles.row}>
<div className={styles.field}>
<label htmlFor="bore_diameter_mm">Ø Perçage (mm)</label>
<input
type="number"
id="bore_diameter_mm"
name="bore_diameter_mm"
value={formData.bore_diameter_mm}
onChange={handleChange}
placeholder="8"
step="0.1"
/>
</div>
<div className={styles.field}>
<label htmlFor="bore_depth_base_mm">Prof. fond (mm)</label>
<input
type="number"
id="bore_depth_base_mm"
name="bore_depth_base_mm"
value={formData.bore_depth_base_mm}
onChange={handleChange}
placeholder="11"
step="0.1"
/>
</div>
<div className={styles.field}>
<label htmlFor="bore_depth_piece_mm">Prof. pièce (mm)</label>
<input
type="number"
id="bore_depth_piece_mm"
name="bore_depth_piece_mm"
value={formData.bore_depth_piece_mm}
onChange={handleChange}
placeholder="8"
step="0.1"
/>
</div>
</div>
</fieldset>
<div className={styles.row}>
<div className={styles.field}>
<label htmlFor="price_chf">Prix CHF</label>
<input
type="number"
id="price_chf"
name="price_chf"
value={formData.price_chf}
onChange={handleChange}
placeholder="0.60"
step="0.01"
/>
</div>
<div className={styles.field}>
<label htmlFor="price_unit">Unité de prix</label>
<input
type="text"
id="price_unit"
name="price_unit"
value={formData.price_unit}
onChange={handleChange}
placeholder="par Pièce (PC)"
/>
</div>
</div>
<div className={styles.field}>
<label htmlFor="formex_url">URL Formex</label>
<label htmlFor="formex_url">URL</label>
<input
type="url"
id="formex_url"
name="formex_url"
value={formData.formex_url}
onChange={handleChange}
placeholder="https://www.formex.ch/fr/shop/..."
placeholder="https://..."
/>
</div>