@mantine-vue/dropzone 1.1.2
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/cjs/index.cjs +941 -0
- package/cjs/index.cjs.map +1 -0
- package/esm/index.mjs +906 -0
- package/esm/index.mjs.map +1 -0
- package/lib/Dropzone.context.d.ts +6 -0
- package/lib/Dropzone.d.ts +1125 -0
- package/lib/DropzoneFullScreen.d.ts +101 -0
- package/lib/DropzoneStatus.d.ts +16 -0
- package/lib/get-files-from-event.d.ts +2 -0
- package/lib/index.d.mts +16 -0
- package/lib/index.d.ts +16 -0
- package/lib/mime-types.d.ts +29 -0
- package/lib/types.d.ts +14 -0
- package/lib/use-dropzone.d.ts +72 -0
- package/lib/utils.d.ts +46 -0
- package/package.json +44 -0
- package/styles.css +83 -0
- package/styles.layer.css +85 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type DropzoneProps, type DropzoneStylesNames } from './Dropzone';
|
|
3
|
+
export type DropzoneFullScreenStylesNames = DropzoneStylesNames | 'fullScreen';
|
|
4
|
+
export interface DropzoneFullScreenProps extends Omit<DropzoneProps, 'variant' | 'classNames' | 'styles' | 'vars'> {
|
|
5
|
+
/** Determines whether user can drop files to browser window @default true */
|
|
6
|
+
active?: boolean;
|
|
7
|
+
/** Z-index value @default 9999 (theme "max" z-index) */
|
|
8
|
+
zIndex?: string | number;
|
|
9
|
+
/** Determines whether component should be rendered within `Portal` @default true */
|
|
10
|
+
withinPortal?: boolean;
|
|
11
|
+
/** Props to pass down to the portal when withinPortal is `true` */
|
|
12
|
+
portalProps?: Record<string, any>;
|
|
13
|
+
classNames?: any;
|
|
14
|
+
styles?: any;
|
|
15
|
+
}
|
|
16
|
+
export declare const DropzoneFullScreen: import("@mantine-vue/core").WithBoxProps<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
17
|
+
active: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
default: undefined;
|
|
20
|
+
};
|
|
21
|
+
onDrop: {
|
|
22
|
+
type: PropType<(files: any[]) => void>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
onReject: {
|
|
26
|
+
type: PropType<(fileRejections: any[]) => void>;
|
|
27
|
+
default: undefined;
|
|
28
|
+
};
|
|
29
|
+
zIndex: {
|
|
30
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
31
|
+
default: undefined;
|
|
32
|
+
};
|
|
33
|
+
withinPortal: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
default: undefined;
|
|
36
|
+
};
|
|
37
|
+
portalProps: {
|
|
38
|
+
type: PropType<Record<string, any>>;
|
|
39
|
+
default: undefined;
|
|
40
|
+
};
|
|
41
|
+
classNames: {
|
|
42
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
43
|
+
default: undefined;
|
|
44
|
+
};
|
|
45
|
+
styles: {
|
|
46
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
47
|
+
default: undefined;
|
|
48
|
+
};
|
|
49
|
+
unstyled: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
53
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
56
|
+
active: {
|
|
57
|
+
type: BooleanConstructor;
|
|
58
|
+
default: undefined;
|
|
59
|
+
};
|
|
60
|
+
onDrop: {
|
|
61
|
+
type: PropType<(files: any[]) => void>;
|
|
62
|
+
required: true;
|
|
63
|
+
};
|
|
64
|
+
onReject: {
|
|
65
|
+
type: PropType<(fileRejections: any[]) => void>;
|
|
66
|
+
default: undefined;
|
|
67
|
+
};
|
|
68
|
+
zIndex: {
|
|
69
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
70
|
+
default: undefined;
|
|
71
|
+
};
|
|
72
|
+
withinPortal: {
|
|
73
|
+
type: BooleanConstructor;
|
|
74
|
+
default: undefined;
|
|
75
|
+
};
|
|
76
|
+
portalProps: {
|
|
77
|
+
type: PropType<Record<string, any>>;
|
|
78
|
+
default: undefined;
|
|
79
|
+
};
|
|
80
|
+
classNames: {
|
|
81
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
82
|
+
default: undefined;
|
|
83
|
+
};
|
|
84
|
+
styles: {
|
|
85
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
86
|
+
default: undefined;
|
|
87
|
+
};
|
|
88
|
+
unstyled: {
|
|
89
|
+
type: BooleanConstructor;
|
|
90
|
+
default: boolean;
|
|
91
|
+
};
|
|
92
|
+
}>> & Readonly<{}>, {
|
|
93
|
+
classNames: Function | Record<string, any>;
|
|
94
|
+
styles: Function | Record<string, any>;
|
|
95
|
+
active: boolean;
|
|
96
|
+
zIndex: string | number;
|
|
97
|
+
unstyled: boolean;
|
|
98
|
+
withinPortal: boolean;
|
|
99
|
+
portalProps: Record<string, any>;
|
|
100
|
+
onReject: (fileRejections: any[]) => void;
|
|
101
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type VNodeChild } from 'vue';
|
|
2
|
+
export declare const DropzoneAccept: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
5
|
+
export declare const DropzoneReject: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
export declare const DropzoneIdle: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
export interface DropzoneStatusProps {
|
|
12
|
+
children?: VNodeChild;
|
|
13
|
+
}
|
|
14
|
+
export type DropzoneAcceptProps = DropzoneStatusProps;
|
|
15
|
+
export type DropzoneRejectProps = DropzoneStatusProps;
|
|
16
|
+
export type DropzoneIdleProps = DropzoneStatusProps;
|
package/lib/index.d.mts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Dropzone as _Dropzone } from './Dropzone';
|
|
2
|
+
import { DropzoneFullScreen } from './DropzoneFullScreen';
|
|
3
|
+
export declare const Dropzone: typeof _Dropzone & {
|
|
4
|
+
FullScreen: typeof DropzoneFullScreen;
|
|
5
|
+
};
|
|
6
|
+
export { DropzoneFullScreen };
|
|
7
|
+
export { DropzoneAccept, DropzoneIdle, DropzoneReject } from './DropzoneStatus';
|
|
8
|
+
export { useDropzone } from './use-dropzone';
|
|
9
|
+
export * from './mime-types';
|
|
10
|
+
export * from './utils';
|
|
11
|
+
export type { DropzoneFullScreenProps, DropzoneFullScreenStylesNames } from './DropzoneFullScreen';
|
|
12
|
+
export type { DropzoneCssVariables, DropzoneProps, DropzoneStylesNames, DropzoneVariant, } from './Dropzone';
|
|
13
|
+
export type { DropzoneAcceptProps, DropzoneIdleProps, DropzoneRejectProps } from './DropzoneStatus';
|
|
14
|
+
export type { DropzoneContextValue } from './Dropzone.context';
|
|
15
|
+
export type { UseDropzoneOptions } from './use-dropzone';
|
|
16
|
+
export type { Accept, DropEvent, FileError, FileRejection, FileWithPath } from './types';
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Dropzone as _Dropzone } from './Dropzone';
|
|
2
|
+
import { DropzoneFullScreen } from './DropzoneFullScreen';
|
|
3
|
+
export declare const Dropzone: typeof _Dropzone & {
|
|
4
|
+
FullScreen: typeof DropzoneFullScreen;
|
|
5
|
+
};
|
|
6
|
+
export { DropzoneFullScreen };
|
|
7
|
+
export { DropzoneAccept, DropzoneIdle, DropzoneReject } from './DropzoneStatus';
|
|
8
|
+
export { useDropzone } from './use-dropzone';
|
|
9
|
+
export * from './mime-types';
|
|
10
|
+
export * from './utils';
|
|
11
|
+
export type { DropzoneFullScreenProps, DropzoneFullScreenStylesNames } from './DropzoneFullScreen';
|
|
12
|
+
export type { DropzoneCssVariables, DropzoneProps, DropzoneStylesNames, DropzoneVariant, } from './Dropzone';
|
|
13
|
+
export type { DropzoneAcceptProps, DropzoneIdleProps, DropzoneRejectProps } from './DropzoneStatus';
|
|
14
|
+
export type { DropzoneContextValue } from './Dropzone.context';
|
|
15
|
+
export type { UseDropzoneOptions } from './use-dropzone';
|
|
16
|
+
export type { Accept, DropEvent, FileError, FileRejection, FileWithPath } from './types';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const MIME_TYPES: {
|
|
2
|
+
readonly png: "image/png";
|
|
3
|
+
readonly gif: "image/gif";
|
|
4
|
+
readonly jpeg: "image/jpeg";
|
|
5
|
+
readonly svg: "image/svg+xml";
|
|
6
|
+
readonly webp: "image/webp";
|
|
7
|
+
readonly avif: "image/avif";
|
|
8
|
+
readonly heic: "image/heic";
|
|
9
|
+
readonly heif: "image/heif";
|
|
10
|
+
readonly mp4: "video/mp4";
|
|
11
|
+
readonly zip: "application/zip";
|
|
12
|
+
readonly rar: "application/x-rar";
|
|
13
|
+
readonly '7z': "application/x-7z-compressed";
|
|
14
|
+
readonly csv: "text/csv";
|
|
15
|
+
readonly pdf: "application/pdf";
|
|
16
|
+
readonly doc: "application/msword";
|
|
17
|
+
readonly docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
18
|
+
readonly xls: "application/vnd.ms-excel";
|
|
19
|
+
readonly xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
20
|
+
readonly ppt: "application/vnd.ms-powerpoint";
|
|
21
|
+
readonly pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
22
|
+
readonly exe: "application/vnd.microsoft.portable-executable";
|
|
23
|
+
};
|
|
24
|
+
export declare const IMAGE_MIME_TYPE: ("image/png" | "image/svg+xml" | "image/gif" | "image/jpeg" | "image/webp" | "image/avif" | "image/heic" | "image/heif")[];
|
|
25
|
+
export declare const PDF_MIME_TYPE: "application/pdf"[];
|
|
26
|
+
export declare const MS_WORD_MIME_TYPE: ("application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document")[];
|
|
27
|
+
export declare const MS_EXCEL_MIME_TYPE: ("application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")[];
|
|
28
|
+
export declare const MS_POWERPOINT_MIME_TYPE: ("application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation")[];
|
|
29
|
+
export declare const EXE_MIME_TYPE: "application/vnd.microsoft.portable-executable"[];
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface FileWithPath extends File {
|
|
2
|
+
readonly path?: string;
|
|
3
|
+
}
|
|
4
|
+
export interface FileError {
|
|
5
|
+
message: string;
|
|
6
|
+
code: string;
|
|
7
|
+
}
|
|
8
|
+
export interface FileRejection {
|
|
9
|
+
file: FileWithPath;
|
|
10
|
+
errors: FileError[];
|
|
11
|
+
}
|
|
12
|
+
/** Mime type -> array of accepted file extensions (e.g. `{ 'image/png': ['.png'] }`) */
|
|
13
|
+
export type Accept = Record<string, string[]>;
|
|
14
|
+
export type DropEvent = DragEvent | Event | FileSystemFileHandle[];
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Accept, DropEvent, FileError, FileRejection, FileWithPath } from './types';
|
|
2
|
+
export interface UseDropzoneOptions {
|
|
3
|
+
accept?: () => Accept | undefined;
|
|
4
|
+
disabled?: () => boolean | undefined;
|
|
5
|
+
multiple?: () => boolean | undefined;
|
|
6
|
+
maxSize?: () => number | undefined;
|
|
7
|
+
minSize?: () => number | undefined;
|
|
8
|
+
maxFiles?: () => number | undefined;
|
|
9
|
+
autoFocus?: () => boolean | undefined;
|
|
10
|
+
noClick?: () => boolean | undefined;
|
|
11
|
+
noDrag?: () => boolean | undefined;
|
|
12
|
+
noDragEventsBubbling?: () => boolean | undefined;
|
|
13
|
+
noKeyboard?: () => boolean | undefined;
|
|
14
|
+
preventDropOnDocument?: () => boolean | undefined;
|
|
15
|
+
useFsAccessApi?: () => boolean | undefined;
|
|
16
|
+
validator?: () => ((file: FileWithPath) => FileError | FileError[] | null) | undefined;
|
|
17
|
+
getFilesFromEvent?: () => ((event: DropEvent) => Promise<FileWithPath[]>) | undefined;
|
|
18
|
+
onDrop?: (files: FileWithPath[], fileRejections: FileRejection[], event: DropEvent | null) => void;
|
|
19
|
+
onDropAccepted?: (files: FileWithPath[], event: DropEvent | null) => void;
|
|
20
|
+
onDropRejected?: (fileRejections: FileRejection[], event: DropEvent | null) => void;
|
|
21
|
+
onDragEnter?: (event: DragEvent) => void;
|
|
22
|
+
onDragLeave?: (event: DragEvent) => void;
|
|
23
|
+
onDragOver?: (event: DragEvent) => void;
|
|
24
|
+
onFileDialogCancel?: () => void;
|
|
25
|
+
onFileDialogOpen?: () => void;
|
|
26
|
+
onError?: (error: unknown) => void;
|
|
27
|
+
}
|
|
28
|
+
export interface DropzoneRootProps {
|
|
29
|
+
onKeydown: ((event: KeyboardEvent) => void) | null;
|
|
30
|
+
onFocus: (() => void) | null;
|
|
31
|
+
onBlur: (() => void) | null;
|
|
32
|
+
onClick: (() => void) | null;
|
|
33
|
+
onDragenter: ((event: DragEvent) => void) | null;
|
|
34
|
+
onDragover: ((event: DragEvent) => void) | null;
|
|
35
|
+
onDragleave: ((event: DragEvent) => void) | null;
|
|
36
|
+
onDrop: ((event: DragEvent) => void) | null;
|
|
37
|
+
role: string;
|
|
38
|
+
ref: (el: any) => void;
|
|
39
|
+
tabindex?: number;
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
}
|
|
42
|
+
export interface DropzoneInputProps {
|
|
43
|
+
type: 'file';
|
|
44
|
+
accept?: string;
|
|
45
|
+
multiple: boolean;
|
|
46
|
+
style: Record<string, string | number>;
|
|
47
|
+
tabindex: number;
|
|
48
|
+
ref: (el: any) => void;
|
|
49
|
+
onChange: ((event: Event) => void) | null;
|
|
50
|
+
onClick: ((event: Event) => void) | null;
|
|
51
|
+
[key: string]: any;
|
|
52
|
+
}
|
|
53
|
+
declare function noop(): void;
|
|
54
|
+
export declare function useDropzone(options: UseDropzoneOptions): {
|
|
55
|
+
state: {
|
|
56
|
+
isFocused: boolean;
|
|
57
|
+
isFileDialogActive: boolean;
|
|
58
|
+
isDragActive: boolean;
|
|
59
|
+
isDragAccept: boolean;
|
|
60
|
+
isDragReject: boolean;
|
|
61
|
+
};
|
|
62
|
+
rootRef: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
|
|
63
|
+
inputRef: import("vue").Ref<HTMLInputElement | null, HTMLInputElement | null>;
|
|
64
|
+
isFocused: import("vue").ComputedRef<boolean>;
|
|
65
|
+
isDragActive: import("vue").ComputedRef<boolean>;
|
|
66
|
+
isDragAccept: import("vue").ComputedRef<boolean>;
|
|
67
|
+
isDragReject: import("vue").ComputedRef<boolean>;
|
|
68
|
+
getRootProps: (overrides?: Record<string, any>) => DropzoneRootProps;
|
|
69
|
+
getInputProps: (overrides?: Record<string, any>) => DropzoneInputProps;
|
|
70
|
+
open: () => void | undefined;
|
|
71
|
+
};
|
|
72
|
+
export { noop };
|
package/lib/utils.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Accept, FileError, FileWithPath } from './types';
|
|
2
|
+
export declare const FILE_INVALID_TYPE = "file-invalid-type";
|
|
3
|
+
export declare const FILE_TOO_LARGE = "file-too-large";
|
|
4
|
+
export declare const FILE_TOO_SMALL = "file-too-small";
|
|
5
|
+
export declare const TOO_MANY_FILES = "too-many-files";
|
|
6
|
+
export declare const ErrorCode: {
|
|
7
|
+
readonly FileInvalidType: "file-invalid-type";
|
|
8
|
+
readonly FileTooLarge: "file-too-large";
|
|
9
|
+
readonly FileTooSmall: "file-too-small";
|
|
10
|
+
readonly TooManyFiles: "too-many-files";
|
|
11
|
+
};
|
|
12
|
+
export declare const getInvalidTypeRejectionErr: (accept?: string) => FileError;
|
|
13
|
+
export declare const getTooLargeRejectionErr: (maxSize: number) => FileError;
|
|
14
|
+
export declare const getTooSmallRejectionErr: (minSize: number) => FileError;
|
|
15
|
+
export declare const TOO_MANY_FILES_REJECTION: FileError;
|
|
16
|
+
/**
|
|
17
|
+
* Check if the given file is a DataTransferItem with an empty type. During drag events some
|
|
18
|
+
* browsers report an empty MIME type on DataTransferItem for certain file extensions even though
|
|
19
|
+
* the type is correctly set once the file is actually dropped, so we accept those provisionally.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isDataTransferItemWithEmptyType(file: any): boolean;
|
|
22
|
+
export declare function fileAccepted(file: FileWithPath | DataTransferItem, accept?: string): [boolean, FileError | null];
|
|
23
|
+
export declare function fileMatchSize(file: FileWithPath, minSize?: number, maxSize?: number): [boolean, FileError | null];
|
|
24
|
+
export interface AllFilesAcceptedOptions {
|
|
25
|
+
files: FileWithPath[];
|
|
26
|
+
accept?: string;
|
|
27
|
+
minSize?: number;
|
|
28
|
+
maxSize?: number;
|
|
29
|
+
multiple?: boolean;
|
|
30
|
+
maxFiles?: number;
|
|
31
|
+
validator?: (file: FileWithPath) => FileError | FileError[] | null;
|
|
32
|
+
}
|
|
33
|
+
export declare function allFilesAccepted({ files, accept, minSize, maxSize, multiple, maxFiles, validator, }: AllFilesAcceptedOptions): boolean;
|
|
34
|
+
export declare function isEvtWithFiles(event: DragEvent | Event): boolean;
|
|
35
|
+
export declare function canUseFileSystemAccessAPI(): boolean;
|
|
36
|
+
/** Convert the `accept` prop into the `{types}` option for `window.showOpenFilePicker`. */
|
|
37
|
+
export declare function pickerOptionsFromAccept(accept?: Accept): {
|
|
38
|
+
description: string;
|
|
39
|
+
accept: Accept;
|
|
40
|
+
}[] | undefined;
|
|
41
|
+
/** Convert the `accept` prop into a comma-separated string suitable for `<input accept>`. */
|
|
42
|
+
export declare function acceptPropAsAcceptAttr(accept?: Accept): string | undefined;
|
|
43
|
+
export declare function isAbort(v: unknown): boolean;
|
|
44
|
+
export declare function isSecurityError(v: unknown): boolean;
|
|
45
|
+
export declare function isMIMEType(v: string): boolean;
|
|
46
|
+
export declare function isExt(v: string): boolean;
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mantine-vue/dropzone",
|
|
3
|
+
"version": "1.1.2",
|
|
4
|
+
"description": "Vue file drag & drop zone component equivalent to @mantine/dropzone",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"files": [
|
|
7
|
+
"cjs",
|
|
8
|
+
"esm",
|
|
9
|
+
"lib",
|
|
10
|
+
"styles.css",
|
|
11
|
+
"styles.layer.css",
|
|
12
|
+
"styles"
|
|
13
|
+
],
|
|
14
|
+
"sideEffects": [
|
|
15
|
+
"*.css"
|
|
16
|
+
],
|
|
17
|
+
"main": "./cjs/index.cjs",
|
|
18
|
+
"module": "./esm/index.mjs",
|
|
19
|
+
"types": "./lib/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"import": {
|
|
23
|
+
"types": "./lib/index.d.mts",
|
|
24
|
+
"default": "./esm/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"require": {
|
|
27
|
+
"types": "./lib/index.d.ts",
|
|
28
|
+
"default": "./cjs/index.cjs"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@mantine-vue/core": "workspace:*",
|
|
34
|
+
"@mantine-vue/hooks": "workspace:*",
|
|
35
|
+
"@vue/compiler-dom": "^3.5.0",
|
|
36
|
+
"@vue/test-utils": "^2.4.6",
|
|
37
|
+
"vue": "^3.5.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@mantine-vue/core": "1.1.1",
|
|
41
|
+
"@mantine-vue/hooks": "1.1.2",
|
|
42
|
+
"vue": "^3.5.0"
|
|
43
|
+
}
|
|
44
|
+
}
|
package/styles.css
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
._root_27ynu_1 {
|
|
2
|
+
position: relative;
|
|
3
|
+
border: calc(0.0625rem * var(--mantine-scale)) dashed;
|
|
4
|
+
color: var(--mantine-color-text);
|
|
5
|
+
padding: var(--mantine-spacing-md);
|
|
6
|
+
border-radius: var(--dropzone-radius);
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
user-select: none;
|
|
9
|
+
transition:
|
|
10
|
+
background-color 100ms ease,
|
|
11
|
+
border-color 100ms ease;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
._root_27ynu_1:where([data-loading]),
|
|
15
|
+
._root_27ynu_1:where(:not([data-activate-on-click])) {
|
|
16
|
+
cursor: default;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:where([data-mantine-color-scheme='light']) ._root_27ynu_1 {
|
|
20
|
+
background-color: var(--mantine-color-white);
|
|
21
|
+
border-color: var(--mantine-color-gray-4);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:where([data-mantine-color-scheme='dark']) ._root_27ynu_1 {
|
|
25
|
+
background-color: var(--mantine-color-dark-6);
|
|
26
|
+
border-color: var(--mantine-color-dark-4);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@media (hover: hover) {
|
|
30
|
+
:where([data-mantine-color-scheme='light']) ._root_27ynu_1:hover:where([data-activate-on-click]:not([data-loading])) {
|
|
31
|
+
background-color: var(--mantine-color-gray-0);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:where([data-mantine-color-scheme='dark']) ._root_27ynu_1:hover:where([data-activate-on-click]:not([data-loading])) {
|
|
35
|
+
background-color: var(--mantine-color-dark-5);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@media (hover: none) {
|
|
40
|
+
:where([data-mantine-color-scheme='light']) ._root_27ynu_1:active:where([data-activate-on-click]:not([data-loading])) {
|
|
41
|
+
background-color: var(--mantine-color-gray-0);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:where([data-mantine-color-scheme='dark']) ._root_27ynu_1:active:where([data-activate-on-click]:not([data-loading])) {
|
|
45
|
+
background-color: var(--mantine-color-dark-5);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
._root_27ynu_1:where([data-accept]) {
|
|
50
|
+
background-color: var(--dropzone-accept-bg);
|
|
51
|
+
border-color: var(--dropzone-accept-bg);
|
|
52
|
+
color: var(--dropzone-accept-color);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
._root_27ynu_1:where([data-reject]) {
|
|
56
|
+
background-color: var(--dropzone-reject-bg);
|
|
57
|
+
border-color: var(--dropzone-reject-bg);
|
|
58
|
+
color: var(--dropzone-reject-color);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
._inner_27ynu_53 {
|
|
62
|
+
pointer-events: none;
|
|
63
|
+
user-select: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
._inner_27ynu_53:where([data-enable-pointer-events]) {
|
|
67
|
+
pointer-events: all;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
._fullScreen_27ynu_62 {
|
|
71
|
+
position: fixed;
|
|
72
|
+
inset: 0;
|
|
73
|
+
background-color: var(--mantine-color-body);
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
padding: var(--mantine-spacing-xs);
|
|
77
|
+
transition: opacity 100ms ease;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
._fullScreen_27ynu_62 ._dropzone_27ynu_71 {
|
|
81
|
+
flex: 1;
|
|
82
|
+
}
|
|
83
|
+
/*$vite$:1*/
|
package/styles.layer.css
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
@layer mantine {
|
|
2
|
+
._root_27ynu_1 {
|
|
3
|
+
position: relative;
|
|
4
|
+
border: calc(0.0625rem * var(--mantine-scale)) dashed;
|
|
5
|
+
color: var(--mantine-color-text);
|
|
6
|
+
padding: var(--mantine-spacing-md);
|
|
7
|
+
border-radius: var(--dropzone-radius);
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
user-select: none;
|
|
10
|
+
transition:
|
|
11
|
+
background-color 100ms ease,
|
|
12
|
+
border-color 100ms ease;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
._root_27ynu_1:where([data-loading]),
|
|
16
|
+
._root_27ynu_1:where(:not([data-activate-on-click])) {
|
|
17
|
+
cursor: default;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:where([data-mantine-color-scheme='light']) ._root_27ynu_1 {
|
|
21
|
+
background-color: var(--mantine-color-white);
|
|
22
|
+
border-color: var(--mantine-color-gray-4);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:where([data-mantine-color-scheme='dark']) ._root_27ynu_1 {
|
|
26
|
+
background-color: var(--mantine-color-dark-6);
|
|
27
|
+
border-color: var(--mantine-color-dark-4);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media (hover: hover) {
|
|
31
|
+
:where([data-mantine-color-scheme='light']) ._root_27ynu_1:hover:where([data-activate-on-click]:not([data-loading])) {
|
|
32
|
+
background-color: var(--mantine-color-gray-0);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:where([data-mantine-color-scheme='dark']) ._root_27ynu_1:hover:where([data-activate-on-click]:not([data-loading])) {
|
|
36
|
+
background-color: var(--mantine-color-dark-5);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@media (hover: none) {
|
|
41
|
+
:where([data-mantine-color-scheme='light']) ._root_27ynu_1:active:where([data-activate-on-click]:not([data-loading])) {
|
|
42
|
+
background-color: var(--mantine-color-gray-0);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:where([data-mantine-color-scheme='dark']) ._root_27ynu_1:active:where([data-activate-on-click]:not([data-loading])) {
|
|
46
|
+
background-color: var(--mantine-color-dark-5);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
._root_27ynu_1:where([data-accept]) {
|
|
51
|
+
background-color: var(--dropzone-accept-bg);
|
|
52
|
+
border-color: var(--dropzone-accept-bg);
|
|
53
|
+
color: var(--dropzone-accept-color);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
._root_27ynu_1:where([data-reject]) {
|
|
57
|
+
background-color: var(--dropzone-reject-bg);
|
|
58
|
+
border-color: var(--dropzone-reject-bg);
|
|
59
|
+
color: var(--dropzone-reject-color);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
._inner_27ynu_53 {
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
user-select: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
._inner_27ynu_53:where([data-enable-pointer-events]) {
|
|
68
|
+
pointer-events: all;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
._fullScreen_27ynu_62 {
|
|
72
|
+
position: fixed;
|
|
73
|
+
inset: 0;
|
|
74
|
+
background-color: var(--mantine-color-body);
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
padding: var(--mantine-spacing-xs);
|
|
78
|
+
transition: opacity 100ms ease;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
._fullScreen_27ynu_62 ._dropzone_27ynu_71 {
|
|
82
|
+
flex: 1;
|
|
83
|
+
}
|
|
84
|
+
/*$vite$:1*/
|
|
85
|
+
}
|