@groupeactual/ui-kit 1.7.0-beta.3 → 1.7.0-beta.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/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.d.ts +5 -5
- package/dist/es/index.js +2 -2
- package/dist/es/index.js.map +1 -1
- package/dist/es/src/components/UploadDocument/FileUploaderSingle.d.ts +5 -5
- package/package.json +2 -2
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/components/UploadDocument/FileUploaderSingle.tsx +46 -19
package/dist/es/index.d.ts
CHANGED
|
@@ -261,7 +261,7 @@ interface Props$a {
|
|
|
261
261
|
children?: JSX.Element | null;
|
|
262
262
|
titleAddButton?: string;
|
|
263
263
|
_isDroppingFile?: boolean;
|
|
264
|
-
validateFile?: (_size: number, _type: string) => boolean;
|
|
264
|
+
validateFile?: (_size: number, _type: string, _accept: string[], _setUploadFileError: React.Dispatch<React.SetStateAction<boolean | string>>) => boolean;
|
|
265
265
|
removeExistingFile?: () => void;
|
|
266
266
|
onTouched?: () => void;
|
|
267
267
|
onFileDataChange?: (_fileData: {
|
|
@@ -301,13 +301,13 @@ interface Props$a {
|
|
|
301
301
|
*
|
|
302
302
|
* Example:
|
|
303
303
|
* ```js
|
|
304
|
-
* validateFile={(size, type) => {
|
|
304
|
+
* validateFile={(size, type, accept, setUploadFileError) => {
|
|
305
305
|
* if (size > 10 * 1024 * 1024) {
|
|
306
|
-
|
|
306
|
+
* setUploadFileError('Le fichier doit être inférieur à 10 Mo');
|
|
307
307
|
* return true;
|
|
308
308
|
* }
|
|
309
|
-
* if (!
|
|
310
|
-
*
|
|
309
|
+
* if (!accept.includes(type)) {
|
|
310
|
+
* setUploadFileError('Le fichier doit être au format PDF, PNG, JPEG ou JPG');
|
|
311
311
|
* return true;
|
|
312
312
|
* }
|
|
313
313
|
* return false;
|