@guo514360255/antd-lib 1.4.28 → 1.4.30
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/CustomTag/index.d.ts +1 -2
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +2 -2
- package/dist/utils/util.d.ts +7 -0
- package/dist/utils/util.js +36 -1
- package/package.json +9 -5
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { CustomTagProps } from "./tag";
|
|
3
|
-
declare const CustomTag: ({ value, valueEnum, options }: CustomTagProps) =>
|
|
2
|
+
declare const CustomTag: ({ value, valueEnum, options }: CustomTagProps) => any;
|
|
4
3
|
export default CustomTag;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { buildTree } from './buildTree';
|
|
2
2
|
import RememberPwd from './rememberPwd';
|
|
3
|
-
import { capitalizeFirstLetter, capitalizeFirstLetters, fileTransformBase64, findTreeNodeByKey, handleColumnFieldProps, isEmptyValue, randomInt, valueEnumTransform } from './util';
|
|
4
|
-
export { buildTree, capitalizeFirstLetter, capitalizeFirstLetters, fileTransformBase64, findTreeNodeByKey, handleColumnFieldProps, isEmptyValue, randomInt, RememberPwd, valueEnumTransform, };
|
|
3
|
+
import { capitalizeFirstLetter, capitalizeFirstLetters, downloadFile, fileTransformBase64, findTreeNodeByKey, handleColumnFieldProps, isEmptyValue, randomInt, valueEnumTransform } from './util';
|
|
4
|
+
export { buildTree, capitalizeFirstLetter, capitalizeFirstLetters, downloadFile, fileTransformBase64, findTreeNodeByKey, handleColumnFieldProps, isEmptyValue, randomInt, RememberPwd, valueEnumTransform, };
|
package/dist/utils/index.js
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { buildTree } from "./buildTree";
|
|
7
7
|
import RememberPwd from "./rememberPwd";
|
|
8
|
-
import { capitalizeFirstLetter, capitalizeFirstLetters, fileTransformBase64, findTreeNodeByKey, handleColumnFieldProps, isEmptyValue, randomInt, valueEnumTransform } from "./util";
|
|
9
|
-
export { buildTree, capitalizeFirstLetter, capitalizeFirstLetters, fileTransformBase64, findTreeNodeByKey, handleColumnFieldProps, isEmptyValue, randomInt, RememberPwd, valueEnumTransform };
|
|
8
|
+
import { capitalizeFirstLetter, capitalizeFirstLetters, downloadFile, fileTransformBase64, findTreeNodeByKey, handleColumnFieldProps, isEmptyValue, randomInt, valueEnumTransform } from "./util";
|
|
9
|
+
export { buildTree, capitalizeFirstLetter, capitalizeFirstLetters, downloadFile, fileTransformBase64, findTreeNodeByKey, handleColumnFieldProps, isEmptyValue, randomInt, RememberPwd, valueEnumTransform };
|
package/dist/utils/util.d.ts
CHANGED
|
@@ -52,3 +52,10 @@ export declare const capitalizeFirstLetters: (strings: string[]) => string[];
|
|
|
52
52
|
* @param fn
|
|
53
53
|
*/
|
|
54
54
|
export declare const handleColumnFieldProps: (setColumns: any, code: string, fn: (data: any) => void) => void;
|
|
55
|
+
/**
|
|
56
|
+
* blob 文件刘处理
|
|
57
|
+
* @param response 响应结果
|
|
58
|
+
* @param fileName 文件名
|
|
59
|
+
* @returns
|
|
60
|
+
*/
|
|
61
|
+
export declare function downloadFile(response: any, fileName: string): void;
|
package/dist/utils/util.js
CHANGED
|
@@ -118,4 +118,39 @@ export var handleColumnFieldProps = function handleColumnFieldProps(setColumns,
|
|
|
118
118
|
}
|
|
119
119
|
return s;
|
|
120
120
|
});
|
|
121
|
-
};
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* blob 文件刘处理
|
|
125
|
+
* @param response 响应结果
|
|
126
|
+
* @param fileName 文件名
|
|
127
|
+
* @returns
|
|
128
|
+
*/
|
|
129
|
+
export function downloadFile(response, fileName) {
|
|
130
|
+
var _document;
|
|
131
|
+
// 处理返回的文件流
|
|
132
|
+
var blob = response;
|
|
133
|
+
if (blob && blob.size === 0) {
|
|
134
|
+
alert('内容为空,无法下载');
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
// @ts-ignore
|
|
138
|
+
var link = (_document = document) === null || _document === void 0 ? void 0 : _document.createElement('a');
|
|
139
|
+
|
|
140
|
+
// 兼容一下 入参不是 File Blob 类型情况
|
|
141
|
+
var binaryData = [];
|
|
142
|
+
binaryData.push(response);
|
|
143
|
+
// @ts-ignore
|
|
144
|
+
link.href = window.URL.createObjectURL(new Blob(binaryData));
|
|
145
|
+
link.download = fileName;
|
|
146
|
+
// @ts-ignore
|
|
147
|
+
document.body.appendChild(link);
|
|
148
|
+
link.click();
|
|
149
|
+
// @ts-ignore
|
|
150
|
+
window.setTimeout(function () {
|
|
151
|
+
// @ts-ignore
|
|
152
|
+
URL.revokeObjectURL(blob);
|
|
153
|
+
// @ts-ignore
|
|
154
|
+
document.body.removeChild(link);
|
|
155
|
+
}, 0);
|
|
156
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guo514360255/antd-lib",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.30",
|
|
4
4
|
"description": "react design 5 lib",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -45,12 +45,8 @@
|
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@ant-design/icons": "^6.1.0",
|
|
49
|
-
"@ant-design/pro-components": "^2.8.10",
|
|
50
48
|
"@babel/runtime": "^7.28.4",
|
|
51
49
|
"@types/lodash": "^4.17.20",
|
|
52
|
-
"antd": "^5.x",
|
|
53
|
-
"antd-img-crop": "^4.27.0",
|
|
54
50
|
"crypto-js": "^4.2.0",
|
|
55
51
|
"js-cookie": "^3.0.5",
|
|
56
52
|
"lodash": "^4.17.21",
|
|
@@ -78,11 +74,19 @@
|
|
|
78
74
|
"stylelint": "^14.9.1"
|
|
79
75
|
},
|
|
80
76
|
"peerDependencies": {
|
|
77
|
+
"@ant-design/icons": "^6.1.0",
|
|
78
|
+
"@ant-design/pro-components": "^2.8.10",
|
|
81
79
|
"@ant-design/pro-table": "^3.x",
|
|
82
80
|
"antd": "^5.x",
|
|
81
|
+
"antd-img-crop": "^4.27.0",
|
|
83
82
|
"react": ">=16.9.0",
|
|
84
83
|
"react-dom": ">=16.9.0"
|
|
85
84
|
},
|
|
85
|
+
"peerDependenciesMeta": {
|
|
86
|
+
"@ant-design/pro-table": {
|
|
87
|
+
"optional": true
|
|
88
|
+
}
|
|
89
|
+
},
|
|
86
90
|
"publishConfig": {
|
|
87
91
|
"access": "public"
|
|
88
92
|
},
|