@pointcloud/pcloud-components 0.1.19 → 0.1.21
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/README.md +24 -3
- package/dist/esm/AdvancedFilter/FormFilter.d.ts +1 -2
- package/dist/esm/AdvancedFilter/index.js +3 -3
- package/dist/esm/AdvancedFilter/styles/index.less +146 -146
- package/dist/esm/AuthComponent/index.d.ts +1 -2
- package/dist/esm/ColorPicker/index.d.ts +10 -11
- package/dist/esm/ColorPicker/index.js +4 -4
- package/dist/esm/ColorPicker/index.less +18 -18
- package/dist/esm/ConfigProvider/index.d.ts +1 -1
- package/dist/esm/DCascader/index.js +2 -3
- package/dist/esm/DForm/DItem/itemsRender.d.ts +29 -29
- package/dist/esm/DForm/DItem/itemsRender.js +6 -6
- package/dist/esm/DForm/index.d.ts +2 -1
- package/dist/esm/DForm/index.js +1 -2
- package/dist/esm/DForm/index.less +5 -4
- package/dist/esm/DInput/index.js +4 -4
- package/dist/esm/DModal/index.d.ts +1 -2
- package/dist/esm/DModal/styles/index.less +27 -27
- package/dist/esm/DSelect/index.d.ts +1 -2
- package/dist/esm/DSelect/index.js +1 -1
- package/dist/esm/DTable/index.js +8 -8
- package/dist/esm/DTreeSelect/index.d.ts +1 -11
- package/dist/esm/DTreeSelect/index.js +1 -9
- package/dist/esm/DUpload/helper.d.ts +1 -1
- package/dist/esm/DUpload/helper.js +48 -48
- package/dist/esm/DUpload/index.d.ts +1 -1
- package/dist/esm/DUpload/index.js +8 -8
- package/dist/esm/ErrorBoundary/index.d.ts +1 -2
- package/dist/esm/InfiniteScrollList/index.d.ts +54 -0
- package/dist/esm/InfiniteScrollList/index.js +175 -0
- package/dist/esm/InfiniteScrollList/styles/index.less +22 -0
- package/dist/esm/LabelValue/index.d.ts +1 -1
- package/dist/esm/LabelValue/index.js +7 -3
- package/dist/esm/LabelValue/interface.d.ts +12 -3
- package/dist/esm/Loading/index.js +1 -1
- package/dist/esm/Loading/interface.d.ts +8 -3
- package/dist/esm/Loading/loading.d.ts +1 -2
- package/dist/esm/Loading/loading.js +32 -11
- package/dist/esm/ModalForm/index.d.ts +1 -1
- package/dist/esm/ModalForm/index.js +1 -1
- package/dist/esm/NoData/index.d.ts +1 -2
- package/dist/esm/PictureCard/index.d.ts +16 -0
- package/dist/esm/PictureCard/index.js +78 -0
- package/dist/esm/PictureCard/index.less +28 -0
- package/dist/esm/RndDrag/index.d.ts +5 -0
- package/dist/esm/RndDrag/index.js +26 -0
- package/dist/esm/ScrollNumber/index.d.ts +1 -2
- package/dist/esm/WordCloud/index.d.ts +1 -2
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.js +4 -1
- package/dist/umd/pcloud-components.min.css +1 -1
- package/dist/umd/pcloud-components.min.js +1 -1
- package/package.json +106 -100
- package/dist/cjs/AdvancedFilter/FormFilter.d.ts +0 -5
- package/dist/cjs/AdvancedFilter/FormFilter.js +0 -158
- package/dist/cjs/AdvancedFilter/demos/demo1.d.ts +0 -3
- package/dist/cjs/AdvancedFilter/demos/demo1.js +0 -56
- package/dist/cjs/AdvancedFilter/demos/demo2.d.ts +0 -3
- package/dist/cjs/AdvancedFilter/demos/demo2.js +0 -63
- package/dist/cjs/AdvancedFilter/demos/demo3.d.ts +0 -3
- package/dist/cjs/AdvancedFilter/demos/demo3.js +0 -113
- package/dist/cjs/AdvancedFilter/index.d.ts +0 -5
- package/dist/cjs/AdvancedFilter/index.js +0 -114
- package/dist/cjs/AdvancedFilter/interface.d.ts +0 -97
- package/dist/cjs/AdvancedFilter/interface.js +0 -17
- package/dist/cjs/AdvancedFilter/styles/index.less +0 -115
- package/dist/cjs/ErrorBoundary/index.d.ts +0 -6
- package/dist/cjs/ErrorBoundary/index.js +0 -45
- package/dist/cjs/ErrorBoundary/index.less +0 -42
- package/dist/cjs/LabelValue/demos/demo1.d.ts +0 -3
- package/dist/cjs/LabelValue/demos/demo1.js +0 -35
- package/dist/cjs/LabelValue/demos/demo2.d.ts +0 -3
- package/dist/cjs/LabelValue/demos/demo2.js +0 -36
- package/dist/cjs/LabelValue/demos/demo3.d.ts +0 -3
- package/dist/cjs/LabelValue/demos/demo3.js +0 -36
- package/dist/cjs/LabelValue/index.d.ts +0 -16
- package/dist/cjs/LabelValue/index.js +0 -50
- package/dist/cjs/LabelValue/interface.d.ts +0 -29
- package/dist/cjs/LabelValue/interface.js +0 -17
- package/dist/cjs/LabelValue/styles/index.less +0 -18
- package/dist/cjs/index.d.ts +0 -4
- package/dist/cjs/index.js +0 -38
package/dist/esm/DInput/index.js
CHANGED
|
@@ -44,10 +44,10 @@ function InternalInput(props, ref) {
|
|
|
44
44
|
if (_debounce > 0) {
|
|
45
45
|
clearTimeout(debounceRef.current);
|
|
46
46
|
debounceRef.current = setTimeout(function () {
|
|
47
|
-
onChange === null || onChange === void 0
|
|
47
|
+
onChange === null || onChange === void 0 || onChange(_value, e);
|
|
48
48
|
}, _debounce);
|
|
49
49
|
} else {
|
|
50
|
-
onChange === null || onChange === void 0
|
|
50
|
+
onChange === null || onChange === void 0 || onChange(_value, e);
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
|
|
@@ -60,13 +60,13 @@ function InternalInput(props, ref) {
|
|
|
60
60
|
|
|
61
61
|
// 监听合成输入开始事件(执行用户事件并置合成标记为true)
|
|
62
62
|
var _onCompositionStart = function _onCompositionStart(e) {
|
|
63
|
-
onCompositionStart === null || onCompositionStart === void 0
|
|
63
|
+
onCompositionStart === null || onCompositionStart === void 0 || onCompositionStart(e);
|
|
64
64
|
enableCompose && setComposeFlag(true);
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
// 监听合成输入结束事件(执行用户事件并置合成标记为false,同时触发用户onChange事件)
|
|
68
68
|
var _onCompositionEnd = function _onCompositionEnd(e) {
|
|
69
|
-
onCompositionEnd === null || onCompositionEnd === void 0
|
|
69
|
+
onCompositionEnd === null || onCompositionEnd === void 0 || onCompositionEnd(e);
|
|
70
70
|
if (enableCompose) {
|
|
71
71
|
setComposeFlag(false);
|
|
72
72
|
emitChange(e.target.value, e);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DModalProps, DeleteModalProps } from './interface';
|
|
3
2
|
import './styles/index.less';
|
|
4
|
-
declare function DModal(props: DModalProps): JSX.Element;
|
|
3
|
+
declare function DModal(props: DModalProps): import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
declare namespace DModal {
|
|
6
5
|
export var useModal: typeof import("antd/lib/modal/useModal").default;
|
|
7
6
|
export var info: import("antd/lib/modal/confirm").ModalFunc;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
@import '../../commonStyle/index.less';
|
|
2
|
-
|
|
3
|
-
.@{prefix}-modal-container {
|
|
4
|
-
.ant-modal-wrap {
|
|
5
|
-
.ant-modal {
|
|
6
|
-
max-width: unset;
|
|
7
|
-
height: 100%;
|
|
8
|
-
|
|
9
|
-
.ant-modal-content {
|
|
10
|
-
width: 100%;
|
|
11
|
-
height: 100%;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.@{prefix}-absolute-modal-container {
|
|
18
|
-
.ant-modal-wrap {
|
|
19
|
-
position: fixed;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.@{prefix}-relative-modal-container {
|
|
24
|
-
.ant-modal-wrap {
|
|
25
|
-
position: absolute;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
@import '../../commonStyle/index.less';
|
|
2
|
+
|
|
3
|
+
.@{prefix}-modal-container {
|
|
4
|
+
.ant-modal-wrap {
|
|
5
|
+
.ant-modal {
|
|
6
|
+
max-width: unset;
|
|
7
|
+
height: 100%;
|
|
8
|
+
|
|
9
|
+
.ant-modal-content {
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.@{prefix}-absolute-modal-container {
|
|
18
|
+
.ant-modal-wrap {
|
|
19
|
+
position: fixed;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.@{prefix}-relative-modal-container {
|
|
24
|
+
.ant-modal-wrap {
|
|
25
|
+
position: absolute;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SelectProps } from 'antd';
|
|
3
3
|
import { DefaultOptionType } from 'antd/lib/select';
|
|
4
|
-
import { BaseSelectRef } from 'rc-select/lib/BaseSelect';
|
|
5
4
|
export declare type DSelectProps = Omit<SelectProps, 'options' | 'onSearch' | 'loading'> & {
|
|
6
5
|
/** antd的onSearch属性,onSearch有效时showSearch自动为true */
|
|
7
6
|
onSearch?: (params?: any) => Promise<DefaultOptionType[] | any[]>;
|
|
@@ -21,5 +20,5 @@ declare const DSelect: React.ForwardRefExoticComponent<Omit<SelectProps<any, Def
|
|
|
21
20
|
loading?: number | boolean | undefined;
|
|
22
21
|
/** 是否开启防抖: true表示800毫秒,true表示默认值,false或0表示不开启 */
|
|
23
22
|
debounce?: number | boolean | undefined;
|
|
24
|
-
} & React.RefAttributes<
|
|
23
|
+
} & React.RefAttributes<any>>;
|
|
25
24
|
export default DSelect;
|
|
@@ -88,7 +88,7 @@ function InternalSelect(props, ref) {
|
|
|
88
88
|
setOptions([]);
|
|
89
89
|
|
|
90
90
|
// 发起请求
|
|
91
|
-
fun === null || fun === void 0
|
|
91
|
+
fun === null || fun === void 0 || fun(value).then(function (response) {
|
|
92
92
|
if (loadingParamsRef.current === value) {
|
|
93
93
|
setOptions(response);
|
|
94
94
|
setLoading(false);
|
package/dist/esm/DTable/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
var _excluded = ["loadMore", "defaultColumnProps", "actionColumn", "showErrorMsg", "extraParams", "dataSource", "rowKey", "scroll", "className", "pagination", "columns", "loading"];
|
|
5
|
-
/*
|
|
6
|
-
* @Author : wangfeihu
|
|
7
|
-
* @Date : 2023-05-09 15:04:48
|
|
8
|
-
* @LastEditors : wangfeihu
|
|
9
|
-
* @LastEditTime : 2023-08-16 16:45:15
|
|
10
|
-
* @Description : 基于antd的Table组件
|
|
5
|
+
/*
|
|
6
|
+
* @Author : wangfeihu
|
|
7
|
+
* @Date : 2023-05-09 15:04:48
|
|
8
|
+
* @LastEditors : wangfeihu
|
|
9
|
+
* @LastEditTime : 2023-08-16 16:45:15
|
|
10
|
+
* @Description : 基于antd的Table组件
|
|
11
11
|
*/
|
|
12
12
|
import React, { forwardRef, useEffect, useRef, useState, useContext, useMemo } from 'react';
|
|
13
13
|
import { message, Table } from 'antd';
|
|
@@ -162,8 +162,8 @@ function InternalTable(props, ref) {
|
|
|
162
162
|
loading: false
|
|
163
163
|
}));
|
|
164
164
|
if (showErrorMsg) {
|
|
165
|
-
var _err$response
|
|
166
|
-
var errMsg = (err === null || err === void 0
|
|
165
|
+
var _err$response;
|
|
166
|
+
var errMsg = (err === null || err === void 0 || (_err$response = err.response) === null || _err$response === void 0 || (_err$response = _err$response.data) === null || _err$response === void 0 ? void 0 : _err$response.msg) || (err === null || err === void 0 ? void 0 : err.msg) || (err === null || err === void 0 ? void 0 : err.message);
|
|
167
167
|
message.error(typeof showErrorMsg === 'function' ? showErrorMsg(err) : "\u6570\u636E\u52A0\u8F7D\u5F02\u5E38\uFF1A".concat(errMsg));
|
|
168
168
|
} else {
|
|
169
169
|
throw err;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TreeSelectProps } from 'antd';
|
|
3
3
|
import { DefaultOptionType } from 'antd/lib/select';
|
|
4
|
-
import { BaseSelectRef } from 'rc-select/lib/BaseSelect';
|
|
5
4
|
import './index.less';
|
|
6
5
|
export declare type DTreeSelectProps = Omit<TreeSelectProps, 'treeData' | 'loadData' | 'loading'> & {
|
|
7
6
|
/** antd的treeData属性,可以是一个treeData数组,或一个返回等价treeData数组的promise */
|
|
@@ -13,14 +12,5 @@ export declare type DTreeSelectProps = Omit<TreeSelectProps, 'treeData' | 'loadD
|
|
|
13
12
|
/** antd的loading属性,是否显示加载中:传入数字表示延迟加载,单位毫秒,0等同于false */
|
|
14
13
|
loading?: boolean | number;
|
|
15
14
|
};
|
|
16
|
-
declare const DTreeSelect: React.ForwardRefExoticComponent<
|
|
17
|
-
/** antd的treeData属性,可以是一个treeData数组,或一个返回等价treeData数组的promise */
|
|
18
|
-
treeData?: import("rc-tree-select/lib/TreeSelect").DefaultOptionType[] | ((node?: DefaultOptionType) => Promise<TreeSelectProps['treeData']>) | undefined;
|
|
19
|
-
/** antd的loadData属性,动态加载子级列表数据,默认使用treeData所提供的方法,如果传入null,则表示不进行动态加载,该方法要求返回一个treeData数组或与其等价的Promise */
|
|
20
|
-
loadData?: ((node?: DefaultOptionType) => Promise<TreeSelectProps['treeData']>) | null | undefined;
|
|
21
|
-
/** 等同antd的loadData属性,用于监听loadData事件*/
|
|
22
|
-
onLoadData?: ((node?: DefaultOptionType) => void) | undefined;
|
|
23
|
-
/** antd的loading属性,是否显示加载中:传入数字表示延迟加载,单位毫秒,0等同于false */
|
|
24
|
-
loading?: number | boolean | undefined;
|
|
25
|
-
} & React.RefAttributes<BaseSelectRef>>;
|
|
15
|
+
declare const DTreeSelect: React.ForwardRefExoticComponent<DTreeSelectProps & React.RefAttributes<any>>;
|
|
26
16
|
export default DTreeSelect;
|
|
@@ -3,14 +3,6 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
var _excluded = ["className", "popupClassName", "treeData", "fieldNames", "loadData", "onLoadData", "loading"];
|
|
6
|
-
/*
|
|
7
|
-
* @Author : wangfeihu
|
|
8
|
-
* @Date : 2023-05-22 10:38:17
|
|
9
|
-
* @LastEditors : wangfeihu
|
|
10
|
-
* @LastEditTime : 2023-06-30 16:24:47
|
|
11
|
-
* @Description : 基于antd的TreeSelect组件
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
6
|
import React, { useRef, forwardRef, useState, useEffect, useMemo, useContext } from 'react';
|
|
15
7
|
import { TreeSelect } from 'antd';
|
|
16
8
|
import { ConfigContext } from "../ConfigProvider";
|
|
@@ -104,7 +96,7 @@ function InternalTreeSelect(props, ref) {
|
|
|
104
96
|
}, _loadingState);
|
|
105
97
|
}
|
|
106
98
|
// 发起请求
|
|
107
|
-
fun === null || fun === void 0
|
|
99
|
+
fun === null || fun === void 0 || fun(value).then(function (response) {
|
|
108
100
|
if (loadingParamsRef.current === value) {
|
|
109
101
|
setTreeData(response);
|
|
110
102
|
setLoading(false);
|
|
@@ -52,7 +52,7 @@ declare function getUploadFile(files: any, maxCount?: number): any[];
|
|
|
52
52
|
*/
|
|
53
53
|
declare function getThumbOption(option?: ThumbOptionProps | null): {
|
|
54
54
|
size: number;
|
|
55
|
-
filter: (file: DUploadFile) => boolean;
|
|
55
|
+
filter: ((file: DUploadFile) => boolean) | ((file: any) => any);
|
|
56
56
|
compress: {
|
|
57
57
|
width: number;
|
|
58
58
|
height: number;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
3
|
-
/*
|
|
4
|
-
* @Author : wangfeihu
|
|
5
|
-
* @Date : 2023-06-16 11:25:57
|
|
6
|
-
* @LastEditors : wangfeihu
|
|
7
|
-
* @LastEditTime : 2023-08-30 11:26:22
|
|
8
|
-
* @Description : 辅助方法集合
|
|
3
|
+
/*
|
|
4
|
+
* @Author : wangfeihu
|
|
5
|
+
* @Date : 2023-06-16 11:25:57
|
|
6
|
+
* @LastEditors : wangfeihu
|
|
7
|
+
* @LastEditTime : 2023-08-30 11:26:22
|
|
8
|
+
* @Description : 辅助方法集合
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/** 转换base64时的参数 */
|
|
@@ -41,12 +41,12 @@ function getType(value) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
/**
|
|
45
|
-
* @description : 将图像文件转换为Base64格式
|
|
46
|
-
* @param {Blob} blob 图像文件
|
|
47
|
-
* @param {CompressProps} options 指定图像压缩参数,其格式为: {width:300,height:200,quality:0.7}
|
|
48
|
-
* @return {Promise<string>} 包含Base64字符串的Promise对象
|
|
49
|
-
* @example : imageToBase64(file,{ width: 300, height: 200, quality: 0.7 }).then( url => console.log( url ) )
|
|
44
|
+
/**
|
|
45
|
+
* @description : 将图像文件转换为Base64格式
|
|
46
|
+
* @param {Blob} blob 图像文件
|
|
47
|
+
* @param {CompressProps} options 指定图像压缩参数,其格式为: {width:300,height:200,quality:0.7}
|
|
48
|
+
* @return {Promise<string>} 包含Base64字符串的Promise对象
|
|
49
|
+
* @example : imageToBase64(file,{ width: 300, height: 200, quality: 0.7 }).then( url => console.log( url ) )
|
|
50
50
|
*/
|
|
51
51
|
function imageToBase64(blob, options) {
|
|
52
52
|
return new Promise(function (resolve, reject) {
|
|
@@ -97,11 +97,11 @@ function imageToBase64(blob, options) {
|
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
/**
|
|
101
|
-
* @description : 将传入的文件转换为UploadFile数组
|
|
102
|
-
* @param {any} files 目标文件对象
|
|
103
|
-
* @return {UploadFile[]} UploadFile数组
|
|
104
|
-
* @example :
|
|
100
|
+
/**
|
|
101
|
+
* @description : 将传入的文件转换为UploadFile数组
|
|
102
|
+
* @param {any} files 目标文件对象
|
|
103
|
+
* @return {UploadFile[]} UploadFile数组
|
|
104
|
+
* @example :
|
|
105
105
|
*/
|
|
106
106
|
function getUploadFile(files, maxCount) {
|
|
107
107
|
if (files) {
|
|
@@ -114,11 +114,11 @@ function getUploadFile(files, maxCount) {
|
|
|
114
114
|
return [];
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
/**
|
|
118
|
-
* @description : 根据传入的option对象获取缩略图参数
|
|
119
|
-
* @param {ThumbOptionProps} option 缩略图参数对象
|
|
120
|
-
* @return {ThumbOptionProps} ThumbOption对象
|
|
121
|
-
* @example :
|
|
117
|
+
/**
|
|
118
|
+
* @description : 根据传入的option对象获取缩略图参数
|
|
119
|
+
* @param {ThumbOptionProps} option 缩略图参数对象
|
|
120
|
+
* @return {ThumbOptionProps} ThumbOption对象
|
|
121
|
+
* @example :
|
|
122
122
|
*/
|
|
123
123
|
function getThumbOption(option) {
|
|
124
124
|
var _ref2 = option || {},
|
|
@@ -152,12 +152,12 @@ function getThumbOption(option) {
|
|
|
152
152
|
return _option;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
/**
|
|
156
|
-
* @description : a标签下载文件
|
|
157
|
-
* @param {Blob | string} url a标签的下载url或文件流
|
|
158
|
-
* @param {string} fileName 下载文件的名称,如果缺省则尝试从url中获取,默认为: "新建文件"
|
|
159
|
-
* @return {*}
|
|
160
|
-
* @example :
|
|
155
|
+
/**
|
|
156
|
+
* @description : a标签下载文件
|
|
157
|
+
* @param {Blob | string} url a标签的下载url或文件流
|
|
158
|
+
* @param {string} fileName 下载文件的名称,如果缺省则尝试从url中获取,默认为: "新建文件"
|
|
159
|
+
* @return {*}
|
|
160
|
+
* @example :
|
|
161
161
|
*/
|
|
162
162
|
function downloadFile(url, fileName) {
|
|
163
163
|
var eLink = document.createElement('a');
|
|
@@ -170,11 +170,11 @@ function downloadFile(url, fileName) {
|
|
|
170
170
|
document.body.removeChild(eLink);
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
/**
|
|
174
|
-
* @description : a标签预览文件
|
|
175
|
-
* @param {Blob | string} url a标签的预览url或文件流
|
|
176
|
-
* @return {*}
|
|
177
|
-
* @example :
|
|
173
|
+
/**
|
|
174
|
+
* @description : a标签预览文件
|
|
175
|
+
* @param {Blob | string} url a标签的预览url或文件流
|
|
176
|
+
* @return {*}
|
|
177
|
+
* @example :
|
|
178
178
|
*/
|
|
179
179
|
function previewFile(url) {
|
|
180
180
|
var eLink = document.createElement('a');
|
|
@@ -187,13 +187,13 @@ function previewFile(url) {
|
|
|
187
187
|
document.body.removeChild(eLink);
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
/**
|
|
191
|
-
* @description : 以递归方式深度查找一个对象
|
|
192
|
-
* @param {Record} object 待查找的对象
|
|
193
|
-
* @param {function} fn 查找函数,每次递归时执行,如果执行结果为true,则递归过程并返回当前对象
|
|
194
|
-
* @param {number} maxDepth 递归的最大深度,默认10
|
|
195
|
-
* @return {*} 查找到的对象,未查找到则返回undefined
|
|
196
|
-
* @example :
|
|
190
|
+
/**
|
|
191
|
+
* @description : 以递归方式深度查找一个对象
|
|
192
|
+
* @param {Record} object 待查找的对象
|
|
193
|
+
* @param {function} fn 查找函数,每次递归时执行,如果执行结果为true,则递归过程并返回当前对象
|
|
194
|
+
* @param {number} maxDepth 递归的最大深度,默认10
|
|
195
|
+
* @return {*} 查找到的对象,未查找到则返回undefined
|
|
196
|
+
* @example :
|
|
197
197
|
*/
|
|
198
198
|
// eslint-disable-next-line no-unused-vars
|
|
199
199
|
function deepFindObject(object, fn) {
|
|
@@ -223,13 +223,13 @@ function deepFindObject(object, fn) {
|
|
|
223
223
|
return recursive(object, undefined, '', fn, {});
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
/**
|
|
227
|
-
* @description : 以递归方式深度查找一个Jsx对象
|
|
228
|
-
* @param {Record} object 待查找的Jsx对象
|
|
229
|
-
* @param {function} fn 查找函数,每次递归时执行,如果执行结果为true,则停止递归过程并返回当前对象
|
|
230
|
-
* @param {number} maxDepth 递归的最大深度,默认10
|
|
231
|
-
* @return {*} 查找到的对象,未查找到则返回undefined
|
|
232
|
-
* @example :
|
|
226
|
+
/**
|
|
227
|
+
* @description : 以递归方式深度查找一个Jsx对象
|
|
228
|
+
* @param {Record} object 待查找的Jsx对象
|
|
229
|
+
* @param {function} fn 查找函数,每次递归时执行,如果执行结果为true,则停止递归过程并返回当前对象
|
|
230
|
+
* @param {number} maxDepth 递归的最大深度,默认10
|
|
231
|
+
* @return {*} 查找到的对象,未查找到则返回undefined
|
|
232
|
+
* @example :
|
|
233
233
|
*/
|
|
234
234
|
// eslint-disable-next-line no-unused-vars
|
|
235
235
|
function deepFindJsx(object, fn) {
|
|
@@ -238,7 +238,7 @@ function deepFindJsx(object, fn) {
|
|
|
238
238
|
var _obj$props;
|
|
239
239
|
if (fn(obj, parent)) return obj;
|
|
240
240
|
if (parentPath.split(/\./).length >= maxDepth) return;
|
|
241
|
-
var children = obj === null || obj === void 0
|
|
241
|
+
var children = obj === null || obj === void 0 || (_obj$props = obj.props) === null || _obj$props === void 0 ? void 0 : _obj$props.children;
|
|
242
242
|
if (children instanceof Array) {
|
|
243
243
|
for (var index = 0; index < children.length; index++) {
|
|
244
244
|
var pathString = parentPath ? "".concat(parentPath, ".children[").concat(index, "]") : ".children[".concat(index, "]");
|
|
@@ -42,7 +42,7 @@ declare const DUpload: React.ForwardRefExoticComponent<Omit<UploadProps<any>, "o
|
|
|
42
42
|
/** 点击预览按钮时的回调,支持Promise */
|
|
43
43
|
onPreview?: ((file: DUploadFile) => DUploadFile | Blob | Promise<DUploadFile | Blob> | void) | undefined;
|
|
44
44
|
/** 上传按钮,等同于children但优先于children */
|
|
45
|
-
uploadButton?:
|
|
45
|
+
uploadButton?: any;
|
|
46
46
|
/** 上传文件时的缩略图选项,null表示不生成缩略图 */
|
|
47
47
|
thumbOption?: ThumbOptionProps | null | undefined;
|
|
48
48
|
/** 列表项样式类名 */
|
|
@@ -151,7 +151,7 @@ function InternalUpload(props, ref) {
|
|
|
151
151
|
if (list) {
|
|
152
152
|
setFileList(_toConsumableArray(list));
|
|
153
153
|
setTempList(_toConsumableArray(list));
|
|
154
|
-
onChange === null || onChange === void 0
|
|
154
|
+
onChange === null || onChange === void 0 || onChange(list, {
|
|
155
155
|
file: file,
|
|
156
156
|
fileList: list
|
|
157
157
|
});
|
|
@@ -161,7 +161,7 @@ function InternalUpload(props, ref) {
|
|
|
161
161
|
if (_list) {
|
|
162
162
|
setFileList(_toConsumableArray(_list));
|
|
163
163
|
setTempList(_toConsumableArray(_list));
|
|
164
|
-
onChange === null || onChange === void 0
|
|
164
|
+
onChange === null || onChange === void 0 || onChange(_list, {
|
|
165
165
|
file: file,
|
|
166
166
|
fileList: _list
|
|
167
167
|
});
|
|
@@ -189,7 +189,7 @@ function InternalUpload(props, ref) {
|
|
|
189
189
|
case 20:
|
|
190
190
|
_context.prev = 20;
|
|
191
191
|
_context.t0 = _context["catch"](13);
|
|
192
|
-
(_thumbOption$onError = _thumbOption.onError) === null || _thumbOption$onError === void 0
|
|
192
|
+
(_thumbOption$onError = _thumbOption.onError) === null || _thumbOption$onError === void 0 || _thumbOption$onError.call(_thumbOption, _context.t0);
|
|
193
193
|
updateFileList(file, 'done', false);
|
|
194
194
|
case 24:
|
|
195
195
|
_context.next = 43;
|
|
@@ -212,7 +212,7 @@ function InternalUpload(props, ref) {
|
|
|
212
212
|
case 36:
|
|
213
213
|
_context.prev = 36;
|
|
214
214
|
_context.t1 = _context["catch"](29);
|
|
215
|
-
(_thumbOption$onError2 = _thumbOption.onError) === null || _thumbOption$onError2 === void 0
|
|
215
|
+
(_thumbOption$onError2 = _thumbOption.onError) === null || _thumbOption$onError2 === void 0 || _thumbOption$onError2.call(_thumbOption, _context.t1);
|
|
216
216
|
updateFileList(file, 'done', false);
|
|
217
217
|
case 40:
|
|
218
218
|
_context.next = 43;
|
|
@@ -237,7 +237,7 @@ function InternalUpload(props, ref) {
|
|
|
237
237
|
_list2.then(function (list) {
|
|
238
238
|
if (list) {
|
|
239
239
|
setFileList(_toConsumableArray(list));
|
|
240
|
-
onChange === null || onChange === void 0
|
|
240
|
+
onChange === null || onChange === void 0 || onChange(list, {
|
|
241
241
|
file: file,
|
|
242
242
|
fileList: list
|
|
243
243
|
});
|
|
@@ -246,7 +246,7 @@ function InternalUpload(props, ref) {
|
|
|
246
246
|
} else if (_list2 instanceof Array) {
|
|
247
247
|
if (_list2) {
|
|
248
248
|
setFileList(_toConsumableArray(_list2));
|
|
249
|
-
onChange === null || onChange === void 0
|
|
249
|
+
onChange === null || onChange === void 0 || onChange(_list2, {
|
|
250
250
|
file: file,
|
|
251
251
|
fileList: _list2
|
|
252
252
|
});
|
|
@@ -264,7 +264,7 @@ function InternalUpload(props, ref) {
|
|
|
264
264
|
}
|
|
265
265
|
var _list3 = _toConsumableArray(fileList);
|
|
266
266
|
setTempList(_list3);
|
|
267
|
-
onChange === null || onChange === void 0
|
|
267
|
+
onChange === null || onChange === void 0 || onChange(_list3, {
|
|
268
268
|
file: file,
|
|
269
269
|
fileList: _list3
|
|
270
270
|
});
|
|
@@ -299,7 +299,7 @@ function InternalUpload(props, ref) {
|
|
|
299
299
|
var actionChildren = action.props.children.map(function (item, index) {
|
|
300
300
|
if (index > 0) {
|
|
301
301
|
var _item$props2, _item$props3, _children2;
|
|
302
|
-
var _children = (item === null || item === void 0
|
|
302
|
+
var _children = (item === null || item === void 0 || (_item$props2 = item.props) === null || _item$props2 === void 0 ? void 0 : _item$props2.children) || (item === null || item === void 0 || (_item$props3 = item.props) === null || _item$props3 === void 0 ? void 0 : _item$props3.icon);
|
|
303
303
|
if ((_children2 = _children) !== null && _children2 !== void 0 && _children2.props) {
|
|
304
304
|
_children = _objectSpread(_objectSpread({}, _children), {}, {
|
|
305
305
|
key: index,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './styles/index.less';
|
|
3
|
+
interface ISLProps<T, P> {
|
|
4
|
+
/**
|
|
5
|
+
* @description 容器id
|
|
6
|
+
* @default scrollableDiv
|
|
7
|
+
*/
|
|
8
|
+
containerId?: string;
|
|
9
|
+
/**
|
|
10
|
+
* @description 列表项的唯一标识字段
|
|
11
|
+
* @default id
|
|
12
|
+
*/
|
|
13
|
+
itemKey?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @description 容器高度(超过此高度将滚动)
|
|
16
|
+
*/
|
|
17
|
+
containerHeight: number | string;
|
|
18
|
+
/**
|
|
19
|
+
* @description 列表请求的初始参数
|
|
20
|
+
*/
|
|
21
|
+
initialParams?: any;
|
|
22
|
+
/**
|
|
23
|
+
* @description 列表请求方法
|
|
24
|
+
* @param params 请求参数
|
|
25
|
+
* @returns Promise<{ data: { total: number; records: any[] } }>
|
|
26
|
+
*/
|
|
27
|
+
loadMore: (params?: T) => Promise<{
|
|
28
|
+
data: {
|
|
29
|
+
total: number;
|
|
30
|
+
records: any[];
|
|
31
|
+
};
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* @description 列表项的渲染方法
|
|
35
|
+
* @param item 列表项数据
|
|
36
|
+
* @returns React.ReactNode
|
|
37
|
+
*/
|
|
38
|
+
renderItem: (item: P, index: number) => React.ReactNode;
|
|
39
|
+
grid?: object;
|
|
40
|
+
className?: string;
|
|
41
|
+
/**
|
|
42
|
+
* @description 滚动阈值,默认为 100px
|
|
43
|
+
* @default 100px
|
|
44
|
+
*/
|
|
45
|
+
scrollThreshold?: string | number;
|
|
46
|
+
/**
|
|
47
|
+
* @description 滚动高度达到此参数值才出现 BackTop
|
|
48
|
+
* @default 200
|
|
49
|
+
*/
|
|
50
|
+
visibilityHeight?: number;
|
|
51
|
+
}
|
|
52
|
+
export declare type InfiniteScrollListProps<T, P> = ISLProps<T, P>;
|
|
53
|
+
declare const _default: React.MemoExoticComponent<(<T, P>(props: ISLProps<T, P>) => import("react/jsx-runtime").JSX.Element)>;
|
|
54
|
+
export default _default;
|