demio-ui 2.5.14 → 2.5.16
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 +5 -13
- package/dist/cjs/types/src/components/UploadMenu/UploadMenu.d.ts +25 -0
- package/dist/cjs/types/src/components/UploadMenu/index.d.ts +1 -0
- package/dist/cjs/types/src/components/index.d.ts +1 -0
- package/dist/cjs/types/src/utils/file/file-utils.d.ts +1 -0
- package/dist/cjs/types/src/utils/file/index.d.ts +1 -1
- package/dist/cjs/types/src/utils/file/test.d.ts +1 -0
- package/dist/cjs/types/src/utils/image/test.d.ts +1 -0
- package/dist/cjs/types/src/utils/index.d.ts +1 -1
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/types/src/components/Upload/Upload.d.ts +5 -13
- package/dist/esm/types/src/components/UploadMenu/UploadMenu.d.ts +25 -0
- package/dist/esm/types/src/components/UploadMenu/index.d.ts +1 -0
- package/dist/esm/types/src/components/index.d.ts +1 -0
- package/dist/esm/types/src/utils/file/file-utils.d.ts +1 -0
- package/dist/esm/types/src/utils/file/index.d.ts +1 -1
- package/dist/esm/types/src/utils/file/test.d.ts +1 -0
- package/dist/esm/types/src/utils/image/test.d.ts +1 -0
- package/dist/esm/types/src/utils/index.d.ts +1 -1
- package/dist/types.d.ts +48 -10
- package/package.json +1 -1
- package/dist/cjs/types/src/components/Pagination/Pagination.utils.d.ts +0 -7
- package/dist/cjs/types/src/hooks/useCroppedImage.d.ts +0 -4
- package/dist/esm/types/src/components/Pagination/Pagination.utils.d.ts +0 -7
- package/dist/esm/types/src/hooks/useCroppedImage.d.ts +0 -4
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import React, { DragEvent, FC, ReactNode, SetStateAction } from 'react';
|
|
2
2
|
import { RcFile, UploadProgressEvent } from 'rc-upload/es/interface';
|
|
3
3
|
import { Area, Point } from 'react-easy-crop';
|
|
4
|
-
|
|
5
|
-
file?: string;
|
|
6
|
-
setFile?: (file: string) => void;
|
|
7
|
-
}
|
|
8
|
-
export interface UploadMenuItem {
|
|
9
|
-
className?: string;
|
|
10
|
-
icon?: ReactNode;
|
|
11
|
-
onSelect?: (e: Event, options: SelectOptions) => void;
|
|
12
|
-
text: ReactNode;
|
|
13
|
-
isDisabled?: boolean;
|
|
14
|
-
}
|
|
4
|
+
import { UploadMenuItem } from '../UploadMenu/UploadMenu';
|
|
15
5
|
export interface UploadProps {
|
|
16
6
|
acceptableFileTypes?: string;
|
|
17
7
|
children?: ReactNode;
|
|
@@ -30,11 +20,12 @@ export interface UploadProps {
|
|
|
30
20
|
isDimensionValidationEnabled?: boolean;
|
|
31
21
|
isSizeValidationEnabled?: boolean;
|
|
32
22
|
isTypeValidationEnabled?: boolean;
|
|
23
|
+
isUploadProgress?: boolean;
|
|
33
24
|
isValidationEnabled?: boolean;
|
|
34
25
|
menu?: UploadMenuItem[];
|
|
26
|
+
menuUpload?: UploadMenuItem[];
|
|
35
27
|
minHeightLimit?: number;
|
|
36
28
|
minWidthLimit?: number;
|
|
37
|
-
name?: string;
|
|
38
29
|
onBeforeUpload?: (file: RcFile, fileList: RcFile[]) => void;
|
|
39
30
|
onCropCancel?: () => void;
|
|
40
31
|
onCropOk?: (croppedUrl: string) => void;
|
|
@@ -46,8 +37,9 @@ export interface UploadProps {
|
|
|
46
37
|
onError?: (err: Error, ret: Record<string, unknown>, file: RcFile) => void;
|
|
47
38
|
onProgress?: (event: UploadProgressEvent, file: RcFile) => void;
|
|
48
39
|
onStart?: (file: RcFile) => void;
|
|
49
|
-
onSuccess?: (
|
|
40
|
+
onSuccess?: (response: Record<string, unknown>, file: RcFile, xhr: XMLHttpRequest) => void;
|
|
50
41
|
onZoomChange?: (value: number) => void;
|
|
42
|
+
uploadPercent?: number;
|
|
51
43
|
}
|
|
52
44
|
declare const Upload: FC<UploadProps>;
|
|
53
45
|
export default Upload;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
export interface SelectOptions {
|
|
3
|
+
itemNumber: number;
|
|
4
|
+
file?: string;
|
|
5
|
+
resetUpload?: () => void;
|
|
6
|
+
setFile?: (file: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface UploadMenuItem {
|
|
9
|
+
className?: string;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
onSelect?: (e: Event, options: SelectOptions) => void;
|
|
12
|
+
text: ReactNode;
|
|
13
|
+
isDisabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface UploadMenuProps {
|
|
16
|
+
align?: 'end' | 'center' | 'start';
|
|
17
|
+
isOpen?: boolean;
|
|
18
|
+
menu?: UploadMenuItem[];
|
|
19
|
+
onOpen?: (isOpen: boolean) => void;
|
|
20
|
+
sideOffset?: number;
|
|
21
|
+
triggerButton?: ReactNode;
|
|
22
|
+
triggerButtonClass?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const UploadMenu: FC<UploadMenuProps>;
|
|
25
|
+
export default UploadMenu;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './UploadMenu';
|
|
@@ -4,5 +4,6 @@ export declare const getFileMimeType: (file?: unknown) => string;
|
|
|
4
4
|
export declare const isExtensionMatchingMimeType: (extension?: unknown, mimeType?: unknown) => boolean;
|
|
5
5
|
export declare const isValidFileType: (file?: unknown, acceptableTypePattern?: unknown) => boolean;
|
|
6
6
|
export declare const isImage: (file?: unknown) => boolean;
|
|
7
|
+
export declare const isVideo: (file?: unknown) => boolean;
|
|
7
8
|
export declare const isValidFileSize: (file?: unknown, fileSizeMbLimit?: unknown) => boolean;
|
|
8
9
|
export declare const isValidFileDimension: (file?: unknown, minWidth?: number, minHeight?: number) => Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { getFileExtension, getFileMimeType, isExtensionMatchingMimeType, isValidFileDimension, isValidFileSize, isValidFileType, mimeTypeMap, } from './file-utils';
|
|
1
|
+
export { getFileExtension, getFileMimeType, isExtensionMatchingMimeType, isImage, isValidFileDimension, isValidFileSize, isValidFileType, isVideo, mimeTypeMap, } from './file-utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { getFileExtension, getFileMimeType, isExtensionMatchingMimeType, isValidFileDimension, isValidFileSize, isValidFileType, mimeTypeMap, } from './file';
|
|
1
|
+
export { getFileExtension, getFileMimeType, isExtensionMatchingMimeType, isImage, isValidFileDimension, isValidFileSize, isValidFileType, isVideo, mimeTypeMap, } from './file';
|
|
2
2
|
export { createImage, getCroppedImageURL, getRadianAngle, rotateSize } from './image';
|
package/dist/types.d.ts
CHANGED
|
@@ -477,7 +477,9 @@ interface TypoProps extends PropsWithChildren {
|
|
|
477
477
|
declare const Typography: ({ tag, dataTestId, align, className, children, emphasis, title, variant, ...restProps }: TypoProps) => React__default.JSX.Element;
|
|
478
478
|
|
|
479
479
|
interface SelectOptions {
|
|
480
|
+
itemNumber: number;
|
|
480
481
|
file?: string;
|
|
482
|
+
resetUpload?: () => void;
|
|
481
483
|
setFile?: (file: string) => void;
|
|
482
484
|
}
|
|
483
485
|
interface UploadMenuItem {
|
|
@@ -487,6 +489,17 @@ interface UploadMenuItem {
|
|
|
487
489
|
text: ReactNode;
|
|
488
490
|
isDisabled?: boolean;
|
|
489
491
|
}
|
|
492
|
+
interface UploadMenuProps {
|
|
493
|
+
align?: 'end' | 'center' | 'start';
|
|
494
|
+
isOpen?: boolean;
|
|
495
|
+
menu?: UploadMenuItem[];
|
|
496
|
+
onOpen?: (isOpen: boolean) => void;
|
|
497
|
+
sideOffset?: number;
|
|
498
|
+
triggerButton?: ReactNode;
|
|
499
|
+
triggerButtonClass?: string;
|
|
500
|
+
}
|
|
501
|
+
declare const UploadMenu: FC<UploadMenuProps>;
|
|
502
|
+
|
|
490
503
|
interface UploadProps {
|
|
491
504
|
acceptableFileTypes?: string;
|
|
492
505
|
children?: ReactNode;
|
|
@@ -505,11 +518,12 @@ interface UploadProps {
|
|
|
505
518
|
isDimensionValidationEnabled?: boolean;
|
|
506
519
|
isSizeValidationEnabled?: boolean;
|
|
507
520
|
isTypeValidationEnabled?: boolean;
|
|
521
|
+
isUploadProgress?: boolean;
|
|
508
522
|
isValidationEnabled?: boolean;
|
|
509
523
|
menu?: UploadMenuItem[];
|
|
524
|
+
menuUpload?: UploadMenuItem[];
|
|
510
525
|
minHeightLimit?: number;
|
|
511
526
|
minWidthLimit?: number;
|
|
512
|
-
name?: string;
|
|
513
527
|
onBeforeUpload?: (file: RcFile, fileList: RcFile[]) => void;
|
|
514
528
|
onCropCancel?: () => void;
|
|
515
529
|
onCropOk?: (croppedUrl: string) => void;
|
|
@@ -521,8 +535,9 @@ interface UploadProps {
|
|
|
521
535
|
onError?: (err: Error, ret: Record<string, unknown>, file: RcFile) => void;
|
|
522
536
|
onProgress?: (event: UploadProgressEvent, file: RcFile) => void;
|
|
523
537
|
onStart?: (file: RcFile) => void;
|
|
524
|
-
onSuccess?: (
|
|
538
|
+
onSuccess?: (response: Record<string, unknown>, file: RcFile, xhr: XMLHttpRequest) => void;
|
|
525
539
|
onZoomChange?: (value: number) => void;
|
|
540
|
+
uploadPercent?: number;
|
|
526
541
|
}
|
|
527
542
|
declare const Upload: FC<UploadProps>;
|
|
528
543
|
|
|
@@ -606,7 +621,7 @@ var SvgArrowLeft = function SvgArrowLeft(props) {
|
|
|
606
621
|
})));
|
|
607
622
|
};
|
|
608
623
|
|
|
609
|
-
var _path$1p, _path2$
|
|
624
|
+
var _path$1p, _path2$5;
|
|
610
625
|
function _extends$1q() { return _extends$1q = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1q.apply(null, arguments); }
|
|
611
626
|
var SvgArrowLeftDouble = function SvgArrowLeftDouble(props) {
|
|
612
627
|
return /*#__PURE__*/React.createElement("svg", _extends$1q({
|
|
@@ -616,7 +631,7 @@ var SvgArrowLeftDouble = function SvgArrowLeftDouble(props) {
|
|
|
616
631
|
}, props), _path$1p || (_path$1p = /*#__PURE__*/React.createElement("path", {
|
|
617
632
|
fill: "#2C3336",
|
|
618
633
|
d: "m3.166 11.602 6.93-6.938a.57.57 0 0 1 .803 0l.935.928a.56.56 0 0 1 0 .797L6.24 12l5.594 5.61a.56.56 0 0 1 0 .798l-.935.928a.57.57 0 0 1-.803 0l-6.93-6.938a.56.56 0 0 1 0-.796"
|
|
619
|
-
})), _path2$
|
|
634
|
+
})), _path2$5 || (_path2$5 = /*#__PURE__*/React.createElement("path", {
|
|
620
635
|
fill: "#2C3336",
|
|
621
636
|
d: "m12.166 11.602 6.93-6.938a.57.57 0 0 1 .803 0l.935.928a.56.56 0 0 1 0 .797L15.24 12l5.594 5.61a.56.56 0 0 1 0 .798l-.935.928a.57.57 0 0 1-.803 0l-6.93-6.938a.56.56 0 0 1 0-.796"
|
|
622
637
|
})));
|
|
@@ -757,7 +772,7 @@ var SvgCalendar = function SvgCalendar(props) {
|
|
|
757
772
|
}))));
|
|
758
773
|
};
|
|
759
774
|
|
|
760
|
-
var _path$1i, _path2$
|
|
775
|
+
var _path$1i, _path2$4;
|
|
761
776
|
function _extends$1j() { return _extends$1j = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1j.apply(null, arguments); }
|
|
762
777
|
var SvgCalendarStar = function SvgCalendarStar(props) {
|
|
763
778
|
return /*#__PURE__*/React.createElement("svg", _extends$1j({
|
|
@@ -768,7 +783,7 @@ var SvgCalendarStar = function SvgCalendarStar(props) {
|
|
|
768
783
|
fill: "#2C3336",
|
|
769
784
|
d: "M1.2 9v12.75A2.25 2.25 0 0 0 3.45 24h16.5a2.25 2.25 0 0 0 2.25-2.25V9zm15.194 6.652a.56.56 0 0 1-.166.323l-1.856 1.81.44 2.559a.564.564 0 0 1-.815.59L11.7 19.725l-2.292 1.21a.563.563 0 0 1-.816-.591l.44-2.56-1.855-1.809a.562.562 0 0 1 .309-.96l2.564-.376 1.148-2.325a.562.562 0 0 1 1.008 0l1.149 2.325 2.564.375a.56.56 0 0 1 .474.638M15.45 6h1.5a.75.75 0 0 0 .75-.75V.75a.75.75 0 0 0-.75-.75h-1.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 .75.75m-9 0h1.5a.75.75 0 0 0 .75-.75V.75A.75.75 0 0 0 7.95 0h-1.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 .75.75",
|
|
770
785
|
opacity: 0.4
|
|
771
|
-
})), _path2$
|
|
786
|
+
})), _path2$4 || (_path2$4 = /*#__PURE__*/React.createElement("path", {
|
|
772
787
|
fill: "#2C3336",
|
|
773
788
|
d: "m15.919 15.014-2.564-.375-1.149-2.325a.563.563 0 0 0-1.008 0L10.05 14.64l-2.564.375a.562.562 0 0 0-.31.961l1.857 1.81-.44 2.559a.563.563 0 0 0 .815.59l2.292-1.209 2.297 1.21a.563.563 0 0 0 .816-.591l-.441-2.56 1.856-1.809a.562.562 0 0 0-.31-.96M19.95 3H17.7v2.25a.75.75 0 0 1-.75.75h-1.5a.75.75 0 0 1-.75-.75V3h-6v2.25a.75.75 0 0 1-.75.75h-1.5a.75.75 0 0 1-.75-.75V3H3.45A2.25 2.25 0 0 0 1.2 5.25V9h21V5.25A2.25 2.25 0 0 0 19.95 3"
|
|
774
789
|
})));
|
|
@@ -796,15 +811,36 @@ var SvgChatIcon = function SvgChatIcon(props) {
|
|
|
796
811
|
})));
|
|
797
812
|
};
|
|
798
813
|
|
|
799
|
-
var _path$1f;
|
|
814
|
+
var _path$1f, _path2$3, _path3$1, _path4, _path5;
|
|
800
815
|
function _extends$1g() { return _extends$1g = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1g.apply(null, arguments); }
|
|
801
816
|
var SvgChatDisabled = function SvgChatDisabled(props) {
|
|
802
817
|
return /*#__PURE__*/React.createElement("svg", _extends$1g({
|
|
803
818
|
xmlns: "http://www.w3.org/2000/svg",
|
|
804
|
-
|
|
819
|
+
fill: "none",
|
|
820
|
+
viewBox: "0 0 24 24"
|
|
805
821
|
}, props), _path$1f || (_path$1f = /*#__PURE__*/React.createElement("path", {
|
|
806
822
|
fill: "#02BF6F",
|
|
807
|
-
|
|
823
|
+
fillRule: "evenodd",
|
|
824
|
+
d: "M0 15.6V2.4h2.4v13.2zM21.6 15.6V2.4H24v13.2zM21.6 2.4H2.4V0h19.2zM7.2 18H2.4v-2.4h4.8zM21.6 18h-4.8v-2.4h4.8z",
|
|
825
|
+
clipRule: "evenodd"
|
|
826
|
+
})), _path2$3 || (_path2$3 = /*#__PURE__*/React.createElement("path", {
|
|
827
|
+
fill: "#02BF6F",
|
|
828
|
+
d: "M24 2.4A2.4 2.4 0 0 0 21.6 0v2.4zM24 15.6a2.4 2.4 0 0 1-2.4 2.4v-2.4zM0 2.4A2.4 2.4 0 0 1 2.4 0v2.4zM0 15.6A2.4 2.4 0 0 0 2.4 18v-2.4zM7.2 15.6A2.4 2.4 0 0 1 9.6 18H7.2zM7.2 22.8a1.2 1.2 0 1 0 2.4 0z"
|
|
829
|
+
})), _path3$1 || (_path3$1 = /*#__PURE__*/React.createElement("path", {
|
|
830
|
+
fill: "#02BF6F",
|
|
831
|
+
fillRule: "evenodd",
|
|
832
|
+
d: "M7.2 22.8V18h2.4v4.8z",
|
|
833
|
+
clipRule: "evenodd"
|
|
834
|
+
})), _path4 || (_path4 = /*#__PURE__*/React.createElement("path", {
|
|
835
|
+
fill: "#02BF6F",
|
|
836
|
+
fillRule: "evenodd",
|
|
837
|
+
d: "M17.777 16.103a1.2 1.2 0 0 1-.28 1.673l-8.4 6a1.2 1.2 0 0 1-1.394-1.953l8.4-6a1.2 1.2 0 0 1 1.673.28M12 6a3.6 3.6 0 1 0 0 7.2A3.6 3.6 0 0 0 12 6M6 9.6a6 6 0 1 1 12 0 6 6 0 0 1-12 0",
|
|
838
|
+
clipRule: "evenodd"
|
|
839
|
+
})), _path5 || (_path5 = /*#__PURE__*/React.createElement("path", {
|
|
840
|
+
fill: "#02BF6F",
|
|
841
|
+
fillRule: "evenodd",
|
|
842
|
+
d: "M7.2 11.562 15.025 6l1.39 1.956-7.825 5.562z",
|
|
843
|
+
clipRule: "evenodd"
|
|
808
844
|
})));
|
|
809
845
|
};
|
|
810
846
|
|
|
@@ -2277,6 +2313,8 @@ declare const getFileExtension: (file?: unknown) => string;
|
|
|
2277
2313
|
declare const getFileMimeType: (file?: unknown) => string;
|
|
2278
2314
|
declare const isExtensionMatchingMimeType: (extension?: unknown, mimeType?: unknown) => boolean;
|
|
2279
2315
|
declare const isValidFileType: (file?: unknown, acceptableTypePattern?: unknown) => boolean;
|
|
2316
|
+
declare const isImage: (file?: unknown) => boolean;
|
|
2317
|
+
declare const isVideo: (file?: unknown) => boolean;
|
|
2280
2318
|
declare const isValidFileSize: (file?: unknown, fileSizeMbLimit?: unknown) => boolean;
|
|
2281
2319
|
declare const isValidFileDimension: (file?: unknown, minWidth?: number, minHeight?: number) => Promise<boolean>;
|
|
2282
2320
|
|
|
@@ -2291,4 +2329,4 @@ declare const getCroppedImageURL: (imageSrc: string, pixelCrop: Area, rotation?:
|
|
|
2291
2329
|
vertical: boolean;
|
|
2292
2330
|
}) => Promise<string | null>;
|
|
2293
2331
|
|
|
2294
|
-
export { Alert, Avatar, Badge, Button$1 as Button, Button as ButtonNew, Card, Checkbox, Crop, DnDArea, Drawer, DropdownItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuTrigger, FormGroup, InfoBanner, Input, InputHint, Label, Loader, Modal, MultiSelect, Pagination, Popover, PopoverTooltip, Progress, RadioGroup, Select, SelectItem, SelectItemText, SliderDemo as Slider, Switch, Tab, TabsContent, TabsList, TabsRoot, Tag, Tooltip, Typography, Upload, createImage, getCroppedImageURL, getFileExtension, getFileMimeType, getRadianAngle, index as icons, isExtensionMatchingMimeType, isValidFileDimension, isValidFileSize, isValidFileType, mimeTypeMap, rotateSize, useCroppedImage, useFileValidation };
|
|
2332
|
+
export { Alert, Avatar, Badge, Button$1 as Button, Button as ButtonNew, Card, Checkbox, Crop, DnDArea, Drawer, DropdownItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuTrigger, FormGroup, InfoBanner, Input, InputHint, Label, Loader, Modal, MultiSelect, Pagination, Popover, PopoverTooltip, Progress, RadioGroup, Select, SelectItem, SelectItemText, SliderDemo as Slider, Switch, Tab, TabsContent, TabsList, TabsRoot, Tag, Tooltip, Typography, Upload, UploadMenu, createImage, getCroppedImageURL, getFileExtension, getFileMimeType, getRadianAngle, index as icons, isExtensionMatchingMimeType, isImage, isValidFileDimension, isValidFileSize, isValidFileType, isVideo, mimeTypeMap, rotateSize, useCroppedImage, useFileValidation };
|
package/package.json
CHANGED