@fe-free/core 3.0.14 → 3.0.15

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @fe-free/core
2
2
 
3
+ ## 3.0.15
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: uploader
8
+ - @fe-free/tool@3.0.15
9
+
3
10
  ## 3.0.14
4
11
 
5
12
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fe-free/core",
3
- "version": "3.0.14",
3
+ "version": "3.0.15",
4
4
  "description": "",
5
5
  "main": "./src/index.ts",
6
6
  "author": "",
@@ -41,7 +41,7 @@
41
41
  "safe-stable-stringify": "^2.5.0",
42
42
  "vanilla-jsoneditor": "^0.23.1",
43
43
  "zustand": "^4.5.4",
44
- "@fe-free/tool": "3.0.14"
44
+ "@fe-free/tool": "3.0.15"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@ant-design/pro-components": "2.8.9",
@@ -228,7 +228,11 @@ export const ProFormUploadComponent: Story = {
228
228
  <ProFormUploadDragger
229
229
  label="file_dragger"
230
230
  name="file_dragger"
231
- fieldProps={{ customRequest }}
231
+ fieldProps={{
232
+ title: '这是标题',
233
+ description: '这是描述',
234
+ customRequest,
235
+ }}
232
236
  />
233
237
  <ProFormUploadDragger
234
238
  label="files_dragger"
@@ -19,8 +19,6 @@ interface UploadBaseProps {
19
19
  interface UploadProps extends UploadBaseProps {
20
20
  showCount?: boolean;
21
21
  }
22
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
23
- interface UploadDraggerProps extends UploadBaseProps {}
24
22
 
25
23
  function useUpload(props: ImageUploadProps) {
26
24
  const { value, onChange, multiple, maxCount } = props;
@@ -115,8 +113,12 @@ function Upload(props: ImageUploadProps) {
115
113
  );
116
114
  }
117
115
 
118
- function UploadDragger(props: ImageUploadDraggerProps) {
119
- const { multiple, maxCount, action, customRequest, listType, accept } = props;
116
+ interface UploadDraggerProps extends UploadBaseProps {
117
+ title?: string;
118
+ description?: string;
119
+ }
120
+ function UploadDragger(props: UploadDraggerProps) {
121
+ const { multiple, maxCount, action, customRequest, listType, accept, title, description } = props;
120
122
  const { onChange, beforeUpload, isDisabled, fileList } = useUpload(props);
121
123
 
122
124
  return (
@@ -150,8 +152,9 @@ function UploadDragger(props: ImageUploadDraggerProps) {
150
152
  '!text-03': isDisabled,
151
153
  })}
152
154
  >
153
- 点击或拖拽到此区域进行上传
155
+ {title || '点击或拖拽到此区域进行上传'}
154
156
  </p>
157
+ {description && <p className={classNames('ant-upload-hint')}>{description}</p>}
155
158
  </div>
156
159
  </AntdUpload.Dragger>
157
160
  );