@pointcloud/pcloud-components 0.1.6 → 0.1.7
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [0.1.7](https://192.168.101.96:8092/pointcloud_frontend/basiclibrary/pcloud-components/compare/v0.1.6...v0.1.7) (2023-08-30)
|
|
2
|
+
|
|
3
|
+
### 🐛 修复 bug
|
|
4
|
+
|
|
5
|
+
- 修复 DFormbug ([52d3fb9](https://192.168.101.96:8092/pointcloud_frontend/basiclibrary/pcloud-components/commit/52d3fb92bd4d74ae782ea40b96ccd4c4a265a8e8))
|
|
6
|
+
- 修复 DUpload 组件显示错误的 bug ([52c0698](https://192.168.101.96:8092/pointcloud_frontend/basiclibrary/pcloud-components/commit/52c06988a55486cad8596cf855b27f7d73303342))
|
|
7
|
+
|
|
1
8
|
## [0.1.6](https://192.168.101.96:8092/pointcloud_frontend/basiclibrary/pcloud-components/compare/v0.1.5...v0.1.6) (2023-08-16)
|
|
2
9
|
|
|
3
10
|
### 📚 文档变更
|
|
@@ -16,8 +16,7 @@ declare type DFormProps = Omit<FormProps, 'children' | 'layout'> & InternalFormP
|
|
|
16
16
|
declare type DFormRefProps = {
|
|
17
17
|
setItems: (items: DItemProps[] | ((values: DItemProps[]) => DItemProps[] | Promise<DItemProps[]>)) => void;
|
|
18
18
|
} | undefined;
|
|
19
|
-
declare
|
|
20
|
-
declare const DForm: typeof InternalForm & {
|
|
19
|
+
declare const DForm: React.ForwardRefExoticComponent<Omit<FormProps<any>, "children" | "layout"> & InternalFormProps & React.RefAttributes<DFormRefProps>> & {
|
|
21
20
|
Item: typeof DItem;
|
|
22
21
|
};
|
|
23
22
|
export { type DFormProps, type DFormRefProps, type DItemProps };
|
package/dist/esm/DForm/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 = ["className", "defaultItemProps", "items", "children", "layout", "autoComplete"];
|
|
5
|
-
/*
|
|
6
|
-
* @Author : wangfeihu
|
|
7
|
-
* @Date : 2023-06-02 09:29:11
|
|
8
|
-
* @LastEditors : wangfeihu
|
|
9
|
-
* @LastEditTime : 2023-08-16
|
|
10
|
-
* @Description : 基于antd的Form组件
|
|
5
|
+
/*
|
|
6
|
+
* @Author : wangfeihu
|
|
7
|
+
* @Date : 2023-06-02 09:29:11
|
|
8
|
+
* @LastEditors : wangfeihu
|
|
9
|
+
* @LastEditTime : 2023-08-16 17:44:33
|
|
10
|
+
* @Description : 基于antd的Form组件
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import React, { forwardRef, useContext, useState, useEffect, useImperativeHandle } from 'react';
|
|
@@ -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-
|
|
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,25 +97,28 @@ 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) {
|
|
108
108
|
var list = files instanceof Array ? files : [files];
|
|
109
|
-
|
|
109
|
+
var removedCount = list.filter(function (item) {
|
|
110
|
+
return (item === null || item === void 0 ? void 0 : item.status) === 'removed';
|
|
111
|
+
}).length;
|
|
112
|
+
return maxCount && maxCount > 0 ? list.slice(0, maxCount + removedCount) : list;
|
|
110
113
|
}
|
|
111
114
|
return [];
|
|
112
115
|
}
|
|
113
116
|
|
|
114
|
-
/**
|
|
115
|
-
* @description : 根据传入的option对象获取缩略图参数
|
|
116
|
-
* @param {ThumbOptionProps} option 缩略图参数对象
|
|
117
|
-
* @return {ThumbOptionProps} ThumbOption对象
|
|
118
|
-
* @example :
|
|
117
|
+
/**
|
|
118
|
+
* @description : 根据传入的option对象获取缩略图参数
|
|
119
|
+
* @param {ThumbOptionProps} option 缩略图参数对象
|
|
120
|
+
* @return {ThumbOptionProps} ThumbOption对象
|
|
121
|
+
* @example :
|
|
119
122
|
*/
|
|
120
123
|
function getThumbOption(option) {
|
|
121
124
|
var _ref2 = option || {},
|
|
@@ -149,12 +152,12 @@ function getThumbOption(option) {
|
|
|
149
152
|
return _option;
|
|
150
153
|
}
|
|
151
154
|
|
|
152
|
-
/**
|
|
153
|
-
* @description : a标签下载文件
|
|
154
|
-
* @param {Blob | string} url a标签的下载url或文件流
|
|
155
|
-
* @param {string} fileName 下载文件的名称,如果缺省则尝试从url中获取,默认为: "新建文件"
|
|
156
|
-
* @return {*}
|
|
157
|
-
* @example :
|
|
155
|
+
/**
|
|
156
|
+
* @description : a标签下载文件
|
|
157
|
+
* @param {Blob | string} url a标签的下载url或文件流
|
|
158
|
+
* @param {string} fileName 下载文件的名称,如果缺省则尝试从url中获取,默认为: "新建文件"
|
|
159
|
+
* @return {*}
|
|
160
|
+
* @example :
|
|
158
161
|
*/
|
|
159
162
|
function downloadFile(url, fileName) {
|
|
160
163
|
var eLink = document.createElement('a');
|
|
@@ -167,11 +170,11 @@ function downloadFile(url, fileName) {
|
|
|
167
170
|
document.body.removeChild(eLink);
|
|
168
171
|
}
|
|
169
172
|
|
|
170
|
-
/**
|
|
171
|
-
* @description : a标签预览文件
|
|
172
|
-
* @param {Blob | string} url a标签的预览url或文件流
|
|
173
|
-
* @return {*}
|
|
174
|
-
* @example :
|
|
173
|
+
/**
|
|
174
|
+
* @description : a标签预览文件
|
|
175
|
+
* @param {Blob | string} url a标签的预览url或文件流
|
|
176
|
+
* @return {*}
|
|
177
|
+
* @example :
|
|
175
178
|
*/
|
|
176
179
|
function previewFile(url) {
|
|
177
180
|
var eLink = document.createElement('a');
|
|
@@ -184,13 +187,13 @@ function previewFile(url) {
|
|
|
184
187
|
document.body.removeChild(eLink);
|
|
185
188
|
}
|
|
186
189
|
|
|
187
|
-
/**
|
|
188
|
-
* @description : 以递归方式深度查找一个对象
|
|
189
|
-
* @param {Record} object 待查找的对象
|
|
190
|
-
* @param {function} fn 查找函数,每次递归时执行,如果执行结果为true,则递归过程并返回当前对象
|
|
191
|
-
* @param {number} maxDepth 递归的最大深度,默认10
|
|
192
|
-
* @return {*} 查找到的对象,未查找到则返回undefined
|
|
193
|
-
* @example :
|
|
190
|
+
/**
|
|
191
|
+
* @description : 以递归方式深度查找一个对象
|
|
192
|
+
* @param {Record} object 待查找的对象
|
|
193
|
+
* @param {function} fn 查找函数,每次递归时执行,如果执行结果为true,则递归过程并返回当前对象
|
|
194
|
+
* @param {number} maxDepth 递归的最大深度,默认10
|
|
195
|
+
* @return {*} 查找到的对象,未查找到则返回undefined
|
|
196
|
+
* @example :
|
|
194
197
|
*/
|
|
195
198
|
// eslint-disable-next-line no-unused-vars
|
|
196
199
|
function deepFindObject(object, fn) {
|
|
@@ -220,13 +223,13 @@ function deepFindObject(object, fn) {
|
|
|
220
223
|
return recursive(object, undefined, '', fn, {});
|
|
221
224
|
}
|
|
222
225
|
|
|
223
|
-
/**
|
|
224
|
-
* @description : 以递归方式深度查找一个Jsx对象
|
|
225
|
-
* @param {Record} object 待查找的Jsx对象
|
|
226
|
-
* @param {function} fn 查找函数,每次递归时执行,如果执行结果为true,则停止递归过程并返回当前对象
|
|
227
|
-
* @param {number} maxDepth 递归的最大深度,默认10
|
|
228
|
-
* @return {*} 查找到的对象,未查找到则返回undefined
|
|
229
|
-
* @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 :
|
|
230
233
|
*/
|
|
231
234
|
// eslint-disable-next-line no-unused-vars
|
|
232
235
|
function deepFindJsx(object, fn) {
|