demio-ui 2.5.17 → 2.5.19
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.css +1 -1
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/types/src/components/Upload/Upload.d.ts +12 -12
- package/dist/cjs/types/src/components/UploadMenu/UploadMenu.d.ts +2 -0
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/types/src/components/Upload/Upload.d.ts +12 -12
- package/dist/esm/types/src/components/UploadMenu/UploadMenu.d.ts +2 -0
- package/dist/types.d.ts +13 -11
- package/package.json +1 -2
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { RcFile, UploadProgressEvent, UploadRequestOption } from 'rc-upload/es/interface';
|
|
1
|
+
import { DragEvent, FC, ReactNode, SetStateAction } from 'react';
|
|
3
2
|
import { Area, Point } from 'react-easy-crop';
|
|
4
3
|
import { UploadMenuItem } from '../UploadMenu/UploadMenu';
|
|
5
4
|
export interface UploadProps {
|
|
@@ -20,27 +19,28 @@ export interface UploadProps {
|
|
|
20
19
|
isDimensionValidationEnabled?: boolean;
|
|
21
20
|
isSizeValidationEnabled?: boolean;
|
|
22
21
|
isTypeValidationEnabled?: boolean;
|
|
23
|
-
isUploadProgress?: boolean;
|
|
24
22
|
isValidationEnabled?: boolean;
|
|
25
23
|
menu?: UploadMenuItem[];
|
|
26
|
-
menuUpload?: UploadMenuItem[];
|
|
27
24
|
minHeightLimit?: number;
|
|
28
25
|
minWidthLimit?: number;
|
|
29
|
-
onBeforeUpload?: (file:
|
|
26
|
+
onBeforeUpload?: (file: File, fileList?: File[]) => void;
|
|
30
27
|
onCropCancel?: () => void;
|
|
31
28
|
onCropOk?: (croppedUrl: string) => void;
|
|
32
29
|
onCropChange?: (data: SetStateAction<Point>) => void;
|
|
33
30
|
onCropComplete?: (croppedArea: Area, croppedAreaPixels: Area) => void;
|
|
34
|
-
onDragLeave?: (event:
|
|
35
|
-
onDragOver?: (event:
|
|
31
|
+
onDragLeave?: (event: DragEvent<HTMLDivElement>) => void;
|
|
32
|
+
onDragOver?: (event: DragEvent<HTMLDivElement>) => void;
|
|
36
33
|
onDrop?: (event: DragEvent<HTMLDivElement>, file: File | null) => void;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
onUploadError?: (error: Error | DOMException | null | unknown, file: File) => void;
|
|
35
|
+
onUploadProgress?: (progress: number, file: File) => void;
|
|
36
|
+
onUploadStart?: (file: File) => void;
|
|
37
|
+
onUploadSuccess?: (response: string | ArrayBuffer | null, file: File) => void;
|
|
41
38
|
onZoomChange?: (value: number) => void;
|
|
39
|
+
previewDuration?: string;
|
|
40
|
+
previewFileName?: string;
|
|
41
|
+
previewImage?: string;
|
|
42
|
+
previewText?: string;
|
|
42
43
|
uploadPercent?: number;
|
|
43
|
-
uploadRequest?: (options: UploadRequestOption) => void;
|
|
44
44
|
}
|
|
45
45
|
declare const Upload: FC<UploadProps>;
|
|
46
46
|
export default Upload;
|
|
@@ -11,6 +11,8 @@ export interface UploadMenuItem {
|
|
|
11
11
|
onSelect?: (e: Event, options: SelectOptions) => void;
|
|
12
12
|
text: ReactNode;
|
|
13
13
|
isDisabled?: boolean;
|
|
14
|
+
isPreviewOnlyItem?: boolean;
|
|
15
|
+
isUploadOnlyItem?: boolean;
|
|
14
16
|
}
|
|
15
17
|
export interface UploadMenuProps {
|
|
16
18
|
align?: 'end' | 'center' | 'start';
|
package/dist/types.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
|
7
7
|
import { PopoverContentTypeProps } from '@radix-ui/react-popover';
|
|
8
8
|
export { Content as PopoverContent, Portal as PopoverPortal, Root as PopoverRoot, Trigger as PopoverTrigger } from '@radix-ui/react-popover';
|
|
9
9
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
10
|
-
import { RcFile, UploadProgressEvent, UploadRequestOption } from 'rc-upload/es/interface';
|
|
11
10
|
|
|
12
11
|
type Props$l = {
|
|
13
12
|
className?: string;
|
|
@@ -488,6 +487,8 @@ interface UploadMenuItem {
|
|
|
488
487
|
onSelect?: (e: Event, options: SelectOptions) => void;
|
|
489
488
|
text: ReactNode;
|
|
490
489
|
isDisabled?: boolean;
|
|
490
|
+
isPreviewOnlyItem?: boolean;
|
|
491
|
+
isUploadOnlyItem?: boolean;
|
|
491
492
|
}
|
|
492
493
|
interface UploadMenuProps {
|
|
493
494
|
align?: 'end' | 'center' | 'start';
|
|
@@ -518,27 +519,28 @@ interface UploadProps {
|
|
|
518
519
|
isDimensionValidationEnabled?: boolean;
|
|
519
520
|
isSizeValidationEnabled?: boolean;
|
|
520
521
|
isTypeValidationEnabled?: boolean;
|
|
521
|
-
isUploadProgress?: boolean;
|
|
522
522
|
isValidationEnabled?: boolean;
|
|
523
523
|
menu?: UploadMenuItem[];
|
|
524
|
-
menuUpload?: UploadMenuItem[];
|
|
525
524
|
minHeightLimit?: number;
|
|
526
525
|
minWidthLimit?: number;
|
|
527
|
-
onBeforeUpload?: (file:
|
|
526
|
+
onBeforeUpload?: (file: File, fileList?: File[]) => void;
|
|
528
527
|
onCropCancel?: () => void;
|
|
529
528
|
onCropOk?: (croppedUrl: string) => void;
|
|
530
529
|
onCropChange?: (data: SetStateAction<Point>) => void;
|
|
531
530
|
onCropComplete?: (croppedArea: Area, croppedAreaPixels: Area) => void;
|
|
532
|
-
onDragLeave?: (event:
|
|
533
|
-
onDragOver?: (event:
|
|
531
|
+
onDragLeave?: (event: DragEvent<HTMLDivElement>) => void;
|
|
532
|
+
onDragOver?: (event: DragEvent<HTMLDivElement>) => void;
|
|
534
533
|
onDrop?: (event: DragEvent<HTMLDivElement>, file: File | null) => void;
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
534
|
+
onUploadError?: (error: Error | DOMException | null | unknown, file: File) => void;
|
|
535
|
+
onUploadProgress?: (progress: number, file: File) => void;
|
|
536
|
+
onUploadStart?: (file: File) => void;
|
|
537
|
+
onUploadSuccess?: (response: string | ArrayBuffer | null, file: File) => void;
|
|
539
538
|
onZoomChange?: (value: number) => void;
|
|
539
|
+
previewDuration?: string;
|
|
540
|
+
previewFileName?: string;
|
|
541
|
+
previewImage?: string;
|
|
542
|
+
previewText?: string;
|
|
540
543
|
uploadPercent?: number;
|
|
541
|
-
uploadRequest?: (options: UploadRequestOption) => void;
|
|
542
544
|
}
|
|
543
545
|
declare const Upload: FC<UploadProps>;
|
|
544
546
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "demio-ui",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.19",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
"@storybook/react": "^8.4.4",
|
|
67
67
|
"@storybook/react-webpack5": "^8.4.4",
|
|
68
68
|
"classnames": "^2.5.1",
|
|
69
|
-
"rc-upload": "^4.6.0",
|
|
70
69
|
"react-easy-crop": "^5.0.8",
|
|
71
70
|
"react-select": "^5.8.0"
|
|
72
71
|
},
|