@hw-component/form 1.9.59 → 1.9.61
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/Form/config.d.ts +1 -1
- package/es/Input/InputNumberGroup.js +72 -104
- package/es/InputGroup/index.d.ts +9 -0
- package/es/InputGroup/index.js +65 -0
- package/es/TextArea/index.d.ts +4 -1
- package/es/TextArea/index.js +12 -3
- package/es/hooks/index.js +1 -1
- package/es/index.css +30 -26
- package/es/index.d.ts +2 -1
- package/es/index.js +1 -0
- package/lib/Form/config.d.ts +1 -1
- package/lib/Input/InputNumberGroup.js +76 -108
- package/lib/InputGroup/index.d.ts +9 -0
- package/lib/InputGroup/index.js +68 -0
- package/lib/TextArea/index.d.ts +4 -1
- package/lib/TextArea/index.js +12 -3
- package/lib/index.css +30 -26
- package/lib/index.d.ts +2 -1
- package/lib/index.js +6 -4
- package/package.json +1 -1
- package/src/components/Input/InputNumberGroup.tsx +58 -76
- package/src/components/Input/index.less +5 -18
- package/src/components/InputGroup/index.less +26 -0
- package/src/components/InputGroup/index.tsx +42 -0
- package/src/components/TextArea/index.less +8 -0
- package/src/components/TextArea/index.tsx +11 -2
- package/src/components/index.tsx +1 -0
- package/src/components/styles/index.less +2 -14
- package/src/pages/Form/index.tsx +6 -123
- package/src/pages/Input/index.tsx +2 -0
- package/src/pages/InputNumberGroup/index.tsx +3 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { InputNumber
|
|
1
|
+
import { InputNumber } from "antd";
|
|
2
2
|
import { SwapRightOutlined } from "@ant-design/icons";
|
|
3
3
|
import React, { useMemo, useState } from "react";
|
|
4
4
|
import type { InputNumberProps } from "antd/lib/input-number";
|
|
5
5
|
import { useClassName } from "../hooks";
|
|
6
6
|
import type { addFormatItemModal, HItemProps } from "@/components/Form/modal";
|
|
7
7
|
import HFormConnect from "../Form/HFormConnect";
|
|
8
|
-
|
|
8
|
+
import InputGroup from '../InputGroup'
|
|
9
9
|
interface IProps<T = any> {
|
|
10
10
|
placeholder?: [string, string] | string;
|
|
11
11
|
addonAfter?: React.ReactNode;
|
|
@@ -15,7 +15,7 @@ interface IProps<T = any> {
|
|
|
15
15
|
};
|
|
16
16
|
inputNumberProps?: [InputNumberProps, InputNumberProps] | InputNumberProps;
|
|
17
17
|
value?: T;
|
|
18
|
-
onChange
|
|
18
|
+
onChange?: (value: T) => void;
|
|
19
19
|
addFormat?: (config: Record<string, addFormatItemModal>) => void;
|
|
20
20
|
noHandlerWrap?: boolean;
|
|
21
21
|
disabled?: boolean;
|
|
@@ -31,21 +31,9 @@ const useArrayProps = (props: any) => {
|
|
|
31
31
|
return [props, props];
|
|
32
32
|
}, [props]);
|
|
33
33
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return <></>;
|
|
38
|
-
}
|
|
39
|
-
if (React.isValidElement(children)) {
|
|
40
|
-
return (
|
|
41
|
-
<div className={addonClassname}>
|
|
42
|
-
{React.cloneElement(children as any, { value, onChange })}
|
|
43
|
-
</div>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
return <div className={addonClassname}>{children}</div>;
|
|
47
|
-
};
|
|
48
|
-
const InputNumberGroup = ({
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
const Content = ({
|
|
49
37
|
value = {},
|
|
50
38
|
valueMap = { min: "min", max: "max" },
|
|
51
39
|
onChange,
|
|
@@ -64,10 +52,8 @@ const InputNumberGroup = ({
|
|
|
64
52
|
const [fsPlaceholder, edPlaceholder] = useArrayProps(placeholder);
|
|
65
53
|
const [fsProps, edProps] = useArrayProps(inputNumberProps);
|
|
66
54
|
const [focus, setFocus] = useState(false);
|
|
67
|
-
const
|
|
68
|
-
const bodyClassname = useClassName(["hw-input-group-body"]);
|
|
55
|
+
const bodyClassname = useClassName(["hw-input-group-number-body"]);
|
|
69
56
|
const activeClassname = useClassName(["hw-input-group-active"]);
|
|
70
|
-
const borderClassname = useClassName(["hw-input-group-border"]);
|
|
71
57
|
const oneClassname = useClassName(["hw-input-group-one"]);
|
|
72
58
|
const iconClassname = useClassName(["hw-input-group-icon"]);
|
|
73
59
|
const disabledClassname = useClassName(["hw-input-group-disabled"]);
|
|
@@ -113,66 +99,62 @@ const InputNumberGroup = ({
|
|
|
113
99
|
newVal[key] = val;
|
|
114
100
|
onChange?.(newVal);
|
|
115
101
|
};
|
|
116
|
-
return
|
|
117
|
-
|
|
118
|
-
<Addon value={value} onChange={onChange}>
|
|
119
|
-
{addonBefore}
|
|
120
|
-
</Addon>
|
|
121
|
-
<div
|
|
122
|
-
className={`${bodyClassname}
|
|
102
|
+
return <div
|
|
103
|
+
className={`${bodyClassname}
|
|
123
104
|
${focus ? activeClassname : ""}
|
|
124
105
|
${noHandlerWrap ? noHandlerWrapClassname : ""}
|
|
125
106
|
${disabled ? disabledClassname : notDisabledClassname}
|
|
126
107
|
`}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
<Addon value={value} onChange={onChange}>
|
|
171
|
-
{addonAfter}
|
|
172
|
-
</Addon>
|
|
173
|
-
</Input.Group>
|
|
174
|
-
);
|
|
108
|
+
>
|
|
109
|
+
<InputNumber<number>
|
|
110
|
+
bordered={false}
|
|
111
|
+
value={minVal}
|
|
112
|
+
max={maxValMk ? maxValMk(maxVal) : maxVal}
|
|
113
|
+
min={0}
|
|
114
|
+
className={oneClassname}
|
|
115
|
+
onFocus={() => {
|
|
116
|
+
setFocus(true);
|
|
117
|
+
}}
|
|
118
|
+
onBlur={() => {
|
|
119
|
+
setFocus(false);
|
|
120
|
+
}}
|
|
121
|
+
onChange={(val) => {
|
|
122
|
+
change(min, val);
|
|
123
|
+
}}
|
|
124
|
+
placeholder={fsPlaceholder}
|
|
125
|
+
{...fsProps}
|
|
126
|
+
disabled={disabled}
|
|
127
|
+
/>
|
|
128
|
+
<div className={iconClassname}>
|
|
129
|
+
<SwapRightOutlined />
|
|
130
|
+
</div>
|
|
131
|
+
<InputNumber<number>
|
|
132
|
+
bordered={false}
|
|
133
|
+
value={maxVal}
|
|
134
|
+
className={oneClassname}
|
|
135
|
+
placeholder={edPlaceholder}
|
|
136
|
+
min={minValMk ? minValMk(minVal) : minVal}
|
|
137
|
+
onFocus={() => {
|
|
138
|
+
setFocus(true);
|
|
139
|
+
}}
|
|
140
|
+
onBlur={() => {
|
|
141
|
+
setFocus(false);
|
|
142
|
+
}}
|
|
143
|
+
onChange={(val) => {
|
|
144
|
+
change(max, val);
|
|
145
|
+
}}
|
|
146
|
+
{...edProps}
|
|
147
|
+
disabled={disabled}
|
|
148
|
+
/>
|
|
149
|
+
</div>
|
|
150
|
+
|
|
175
151
|
};
|
|
152
|
+
const InputNumberGroup=(props)=>{
|
|
153
|
+
return <InputGroup {...props}>
|
|
154
|
+
<Content/>
|
|
155
|
+
</InputGroup>
|
|
156
|
+
}
|
|
157
|
+
|
|
176
158
|
const Index = HFormConnect(InputNumberGroup);
|
|
177
159
|
export default {
|
|
178
160
|
Component: Index,
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
@import "../
|
|
2
|
-
@all-input-group: ~"@{ant-prefix}-hw-input-group";
|
|
1
|
+
@import "../InputGroup/index";
|
|
3
2
|
|
|
4
3
|
.@{all-input-group} {
|
|
5
|
-
display: flex !important;
|
|
6
|
-
width: 100%;
|
|
7
|
-
color: rgba(0, 0, 0, 0.25);
|
|
8
4
|
.@{all-input-group}-disabled {
|
|
9
5
|
background-color: #f5f5f5;
|
|
10
6
|
}
|
|
11
|
-
.@{all-input-group}-body
|
|
12
|
-
|
|
13
|
-
display: flex !important;
|
|
14
|
-
flex: 1;
|
|
7
|
+
.@{all-input-group}-number-body{
|
|
8
|
+
width: 100%;
|
|
15
9
|
border: 1px solid #d9d9d9;
|
|
10
|
+
display: flex !important;
|
|
16
11
|
}
|
|
17
12
|
.@{all-input-group}-not-disabled {
|
|
18
13
|
&:hover {
|
|
@@ -30,14 +25,6 @@
|
|
|
30
25
|
display: none;
|
|
31
26
|
}
|
|
32
27
|
}
|
|
33
|
-
.@{all-input-group}-border {
|
|
34
|
-
position: absolute;
|
|
35
|
-
left: -1px;
|
|
36
|
-
display: none;
|
|
37
|
-
width: 1px;
|
|
38
|
-
height: 100%;
|
|
39
|
-
background-color: #40a9ff;
|
|
40
|
-
}
|
|
41
28
|
.@{all-input-group}-icon {
|
|
42
29
|
display: flex;
|
|
43
30
|
align-items: center;
|
|
@@ -63,7 +50,7 @@
|
|
|
63
50
|
box-shadow: 0 0 0 0 !important;
|
|
64
51
|
}
|
|
65
52
|
.@{ant-prefix}-form-item-has-error {
|
|
66
|
-
.@{all-input-group}-body {
|
|
53
|
+
.@{all-input-group}-number-body {
|
|
67
54
|
border-color: #ff4d4f !important;
|
|
68
55
|
}
|
|
69
56
|
.@{all-input-group}-active {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@import "../styles/local.less";
|
|
2
|
+
@all-input-group: ~"@{ant-prefix}-hw-input-group";
|
|
3
|
+
|
|
4
|
+
.@{all-input-group} {
|
|
5
|
+
display: flex !important;
|
|
6
|
+
width: 100%;
|
|
7
|
+
color: rgba(0, 0, 0, 0.25);
|
|
8
|
+
.@{all-input-group}-body {
|
|
9
|
+
position: relative;
|
|
10
|
+
display: flex !important;
|
|
11
|
+
flex: 1;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.@{ant-prefix}-hw-addon {
|
|
16
|
+
display: flex !important;
|
|
17
|
+
align-items: center;
|
|
18
|
+
padding: 0 11px;
|
|
19
|
+
background-color: #fafafa;
|
|
20
|
+
border: 1px solid #d9d9d9;
|
|
21
|
+
}
|
|
22
|
+
.@{ant-prefix}-form-item-has-error {
|
|
23
|
+
.@{all-input-group}-body {
|
|
24
|
+
border-color: #ff4d4f !important;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {useClassName} from "../hooks";
|
|
3
|
+
import {Input} from "antd"
|
|
4
|
+
interface HInputGroupProps<T=any> {
|
|
5
|
+
addonAfter?: React.ReactNode;
|
|
6
|
+
value?: T;
|
|
7
|
+
onChange?: (value: T) => void;
|
|
8
|
+
addonBefore?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
const Addon: React.FC<HInputGroupProps> = ({ children, value, onChange }) => {
|
|
11
|
+
const addonClassname = useClassName(["hw-addon"]);
|
|
12
|
+
if (!children) {
|
|
13
|
+
return <></>;
|
|
14
|
+
}
|
|
15
|
+
if (React.isValidElement(children)) {
|
|
16
|
+
return (
|
|
17
|
+
<div className={addonClassname}>
|
|
18
|
+
{React.cloneElement(children as any, { value, onChange })}
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
return <div className={addonClassname}>{children}</div>;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const Index:React.FC<HInputGroupProps>=({addonAfter,addonBefore,children,value,onChange,...props})=>{
|
|
26
|
+
const contentClassname = useClassName(["hw-input-group"]);
|
|
27
|
+
const bodyClassname = useClassName(["hw-input-group-body"]);
|
|
28
|
+
|
|
29
|
+
return <Input.Group compact className={contentClassname}>
|
|
30
|
+
<Addon value={value} onChange={onChange}>
|
|
31
|
+
{addonBefore}
|
|
32
|
+
</Addon>
|
|
33
|
+
<div className={bodyClassname}>
|
|
34
|
+
{React.cloneElement((children as any),{value,onChange,...props})}
|
|
35
|
+
</div>
|
|
36
|
+
<Addon value={value} onChange={onChange}>
|
|
37
|
+
{addonAfter}
|
|
38
|
+
</Addon>
|
|
39
|
+
</Input.Group>
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default Index;
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { Input } from "antd";
|
|
2
2
|
import type { TextAreaProps } from "antd/es/input";
|
|
3
|
+
import {useClassName} from "../hooks";
|
|
4
|
+
export interface HTextAreaProps extends TextAreaProps{
|
|
5
|
+
bordered?:boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
3
8
|
export default ({
|
|
4
9
|
autoSize = { minRows: 4, maxRows: 4 },
|
|
10
|
+
bordered=true,
|
|
11
|
+
className="",
|
|
5
12
|
...props
|
|
6
|
-
}:
|
|
7
|
-
|
|
13
|
+
}: HTextAreaProps) => {
|
|
14
|
+
const noBorderClassName=useClassName("hw-text-area-no-border") ;
|
|
15
|
+
const borderClassName=!bordered?noBorderClassName:"";
|
|
16
|
+
return <Input.TextArea autoSize={autoSize} {...props} className={`${borderClassName} ${className}`}/>;
|
|
8
17
|
};
|
package/src/components/index.tsx
CHANGED
|
@@ -7,6 +7,7 @@ export { useHDialogForm } from "@/components/DialogForm/hooks";
|
|
|
7
7
|
export { default as HFormConnect } from "./Form/HFormConnect";
|
|
8
8
|
export { default as HFormConfigProvider } from "./Form/Context/FormConfigProvider";
|
|
9
9
|
export { default as HBasicForm } from "./Form/Basic";
|
|
10
|
+
export { default as HInputGroup } from "./InputGroup";
|
|
10
11
|
|
|
11
12
|
import ModalForm from "./DialogForm/ModalForm";
|
|
12
13
|
import DrawerForm from "./DialogForm/DrawerForm";
|
|
@@ -2,17 +2,5 @@
|
|
|
2
2
|
@import "../Form/index.less";
|
|
3
3
|
@import "../Input/index.less";
|
|
4
4
|
@import "../Switch/index.less";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
display: flex !important;
|
|
8
|
-
align-items: center;
|
|
9
|
-
padding: 0 11px;
|
|
10
|
-
background-color: #fafafa;
|
|
11
|
-
border: 1px solid #d9d9d9;
|
|
12
|
-
}
|
|
13
|
-
.@{ant-prefix}-form-item-has-error {
|
|
14
|
-
.@{ant-prefix}-hw-addon {
|
|
15
|
-
color: #ff4d4f;
|
|
16
|
-
border-color: #ff4d4f !important;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
5
|
+
@import "../TextArea/index.less";
|
|
6
|
+
@import "../InputGroup/index.less";
|
package/src/pages/Form/index.tsx
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
HBasicForm,
|
|
3
2
|
HForm,
|
|
4
3
|
HFormConfigProvider,
|
|
5
|
-
HSwitch,
|
|
6
4
|
useHForm,
|
|
7
5
|
HSelect,
|
|
8
6
|
} from "../../components";
|
|
9
7
|
import { useState } from "react";
|
|
10
|
-
import { Button,
|
|
11
|
-
import Basic from "@/components/Form/Basic";
|
|
12
|
-
const Test2 = () => {
|
|
13
|
-
return <Row style={{ background: "red" }} />;
|
|
14
|
-
};
|
|
8
|
+
import { Button, Form, Input, Space } from "antd";
|
|
15
9
|
const Test3 = ({ value = {}, onChange }) => {
|
|
16
10
|
const { fs, end } = value;
|
|
17
11
|
return (
|
|
@@ -45,122 +39,6 @@ const TestItem = () => {
|
|
|
45
39
|
</Form.Item>
|
|
46
40
|
);
|
|
47
41
|
};
|
|
48
|
-
const Test3Item = () => {
|
|
49
|
-
return (
|
|
50
|
-
<Form.List name="users">
|
|
51
|
-
{(fields, { add, remove }) => (
|
|
52
|
-
<>
|
|
53
|
-
{fields.map(({ key, name, ...restField }) => (
|
|
54
|
-
<Form.Item {...restField} name={name} key={key}>
|
|
55
|
-
<Test3 />
|
|
56
|
-
</Form.Item>
|
|
57
|
-
))}
|
|
58
|
-
<Form.Item>
|
|
59
|
-
<Button type="dashed" onClick={() => add({})} block>
|
|
60
|
-
Add field
|
|
61
|
-
</Button>
|
|
62
|
-
</Form.Item>
|
|
63
|
-
</>
|
|
64
|
-
)}
|
|
65
|
-
</Form.List>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
const formData = (options) => {
|
|
69
|
-
return [
|
|
70
|
-
{
|
|
71
|
-
name: "name",
|
|
72
|
-
label: "name",
|
|
73
|
-
rules: [
|
|
74
|
-
{
|
|
75
|
-
validator: () => {
|
|
76
|
-
return Promise.reject(new Error("错误"));
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
itemProps: {
|
|
81
|
-
addonBefore: "前面",
|
|
82
|
-
addonAfter: "后面",
|
|
83
|
-
disabled: true,
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
name: "inputNumberGroup",
|
|
88
|
-
label: "inputNumber",
|
|
89
|
-
type: "inputNumberGroup",
|
|
90
|
-
rules: [
|
|
91
|
-
{
|
|
92
|
-
validator: () => {
|
|
93
|
-
return Promise.reject(new Error("错误"));
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
itemProps: {
|
|
98
|
-
addonBefore: "前面",
|
|
99
|
-
addonAfter: "后面",
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
label: "时间",
|
|
104
|
-
name: "time",
|
|
105
|
-
type: "datePicker",
|
|
106
|
-
itemProps: {
|
|
107
|
-
picker: "month",
|
|
108
|
-
placeholder: "请选择月份",
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
label: "inputSelect",
|
|
113
|
-
type: "selectInput",
|
|
114
|
-
name: "selectInput",
|
|
115
|
-
itemProps: {
|
|
116
|
-
selectProps: {
|
|
117
|
-
options: [
|
|
118
|
-
{
|
|
119
|
-
value: "第一",
|
|
120
|
-
key: 1,
|
|
121
|
-
},
|
|
122
|
-
],
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
label: "下拉",
|
|
128
|
-
name: "select",
|
|
129
|
-
type: "select",
|
|
130
|
-
rules: [
|
|
131
|
-
{
|
|
132
|
-
validator: () => {
|
|
133
|
-
return Promise.reject(new Error("错误"));
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
],
|
|
137
|
-
itemProps: {
|
|
138
|
-
addonBefore: "前面",
|
|
139
|
-
addonAfter: (
|
|
140
|
-
<div
|
|
141
|
-
onClick={() => {
|
|
142
|
-
console.log("fff");
|
|
143
|
-
}}
|
|
144
|
-
>
|
|
145
|
-
后面
|
|
146
|
-
</div>
|
|
147
|
-
),
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
];
|
|
151
|
-
};
|
|
152
|
-
function Ttta({ form }) {
|
|
153
|
-
return (
|
|
154
|
-
<div
|
|
155
|
-
onClick={() => {
|
|
156
|
-
form.setFieldsValue({ switch: 1 });
|
|
157
|
-
}}
|
|
158
|
-
>
|
|
159
|
-
ttta
|
|
160
|
-
</div>
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
42
|
const Test = (props) => {
|
|
165
43
|
return <div>ffff</div>;
|
|
166
44
|
};
|
|
@@ -258,6 +136,11 @@ export default () => {
|
|
|
258
136
|
></div>
|
|
259
137
|
);
|
|
260
138
|
},
|
|
139
|
+
},{
|
|
140
|
+
label:"数字输入框",
|
|
141
|
+
name:"yyy",
|
|
142
|
+
type:"inputNumberGroup",
|
|
143
|
+
rules:[{required:true}]
|
|
261
144
|
},
|
|
262
145
|
{
|
|
263
146
|
label: "文字",
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
HColorInput,
|
|
7
7
|
HVerificationCodeInput,
|
|
8
8
|
HInputNumberGroup,
|
|
9
|
+
HTextArea,
|
|
9
10
|
} from "../../components";
|
|
10
11
|
import { Space } from "antd";
|
|
11
12
|
import { useState } from "react";
|
|
@@ -36,6 +37,7 @@ export default () => {
|
|
|
36
37
|
},
|
|
37
38
|
]}
|
|
38
39
|
/>
|
|
40
|
+
<HTextArea />
|
|
39
41
|
</Space>
|
|
40
42
|
);
|
|
41
43
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HInputNumberGroup } from "@/components";
|
|
2
2
|
import { Col, Row } from "antd";
|
|
3
|
+
import {useState} from "react";
|
|
3
4
|
const Test = ({ value, onChange }) => {
|
|
4
5
|
console.log(value);
|
|
5
6
|
return (
|
|
@@ -13,10 +14,11 @@ const Test = ({ value, onChange }) => {
|
|
|
13
14
|
);
|
|
14
15
|
};
|
|
15
16
|
export default () => {
|
|
17
|
+
const [val,setVal]=useState({});
|
|
16
18
|
return (
|
|
17
19
|
<Row style={{ marginTop: 20, marginLeft: 20 }}>
|
|
18
20
|
<Col span={10}>
|
|
19
|
-
<HInputNumberGroup addonBefore={<Test />} />
|
|
21
|
+
<HInputNumberGroup addonBefore={<Test />} value={val} onChange={setVal}/>
|
|
20
22
|
</Col>
|
|
21
23
|
</Row>
|
|
22
24
|
);
|