@hw-component/form 1.10.97 → 1.11.1
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/.eslintcache +1 -1
- package/es/Form/config.d.ts +3 -2
- package/es/Form/config.js +3 -1
- package/es/Form/hooks/useHForm.js +12 -1
- package/es/Input/SelectInput.js +0 -1
- package/es/Upload/ImgCropUpload.d.ts +3 -0
- package/es/Upload/ImgCropUpload.js +71 -0
- package/es/Upload/MediaTypeEle/index.js +2 -1
- package/es/Upload/hooks/change.js +0 -1
- package/es/Upload/util.js +0 -2
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/lib/Form/config.d.ts +3 -2
- package/lib/Form/config.js +3 -1
- package/lib/Form/hooks/useHForm.js +12 -1
- package/lib/Input/SelectInput.js +0 -1
- package/lib/Upload/ImgCropUpload.d.ts +3 -0
- package/lib/Upload/ImgCropUpload.js +74 -0
- package/lib/Upload/MediaTypeEle/index.js +2 -1
- package/lib/Upload/hooks/change.js +0 -1
- package/lib/Upload/util.js +0 -2
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -0
- package/package.json +3 -2
- package/src/components/Form/config.ts +3 -0
- package/src/components/Form/hooks/useHForm.ts +12 -1
- package/src/components/Input/SelectInput.tsx +0 -1
- package/src/components/Select/index.tsx +4 -4
- package/src/components/Upload/ImgCropUpload.tsx +50 -0
- package/src/components/Upload/MediaTypeEle/index.tsx +1 -1
- package/src/components/Upload/hooks/change.ts +0 -1
- package/src/components/Upload/hooks/customRequest.ts +0 -1
- package/src/components/Upload/util.ts +0 -2
- package/src/components/index.tsx +2 -0
- package/src/pages/Form/index.tsx +26 -13
package/src/pages/Form/index.tsx
CHANGED
|
@@ -6,9 +6,11 @@ import {
|
|
|
6
6
|
HBasicForm,
|
|
7
7
|
HRangePicker,
|
|
8
8
|
HSelectInput,
|
|
9
|
+
HUpload
|
|
9
10
|
} from "../../components";
|
|
10
11
|
import { useEffect, useState } from "react";
|
|
11
12
|
import { Button, Col, Form, Input, Row, Space } from "antd";
|
|
13
|
+
import ImgCrop from 'antd-img-crop';
|
|
12
14
|
|
|
13
15
|
const Test3 = ({ value = {}, onChange }) => {
|
|
14
16
|
const { fs, end } = value;
|
|
@@ -143,6 +145,25 @@ const TestItem1 = ({ value, onChange }) => {
|
|
|
143
145
|
);
|
|
144
146
|
};
|
|
145
147
|
|
|
148
|
+
const HeaderImg=({ value=[], onChange }) => {
|
|
149
|
+
console.log(value);
|
|
150
|
+
return (
|
|
151
|
+
<ImgCrop rotate>
|
|
152
|
+
<HUpload
|
|
153
|
+
value={value}
|
|
154
|
+
request={null}
|
|
155
|
+
onChange={(info)=>{
|
|
156
|
+
console.log(info,"info")
|
|
157
|
+
onChange(info.fileList)
|
|
158
|
+
}}
|
|
159
|
+
|
|
160
|
+
>
|
|
161
|
+
天际
|
|
162
|
+
</HUpload>
|
|
163
|
+
</ImgCrop>
|
|
164
|
+
);
|
|
165
|
+
};
|
|
166
|
+
|
|
146
167
|
export default () => {
|
|
147
168
|
const form = useHForm();
|
|
148
169
|
const [id, setId] = useState(1);
|
|
@@ -226,6 +247,9 @@ export default () => {
|
|
|
226
247
|
label: "你好啊",
|
|
227
248
|
type: "rangePicker",
|
|
228
249
|
hover: ["123123213", "22222"],
|
|
250
|
+
rules: [
|
|
251
|
+
{ required: true, message: "Please input your password!" },
|
|
252
|
+
],
|
|
229
253
|
itemProps: {
|
|
230
254
|
valueMap: {
|
|
231
255
|
start: "start",
|
|
@@ -236,25 +260,14 @@ export default () => {
|
|
|
236
260
|
{
|
|
237
261
|
name: "num1",
|
|
238
262
|
label: "必填",
|
|
239
|
-
type:"
|
|
263
|
+
type:"imgCropUpload",
|
|
240
264
|
dependencies: ["num"],
|
|
241
265
|
},
|
|
242
266
|
]}
|
|
243
267
|
dismissOnPressEnter={false}
|
|
244
268
|
form={form}
|
|
245
269
|
initialValues={{
|
|
246
|
-
|
|
247
|
-
tt: {
|
|
248
|
-
select: "test",
|
|
249
|
-
time: {
|
|
250
|
-
EndTime: null,
|
|
251
|
-
StartTime: null,
|
|
252
|
-
},
|
|
253
|
-
},
|
|
254
|
-
selectInput: {
|
|
255
|
-
select: "1",
|
|
256
|
-
input: "",
|
|
257
|
-
},
|
|
270
|
+
|
|
258
271
|
}}
|
|
259
272
|
labelAlign={"top"}
|
|
260
273
|
onValuesChange={(val) => {
|