ztxkui 1.4.8 → 1.5.2

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.
@@ -47,6 +47,11 @@ var Upload = function (props) {
47
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, _d = props.showDownloadBtn, showDownloadBtn = _d === void 0 ? true : _d, _e = props.showPreviewBtn, showPreviewBtn = _e === void 0 ? true : _e, _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, restProps = __rest(props, ["children", "className", "showTip", "showUploadBtn", "showDeleteBtn", "showDownloadBtn", "showPreviewBtn", "showTable", "showUploadList", "onChange", "beforeUpload", "multiple", "ztAccept", "maxCount", "maxSize", "maxSizeStr", "action", "headers", "method", "uploadUser", "originFileList", "callback", "onDeleteCallback", "isAutoDelete", "apiBaseUrl", "fileBaseUrl", "fileBtnText", "data", "authToken", "listType", "isPublic"]);
48
48
  var _h = useState(originFileList || []), fileList = _h[0], setFileList = _h[1];
49
49
  var _j = useState('20M'), maxSizeTransStr = _j[0], setMaxSizeTransStr = _j[1];
50
+ useEffect(function () {
51
+ var MAXSIZE = maxSize ? maxSize : 1024 * 1024 * 100;
52
+ var MAXSIZESTR = maxSizeStr ? maxSizeStr : transformFileSize(MAXSIZE);
53
+ setMaxSizeTransStr(MAXSIZESTR);
54
+ }, [maxSize, maxSizeStr]);
50
55
  useEffect(function () {
51
56
  if (Array.isArray(originFileList) && originFileList.length > 0) {
52
57
  if (listType === 'text') {
@@ -62,7 +62,15 @@ var DetailList = function (_a) {
62
62
  if (!item.isManOrDate) {
63
63
  // 进一步筛选出附件的数据
64
64
  if (!item.isAttach) {
65
- return (React.createElement(Item, { label: item === null || item === void 0 ? void 0 : item.label, key: index }, item === null || item === void 0 ? void 0 : item.content));
65
+ return (React.createElement(Item, { label: item === null || item === void 0 ? void 0 : item.label, key: index },
66
+ React.createElement("pre", { style: {
67
+ fontSize: '12px',
68
+ fontFamily: 'inherit',
69
+ overflow: 'hidden',
70
+ whiteSpace: 'pre-wrap',
71
+ wordBreak: 'break-all',
72
+ wordWrap: 'break-word',
73
+ } }, item === null || item === void 0 ? void 0 : item.content)));
66
74
  }
67
75
  return (React.createElement(Item, { label: item === null || item === void 0 ? void 0 : item.label, key: index }, item.content.length > 0 &&
68
76
  item.content.map(function (item, index) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "1.4.8",
3
+ "version": "1.5.2",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",