@pointcloud/pcloud-components 0.1.32 → 0.1.33

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.
Files changed (69) hide show
  1. package/README.md +11 -9
  2. package/dist/esm/AdvancedFilter/FormFilter.d.ts +4 -4
  3. package/dist/esm/AdvancedFilter/index.d.ts +5 -5
  4. package/dist/esm/AdvancedFilter/interface.d.ts +101 -101
  5. package/dist/esm/AnimatedScrollList/index.d.ts +7 -7
  6. package/dist/esm/AnimatedScrollList/interface.d.ts +71 -71
  7. package/dist/esm/AspectRatio/index.d.ts +9 -9
  8. package/dist/esm/AuthComponent/index.d.ts +3 -3
  9. package/dist/esm/AuthComponent/interface.d.ts +24 -24
  10. package/dist/esm/ColorPicker/index.d.ts +17 -18
  11. package/dist/esm/ColorPicker/interface.d.ts +164 -164
  12. package/dist/esm/ConfigProvider/index.d.ts +6 -6
  13. package/dist/esm/ConfigProvider/index.js +7 -13
  14. package/dist/esm/ConfigProvider/interface.d.ts +9 -9
  15. package/dist/esm/ContextMenu/index.d.ts +28 -28
  16. package/dist/esm/DCascader/index.d.ts +24 -24
  17. package/dist/esm/DForm/DItem/index.d.ts +5 -5
  18. package/dist/esm/DForm/DItem/itemType.d.ts +123 -119
  19. package/dist/esm/DForm/DItem/itemsRender.d.ts +47 -45
  20. package/dist/esm/DForm/DItem/itemsRender.js +6 -0
  21. package/dist/esm/DForm/helper.d.ts +8 -8
  22. package/dist/esm/DForm/index.d.ts +29 -29
  23. package/dist/esm/DInput/index.d.ts +19 -19
  24. package/dist/esm/DModal/index.d.ts +18 -18
  25. package/dist/esm/DModal/interface.d.ts +14 -14
  26. package/dist/esm/DRangePicker/index.d.ts +7 -0
  27. package/dist/esm/DRangePicker/index.js +24 -0
  28. package/dist/esm/DRangePicker/index.less +30 -0
  29. package/dist/esm/DRangePicker/interface.d.ts +5 -0
  30. package/dist/esm/DRangePicker/interface.js +1 -0
  31. package/dist/esm/DSelect/index.d.ts +24 -24
  32. package/dist/esm/DTable/index.d.ts +46 -46
  33. package/dist/esm/DTreeSelect/index.d.ts +16 -16
  34. package/dist/esm/DUpload/helper.d.ts +107 -107
  35. package/dist/esm/DUpload/index.d.ts +55 -55
  36. package/dist/esm/ErrorBoundary/index.d.ts +5 -6
  37. package/dist/esm/IPAddress/index.d.ts +20 -20
  38. package/dist/esm/IconFont/index.d.ts +17 -17
  39. package/dist/esm/InfiniteScrollList/index.d.ts +63 -63
  40. package/dist/esm/LabelValue/index.d.ts +16 -16
  41. package/dist/esm/LabelValue/interface.d.ts +39 -39
  42. package/dist/esm/Loading/hooks/useLoading.d.ts +6 -6
  43. package/dist/esm/Loading/index.d.ts +10 -10
  44. package/dist/esm/Loading/interface.d.ts +23 -23
  45. package/dist/esm/Loading/loading.d.ts +7 -8
  46. package/dist/esm/LoginForm/defaultConfig.d.ts +4 -4
  47. package/dist/esm/LoginForm/index.d.ts +21 -21
  48. package/dist/esm/ModalForm/index.d.ts +11 -11
  49. package/dist/esm/NoData/index.d.ts +4 -5
  50. package/dist/esm/NoData/interface.d.ts +13 -13
  51. package/dist/esm/OrgTree/index.d.ts +5 -5
  52. package/dist/esm/OrgTree/interface.d.ts +41 -41
  53. package/dist/esm/PictureCard/index.d.ts +16 -16
  54. package/dist/esm/RCropper/handler.d.ts +16 -16
  55. package/dist/esm/RCropper/index.d.ts +4 -4
  56. package/dist/esm/RCropper/interface.d.ts +70 -70
  57. package/dist/esm/RCropper/svgIcons.d.ts +28 -28
  58. package/dist/esm/RCropper/toolbar.d.ts +5 -5
  59. package/dist/esm/RndDrag/index.d.ts +5 -6
  60. package/dist/esm/ScrollNumber/index.d.ts +7 -8
  61. package/dist/esm/SignaturePad/index.d.ts +32 -32
  62. package/dist/esm/TypewriterText/index.d.ts +5 -5
  63. package/dist/esm/TypewriterText/interface.d.ts +42 -42
  64. package/dist/esm/WordCloud/index.d.ts +10 -11
  65. package/dist/esm/index.d.ts +64 -62
  66. package/dist/esm/index.js +2 -1
  67. package/dist/umd/pcloud-components.min.css +1 -1
  68. package/dist/umd/pcloud-components.min.js +1 -1
  69. package/package.json +14 -5
@@ -0,0 +1,30 @@
1
+ @import '../commonStyle/index.less';
2
+
3
+ .@{prefix}-range-picker {
4
+ &-right,
5
+ &-left {
6
+ .ant-picker-panel-container {
7
+ display: flex;
8
+ }
9
+
10
+ .ant-picker-footer {
11
+ min-width: 40px;
12
+ flex: 1;
13
+ }
14
+
15
+ .ant-picker-ranges {
16
+ display: flex;
17
+ flex-direction: column;
18
+ }
19
+
20
+ .ant-picker-preset .ant-tag {
21
+ margin-right: 0;
22
+ }
23
+ }
24
+
25
+ &-left {
26
+ .ant-picker-panel-container {
27
+ flex-direction: row-reverse;
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,5 @@
1
+ import type { RangePickerProps } from 'antd/es/date-picker';
2
+ export type DRangePickerProps = {
3
+ rangesPosition?: 'left' | 'bottom' | 'right';
4
+ popupClassName?: string;
5
+ } & Omit<RangePickerProps, 'popupClassName'>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,24 +1,24 @@
1
- import React from 'react';
2
- import { SelectProps } from 'antd';
3
- import { DefaultOptionType } from 'antd/lib/select';
4
- export declare type DSelectProps = Omit<SelectProps, 'options' | 'onSearch' | 'loading'> & {
5
- /** antd的onSearch属性,onSearch有效时showSearch自动为true */
6
- onSearch?: (params?: any) => Promise<DefaultOptionType[] | any[]>;
7
- /** antd的options属性,可以是一个options数组,或一个返回等价options数组的promise */
8
- options?: DefaultOptionType[] | DSelectProps['onSearch'];
9
- /** antd的loading属性,是否显示加载中:传入数字表示延迟加载,单位毫秒,0等同于false */
10
- loading?: boolean | number;
11
- /** 是否开启防抖: true表示800毫秒,true表示默认值,false或0表示不开启 */
12
- debounce?: boolean | number;
13
- };
14
- declare const DSelect: React.ForwardRefExoticComponent<Omit<SelectProps<any, DefaultOptionType>, "options" | "onSearch" | "loading"> & {
15
- /** antd的onSearch属性,onSearch有效时showSearch自动为true */
16
- onSearch?: ((params?: any) => Promise<DefaultOptionType[] | any[]>) | undefined;
17
- /** antd的options属性,可以是一个options数组,或一个返回等价options数组的promise */
18
- options?: DefaultOptionType[] | DSelectProps['onSearch'];
19
- /** antd的loading属性,是否显示加载中:传入数字表示延迟加载,单位毫秒,0等同于false */
20
- loading?: number | boolean | undefined;
21
- /** 是否开启防抖: true表示800毫秒,true表示默认值,false或0表示不开启 */
22
- debounce?: number | boolean | undefined;
23
- } & React.RefAttributes<any>>;
24
- export default DSelect;
1
+ import React from 'react';
2
+ import { SelectProps } from 'antd';
3
+ import { DefaultOptionType } from 'antd/lib/select';
4
+ export type DSelectProps = Omit<SelectProps, 'options' | 'onSearch' | 'loading'> & {
5
+ /** antd的onSearch属性,onSearch有效时showSearch自动为true */
6
+ onSearch?: (params?: any) => Promise<DefaultOptionType[] | any[]>;
7
+ /** antd的options属性,可以是一个options数组,或一个返回等价options数组的promise */
8
+ options?: DefaultOptionType[] | DSelectProps['onSearch'];
9
+ /** antd的loading属性,是否显示加载中:传入数字表示延迟加载,单位毫秒,0等同于false */
10
+ loading?: boolean | number;
11
+ /** 是否开启防抖: true表示800毫秒,true表示默认值,false或0表示不开启 */
12
+ debounce?: boolean | number;
13
+ };
14
+ declare const DSelect: React.ForwardRefExoticComponent<Omit<SelectProps<any, DefaultOptionType>, "options" | "onSearch" | "loading"> & {
15
+ /** antd的onSearch属性,onSearch有效时showSearch自动为true */
16
+ onSearch?: ((params?: any) => Promise<DefaultOptionType[] | any[]>) | undefined;
17
+ /** antd的options属性,可以是一个options数组,或一个返回等价options数组的promise */
18
+ options?: DefaultOptionType[] | DSelectProps['onSearch'];
19
+ /** antd的loading属性,是否显示加载中:传入数字表示延迟加载,单位毫秒,0等同于false */
20
+ loading?: number | boolean | undefined;
21
+ /** 是否开启防抖: true表示800毫秒,true表示默认值,false或0表示不开启 */
22
+ debounce?: number | boolean | undefined;
23
+ } & React.RefAttributes<any>>;
24
+ export default DSelect;
@@ -1,46 +1,46 @@
1
- import React from 'react';
2
- import { TableProps } from 'antd';
3
- import { ColumnType } from 'antd/lib/table';
4
- import './index.less';
5
- export declare type DColumnType = ColumnType<any> & {
6
- cellEllipsis?: boolean;
7
- };
8
- export declare type DTableSourceProps = {
9
- records: TableProps<any>['dataSource'];
10
- total: number;
11
- loading?: boolean;
12
- };
13
- export declare type TableParamsProps = {
14
- current?: number;
15
- size?: number;
16
- [key: string]: any;
17
- };
18
- export declare type DTableProps = Omit<TableProps<any>, 'columns'> & {
19
- /** 表格列的基础默认配置,默认所有列居中,表头文字超出显示省略号,详见 antd columns */
20
- defaultColumnProps?: DColumnType;
21
- /** 操作列配置,可以是一个普通列配置对象,也可以是一个columns的 render 函数 */
22
- actionColumn?: DColumnType | DColumnType['render'];
23
- /** 表格数据的加载函数,在表格创建、分页变化、额外参数变化时自动运行,如果设置该属性,则 dataSource 失效 */
24
- loadMore?: (params?: TableParamsProps, records?: DTableSourceProps['records']) => Promise<DTableSourceProps>;
25
- /** 加载数据失败时是否显示错误信息(仅loadMore可用时生效) */
26
- showErrorMsg?: boolean | ((err: any) => string);
27
- /** 额外的请求参数,(仅loadMore可用时生效) */
28
- extraParams?: TableParamsProps;
29
- /** 表格列配置 */
30
- columns?: DColumnType[];
31
- };
32
- declare const DTable: React.ForwardRefExoticComponent<Omit<TableProps<any>, "columns"> & {
33
- /** 表格列的基础默认配置,默认所有列居中,表头文字超出显示省略号,详见 antd columns */
34
- defaultColumnProps?: DColumnType | undefined;
35
- /** 操作列配置,可以是一个普通列配置对象,也可以是一个columns的 render 函数 */
36
- actionColumn?: DColumnType | DColumnType['render'];
37
- /** 表格数据的加载函数,在表格创建、分页变化、额外参数变化时自动运行,如果设置该属性,则 dataSource 失效 */
38
- loadMore?: ((params?: TableParamsProps, records?: DTableSourceProps['records']) => Promise<DTableSourceProps>) | undefined;
39
- /** 加载数据失败时是否显示错误信息(仅loadMore可用时生效) */
40
- showErrorMsg?: boolean | ((err: any) => string) | undefined;
41
- /** 额外的请求参数,(仅loadMore可用时生效) */
42
- extraParams?: TableParamsProps | undefined;
43
- /** 表格列配置 */
44
- columns?: DColumnType[] | undefined;
45
- } & React.RefAttributes<HTMLDivElement>>;
46
- export default DTable;
1
+ import React from 'react';
2
+ import { TableProps } from 'antd';
3
+ import { ColumnType } from 'antd/lib/table';
4
+ import './index.less';
5
+ export type DColumnType = ColumnType<any> & {
6
+ cellEllipsis?: boolean;
7
+ };
8
+ export type DTableSourceProps = {
9
+ records: TableProps<any>['dataSource'];
10
+ total: number;
11
+ loading?: boolean;
12
+ };
13
+ export type TableParamsProps = {
14
+ current?: number;
15
+ size?: number;
16
+ [key: string]: any;
17
+ };
18
+ export type DTableProps = Omit<TableProps<any>, 'columns'> & {
19
+ /** 表格列的基础默认配置,默认所有列居中,表头文字超出显示省略号,详见 antd columns */
20
+ defaultColumnProps?: DColumnType;
21
+ /** 操作列配置,可以是一个普通列配置对象,也可以是一个columns的 render 函数 */
22
+ actionColumn?: DColumnType | DColumnType['render'];
23
+ /** 表格数据的加载函数,在表格创建、分页变化、额外参数变化时自动运行,如果设置该属性,则 dataSource 失效 */
24
+ loadMore?: (params?: TableParamsProps, records?: DTableSourceProps['records']) => Promise<DTableSourceProps>;
25
+ /** 加载数据失败时是否显示错误信息(仅loadMore可用时生效) */
26
+ showErrorMsg?: boolean | ((err: any) => string);
27
+ /** 额外的请求参数,(仅loadMore可用时生效) */
28
+ extraParams?: TableParamsProps;
29
+ /** 表格列配置 */
30
+ columns?: DColumnType[];
31
+ };
32
+ declare const DTable: React.ForwardRefExoticComponent<Omit<TableProps<any>, "columns"> & {
33
+ /** 表格列的基础默认配置,默认所有列居中,表头文字超出显示省略号,详见 antd columns */
34
+ defaultColumnProps?: DColumnType | undefined;
35
+ /** 操作列配置,可以是一个普通列配置对象,也可以是一个columns的 render 函数 */
36
+ actionColumn?: DColumnType | DColumnType['render'];
37
+ /** 表格数据的加载函数,在表格创建、分页变化、额外参数变化时自动运行,如果设置该属性,则 dataSource 失效 */
38
+ loadMore?: ((params?: TableParamsProps, records?: DTableSourceProps['records']) => Promise<DTableSourceProps>) | undefined;
39
+ /** 加载数据失败时是否显示错误信息(仅loadMore可用时生效) */
40
+ showErrorMsg?: boolean | ((err: any) => string) | undefined;
41
+ /** 额外的请求参数,(仅loadMore可用时生效) */
42
+ extraParams?: TableParamsProps | undefined;
43
+ /** 表格列配置 */
44
+ columns?: DColumnType[] | undefined;
45
+ } & React.RefAttributes<HTMLDivElement>>;
46
+ export default DTable;
@@ -1,16 +1,16 @@
1
- import React from 'react';
2
- import { TreeSelectProps } from 'antd';
3
- import { DefaultOptionType } from 'antd/lib/select';
4
- import './index.less';
5
- export declare type DTreeSelectProps = Omit<TreeSelectProps, 'treeData' | 'loadData' | 'loading'> & {
6
- /** antd的treeData属性,可以是一个treeData数组,或一个返回等价treeData数组的promise */
7
- treeData?: TreeSelectProps['treeData'] | ((node?: DefaultOptionType) => Promise<TreeSelectProps['treeData']>);
8
- /** antd的loadData属性,动态加载子级列表数据,默认使用treeData所提供的方法,如果传入null,则表示不进行动态加载,该方法要求返回一个treeData数组或与其等价的Promise */
9
- loadData?: ((node?: DefaultOptionType) => Promise<TreeSelectProps['treeData']>) | null;
10
- /** 等同antd的loadData属性,用于监听loadData事件*/
11
- onLoadData?: (node?: DefaultOptionType) => void;
12
- /** antd的loading属性,是否显示加载中:传入数字表示延迟加载,单位毫秒,0等同于false */
13
- loading?: boolean | number;
14
- };
15
- declare const DTreeSelect: React.ForwardRefExoticComponent<DTreeSelectProps & React.RefAttributes<any>>;
16
- export default DTreeSelect;
1
+ import React from 'react';
2
+ import { TreeSelectProps } from 'antd';
3
+ import { DefaultOptionType } from 'antd/lib/select';
4
+ import './index.less';
5
+ export type DTreeSelectProps = Omit<TreeSelectProps, 'treeData' | 'loadData' | 'loading'> & {
6
+ /** antd的treeData属性,可以是一个treeData数组,或一个返回等价treeData数组的promise */
7
+ treeData?: TreeSelectProps['treeData'] | ((node?: DefaultOptionType) => Promise<TreeSelectProps['treeData']>);
8
+ /** antd的loadData属性,动态加载子级列表数据,默认使用treeData所提供的方法,如果传入null,则表示不进行动态加载,该方法要求返回一个treeData数组或与其等价的Promise */
9
+ loadData?: ((node?: DefaultOptionType) => Promise<TreeSelectProps['treeData']>) | null;
10
+ /** 等同antd的loadData属性,用于监听loadData事件*/
11
+ onLoadData?: (node?: DefaultOptionType) => void;
12
+ /** antd的loading属性,是否显示加载中:传入数字表示延迟加载,单位毫秒,0等同于false */
13
+ loading?: boolean | number;
14
+ };
15
+ declare const DTreeSelect: React.ForwardRefExoticComponent<DTreeSelectProps & React.RefAttributes<any>>;
16
+ export default DTreeSelect;
@@ -1,107 +1,107 @@
1
- import { UploadFile } from 'antd';
2
- declare type DUploadFile = Omit<UploadFile, 'uid'> & {
3
- /** 文件id */
4
- id?: string | number;
5
- /** 文件uid,系统自动生成 */
6
- uid?: string | number;
7
- /** 文件来源 upload:文件对话框,remote:已上传的文件对象 */
8
- source?: 'upload' | 'remote';
9
- /** 文件状态 */
10
- status?: 'error' | 'success' | 'done' | 'uploading' | 'removed';
11
- };
12
- /** 转换base64时的参数 */
13
- declare type CompressProps = {
14
- width?: number;
15
- /** 图像高度 */
16
- height?: number;
17
- /** 图像质量 */
18
- quality?: number;
19
- };
20
- declare type ThumbOptionProps = {
21
- /** 对目标文件进行过滤,默认只对图片格式生成缩略图 */
22
- filter?: ((file: DUploadFile) => boolean) | Array<string>;
23
- /** 文件大小,当上传文件大于指定值时会对缩略图进行压缩,单位为字节,默认2MB */
24
- size?: number;
25
- /** 缩略图压缩参数,默认为 {width:300,height:200,quality:0.7} */
26
- compress?: CompressProps | null;
27
- /** 缩略图生成失败时的回调函数 */
28
- onError?: (err: Error) => void;
29
- /** 自定义生成base64缩略图的方法 */
30
- getThumbUrl?: (file: DUploadFile, option: ThumbOptionProps) => Promise<string>;
31
- };
32
- /**
33
- * @description : 将图像文件转换为Base64格式
34
- * @param {Blob} blob 图像文件
35
- * @param {CompressProps} options 指定图像压缩参数,其格式为: {width:300,height:200,quality:0.7}
36
- * @return {Promise<string>} 包含Base64字符串的Promise对象
37
- * @example : imageToBase64(file,{ width: 300, height: 200, quality: 0.7 }).then( url => console.log( url ) )
38
- */
39
- declare function imageToBase64(blob: Blob, options?: CompressProps | null): Promise<string>;
40
- /**
41
- * @description : 将传入的文件转换为UploadFile数组
42
- * @param {any} files 目标文件对象
43
- * @return {UploadFile[]} UploadFile数组
44
- * @example :
45
- */
46
- declare function getUploadFile(files: any, maxCount?: number): any[];
47
- /**
48
- * @description : 根据传入的option对象获取缩略图参数
49
- * @param {ThumbOptionProps} option 缩略图参数对象
50
- * @return {ThumbOptionProps} ThumbOption对象
51
- * @example :
52
- */
53
- declare function getThumbOption(option?: ThumbOptionProps | null): {
54
- size: number;
55
- filter: ((file: DUploadFile) => boolean) | ((file: any) => any);
56
- compress: {
57
- width: number;
58
- height: number;
59
- quality: number;
60
- } | null;
61
- onError: ((err: Error) => void) | undefined;
62
- getThumbUrl: ((file: DUploadFile, option: ThumbOptionProps) => Promise<string>) | undefined;
63
- };
64
- /**
65
- * @description : a标签下载文件
66
- * @param {Blob | string} url a标签的下载url或文件流
67
- * @param {string} fileName 下载文件的名称,如果缺省则尝试从url中获取,默认为: "新建文件"
68
- * @return {*}
69
- * @example :
70
- */
71
- declare function downloadFile(url: Blob | string, fileName?: string): void;
72
- /**
73
- * @description : a标签预览文件
74
- * @param {Blob | string} url a标签的预览url或文件流
75
- * @return {*}
76
- * @example :
77
- */
78
- declare function previewFile(url: Blob | string): void;
79
- /**
80
- * @description : 以递归方式深度查找一个对象
81
- * @param {Record} object 待查找的对象
82
- * @param {function} fn 查找函数,每次递归时执行,如果执行结果为true,则递归过程并返回当前对象
83
- * @param {number} maxDepth 递归的最大深度,默认10
84
- * @return {*} 查找到的对象,未查找到则返回undefined
85
- * @example :
86
- */
87
- declare function deepFindObject(object: Record<string, any>, fn: (item: any, parent: any, fieldMap: any) => boolean, maxDepth?: number): any;
88
- /**
89
- * @description : 以递归方式深度查找一个Jsx对象
90
- * @param {Record} object 待查找的Jsx对象
91
- * @param {function} fn 查找函数,每次递归时执行,如果执行结果为true,则停止递归过程并返回当前对象
92
- * @param {number} maxDepth 递归的最大深度,默认10
93
- * @return {*} 查找到的对象,未查找到则返回undefined
94
- * @example :
95
- */
96
- declare function deepFindJsx(object: Record<string, any>, fn: (item: any, parent: any) => boolean, maxDepth?: number): any;
97
- declare const _default: {
98
- imageToBase64: typeof imageToBase64;
99
- getUploadFile: typeof getUploadFile;
100
- getThumbOption: typeof getThumbOption;
101
- downloadFile: typeof downloadFile;
102
- previewFile: typeof previewFile;
103
- deepFindObject: typeof deepFindObject;
104
- deepFindJsx: typeof deepFindJsx;
105
- };
106
- export default _default;
107
- export type { DUploadFile, ThumbOptionProps };
1
+ import { UploadFile } from 'antd';
2
+ type DUploadFile = Omit<UploadFile, 'uid'> & {
3
+ /** 文件id */
4
+ id?: string | number;
5
+ /** 文件uid,系统自动生成 */
6
+ uid?: string | number;
7
+ /** 文件来源 upload:文件对话框,remote:已上传的文件对象 */
8
+ source?: 'upload' | 'remote';
9
+ /** 文件状态 */
10
+ status?: 'error' | 'success' | 'done' | 'uploading' | 'removed';
11
+ };
12
+ /** 转换base64时的参数 */
13
+ type CompressProps = {
14
+ width?: number;
15
+ /** 图像高度 */
16
+ height?: number;
17
+ /** 图像质量 */
18
+ quality?: number;
19
+ };
20
+ type ThumbOptionProps = {
21
+ /** 对目标文件进行过滤,默认只对图片格式生成缩略图 */
22
+ filter?: ((file: DUploadFile) => boolean) | Array<string>;
23
+ /** 文件大小,当上传文件大于指定值时会对缩略图进行压缩,单位为字节,默认2MB */
24
+ size?: number;
25
+ /** 缩略图压缩参数,默认为 {width:300,height:200,quality:0.7} */
26
+ compress?: CompressProps | null;
27
+ /** 缩略图生成失败时的回调函数 */
28
+ onError?: (err: Error) => void;
29
+ /** 自定义生成base64缩略图的方法 */
30
+ getThumbUrl?: (file: DUploadFile, option: ThumbOptionProps) => Promise<string>;
31
+ };
32
+ /**
33
+ * @description : 将图像文件转换为Base64格式
34
+ * @param {Blob} blob 图像文件
35
+ * @param {CompressProps} options 指定图像压缩参数,其格式为: {width:300,height:200,quality:0.7}
36
+ * @return {Promise<string>} 包含Base64字符串的Promise对象
37
+ * @example : imageToBase64(file,{ width: 300, height: 200, quality: 0.7 }).then( url => console.log( url ) )
38
+ */
39
+ declare function imageToBase64(blob: Blob, options?: CompressProps | null): Promise<string>;
40
+ /**
41
+ * @description : 将传入的文件转换为UploadFile数组
42
+ * @param {any} files 目标文件对象
43
+ * @return {UploadFile[]} UploadFile数组
44
+ * @example :
45
+ */
46
+ declare function getUploadFile(files: any, maxCount?: number): any[];
47
+ /**
48
+ * @description : 根据传入的option对象获取缩略图参数
49
+ * @param {ThumbOptionProps} option 缩略图参数对象
50
+ * @return {ThumbOptionProps} ThumbOption对象
51
+ * @example :
52
+ */
53
+ declare function getThumbOption(option?: ThumbOptionProps | null): {
54
+ size: number;
55
+ filter: (file: DUploadFile) => boolean;
56
+ compress: {
57
+ width: number;
58
+ height: number;
59
+ quality: number;
60
+ } | null;
61
+ onError: ((err: Error) => void) | undefined;
62
+ getThumbUrl: ((file: DUploadFile, option: ThumbOptionProps) => Promise<string>) | undefined;
63
+ };
64
+ /**
65
+ * @description : a标签下载文件
66
+ * @param {Blob | string} url a标签的下载url或文件流
67
+ * @param {string} fileName 下载文件的名称,如果缺省则尝试从url中获取,默认为: "新建文件"
68
+ * @return {*}
69
+ * @example :
70
+ */
71
+ declare function downloadFile(url: Blob | string, fileName?: string): void;
72
+ /**
73
+ * @description : a标签预览文件
74
+ * @param {Blob | string} url a标签的预览url或文件流
75
+ * @return {*}
76
+ * @example :
77
+ */
78
+ declare function previewFile(url: Blob | string): void;
79
+ /**
80
+ * @description : 以递归方式深度查找一个对象
81
+ * @param {Record} object 待查找的对象
82
+ * @param {function} fn 查找函数,每次递归时执行,如果执行结果为true,则递归过程并返回当前对象
83
+ * @param {number} maxDepth 递归的最大深度,默认10
84
+ * @return {*} 查找到的对象,未查找到则返回undefined
85
+ * @example :
86
+ */
87
+ declare function deepFindObject(object: Record<string, any>, fn: (item: any, parent: any, fieldMap: any) => boolean, maxDepth?: number): any;
88
+ /**
89
+ * @description : 以递归方式深度查找一个Jsx对象
90
+ * @param {Record} object 待查找的Jsx对象
91
+ * @param {function} fn 查找函数,每次递归时执行,如果执行结果为true,则停止递归过程并返回当前对象
92
+ * @param {number} maxDepth 递归的最大深度,默认10
93
+ * @return {*} 查找到的对象,未查找到则返回undefined
94
+ * @example :
95
+ */
96
+ declare function deepFindJsx(object: Record<string, any>, fn: (item: any, parent: any) => boolean, maxDepth?: number): any;
97
+ declare const _default: {
98
+ imageToBase64: typeof imageToBase64;
99
+ getUploadFile: typeof getUploadFile;
100
+ getThumbOption: typeof getThumbOption;
101
+ downloadFile: typeof downloadFile;
102
+ previewFile: typeof previewFile;
103
+ deepFindObject: typeof deepFindObject;
104
+ deepFindJsx: typeof deepFindJsx;
105
+ };
106
+ export default _default;
107
+ export type { DUploadFile, ThumbOptionProps };
@@ -1,55 +1,55 @@
1
- import React, { ReactNode } from 'react';
2
- import { UploadProps } from 'antd';
3
- import { UploadChangeParam } from 'antd/lib/upload';
4
- import helper, { DUploadFile, ThumbOptionProps } from './helper';
5
- import './index.less';
6
- declare type DUploadProps = Omit<UploadProps, 'fileList' | 'onChange' | 'customRequest' | 'onRemove' | 'onDownload' | 'onPreview'> & {
7
- /** 初始文件列表(相当于defaultFileList,但优先级高于defaultFileList) */
8
- value?: DUploadFile | DUploadFile[];
9
- /** 文件列表(在Form组件中表现为受控列表,在一般情况下相当于初始文件列表,其优先级高于value属性) */
10
- fileList?: DUploadFile | DUploadFile[];
11
- /** 文件列表变化时的回调函数 */
12
- onChange?: (list: DUploadFile[], info: UploadChangeParam<DUploadFile>) => void;
13
- /** 文件上传时的回调函数,支持Promise */
14
- customRequest?: (file: DUploadFile, list: DUploadFile[], requestOption: any) => DUploadFile[] | Promise<DUploadFile[] | void> | void;
15
- /** 点击删除按钮时的回调,支持Promise */
16
- onRemove?: (file: DUploadFile, list: DUploadFile[]) => DUploadFile[] | Promise<DUploadFile[] | void> | void;
17
- /** 点击下载按钮时的回调,支持Promise */
18
- onDownload?: (file: DUploadFile) => DUploadFile | Blob | Promise<DUploadFile | Blob> | void;
19
- /** 点击预览按钮时的回调,支持Promise */
20
- onPreview?: (file: DUploadFile) => DUploadFile | Blob | Promise<DUploadFile | Blob> | void;
21
- /** 上传按钮,等同于children但优先于children */
22
- uploadButton?: ReactNode;
23
- /** 上传文件时的缩略图选项,null表示不生成缩略图 */
24
- thumbOption?: ThumbOptionProps | null;
25
- /** 列表项样式类名 */
26
- itemClassName?: string;
27
- enablePreview?: boolean | ((file: DUploadFile) => boolean);
28
- };
29
- declare const DUpload: React.ForwardRefExoticComponent<Omit<UploadProps<any>, "onChange" | "fileList" | "customRequest" | "onRemove" | "onDownload" | "onPreview"> & {
30
- /** 初始文件列表(相当于defaultFileList,但优先级高于defaultFileList) */
31
- value?: DUploadFile | DUploadFile[] | undefined;
32
- /** 文件列表(在Form组件中表现为受控列表,在一般情况下相当于初始文件列表,其优先级高于value属性) */
33
- fileList?: DUploadFile | DUploadFile[] | undefined;
34
- /** 文件列表变化时的回调函数 */
35
- onChange?: ((list: DUploadFile[], info: UploadChangeParam<DUploadFile>) => void) | undefined;
36
- /** 文件上传时的回调函数,支持Promise */
37
- customRequest?: ((file: DUploadFile, list: DUploadFile[], requestOption: any) => DUploadFile[] | Promise<DUploadFile[] | void> | void) | undefined;
38
- /** 点击删除按钮时的回调,支持Promise */
39
- onRemove?: ((file: DUploadFile, list: DUploadFile[]) => DUploadFile[] | Promise<DUploadFile[] | void> | void) | undefined;
40
- /** 点击下载按钮时的回调,支持Promise */
41
- onDownload?: ((file: DUploadFile) => DUploadFile | Blob | Promise<DUploadFile | Blob> | void) | undefined;
42
- /** 点击预览按钮时的回调,支持Promise */
43
- onPreview?: ((file: DUploadFile) => DUploadFile | Blob | Promise<DUploadFile | Blob> | void) | undefined;
44
- /** 上传按钮,等同于children但优先于children */
45
- uploadButton?: any;
46
- /** 上传文件时的缩略图选项,null表示不生成缩略图 */
47
- thumbOption?: ThumbOptionProps | null | undefined;
48
- /** 列表项样式类名 */
49
- itemClassName?: string | undefined;
50
- enablePreview?: boolean | ((file: DUploadFile) => boolean) | undefined;
51
- } & React.RefAttributes<unknown>> & {
52
- imageToBase64: typeof helper.imageToBase64;
53
- };
54
- export type { DUploadProps, DUploadFile };
55
- export default DUpload;
1
+ import React, { ReactNode } from 'react';
2
+ import { UploadProps } from 'antd';
3
+ import { UploadChangeParam } from 'antd/lib/upload';
4
+ import helper, { DUploadFile, ThumbOptionProps } from './helper';
5
+ import './index.less';
6
+ type DUploadProps = Omit<UploadProps, 'fileList' | 'onChange' | 'customRequest' | 'onRemove' | 'onDownload' | 'onPreview'> & {
7
+ /** 初始文件列表(相当于defaultFileList,但优先级高于defaultFileList) */
8
+ value?: DUploadFile | DUploadFile[];
9
+ /** 文件列表(在Form组件中表现为受控列表,在一般情况下相当于初始文件列表,其优先级高于value属性) */
10
+ fileList?: DUploadFile | DUploadFile[];
11
+ /** 文件列表变化时的回调函数 */
12
+ onChange?: (list: DUploadFile[], info: UploadChangeParam<DUploadFile>) => void;
13
+ /** 文件上传时的回调函数,支持Promise */
14
+ customRequest?: (file: DUploadFile, list: DUploadFile[], requestOption: any) => DUploadFile[] | Promise<DUploadFile[] | void> | void;
15
+ /** 点击删除按钮时的回调,支持Promise */
16
+ onRemove?: (file: DUploadFile, list: DUploadFile[]) => DUploadFile[] | Promise<DUploadFile[] | void> | void;
17
+ /** 点击下载按钮时的回调,支持Promise */
18
+ onDownload?: (file: DUploadFile) => DUploadFile | Blob | Promise<DUploadFile | Blob> | void;
19
+ /** 点击预览按钮时的回调,支持Promise */
20
+ onPreview?: (file: DUploadFile) => DUploadFile | Blob | Promise<DUploadFile | Blob> | void;
21
+ /** 上传按钮,等同于children但优先于children */
22
+ uploadButton?: ReactNode;
23
+ /** 上传文件时的缩略图选项,null表示不生成缩略图 */
24
+ thumbOption?: ThumbOptionProps | null;
25
+ /** 列表项样式类名 */
26
+ itemClassName?: string;
27
+ enablePreview?: boolean | ((file: DUploadFile) => boolean);
28
+ };
29
+ declare const DUpload: React.ForwardRefExoticComponent<Omit<UploadProps<any>, "onChange" | "fileList" | "customRequest" | "onRemove" | "onDownload" | "onPreview"> & {
30
+ /** 初始文件列表(相当于defaultFileList,但优先级高于defaultFileList) */
31
+ value?: DUploadFile | DUploadFile[] | undefined;
32
+ /** 文件列表(在Form组件中表现为受控列表,在一般情况下相当于初始文件列表,其优先级高于value属性) */
33
+ fileList?: DUploadFile | DUploadFile[] | undefined;
34
+ /** 文件列表变化时的回调函数 */
35
+ onChange?: ((list: DUploadFile[], info: UploadChangeParam<DUploadFile>) => void) | undefined;
36
+ /** 文件上传时的回调函数,支持Promise */
37
+ customRequest?: ((file: DUploadFile, list: DUploadFile[], requestOption: any) => DUploadFile[] | Promise<DUploadFile[] | void> | void) | undefined;
38
+ /** 点击删除按钮时的回调,支持Promise */
39
+ onRemove?: ((file: DUploadFile, list: DUploadFile[]) => DUploadFile[] | Promise<DUploadFile[] | void> | void) | undefined;
40
+ /** 点击下载按钮时的回调,支持Promise */
41
+ onDownload?: ((file: DUploadFile) => DUploadFile | Blob | Promise<DUploadFile | Blob> | void) | undefined;
42
+ /** 点击预览按钮时的回调,支持Promise */
43
+ onPreview?: ((file: DUploadFile) => DUploadFile | Blob | Promise<DUploadFile | Blob> | void) | undefined;
44
+ /** 上传按钮,等同于children但优先于children */
45
+ uploadButton?: ReactNode;
46
+ /** 上传文件时的缩略图选项,null表示不生成缩略图 */
47
+ thumbOption?: ThumbOptionProps | null | undefined;
48
+ /** 列表项样式类名 */
49
+ itemClassName?: string | undefined;
50
+ enablePreview?: boolean | ((file: DUploadFile) => boolean) | undefined;
51
+ } & React.RefAttributes<unknown>> & {
52
+ imageToBase64: typeof helper.imageToBase64;
53
+ };
54
+ export type { DUploadProps, DUploadFile };
55
+ export default DUpload;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
- import './index.less';
3
- declare function ErrorBoundary({ err }: {
4
- err?: any;
5
- }): JSX.Element;
6
- export default ErrorBoundary;
1
+ import './index.less';
2
+ declare function ErrorBoundary({ err }: {
3
+ err?: any;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export default ErrorBoundary;
@@ -1,20 +1,20 @@
1
- import React from 'react';
2
- import './index.less';
3
- export interface IPAddressProps {
4
- className?: string;
5
- value?: string;
6
- onChange?: (_value: string) => void;
7
- onFocus?: (_value: string, _index: number) => void;
8
- onBlur?: (_value: string, _index: number) => void;
9
- type?: 'IPv4' | 'IPv6';
10
- delimiter?: React.ReactNode;
11
- readOnly?: boolean;
12
- disabled?: boolean;
13
- size?: 'small' | 'middle' | 'large';
14
- style?: React.CSSProperties;
15
- inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
16
- autoComplete?: boolean;
17
- normalize?: boolean;
18
- }
19
- declare const IPAddress: React.FC<IPAddressProps>;
20
- export default IPAddress;
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface IPAddressProps {
4
+ className?: string;
5
+ value?: string;
6
+ onChange?: (_value: string) => void;
7
+ onFocus?: (_value: string, _index: number) => void;
8
+ onBlur?: (_value: string, _index: number) => void;
9
+ type?: 'IPv4' | 'IPv6';
10
+ delimiter?: React.ReactNode;
11
+ readOnly?: boolean;
12
+ disabled?: boolean;
13
+ size?: 'small' | 'middle' | 'large';
14
+ style?: React.CSSProperties;
15
+ inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
16
+ autoComplete?: boolean;
17
+ normalize?: boolean;
18
+ }
19
+ declare const IPAddress: React.FC<IPAddressProps>;
20
+ export default IPAddress;
@@ -1,17 +1,17 @@
1
- import React from 'react';
2
- import { getTwoToneColor, setTwoToneColor } from '@ant-design/icons';
3
- declare const setIconfontScriptUrl: (urls: string | string[]) => void;
4
- export interface IconFontProps {
5
- type: string;
6
- scriptUrl?: string | string[];
7
- className?: string;
8
- style?: React.CSSProperties;
9
- onClick?: React.MouseEventHandler<HTMLElement>;
10
- }
11
- interface IconFontType extends React.FC<IconFontProps> {
12
- setIconfontScriptUrl: typeof setIconfontScriptUrl;
13
- getTWoToneColor: typeof getTwoToneColor;
14
- setTwoToneColor: typeof setTwoToneColor;
15
- }
16
- declare const IconFont: IconFontType;
17
- export default IconFont;
1
+ import React from 'react';
2
+ import { getTwoToneColor, setTwoToneColor } from '@ant-design/icons';
3
+ declare const setIconfontScriptUrl: (urls: string | string[]) => void;
4
+ export interface IconFontProps {
5
+ type: string;
6
+ scriptUrl?: string | string[];
7
+ className?: string;
8
+ style?: React.CSSProperties;
9
+ onClick?: React.MouseEventHandler<HTMLElement>;
10
+ }
11
+ interface IconFontType extends React.FC<IconFontProps> {
12
+ setIconfontScriptUrl: typeof setIconfontScriptUrl;
13
+ getTWoToneColor: typeof getTwoToneColor;
14
+ setTwoToneColor: typeof setTwoToneColor;
15
+ }
16
+ declare const IconFont: IconFontType;
17
+ export default IconFont;