@rainbow-oh/yee-c 0.9.1 → 0.10.0

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.
Files changed (127) hide show
  1. package/dist/cjs/Badge/badge.js +5 -3
  2. package/dist/cjs/Badge/interface.d.ts +4 -0
  3. package/dist/cjs/Input/style/index.less +1 -0
  4. package/dist/cjs/Popconfirm/interface.d.ts +0 -4
  5. package/dist/cjs/Select/select.js +2 -1
  6. package/dist/cjs/TableSelect/table-select.js +2 -2
  7. package/dist/cjs/Tabs/demo/overflow-center.d.ts +3 -0
  8. package/dist/cjs/Tabs/demo/overflow-center.js +54 -0
  9. package/dist/cjs/Tabs/hooks/useNavListMove.d.ts +2 -1
  10. package/dist/cjs/Tabs/hooks/useNavListMove.js +51 -16
  11. package/dist/cjs/Tabs/hooks/useTabScroll.d.ts +1 -0
  12. package/dist/cjs/Tabs/hooks/useTabScroll.js +5 -1
  13. package/dist/cjs/Tabs/interface.d.ts +9 -0
  14. package/dist/cjs/Tabs/style/index.less +5 -0
  15. package/dist/cjs/Tabs/tab-header/index.d.ts +1 -0
  16. package/dist/cjs/Tabs/tab-header/index.js +9 -2
  17. package/dist/cjs/Tabs/tabs.js +4 -1
  18. package/dist/cjs/TreeSelect/tree-select.js +1 -1
  19. package/dist/cjs/Upload/demo/auto-upload.d.ts +3 -0
  20. package/dist/cjs/Upload/demo/auto-upload.js +65 -0
  21. package/dist/cjs/Upload/demo/basic.js +5 -10
  22. package/dist/cjs/Upload/demo/controlled.js +4 -4
  23. package/dist/cjs/Upload/demo/pictureWall.js +14 -13
  24. package/dist/cjs/Upload/dragger.d.ts +2 -1
  25. package/dist/cjs/Upload/dragger.js +32 -21
  26. package/dist/cjs/Upload/index.d.ts +1 -1
  27. package/dist/cjs/Upload/interface.d.ts +67 -120
  28. package/dist/cjs/Upload/style/index.less +40 -13
  29. package/dist/cjs/Upload/upload.d.ts +2 -2
  30. package/dist/cjs/Upload/upload.js +435 -185
  31. package/dist/cjs/Upload/uploaded-list/index.d.ts +2 -1
  32. package/dist/cjs/Upload/uploaded-list/index.js +6 -3
  33. package/dist/cjs/Upload/uploaded-list/uploaded-item.d.ts +6 -3
  34. package/dist/cjs/Upload/uploaded-list/uploaded-item.js +127 -138
  35. package/dist/cjs/style/size.css +1 -1
  36. package/dist/cjs/style/themes.css +1 -1
  37. package/dist/cjs/style/variables.css +2 -2
  38. package/dist/cjs/utils/ax/core.d.ts +3 -1
  39. package/dist/cjs/utils/ax/core.js +24 -37
  40. package/dist/cjs/utils/ax/index.d.ts +3 -1
  41. package/dist/cjs/utils/folder-scanner.d.ts +1 -1
  42. package/dist/cjs/utils/folder-scanner.js +43 -34
  43. package/dist/cjs/version.d.ts +1 -1
  44. package/dist/cjs/version.js +1 -1
  45. package/dist/esm/Badge/badge.js +3 -2
  46. package/dist/esm/Badge/interface.d.ts +4 -0
  47. package/dist/esm/Input/style/index.less +1 -0
  48. package/dist/esm/Popconfirm/interface.d.ts +0 -4
  49. package/dist/esm/Select/select.js +2 -1
  50. package/dist/esm/TableSelect/table-select.js +2 -2
  51. package/dist/esm/Tabs/demo/overflow-center.d.ts +3 -0
  52. package/dist/esm/Tabs/demo/overflow-center.js +61 -0
  53. package/dist/esm/Tabs/hooks/useNavListMove.d.ts +2 -1
  54. package/dist/esm/Tabs/hooks/useNavListMove.js +62 -25
  55. package/dist/esm/Tabs/hooks/useTabScroll.d.ts +1 -0
  56. package/dist/esm/Tabs/hooks/useTabScroll.js +9 -0
  57. package/dist/esm/Tabs/interface.d.ts +9 -0
  58. package/dist/esm/Tabs/style/index.less +5 -0
  59. package/dist/esm/Tabs/tab-header/index.d.ts +1 -0
  60. package/dist/esm/Tabs/tab-header/index.js +13 -2
  61. package/dist/esm/Tabs/tabs.js +4 -2
  62. package/dist/esm/TreeSelect/tree-select.js +1 -1
  63. package/dist/esm/Upload/demo/auto-upload.d.ts +3 -0
  64. package/dist/esm/Upload/demo/auto-upload.js +42 -0
  65. package/dist/esm/Upload/demo/basic.js +5 -11
  66. package/dist/esm/Upload/demo/controlled.js +8 -6
  67. package/dist/esm/Upload/demo/pictureWall.js +17 -14
  68. package/dist/esm/Upload/dragger.d.ts +2 -1
  69. package/dist/esm/Upload/dragger.js +10 -5
  70. package/dist/esm/Upload/index.d.ts +1 -1
  71. package/dist/esm/Upload/interface.d.ts +67 -120
  72. package/dist/esm/Upload/style/index.less +40 -13
  73. package/dist/esm/Upload/upload.d.ts +2 -2
  74. package/dist/esm/Upload/upload.js +573 -271
  75. package/dist/esm/Upload/uploaded-list/index.d.ts +2 -1
  76. package/dist/esm/Upload/uploaded-list/index.js +9 -4
  77. package/dist/esm/Upload/uploaded-list/uploaded-item.d.ts +6 -3
  78. package/dist/esm/Upload/uploaded-list/uploaded-item.js +145 -150
  79. package/dist/esm/style/size.css +1 -1
  80. package/dist/esm/style/themes.css +1 -1
  81. package/dist/esm/style/variables.css +2 -2
  82. package/dist/esm/utils/ax/core.d.ts +3 -1
  83. package/dist/esm/utils/ax/core.js +32 -40
  84. package/dist/esm/utils/ax/index.d.ts +3 -1
  85. package/dist/esm/utils/folder-scanner.d.ts +1 -1
  86. package/dist/esm/utils/folder-scanner.js +76 -75
  87. package/dist/esm/version.d.ts +1 -1
  88. package/dist/esm/version.js +1 -1
  89. package/dist/umd/yee-c.min.css +2 -2
  90. package/dist/umd/yee-c.min.js +1 -1
  91. package/package.json +1 -1
  92. package/src/Badge/badge.tsx +2 -1
  93. package/src/Badge/interface.ts +4 -0
  94. package/src/Input/style/index.less +1 -0
  95. package/src/Popconfirm/interface.ts +0 -4
  96. package/src/Select/select.tsx +2 -1
  97. package/src/TableSelect/table-select.tsx +1 -0
  98. package/src/Tabs/demo/overflow-center.tsx +35 -0
  99. package/src/Tabs/hooks/useNavListMove.ts +60 -18
  100. package/src/Tabs/hooks/useTabScroll.ts +7 -1
  101. package/src/Tabs/index.en-US.md +33 -31
  102. package/src/Tabs/index.zh-CN.md +33 -31
  103. package/src/Tabs/interface.ts +9 -0
  104. package/src/Tabs/style/index.less +5 -0
  105. package/src/Tabs/tab-header/index.tsx +12 -2
  106. package/src/Tabs/tabs.tsx +2 -0
  107. package/src/TreeSelect/tree-select.tsx +1 -1
  108. package/src/Upload/demo/auto-upload.tsx +35 -0
  109. package/src/Upload/demo/basic.tsx +7 -11
  110. package/src/Upload/demo/controlled.tsx +12 -8
  111. package/src/Upload/demo/directory.tsx +3 -4
  112. package/src/Upload/demo/drag.tsx +5 -12
  113. package/src/Upload/demo/multiple.tsx +3 -4
  114. package/src/Upload/demo/pictureWall.tsx +22 -21
  115. package/src/Upload/dragger.tsx +47 -34
  116. package/src/Upload/index.en-US.md +63 -43
  117. package/src/Upload/index.ts +8 -1
  118. package/src/Upload/index.zh-CN.md +62 -42
  119. package/src/Upload/interface.ts +68 -120
  120. package/src/Upload/style/index.less +40 -13
  121. package/src/Upload/upload.tsx +546 -215
  122. package/src/Upload/uploaded-list/index.tsx +9 -5
  123. package/src/Upload/uploaded-list/uploaded-item.tsx +199 -228
  124. package/src/style/size.css +1 -1
  125. package/src/utils/ax/core.ts +28 -41
  126. package/src/utils/folder-scanner.ts +51 -37
  127. package/src/version.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { UploadFile } from '../interface';
2
+ import type { UploadFile } from '../interface';
3
3
  interface UploadListProps {
4
4
  prefixCls?: string;
5
5
  fileList: UploadFile[];
@@ -18,6 +18,7 @@ interface UploadListProps {
18
18
  onRemove?: (file: UploadFile) => void;
19
19
  onReUpload?: (file: UploadFile) => void;
20
20
  onPreview?: (file: UploadFile) => void;
21
+ isPreviewable?: (file: UploadFile) => boolean;
21
22
  renderUploadTrigger?: () => React.ReactNode;
22
23
  }
23
24
  declare const UploadList: (props: UploadListProps) => string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
@@ -1,4 +1,4 @@
1
- var _excluded = ["prefixCls", "fileList", "renderUploadTrigger"];
1
+ var _excluded = ["prefixCls", "fileList", "isPreviewable", "renderUploadTrigger"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -7,18 +7,23 @@ import UploadedItem from "./uploaded-item";
7
7
  var UploadList = function UploadList(props) {
8
8
  var prefixCls = props.prefixCls,
9
9
  fileList = props.fileList,
10
+ isPreviewable = props.isPreviewable,
10
11
  renderUploadTrigger = props.renderUploadTrigger,
11
12
  rest = _objectWithoutProperties(props, _excluded);
12
13
  if (!Array.isArray(fileList) || fileList.length === 0) {
13
14
  return renderUploadTrigger === null || renderUploadTrigger === void 0 ? void 0 : renderUploadTrigger();
14
15
  }
15
16
  return /*#__PURE__*/React.createElement("div", {
16
- className: "".concat(prefixCls, "-list")
17
- }, fileList.map(function (file) {
17
+ className: "".concat(prefixCls, "-list"),
18
+ "aria-live": "polite"
19
+ }, fileList.map(function (file, index) {
20
+ var _isPreviewable;
18
21
  return /*#__PURE__*/React.createElement(UploadedItem, _extends({}, rest, {
19
22
  prefixCls: prefixCls,
20
23
  file: file,
21
- key: file.uid
24
+ fileList: fileList,
25
+ previewable: (_isPreviewable = isPreviewable === null || isPreviewable === void 0 ? void 0 : isPreviewable(file)) !== null && _isPreviewable !== void 0 ? _isPreviewable : false,
26
+ key: file.uid || "".concat(file.name, "-").concat(index)
22
27
  }));
23
28
  }), renderUploadTrigger === null || renderUploadTrigger === void 0 ? void 0 : renderUploadTrigger());
24
29
  };
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
- import { UploadFile } from '../interface';
3
- declare function UploadedItem(props: {
2
+ import type { UploadFile } from '../interface';
3
+ interface UploadedItemProps {
4
4
  prefixCls?: string;
5
5
  file: UploadFile;
6
+ fileList: UploadFile[];
6
7
  listType?: string;
7
8
  progress?: boolean | object;
8
9
  showUploadList?: boolean | {
@@ -18,5 +19,7 @@ declare function UploadedItem(props: {
18
19
  onRemove?: (file: UploadFile) => void;
19
20
  onReUpload?: (file: UploadFile) => void;
20
21
  onPreview?: (file: UploadFile) => void;
21
- }): React.JSX.Element;
22
+ previewable?: boolean;
23
+ }
24
+ declare function UploadedItem(props: UploadedItemProps): React.JSX.Element;
22
25
  export default UploadedItem;
@@ -10,10 +10,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
10
10
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
11
  import clsx from 'clsx';
12
12
  import { CircleCheck, CircleX, Eye, Image, Paperclip, RotateCcw, Trash2 } from 'lucide-react';
13
- import React, { useEffect, useRef, useState } from 'react';
13
+ import React, { useEffect, useState } from 'react';
14
14
  import Button from "../../Button";
15
- import Dialog from "../../Dialog";
16
- import useEvent from "../../hooks/useEvent";
17
15
  import Space from "../../Space";
18
16
  import Spin from "../../Spin";
19
17
  import Tooltip from "../../Tooltip";
@@ -23,9 +21,15 @@ var fileState = {
23
21
  type: "spin",
24
22
  size: "small"
25
23
  }),
26
- error: /*#__PURE__*/React.createElement(CircleX, null),
27
- success: /*#__PURE__*/React.createElement(CircleCheck, null),
28
- ready: /*#__PURE__*/React.createElement(Paperclip, null)
24
+ error: /*#__PURE__*/React.createElement(CircleX, {
25
+ size: 14
26
+ }),
27
+ success: /*#__PURE__*/React.createElement(CircleCheck, {
28
+ size: 14
29
+ }),
30
+ ready: /*#__PURE__*/React.createElement(Paperclip, {
31
+ size: 14
32
+ })
29
33
  };
30
34
  var fileStatusTitle = {
31
35
  ready: 'Upload Ready',
@@ -34,100 +38,102 @@ var fileStatusTitle = {
34
38
  success: 'Upload Success'
35
39
  };
36
40
  var fileIcon = {
37
- image: /*#__PURE__*/React.createElement(Image, null),
38
- xlsx: /*#__PURE__*/React.createElement(Paperclip, null),
39
- docx: /*#__PURE__*/React.createElement(Paperclip, null),
40
- pdf: /*#__PURE__*/React.createElement(Paperclip, null),
41
- zip: /*#__PURE__*/React.createElement(Paperclip, null),
42
- unknown: /*#__PURE__*/React.createElement(Paperclip, null)
41
+ image: /*#__PURE__*/React.createElement(Image, {
42
+ size: 14
43
+ }),
44
+ xlsx: /*#__PURE__*/React.createElement(Paperclip, {
45
+ size: 14
46
+ }),
47
+ docx: /*#__PURE__*/React.createElement(Paperclip, {
48
+ size: 14
49
+ }),
50
+ pdf: /*#__PURE__*/React.createElement(Paperclip, {
51
+ size: 14
52
+ }),
53
+ zip: /*#__PURE__*/React.createElement(Paperclip, {
54
+ size: 14
55
+ }),
56
+ unknown: /*#__PURE__*/React.createElement(Paperclip, {
57
+ size: 14
58
+ })
43
59
  };
44
60
  var getFileType = function getFileType(type) {
45
61
  var lower = (type === null || type === void 0 ? void 0 : type.toLowerCase()) || '';
46
- var images = ['jpg', 'jpeg', 'png', 'gif', 'bmp'];
47
- if (images.includes(lower)) {
62
+ var images = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'];
63
+ if (lower.startsWith('image/') || images.includes(lower)) {
48
64
  return 'image';
49
65
  }
50
66
  if (lower === 'xlsx' || lower === 'xls') {
51
67
  return 'xlsx';
52
68
  }
53
- if (lower === 'pdf') {
69
+ if (lower === 'pdf' || lower === 'application/pdf') {
54
70
  return 'pdf';
55
71
  }
56
72
  if (lower === 'docx' || lower === 'doc') {
57
73
  return 'docx';
58
74
  }
59
- if (lower === 'zip') {
75
+ if (lower === 'zip' || lower.includes('zip')) {
60
76
  return 'zip';
61
77
  }
62
78
  return 'unknown';
63
79
  };
64
80
  function UploadedItem(props) {
65
- var prefixCls = props.prefixCls,
81
+ var _uploadListConfig$sho, _uploadListConfig$sho2, _uploadListConfig$sho3, _uploadListConfig$sho4;
82
+ var _props$prefixCls = props.prefixCls,
83
+ prefixCls = _props$prefixCls === void 0 ? 'yee-upload' : _props$prefixCls,
66
84
  file = props.file,
85
+ fileList = props.fileList,
67
86
  listType = props.listType,
68
87
  progress = props.progress,
69
88
  showUploadList = props.showUploadList,
70
89
  itemRender = props.itemRender,
71
90
  onRemove = props.onRemove,
72
91
  onReUpload = props.onReUpload,
73
- onPreview = props.onPreview;
74
- var _ref = _typeof(showUploadList) === 'object' ? showUploadList : {},
75
- _ref$showTooltip = _ref.showTooltip,
76
- showTooltip = _ref$showTooltip === void 0 ? true : _ref$showTooltip,
77
- _ref$showReload = _ref.showReload,
78
- showReload = _ref$showReload === void 0 ? true : _ref$showReload,
79
- _ref$showRemoveIcon = _ref.showRemoveIcon,
80
- showRemoveIcon = _ref$showRemoveIcon === void 0 ? true : _ref$showRemoveIcon,
81
- _ref$showPreviewIcon = _ref.showPreviewIcon,
82
- showPreviewIcon = _ref$showPreviewIcon === void 0 ? true : _ref$showPreviewIcon,
83
- reloadIcon = _ref.reloadIcon,
84
- removeIcon = _ref.removeIcon,
85
- previewIcon = _ref.previewIcon;
92
+ onPreview = props.onPreview,
93
+ _props$previewable = props.previewable,
94
+ previewable = _props$previewable === void 0 ? false : _props$previewable;
95
+ var uploadListConfig = _typeof(showUploadList) === 'object' ? showUploadList : undefined;
96
+ var showTooltip = (_uploadListConfig$sho = uploadListConfig === null || uploadListConfig === void 0 ? void 0 : uploadListConfig.showTooltip) !== null && _uploadListConfig$sho !== void 0 ? _uploadListConfig$sho : true;
97
+ var showReload = (_uploadListConfig$sho2 = uploadListConfig === null || uploadListConfig === void 0 ? void 0 : uploadListConfig.showReload) !== null && _uploadListConfig$sho2 !== void 0 ? _uploadListConfig$sho2 : true;
98
+ var showRemoveIcon = (_uploadListConfig$sho3 = uploadListConfig === null || uploadListConfig === void 0 ? void 0 : uploadListConfig.showRemoveIcon) !== null && _uploadListConfig$sho3 !== void 0 ? _uploadListConfig$sho3 : true;
99
+ var showPreviewIcon = (_uploadListConfig$sho4 = uploadListConfig === null || uploadListConfig === void 0 ? void 0 : uploadListConfig.showPreviewIcon) !== null && _uploadListConfig$sho4 !== void 0 ? _uploadListConfig$sho4 : true;
100
+ var reloadIcon = uploadListConfig === null || uploadListConfig === void 0 ? void 0 : uploadListConfig.reloadIcon;
101
+ var removeIcon = uploadListConfig === null || uploadListConfig === void 0 ? void 0 : uploadListConfig.removeIcon;
102
+ var previewIcon = uploadListConfig === null || uploadListConfig === void 0 ? void 0 : uploadListConfig.previewIcon;
86
103
  var _useState = useState(''),
87
104
  _useState2 = _slicedToArray(_useState, 2),
88
105
  objectUrl = _useState2[0],
89
106
  setObjectUrl = _useState2[1];
90
- var _useState3 = useState(false),
91
- _useState4 = _slicedToArray(_useState3, 2),
92
- imagePreviewOpen = _useState4[0],
93
- setImagePreviewOpen = _useState4[1];
94
- var previewImageSrc = useRef('');
95
-
96
- // Create and clean up object URL to prevent memory leaks
97
107
  useEffect(function () {
98
- if (file.raw && file.raw instanceof File) {
108
+ if (file.raw instanceof File) {
99
109
  var url = URL.createObjectURL(file.raw);
100
110
  setObjectUrl(url);
101
111
  return function () {
102
- URL.revokeObjectURL(url);
112
+ return URL.revokeObjectURL(url);
103
113
  };
104
114
  }
115
+ setObjectUrl('');
116
+ return undefined;
105
117
  }, [file.raw]);
106
- var closeDialog = useEvent(function () {
107
- setImagePreviewOpen(false);
108
- });
109
- var showImage = function showImage() {
110
- if (onPreview) {
111
- onPreview(file);
112
- } else if (objectUrl) {
113
- previewImageSrc.current = objectUrl;
114
- setImagePreviewOpen(true);
115
- }
116
- };
118
+ var previewSrc = file.url || objectUrl;
119
+ var inferredType = file.type || file.name.split('.').pop() || '';
120
+ var fileType = getFileType(inferredType);
121
+ var isImage = fileType === 'image';
117
122
  var renderReload = function renderReload() {
118
123
  if (!showReload) {
119
124
  return null;
120
125
  }
121
- var icon = reloadIcon || /*#__PURE__*/React.createElement(RotateCcw, {
122
- size: 18
123
- });
124
126
  return /*#__PURE__*/React.createElement(Button, {
125
127
  size: "small",
126
- icon: icon,
128
+ icon: reloadIcon || /*#__PURE__*/React.createElement(RotateCcw, {
129
+ size: 18
130
+ }),
127
131
  variant: "text",
128
132
  color: "danger",
129
- onClick: function onClick(e) {
130
- e.stopPropagation();
133
+ "aria-label": "Retry ".concat(file.name),
134
+ title: "Retry ".concat(file.name),
135
+ onClick: function onClick(event) {
136
+ event.stopPropagation();
131
137
  onReUpload === null || onReUpload === void 0 || onReUpload(file);
132
138
  }
133
139
  });
@@ -136,64 +142,61 @@ function UploadedItem(props) {
136
142
  if (!showRemoveIcon) {
137
143
  return null;
138
144
  }
139
- var icon = removeIcon || /*#__PURE__*/React.createElement(Trash2, {
140
- size: 18
141
- });
142
145
  return /*#__PURE__*/React.createElement(Button, {
143
146
  size: "small",
144
- icon: icon,
147
+ icon: removeIcon || /*#__PURE__*/React.createElement(Trash2, {
148
+ size: 16
149
+ }),
145
150
  variant: "text",
146
151
  color: "danger",
147
- onClick: function onClick(e) {
148
- e.stopPropagation();
152
+ "aria-label": "Remove ".concat(file.name),
153
+ title: "Remove ".concat(file.name),
154
+ onClick: function onClick(event) {
155
+ event.stopPropagation();
149
156
  onRemove === null || onRemove === void 0 || onRemove(file);
150
157
  }
151
158
  });
152
159
  };
153
160
  var renderPreview = function renderPreview() {
154
- var _file$type;
155
- if (!showPreviewIcon) {
161
+ if (!showPreviewIcon || !isImage || !previewable) {
156
162
  return null;
157
163
  }
158
- var icon = previewIcon || /*#__PURE__*/React.createElement(Eye, {
159
- size: 18
164
+ return /*#__PURE__*/React.createElement(Button, {
165
+ size: "small",
166
+ icon: previewIcon || /*#__PURE__*/React.createElement(Eye, {
167
+ size: 16
168
+ }),
169
+ variant: "text",
170
+ "aria-label": "Preview ".concat(file.name),
171
+ title: "Preview ".concat(file.name),
172
+ onClick: function onClick(event) {
173
+ event.stopPropagation();
174
+ onPreview === null || onPreview === void 0 || onPreview(file);
175
+ }
160
176
  });
161
- var fileType = getFileType(file.type || '');
162
- if (fileType === 'image' || (_file$type = file.type) !== null && _file$type !== void 0 && _file$type.startsWith('image/')) {
163
- return /*#__PURE__*/React.createElement(Button, {
164
- size: "small",
165
- icon: icon,
166
- variant: "text",
167
- onClick: function onClick(e) {
168
- e.stopPropagation();
169
- showImage();
170
- }
177
+ };
178
+ var getShowCase = function getShowCase() {
179
+ if (file.status === 'error' || !isImage) {
180
+ return fileIcon[fileType] || /*#__PURE__*/React.createElement(Paperclip, {
181
+ size: 14
171
182
  });
172
183
  }
173
- return null;
184
+ if (previewSrc) {
185
+ return /*#__PURE__*/React.createElement("img", {
186
+ src: previewSrc,
187
+ alt: file.name
188
+ });
189
+ }
190
+ return fileIcon[fileType] || /*#__PURE__*/React.createElement(Paperclip, {
191
+ size: 14
192
+ });
174
193
  };
175
194
  if (listType === 'picture-wall') {
176
- var fileType = getFileType(file.type || '');
177
- var getShowCase = function getShowCase() {
178
- if (file.status === 'error' || fileType !== 'image') {
179
- return fileIcon[fileType] || /*#__PURE__*/React.createElement(Paperclip, {
180
- size: 18
181
- });
182
- }
183
- if (fileType === 'image' && objectUrl) {
184
- return /*#__PURE__*/React.createElement("img", {
185
- src: objectUrl,
186
- alt: file.name
187
- });
188
- }
189
- return fileIcon[fileType] || /*#__PURE__*/React.createElement(Paperclip, {
190
- size: 18
191
- });
192
- };
193
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
194
- className: clsx("".concat(prefixCls, "-picture-wall-item"), _defineProperty({}, "".concat(prefixCls, "-state-") + file.status, file.status)),
195
- key: file.uid
195
+ return /*#__PURE__*/React.createElement("div", {
196
+ className: clsx("".concat(prefixCls, "-picture-wall-item"), _defineProperty({}, "".concat(prefixCls, "-state-").concat(file.status), file.status)),
197
+ "aria-label": "".concat(file.name, ": ").concat(fileStatusTitle[file.status])
196
198
  }, file.status === 'uploading' ? /*#__PURE__*/React.createElement(UploadProgress, {
199
+ prefixCls: prefixCls,
197
200
  file: file,
198
201
  progress: progress
199
202
  }) : /*#__PURE__*/React.createElement(React.Fragment, null, file.status === 'error' ? /*#__PURE__*/React.createElement("div", {
@@ -202,28 +205,16 @@ function UploadedItem(props) {
202
205
  className: "".concat(prefixCls, "-picture-wall-name")
203
206
  }, file.name)) : /*#__PURE__*/React.createElement("div", {
204
207
  className: "".concat(prefixCls, "-picture-wall-item-content")
205
- }, getShowCase(), fileType !== 'image' && /*#__PURE__*/React.createElement("span", {
208
+ }, getShowCase(), !isImage && /*#__PURE__*/React.createElement("span", {
206
209
  className: "".concat(prefixCls, "-picture-wall-name")
207
210
  }, file.name)), /*#__PURE__*/React.createElement("div", {
208
211
  className: "".concat(prefixCls, "-picture-wall-item-operate")
209
- }, file.status === 'error' ? renderReload() : /*#__PURE__*/React.createElement(React.Fragment, null, renderPreview(), renderTrash())))), /*#__PURE__*/React.createElement(Dialog, {
210
- className: "".concat(prefixCls, "-picture-dialog"),
211
- open: imagePreviewOpen,
212
- onCancel: closeDialog,
213
- footer: false
214
- }, /*#__PURE__*/React.createElement("img", {
215
- src: previewImageSrc.current,
216
- alt: "preview",
217
- style: {
218
- maxWidth: '100%'
219
- }
220
- })));
212
+ }, file.status === 'error' ? renderReload() : /*#__PURE__*/React.createElement(React.Fragment, null, renderPreview(), renderTrash()))));
221
213
  }
222
214
  if (listType === 'picture-list') {
223
- var _fileType = getFileType(file.type || '');
224
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
225
- className: clsx("".concat(prefixCls, "-picture-list-item"), _defineProperty({}, "".concat(prefixCls, "-state-") + file.status, file.status)),
226
- key: file.uid
215
+ return /*#__PURE__*/React.createElement("div", {
216
+ className: clsx("".concat(prefixCls, "-picture-list-item"), _defineProperty({}, "".concat(prefixCls, "-state-").concat(file.status), file.status)),
217
+ "aria-label": "".concat(file.name, ": ").concat(fileStatusTitle[file.status])
227
218
  }, file.status === 'uploading' ? /*#__PURE__*/React.createElement("div", {
228
219
  className: "".concat(prefixCls, "-uploading")
229
220
  }, /*#__PURE__*/React.createElement(Spin, {
@@ -231,55 +222,59 @@ function UploadedItem(props) {
231
222
  type: "spin"
232
223
  }), /*#__PURE__*/React.createElement("div", {
233
224
  className: "".concat(prefixCls, "-uploading-content")
234
- }, /*#__PURE__*/React.createElement("div", null, file.name ? file.name : 'Uploading...'), /*#__PURE__*/React.createElement(UploadProgress, {
225
+ }, /*#__PURE__*/React.createElement("div", null, file.name || 'Uploading...'), /*#__PURE__*/React.createElement(UploadProgress, {
226
+ prefixCls: prefixCls,
235
227
  file: file,
236
228
  progress: progress
237
229
  }))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
238
230
  className: "".concat(prefixCls, "-picture-list-item-content")
239
- }, file.status === 'error' ? /*#__PURE__*/React.createElement(Image, null) : /*#__PURE__*/React.createElement(React.Fragment, null, _fileType === 'image' && objectUrl ? /*#__PURE__*/React.createElement("img", {
231
+ }, file.status === 'error' ? /*#__PURE__*/React.createElement(Image, null) : isImage && previewSrc ? /*#__PURE__*/React.createElement("img", {
240
232
  className: "".concat(prefixCls, "-picture-list-header-img"),
241
- src: objectUrl,
233
+ src: previewSrc,
242
234
  alt: file.name
243
- }) : fileIcon[_fileType] || /*#__PURE__*/React.createElement(Image, null)), /*#__PURE__*/React.createElement("span", null, file.name)), /*#__PURE__*/React.createElement("div", {
235
+ }) : fileIcon[fileType] || /*#__PURE__*/React.createElement(Image, {
236
+ size: 14
237
+ }), /*#__PURE__*/React.createElement("span", null, file.name)), /*#__PURE__*/React.createElement("div", {
244
238
  className: "".concat(prefixCls, "-picture-list-item-operate")
245
- }, file.status === 'error' && renderReload(), renderPreview(), renderTrash()))));
239
+ }, file.status === 'error' && renderReload(), renderPreview(), renderTrash())));
246
240
  }
247
- var renderItem = function renderItem() {
248
- var node = /*#__PURE__*/React.createElement("div", {
249
- className: clsx("".concat(prefixCls, "-list-item"), _defineProperty(_defineProperty({}, "".concat(prefixCls, "-state-") + file.status, file.status), "".concat(prefixCls, "-list-item-clickable"), !!onPreview)),
250
- onClick: function onClick() {
251
- return onPreview === null || onPreview === void 0 ? void 0 : onPreview(file);
252
- },
253
- key: file.uid
254
- }, /*#__PURE__*/React.createElement("div", {
255
- style: {
256
- display: 'flex',
257
- alignItems: 'center'
241
+ var itemNode = /*#__PURE__*/React.createElement("div", {
242
+ className: clsx("".concat(prefixCls, "-list-item"), _defineProperty(_defineProperty({}, "".concat(prefixCls, "-state-").concat(file.status), file.status), "".concat(prefixCls, "-list-item-clickable"), previewable)),
243
+ role: previewable ? 'button' : undefined,
244
+ tabIndex: previewable ? 0 : undefined,
245
+ "aria-label": "".concat(file.name, ": ").concat(fileStatusTitle[file.status]),
246
+ onClick: function onClick() {
247
+ return previewable && (onPreview === null || onPreview === void 0 ? void 0 : onPreview(file));
248
+ },
249
+ onKeyDown: function onKeyDown(event) {
250
+ if (previewable && (event.key === 'Enter' || event.key === ' ')) {
251
+ event.preventDefault();
252
+ onPreview === null || onPreview === void 0 || onPreview(file);
258
253
  }
259
- }, /*#__PURE__*/React.createElement("div", {
260
- className: "".concat(prefixCls, "-item-icon")
261
- }, fileState[file.status] || /*#__PURE__*/React.createElement(Paperclip, {
262
- size: 18
263
- })), /*#__PURE__*/React.createElement("span", {
264
- className: "".concat(prefixCls, "-item-name-content")
265
- }, file.name)), file.status !== 'uploading' && /*#__PURE__*/React.createElement(Space, {
266
- className: "".concat(prefixCls, "-item-operate"),
267
- gap: 8,
268
- onClick: function onClick(event) {
269
- return event.stopPropagation();
270
- }
271
- }, itemRender === null || itemRender === void 0 ? void 0 : itemRender(file, []), file.status === 'error' ? renderReload() : renderPreview(), renderTrash()));
272
- if (showTooltip) {
273
- return /*#__PURE__*/React.createElement(Tooltip, {
274
- title: fileStatusTitle[file.status] || fileStatusTitle.ready
275
- }, node);
276
254
  }
277
- return node;
278
- };
279
- return /*#__PURE__*/React.createElement(React.Fragment, null, renderItem(), file.status === 'uploading' && /*#__PURE__*/React.createElement("div", {
255
+ }, /*#__PURE__*/React.createElement("div", {
256
+ className: "".concat(prefixCls, "-item-label")
257
+ }, /*#__PURE__*/React.createElement("div", {
258
+ className: "".concat(prefixCls, "-item-icon"),
259
+ "aria-hidden": "true"
260
+ }, fileState[file.status] || /*#__PURE__*/React.createElement(Paperclip, {
261
+ size: 14
262
+ })), /*#__PURE__*/React.createElement("span", {
263
+ className: "".concat(prefixCls, "-item-name-content")
264
+ }, file.name)), file.status !== 'uploading' && /*#__PURE__*/React.createElement(Space, {
265
+ className: "".concat(prefixCls, "-item-operate"),
266
+ gap: 8,
267
+ onClick: function onClick(event) {
268
+ return event.stopPropagation();
269
+ }
270
+ }, itemRender === null || itemRender === void 0 ? void 0 : itemRender(file, fileList), file.status === 'error' ? renderReload() : renderPreview(), renderTrash()));
271
+ return /*#__PURE__*/React.createElement(React.Fragment, null, showTooltip ? /*#__PURE__*/React.createElement(Tooltip, {
272
+ title: fileStatusTitle[file.status]
273
+ }, itemNode) : itemNode, file.status === 'uploading' && /*#__PURE__*/React.createElement("div", {
280
274
  className: "".concat(prefixCls, "-item-progress"),
281
275
  title: file.name
282
276
  }, /*#__PURE__*/React.createElement(UploadProgress, {
277
+ prefixCls: prefixCls,
283
278
  file: file,
284
279
  progress: progress,
285
280
  showInfo: true
@@ -743,7 +743,7 @@
743
743
  --yee-tabs-operation-container-margin-top: -8px;
744
744
  --yee-tabs-operation-container-padding: 4px 0;
745
745
  --yee-tabs-operation-tab-height: 32px;
746
- --yee-tabs-operation-tab-padding: 5px 12px;
746
+ --yee-tabs-operation-tab-padding: 0 12px;
747
747
  --yee-tabs-tab-group-margin-left: 4px;
748
748
  --yee-tabs-tab-group-container-padding: 8px;
749
749
  --yee-tabs-tab-group-container-line-height: 32px;
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @rainbow-oh/yee-c CSS Variables
3
3
  * Auto-generated, do not edit manually
4
- * Generated on 2026-08-18T07:24:38.904Z
4
+ * Generated on 2026-09-02T06:10:08.769Z
5
5
  */
6
6
 
7
7
  /* ========== color.blue.css ========== */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @rainbow-oh/yee-c CSS Variables
3
3
  * Auto-generated, do not edit manually
4
- * Generated on 2026-08-18T07:24:38.904Z
4
+ * Generated on 2026-09-02T06:10:08.769Z
5
5
  */
6
6
 
7
7
  /* ========== color.css ========== */
@@ -1865,7 +1865,7 @@
1865
1865
  --yee-tabs-operation-container-margin-top: -8px;
1866
1866
  --yee-tabs-operation-container-padding: 4px 0;
1867
1867
  --yee-tabs-operation-tab-height: 32px;
1868
- --yee-tabs-operation-tab-padding: 5px 12px;
1868
+ --yee-tabs-operation-tab-padding: 0 12px;
1869
1869
  --yee-tabs-tab-group-margin-left: 4px;
1870
1870
  --yee-tabs-tab-group-container-padding: 8px;
1871
1871
  --yee-tabs-tab-group-container-line-height: 32px;
@@ -1,5 +1,7 @@
1
1
  import { AxConfig } from './interface';
2
2
  declare class Ax {
3
- request(configOrUrl: AxConfig | string): Promise<unknown>;
3
+ request(configOrUrl: AxConfig | string): Promise<Response> | (Promise<any> & {
4
+ abort: () => void;
5
+ });
4
6
  }
5
7
  export default Ax;