@groupeactual/ui-kit 1.7.0-beta.4 → 1.7.0-beta.5
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 +23 -67
- package/dist/es/index.js +2 -2
- package/dist/es/index.js.map +1 -1
- package/dist/es/src/components/UploadDocument/FileUploader.d.ts +25 -0
- package/dist/es/src/components/UploadDocument/fileuploader.interface.d.ts +19 -0
- package/dist/es/src/components/UploadDocument/index.d.ts +1 -1
- package/dist/es/src/components/index.d.ts +2 -1
- package/package.json +3 -2
- package/src/components/Form/Checkbox/Checkbox.tsx +1 -1
- package/src/components/UploadDocument/FileUploader.tsx +690 -0
- package/src/components/UploadDocument/fileuploader.interface.ts +21 -0
- package/src/components/UploadDocument/index.ts +1 -1
- package/src/components/index.ts +5 -1
- package/dist/es/src/components/UploadDocument/FileUploaderSingle.d.ts +0 -77
- package/dist/es/src/components/UploadDocument/fileuploadersingle.interface.d.ts +0 -5
- package/src/components/UploadDocument/FileUploaderSingle.tsx +0 -661
- package/src/components/UploadDocument/fileuploadersingle.interface.ts +0 -5
package/dist/es/index.d.ts
CHANGED
|
@@ -238,86 +238,42 @@ interface AutocompleteMultipleSelectProps<T> extends Omit<AutocompleteProps<T, t
|
|
|
238
238
|
}
|
|
239
239
|
declare const AutocompleteMultipleSelect: <T>({ value, label, placeholder, options, disabled, getOptionLabel, getKeyValue, onChange, getOptionDisabled, width, color, helperText, error, searchIcon, ...props }: AutocompleteMultipleSelectProps<T>) => React.JSX.Element;
|
|
240
240
|
|
|
241
|
-
interface
|
|
241
|
+
interface AcceptTextType {
|
|
242
242
|
fileFormat?: string;
|
|
243
243
|
maxSize?: string;
|
|
244
244
|
subText?: string;
|
|
245
245
|
}
|
|
246
|
+
interface FileDataType {
|
|
247
|
+
name: string;
|
|
248
|
+
size: number;
|
|
249
|
+
type: string;
|
|
250
|
+
url: string;
|
|
251
|
+
driveFileId?: string;
|
|
252
|
+
driveAccessToken?: string;
|
|
253
|
+
}
|
|
246
254
|
|
|
247
255
|
interface Props$a {
|
|
248
|
-
setFile: (_file: File | null) => void;
|
|
249
256
|
title?: string;
|
|
257
|
+
subTitle?: string;
|
|
258
|
+
titleAddButton?: string;
|
|
259
|
+
helperText?: string;
|
|
250
260
|
titleTooltip?: string;
|
|
261
|
+
files?: FileDataType[];
|
|
262
|
+
isMulti?: boolean;
|
|
263
|
+
accept?: string[];
|
|
264
|
+
acceptText?: AcceptTextType;
|
|
265
|
+
orText?: string;
|
|
266
|
+
disabled?: boolean;
|
|
267
|
+
error?: string;
|
|
251
268
|
enableGoogleDrive?: boolean;
|
|
252
269
|
googleAuthClientId?: string;
|
|
253
270
|
googleApiKey?: string;
|
|
254
|
-
error?: boolean;
|
|
255
|
-
helperText?: string;
|
|
256
|
-
fileUrl?: string | null;
|
|
257
|
-
fileName?: string | null;
|
|
258
|
-
accept?: string[];
|
|
259
|
-
acceptText?: acceptText;
|
|
260
|
-
disabledInput?: boolean;
|
|
261
|
-
children?: JSX.Element | null;
|
|
262
|
-
titleAddButton?: string;
|
|
263
271
|
_isDroppingFile?: boolean;
|
|
264
272
|
validateFile?: (_size: number, _type: string, _accept: string[], _setUploadFileError: React.Dispatch<React.SetStateAction<boolean | string>>) => boolean;
|
|
265
|
-
removeExistingFile?: () => void;
|
|
266
273
|
onTouched?: () => void;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
type?: string;
|
|
271
|
-
driveFileId?: string;
|
|
272
|
-
driveAccessToken?: string;
|
|
273
|
-
} | null) => void;
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* A single file uploader component that supports file selection from local storage or Google Drive.
|
|
277
|
-
*
|
|
278
|
-
* @param {string[]} accept - Array of accepted file types, will display acceptText message
|
|
279
|
-
* but not verify size or type of your file.
|
|
280
|
-
*
|
|
281
|
-
* Example:
|
|
282
|
-
* ```js
|
|
283
|
-
* accept={[
|
|
284
|
-
'application/pdf',
|
|
285
|
-
'image/png',
|
|
286
|
-
'image/jpeg',
|
|
287
|
-
'image/jpg',
|
|
288
|
-
]}
|
|
289
|
-
* ```
|
|
290
|
-
* @param {Object} acceptText - Object containing text for accepted file format, max size, and additional subtext.
|
|
291
|
-
*
|
|
292
|
-
* Example:
|
|
293
|
-
* ```js
|
|
294
|
-
* acceptText={{
|
|
295
|
-
maxSize: '10 Mo',
|
|
296
|
-
subText: 'Sélectionnez un fichier',
|
|
297
|
-
}}
|
|
298
|
-
* ```
|
|
299
|
-
*
|
|
300
|
-
* @param {Function} validateFile - Function to validate the file size and type.
|
|
301
|
-
*
|
|
302
|
-
* Example:
|
|
303
|
-
* ```js
|
|
304
|
-
* validateFile={(size, type, accept, setUploadFileError) => {
|
|
305
|
-
* if (size > 10 * 1024 * 1024) {
|
|
306
|
-
* setUploadFileError('Le fichier doit être inférieur à 10 Mo');
|
|
307
|
-
* return true;
|
|
308
|
-
* }
|
|
309
|
-
* if (!accept.includes(type)) {
|
|
310
|
-
* setUploadFileError('Le fichier doit être au format PDF, PNG, JPEG ou JPG');
|
|
311
|
-
* return true;
|
|
312
|
-
* }
|
|
313
|
-
* return false;
|
|
314
|
-
* }}
|
|
315
|
-
* ```
|
|
316
|
-
*
|
|
317
|
-
* @param {Function} onFileDataChange - Callback function to handle file data changes and give you all informations you need
|
|
318
|
-
* to handle google drive file.
|
|
319
|
-
*/
|
|
320
|
-
declare const FileUploaderSingle: ({ enableGoogleDrive, googleAuthClientId, googleApiKey, error, helperText, accept, acceptText, title, titleTooltip, disabledInput, children, fileUrl, fileName, titleAddButton, _isDroppingFile, validateFile, setFile, removeExistingFile, onTouched, onFileDataChange, }: Props$a) => React.JSX.Element;
|
|
274
|
+
onFilesDataChange?: (_fileData: FileDataType[] | undefined) => void;
|
|
275
|
+
}
|
|
276
|
+
declare const FileUploader: ({ title, subTitle, titleAddButton, helperText, titleTooltip, files, isMulti, accept, acceptText, orText, disabled, error, enableGoogleDrive, googleAuthClientId, googleApiKey, _isDroppingFile, validateFile, onTouched, onFilesDataChange, }: Props$a) => React.JSX.Element;
|
|
321
277
|
|
|
322
278
|
interface Props$9 extends Omit<MenuItemProps, 'onClick'> {
|
|
323
279
|
onClick: (_event?: React.MouseEvent<HTMLElement>) => void;
|
|
@@ -497,4 +453,4 @@ interface Props {
|
|
|
497
453
|
}
|
|
498
454
|
declare const DesignSystemProvider: ({ children, name: themeName, }: PropsWithChildren<Props>) => React.JSX.Element;
|
|
499
455
|
|
|
500
|
-
export { Accordion, AutocompleteMultipleSelect as AutoCompleteMulti, AutoCompleteSingle, BannerNotification, Breadcrumbs, Button, Checkbox, CheckboxGroup, type CheckboxItemType, Chip, Datatable, DatatableCellRender, DatePicker, DesignSystemContext, type DesignSystemContextValues, DesignSystemProvider, Dialog, Drawer, EmbeddedNotification,
|
|
456
|
+
export { type AcceptTextType, Accordion, AutocompleteMultipleSelect as AutoCompleteMulti, AutoCompleteSingle, BannerNotification, Breadcrumbs, Button, Checkbox, CheckboxGroup, type CheckboxItemType, Chip, Datatable, DatatableCellRender, DatePicker, DesignSystemContext, type DesignSystemContextValues, DesignSystemProvider, Dialog, Drawer, EmbeddedNotification, type FileDataType, FileUploader, IconButton, IconProvider, Link, MenuItem, MultiSelect, NotistackAdapter, Pagination, RadioGroup, Select, Snackbar, Stepper, Switch, Text, TextField, TimePicker, Tooltip };
|