Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code refactor (backported to v2) #132

Merged
merged 12 commits into from
Apr 16, 2020
18 changes: 9 additions & 9 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"dist/index.js": {
"bundled": 31113,
"minified": 19455,
"gzipped": 5043
"bundled": 32649,
"minified": 17718,
"gzipped": 4978
},
"dist/index.es.js": {
"bundled": 29833,
"minified": 18387,
"gzipped": 4932,
"bundled": 31503,
"minified": 16785,
"gzipped": 4869,
"treeshaked": {
"rollup": {
"code": 14351,
"import_statements": 1544
"code": 12627,
"import_statements": 1660
},
"webpack": {
"code": 16909
"code": 15979
}
}
}
Expand Down
150 changes: 76 additions & 74 deletions README.md

Large diffs are not rendered by default.

59 changes: 23 additions & 36 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { ChipProps } from '@material-ui/core/Chip';
import { DialogProps } from '@material-ui/core/Dialog';
import { GridProps } from '@material-ui/core/Grid';
import * as React from 'react';
import { DropEvent } from 'react-dropzone';

// DropzoneArea

export interface DropzoneAreaProps {
acceptedFiles?: string[];
filesLimit?: number;
maxFileSize?: number;
dropzoneText?: string;
previewText?: string;
showPreviews?: boolean;
showPreviewsInDropzone?: boolean;
showFileNamesInPreview?: boolean;
Expand All @@ -27,52 +32,34 @@ export interface DropzoneAreaProps {
dropzoneClass?: string;
dropzoneParagraphClass?: string;
initialFiles?: string[];
onChange?: (files: any) => void;
onDrop?: (files: any) => void;
onDropRejected?: (files: any, evt: any) => void;
onDelete?: (file: any) => void;
onChange?: (files: File[]) => void;
onDrop?: (files: File[], event: DropEvent) => void;
onDropRejected?: (files: File[], event: DropEvent) => void;
onDelete?: (file: File) => void;
getFileLimitExceedMessage?: (filesLimit: number) => string;
getFileAddedMessage?: (fileName: string) => string;
getFileRemovedMessage?: (fileName: string) => string;
getDropRejectMessage?: (
rejectedFile: { name: string; type: string | undefined; size: number },
rejectedFile: File,
acceptedFiles: string[],
maxFileSize: number
maxFileSize: number,
) => string;
}

export const DropzoneArea: React.ComponentType<DropzoneAreaProps>;

export interface DropzoneDialogProps {
open: boolean;
onSave?: (files: any) => void;
onDelete?: (file: any) => void;
onClose?: () => void;
onChange?: (files: any) => void;
onDrop?: (files: any) => void;
onDropRejected?: (files: any, evt: any) => void;
acceptedFiles?: string[];
filesLimit?: number;
maxFileSize?: number;
dropzoneText?: string;
showPreviews?: boolean;
showPreviewsInDropzone?: boolean;
useChipsForPreview?: boolean;
previewChipProps?: ChipProps;
previewGridClasses?: {
container?: string,
item?: string,
image?: string
};
previewGridProps?: {
container?: GridProps,
item?: GridProps
};
showAlerts?: boolean;
clearOnUnmount?: boolean;
dialogTitle?: string;
// DropzoneDialog

export interface DropzoneDialogProps extends DropzoneAreaProps {
cancelButtonText?: string;
submitButtonText?: string;
maxWidth?: string;
dialogProps?: DialogProps;
dialogTitle?: string;
fullWidth?: boolean;
maxWidth?: string;
onClose?: () => void;
onSave?: (files: File[]) => void;
open?: boolean;
submitButtonText?: string;
}

export const DropzoneDialog: React.ComponentType<DropzoneDialogProps>;
Loading