ztxkui 2.2.6 → 2.2.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.
@@ -19,6 +19,8 @@ export interface IProps extends UploadProps {
19
19
  onPreviewCallbackBefore?: (file: any) => boolean;
20
20
  /**允许上传的文件类型 */
21
21
  ztAccept?: string[];
22
+ /**允许上传的文件类型名字 */
23
+ ztShowTipText?: string;
22
24
  /**允许上传的最大文件大小 */
23
25
  maxSize?: number;
24
26
  /**允许上传的最大数量 */
@@ -44,7 +44,7 @@ var _accept = [
44
44
  '.gif',
45
45
  ];
46
46
  var Upload = function (props) {
47
- var children = props.children, className = props.className, _a = props.showTip, showTip = _a === void 0 ? true : _a, _b = props.showUploadBtn, showUploadBtn = _b === void 0 ? true : _b, _c = props.showDeleteBtn, showDeleteBtn = _c === void 0 ? true : _c, onDownLoadCallbackBefore = props.onDownLoadCallbackBefore, _d = props.showDownloadBtn, showDownloadBtn = _d === void 0 ? true : _d, onDownLoadCallbackAfter = props.onDownLoadCallbackAfter, _e = props.showPreviewBtn, showPreviewBtn = _e === void 0 ? true : _e, onPreviewCallbackBefore = props.onPreviewCallbackBefore, _f = props.showTable, showTable = _f === void 0 ? true : _f, showUploadList = props.showUploadList, onChange = props.onChange, beforeUpload = props.beforeUpload, multiple = props.multiple, ztAccept = props.ztAccept, maxCount = props.maxCount, maxSize = props.maxSize, maxSizeStr = props.maxSizeStr, action = props.action, headers = props.headers, method = props.method, uploadUser = props.uploadUser, originFileList = props.originFileList, callback = props.callback, onDeleteCallback = props.onDeleteCallback, isAutoDelete = props.isAutoDelete, apiBaseUrl = props.apiBaseUrl, _g = props.fileBaseUrl, fileBaseUrl = _g === void 0 ? '' : _g, fileBtnText = props.fileBtnText, data = props.data, authToken = props.authToken, listType = props.listType, isPublic = props.isPublic, startColumns = props.startColumns, otherColumns = props.otherColumns, _h = props.isDirect, isDirect = _h === void 0 ? false : _h, restProps = __rest(props, ["children", "className", "showTip", "showUploadBtn", "showDeleteBtn", "onDownLoadCallbackBefore", "showDownloadBtn", "onDownLoadCallbackAfter", "showPreviewBtn", "onPreviewCallbackBefore", "showTable", "showUploadList", "onChange", "beforeUpload", "multiple", "ztAccept", "maxCount", "maxSize", "maxSizeStr", "action", "headers", "method", "uploadUser", "originFileList", "callback", "onDeleteCallback", "isAutoDelete", "apiBaseUrl", "fileBaseUrl", "fileBtnText", "data", "authToken", "listType", "isPublic", "startColumns", "otherColumns", "isDirect"]);
47
+ var children = props.children, className = props.className, _a = props.showTip, showTip = _a === void 0 ? true : _a, _b = props.showUploadBtn, showUploadBtn = _b === void 0 ? true : _b, _c = props.showDeleteBtn, showDeleteBtn = _c === void 0 ? true : _c, onDownLoadCallbackBefore = props.onDownLoadCallbackBefore, _d = props.showDownloadBtn, showDownloadBtn = _d === void 0 ? true : _d, onDownLoadCallbackAfter = props.onDownLoadCallbackAfter, _e = props.showPreviewBtn, showPreviewBtn = _e === void 0 ? true : _e, onPreviewCallbackBefore = props.onPreviewCallbackBefore, _f = props.showTable, showTable = _f === void 0 ? true : _f, showUploadList = props.showUploadList, onChange = props.onChange, beforeUpload = props.beforeUpload, multiple = props.multiple, ztAccept = props.ztAccept, ztShowTipText = props.ztShowTipText, maxCount = props.maxCount, maxSize = props.maxSize, maxSizeStr = props.maxSizeStr, action = props.action, headers = props.headers, method = props.method, uploadUser = props.uploadUser, originFileList = props.originFileList, callback = props.callback, onDeleteCallback = props.onDeleteCallback, isAutoDelete = props.isAutoDelete, apiBaseUrl = props.apiBaseUrl, _g = props.fileBaseUrl, fileBaseUrl = _g === void 0 ? '' : _g, fileBtnText = props.fileBtnText, data = props.data, authToken = props.authToken, listType = props.listType, isPublic = props.isPublic, startColumns = props.startColumns, otherColumns = props.otherColumns, _h = props.isDirect, isDirect = _h === void 0 ? false : _h, restProps = __rest(props, ["children", "className", "showTip", "showUploadBtn", "showDeleteBtn", "onDownLoadCallbackBefore", "showDownloadBtn", "onDownLoadCallbackAfter", "showPreviewBtn", "onPreviewCallbackBefore", "showTable", "showUploadList", "onChange", "beforeUpload", "multiple", "ztAccept", "ztShowTipText", "maxCount", "maxSize", "maxSizeStr", "action", "headers", "method", "uploadUser", "originFileList", "callback", "onDeleteCallback", "isAutoDelete", "apiBaseUrl", "fileBaseUrl", "fileBtnText", "data", "authToken", "listType", "isPublic", "startColumns", "otherColumns", "isDirect"]);
48
48
  var _j = useState(originFileList || []), fileList = _j[0], setFileList = _j[1];
49
49
  var _k = useState('20M'), maxSizeTransStr = _k[0], setMaxSizeTransStr = _k[1];
50
50
  useEffect(function () {
@@ -214,7 +214,11 @@ var Upload = function (props) {
214
214
  showTip && (React.createElement("span", { className: "zt-upload__upload-tips" },
215
215
  "(\u5355\u4E2A\u9644\u4EF6\u6700\u5927\u652F\u6301",
216
216
  maxSizeTransStr,
217
- "\uFF0C\u652F\u6301\u683C\u5F0F\uFF1APDF\u3001Word\u3001Excel\u3001Txt\u3001JPG\u3001PNG\u3001BMP\u3001GIF\u3001RAR\u3001ZIP)")))),
217
+ "\uFF0C\u652F\u6301\u683C\u5F0F\uFF1A",
218
+ ztShowTipText
219
+ ? ztShowTipText
220
+ : 'PDF、Word、Excel、Txt、JPG、PNG、BMP、GIF、RAR、ZIP',
221
+ ")")))),
218
222
  showTable && (React.createElement(UploadTable, { fileList: fileList, action: fileAction, apiBaseUrl: apiBaseUrl, fileBaseUrl: fileBaseUrl, headers: headers, method: method, uploadUser: uploadUser, onDelete: onDeleteHandle, onUpload: onUploadHandle, showDeleteBtn: showDeleteBtn, onDownLoadCallbackBefore: onDownLoadCallbackBefore, showDownloadBtn: showDownloadBtn, onDownLoadCallbackAfter: onDownLoadCallbackAfter, showPreviewBtn: showPreviewBtn, onPreviewCallbackBefore: onPreviewCallbackBefore, isAutoDelete: isAutoDelete, authToken: authToken, isPublic: isPublic, data: data, startColumns: startColumns, otherColumns: otherColumns, showUploadBtn: showUploadBtn }))));
219
223
  };
220
224
  export default Upload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "2.2.6",
3
+ "version": "2.2.7",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",