ztxkui 1.9.5 → 1.9.6

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.
@@ -52,6 +52,8 @@ export interface IProps extends UploadProps {
52
52
  isPublic?: boolean;
53
53
  /**额外的上传表格列配置 */
54
54
  otherColumns?: any;
55
+ /**是否直接替换 */
56
+ isDirect?: boolean;
55
57
  }
56
58
  declare const Upload: React.FC<IProps>;
57
59
  export default Upload;
@@ -44,9 +44,9 @@ 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, otherColumns = props.otherColumns, 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", "otherColumns"]);
48
- var _h = useState(originFileList || []), fileList = _h[0], setFileList = _h[1];
49
- var _j = useState('20M'), maxSizeTransStr = _j[0], setMaxSizeTransStr = _j[1];
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, 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", "otherColumns", "isDirect"]);
48
+ var _j = useState(originFileList || []), fileList = _j[0], setFileList = _j[1];
49
+ var _k = useState('20M'), maxSizeTransStr = _k[0], setMaxSizeTransStr = _k[1];
50
50
  useEffect(function () {
51
51
  var MAXSIZE = maxSize ? maxSize : 1024 * 1024 * 100;
52
52
  var MAXSIZESTR = maxSizeStr ? maxSizeStr : transformFileSize(MAXSIZE);
@@ -177,9 +177,7 @@ var Upload = function (props) {
177
177
  React.createElement(UploadOutlined, null),
178
178
  fileBtnText || '添加附件',
179
179
  maxCount === fileList.length &&
180
- "\uFF08\u6700\u591A\u4E0A\u4F20" + maxCount + "\u4E2A\u6587\u4EF6\uFF09")) : (
181
- // ) : maxCount && fileList.length >= maxCount ? null : (
182
- React.createElement("div", null,
180
+ "\uFF08\u6700\u591A\u4E0A\u4F20" + maxCount + "\u4E2A\u6587\u4EF6\uFF09")) : maxCount && fileList.length >= maxCount && !isDirect ? null : (React.createElement("div", null,
183
181
  React.createElement(UploadOutlined, { style: { fontSize: 18 } }),
184
182
  React.createElement("div", { style: { marginTop: 8 } }, fileBtnText || '添加图片')))),
185
183
  showTip && (React.createElement("span", { className: "zt-upload__upload-tips" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "1.9.5",
3
+ "version": "1.9.6",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",