@hw-component/form 1.10.72 → 1.10.73
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/es/Upload/index.js +23 -18
- package/es/Upload/modal.d.ts +1 -0
- package/lib/Upload/index.js +22 -17
- package/lib/Upload/modal.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/Upload/index.tsx +22 -18
- package/src/components/Upload/modal.ts +1 -0
- package/src/pages/Upload/index.tsx +2 -0
package/es/Upload/index.js
CHANGED
|
@@ -7,11 +7,11 @@ import React, { useState, useImperativeHandle, useMemo } from 'react';
|
|
|
7
7
|
import { useProps } from './hooks/propsMaker.js';
|
|
8
8
|
import Preview from './Preview/index.js';
|
|
9
9
|
import { useChange } from './hooks/change.js';
|
|
10
|
-
import { Upload } from 'antd';
|
|
10
|
+
import { Space, Upload } from 'antd';
|
|
11
11
|
import Btn from './Btn.js';
|
|
12
12
|
import HFormConnect from '../Form/HFormConnect.js';
|
|
13
13
|
|
|
14
|
-
var _excluded = ["value", "onChange", "listType", "exFiles", "maxCount", "maxRowNum", "onPreview", "request", "maxSize", "addFormat", "thumbUrl", "hideAddBtn", "children"];
|
|
14
|
+
var _excluded = ["value", "onChange", "listType", "exFiles", "maxCount", "maxRowNum", "onPreview", "request", "maxSize", "addFormat", "thumbUrl", "hideAddBtn", "children", "addonBefore"];
|
|
15
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
16
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
17
|
var Index = function Index(_ref, ref) {
|
|
@@ -32,6 +32,7 @@ var Index = function Index(_ref, ref) {
|
|
|
32
32
|
thumbUrl = _ref.thumbUrl,
|
|
33
33
|
hideAddBtn = _ref.hideAddBtn,
|
|
34
34
|
children = _ref.children,
|
|
35
|
+
addonBefore = _ref.addonBefore,
|
|
35
36
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
36
37
|
var matchProps = useProps({
|
|
37
38
|
request: request,
|
|
@@ -118,23 +119,27 @@ var Index = function Index(_ref, ref) {
|
|
|
118
119
|
var upListType = listType === null ? undefined : listType;
|
|
119
120
|
return jsxs("div", {
|
|
120
121
|
style: contentStyle,
|
|
121
|
-
children: [
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
onPreview: preview,
|
|
126
|
-
onChange: change,
|
|
127
|
-
beforeUpload: function beforeUpload() {
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
}, props), {}, {
|
|
131
|
-
children: hideAddBtn ? null : jsx(Btn, {
|
|
132
|
-
value: relVal,
|
|
133
|
-
maxCount: maxCount,
|
|
122
|
+
children: [jsxs(Space, {
|
|
123
|
+
size: 8,
|
|
124
|
+
align: "start",
|
|
125
|
+
children: [addonBefore, jsx(Upload, _objectSpread(_objectSpread({
|
|
134
126
|
listType: upListType,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
127
|
+
maxCount: maxNum,
|
|
128
|
+
fileList: relVal,
|
|
129
|
+
onPreview: preview,
|
|
130
|
+
onChange: change,
|
|
131
|
+
beforeUpload: function beforeUpload() {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
}, props), {}, {
|
|
135
|
+
children: hideAddBtn ? null : jsx(Btn, {
|
|
136
|
+
value: relVal,
|
|
137
|
+
maxCount: maxCount,
|
|
138
|
+
listType: upListType,
|
|
139
|
+
children: children
|
|
140
|
+
})
|
|
141
|
+
}))]
|
|
142
|
+
}), jsx(Preview, {
|
|
138
143
|
visible: visible,
|
|
139
144
|
file: previewFile,
|
|
140
145
|
onCancel: function onCancel() {
|
package/es/Upload/modal.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export interface IUpLoadProps extends Omit<UploadProps, "onChange" | "listType"
|
|
|
22
22
|
hideAddBtn?: boolean;
|
|
23
23
|
listType?: UploadListType | null;
|
|
24
24
|
onPreview?: UploadProps["onPreview"] | null;
|
|
25
|
+
addonBefore?: React.ReactNode;
|
|
25
26
|
}
|
|
26
27
|
export interface IMediaTypeEleProps {
|
|
27
28
|
file?: UploadFile;
|
package/lib/Upload/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var antd = require('antd');
|
|
|
14
14
|
var Btn = require('./Btn.js');
|
|
15
15
|
var HFormConnect = require('../Form/HFormConnect.js');
|
|
16
16
|
|
|
17
|
-
var _excluded = ["value", "onChange", "listType", "exFiles", "maxCount", "maxRowNum", "onPreview", "request", "maxSize", "addFormat", "thumbUrl", "hideAddBtn", "children"];
|
|
17
|
+
var _excluded = ["value", "onChange", "listType", "exFiles", "maxCount", "maxRowNum", "onPreview", "request", "maxSize", "addFormat", "thumbUrl", "hideAddBtn", "children", "addonBefore"];
|
|
18
18
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
19
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
20
|
var Index = function Index(_ref, ref) {
|
|
@@ -35,6 +35,7 @@ var Index = function Index(_ref, ref) {
|
|
|
35
35
|
thumbUrl = _ref.thumbUrl,
|
|
36
36
|
hideAddBtn = _ref.hideAddBtn,
|
|
37
37
|
children = _ref.children,
|
|
38
|
+
addonBefore = _ref.addonBefore,
|
|
38
39
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
39
40
|
var matchProps = propsMaker.useProps({
|
|
40
41
|
request: request,
|
|
@@ -121,23 +122,27 @@ var Index = function Index(_ref, ref) {
|
|
|
121
122
|
var upListType = listType === null ? undefined : listType;
|
|
122
123
|
return jsxRuntime.jsxs("div", {
|
|
123
124
|
style: contentStyle,
|
|
124
|
-
children: [jsxRuntime.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
onPreview: preview,
|
|
129
|
-
onChange: change$1,
|
|
130
|
-
beforeUpload: function beforeUpload() {
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
}, props), {}, {
|
|
134
|
-
children: hideAddBtn ? null : jsxRuntime.jsx(Btn.default, {
|
|
135
|
-
value: relVal,
|
|
136
|
-
maxCount: maxCount,
|
|
125
|
+
children: [jsxRuntime.jsxs(antd.Space, {
|
|
126
|
+
size: 8,
|
|
127
|
+
align: "start",
|
|
128
|
+
children: [addonBefore, jsxRuntime.jsx(antd.Upload, _objectSpread(_objectSpread({
|
|
137
129
|
listType: upListType,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
130
|
+
maxCount: maxNum,
|
|
131
|
+
fileList: relVal,
|
|
132
|
+
onPreview: preview,
|
|
133
|
+
onChange: change$1,
|
|
134
|
+
beforeUpload: function beforeUpload() {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
}, props), {}, {
|
|
138
|
+
children: hideAddBtn ? null : jsxRuntime.jsx(Btn.default, {
|
|
139
|
+
value: relVal,
|
|
140
|
+
maxCount: maxCount,
|
|
141
|
+
listType: upListType,
|
|
142
|
+
children: children
|
|
143
|
+
})
|
|
144
|
+
}))]
|
|
145
|
+
}), jsxRuntime.jsx(index.default, {
|
|
141
146
|
visible: visible,
|
|
142
147
|
file: previewFile,
|
|
143
148
|
onCancel: function onCancel() {
|
package/lib/Upload/modal.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export interface IUpLoadProps extends Omit<UploadProps, "onChange" | "listType"
|
|
|
22
22
|
hideAddBtn?: boolean;
|
|
23
23
|
listType?: UploadListType | null;
|
|
24
24
|
onPreview?: UploadProps["onPreview"] | null;
|
|
25
|
+
addonBefore?: React.ReactNode;
|
|
25
26
|
}
|
|
26
27
|
export interface IMediaTypeEleProps {
|
|
27
28
|
file?: UploadFile;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ import { useProps } from "./hooks/propsMaker";
|
|
|
4
4
|
import type { IPreviewProps } from "./Preview";
|
|
5
5
|
import Preview from "./Preview";
|
|
6
6
|
import { useChange } from "./hooks/change";
|
|
7
|
-
import { Upload
|
|
7
|
+
import {Space, Upload} from "antd";
|
|
8
8
|
import Btn from "./Btn";
|
|
9
9
|
import HFormConnect from "../Form/HFormConnect";
|
|
10
10
|
|
|
@@ -23,6 +23,7 @@ const Index: React.ForwardRefRenderFunction<IUploadRefModal, IUpLoadProps> = (
|
|
|
23
23
|
thumbUrl,
|
|
24
24
|
hideAddBtn,
|
|
25
25
|
children,
|
|
26
|
+
addonBefore,
|
|
26
27
|
...props
|
|
27
28
|
},
|
|
28
29
|
ref
|
|
@@ -104,23 +105,26 @@ const Index: React.ForwardRefRenderFunction<IUploadRefModal, IUpLoadProps> = (
|
|
|
104
105
|
const upListType = listType === null ? undefined : listType;
|
|
105
106
|
return (
|
|
106
107
|
<div style={contentStyle}>
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
108
|
+
<Space size={8} align={"start"}>
|
|
109
|
+
{addonBefore}
|
|
110
|
+
<Upload
|
|
111
|
+
listType={upListType}
|
|
112
|
+
maxCount={maxNum}
|
|
113
|
+
fileList={relVal}
|
|
114
|
+
onPreview={preview}
|
|
115
|
+
onChange={change}
|
|
116
|
+
beforeUpload={() => {
|
|
117
|
+
return false;
|
|
118
|
+
}}
|
|
119
|
+
{...props}
|
|
120
|
+
>
|
|
121
|
+
{hideAddBtn ? null : (
|
|
122
|
+
<Btn value={relVal} maxCount={maxCount} listType={upListType}>
|
|
123
|
+
{children}
|
|
124
|
+
</Btn>
|
|
125
|
+
)}
|
|
126
|
+
</Upload>
|
|
127
|
+
</Space>
|
|
124
128
|
<Preview
|
|
125
129
|
visible={visible}
|
|
126
130
|
file={previewFile}
|
|
@@ -11,6 +11,7 @@ export default () => {
|
|
|
11
11
|
<Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
|
|
12
12
|
<HUpload
|
|
13
13
|
value={files}
|
|
14
|
+
addonBefore={<div>32132123</div>}
|
|
14
15
|
exFiles={["MP4"]}
|
|
15
16
|
thumbUrl={
|
|
16
17
|
"https://inews.gtimg.com/om_bt/OGlQWfsaAoKkuCcMZ2o9IVEPqd-72DQy5EAN02XBHUwfYAA/641"
|
|
@@ -40,6 +41,7 @@ export default () => {
|
|
|
40
41
|
</HUpload>
|
|
41
42
|
<HUrlUpload
|
|
42
43
|
inputHelper="测试"
|
|
44
|
+
addonBefore={<div>32132123</div>}
|
|
43
45
|
mediaType={MediaTypeEnum.img}
|
|
44
46
|
value={["https://img1.baidu.com/it/u=2172818577,3783888802&fm=253&app=138&f=JPEG?w=800&h=1422"]}
|
|
45
47
|
onChange={setFiles}
|