@hw-component/form 1.9.46 → 1.9.48
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/DialogForm/DrawerForm/Footer.js +5 -4
- package/es/DialogForm/DrawerForm/index.js +8 -16
- package/es/DialogForm/hooks.d.ts +5 -4
- package/es/DialogForm/hooks.js +13 -3
- package/es/DialogForm/modal.d.ts +1 -1
- package/es/Form/config.d.ts +1 -1
- package/es/Form/modal.d.ts +3 -2
- package/es/Input/ButtonInput.js +5 -5
- package/es/Input/SelectInput.js +1 -0
- package/es/PageHandler/ErrorComponent.js +3 -2
- package/es/Select/TreeSelect.d.ts +2 -2
- package/es/Select/components/NotFoundContent.js +3 -2
- package/es/Submit/components.js +3 -3
- package/es/Switch/index.d.ts +1 -1
- package/es/Text/index.d.ts +8 -2
- package/es/Text/index.js +23 -6
- package/es/index.css +8 -8
- package/es/index.d.ts +1 -1
- package/lib/DialogForm/DrawerForm/Footer.js +4 -3
- package/lib/DialogForm/DrawerForm/index.js +7 -15
- package/lib/DialogForm/hooks.d.ts +5 -4
- package/lib/DialogForm/hooks.js +13 -3
- package/lib/DialogForm/modal.d.ts +1 -1
- package/lib/Form/config.d.ts +1 -1
- package/lib/Form/modal.d.ts +3 -2
- package/lib/Input/ButtonInput.js +4 -4
- package/lib/Input/SelectInput.js +1 -0
- package/lib/PageHandler/ErrorComponent.js +2 -1
- package/lib/Select/TreeSelect.d.ts +2 -2
- package/lib/Select/components/NotFoundContent.js +2 -1
- package/lib/Submit/components.js +3 -3
- package/lib/Switch/index.d.ts +1 -1
- package/lib/Text/index.d.ts +8 -2
- package/lib/Text/index.js +21 -4
- package/lib/index.css +8 -8
- package/lib/index.d.ts +1 -1
- package/package.json +5 -3
- package/src/components/CheckboxGroup/index.tsx +3 -3
- package/src/components/DialogForm/DrawerForm/Footer.tsx +7 -5
- package/src/components/DialogForm/DrawerForm/index.tsx +10 -21
- package/src/components/DialogForm/ModalForm.tsx +2 -2
- package/src/components/DialogForm/{hooks.ts → hooks.tsx} +17 -4
- package/src/components/DialogForm/modal.ts +1 -1
- package/src/components/Form/Basic.tsx +2 -2
- package/src/components/Form/HFormConnect.tsx +3 -3
- package/src/components/Form/config.ts +1 -1
- package/src/components/Form/hooks/index.ts +9 -9
- package/src/components/Form/hooks/useInitConfigData.tsx +3 -3
- package/src/components/Form/index.tsx +0 -1
- package/src/components/Form/modal.ts +8 -8
- package/src/components/Input/ButtonInput.tsx +27 -25
- package/src/components/Input/InputNumberGroup.tsx +4 -4
- package/src/components/Input/SelectInput.tsx +3 -2
- package/src/components/Input/TrimInput.tsx +3 -3
- package/src/components/Input/index.less +1 -1
- package/src/components/Input/modal.ts +1 -1
- package/src/components/PageHandler/ErrorComponent.tsx +4 -3
- package/src/components/PageHandler/index.tsx +0 -1
- package/src/components/PageHandler/modal.ts +1 -1
- package/src/components/Select/TreeSelect.tsx +51 -35
- package/src/components/Select/components/NotFoundContent.tsx +4 -3
- package/src/components/Select/index.less +18 -18
- package/src/components/Select/index.tsx +84 -75
- package/src/components/Select/modal.ts +2 -2
- package/src/components/Submit/components.tsx +5 -5
- package/src/components/Switch/index.tsx +16 -13
- package/src/components/TDPicker/RangePicker.tsx +2 -2
- package/src/components/Text/index.tsx +19 -6
- package/src/components/TextArea/TrimTextArea.tsx +3 -3
- package/src/components/Upload/MediaTypeEle/TypeEle.tsx +7 -1
- package/src/components/Upload/UrlUpload/index.tsx +1 -1
- package/src/components/Upload/index.tsx +4 -4
- package/src/components/index.tsx +1 -1
- package/src/components/styles/index.less +2 -2
- package/src/index.less +1 -0
- package/src/index.tsx +1 -0
- package/src/pages/DrawerForm/index.tsx +0 -3
- package/src/pages/Form/index.tsx +152 -77
- package/src/pages/Input/index.tsx +1 -1
- package/src/pages/ModalForm/index.tsx +3 -4
- package/src/pages/Switch/index.tsx +11 -11
- package/src/pages/Upload/index.tsx +6 -2
package/src/index.tsx
CHANGED
package/src/pages/Form/index.tsx
CHANGED
|
@@ -80,52 +80,73 @@ const formData = (options) => {
|
|
|
80
80
|
itemProps: {
|
|
81
81
|
addonBefore: "前面",
|
|
82
82
|
addonAfter: "后面",
|
|
83
|
-
|
|
83
|
+
disabled: true,
|
|
84
84
|
},
|
|
85
85
|
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
itemProps: {
|
|
98
|
-
addonBefore: "前面",
|
|
99
|
-
addonAfter: "后面",
|
|
86
|
+
{
|
|
87
|
+
name: "inputNumberGroup",
|
|
88
|
+
label: "inputNumber",
|
|
89
|
+
type: "inputNumberGroup",
|
|
90
|
+
rules: [
|
|
91
|
+
{
|
|
92
|
+
validator: () => {
|
|
93
|
+
return Promise.reject(new Error("错误"));
|
|
100
94
|
},
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
itemProps: {
|
|
98
|
+
addonBefore: "前面",
|
|
99
|
+
addonAfter: "后面",
|
|
101
100
|
},
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
label: "时间",
|
|
104
|
+
name: "time",
|
|
105
|
+
type: "datePicker",
|
|
106
|
+
itemProps: {
|
|
107
|
+
picker: "month",
|
|
108
|
+
placeholder: "请选择月份",
|
|
110
109
|
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
label: "inputSelect",
|
|
113
|
+
type: "selectInput",
|
|
114
|
+
name: "selectInput",
|
|
115
|
+
itemProps: {
|
|
116
|
+
selectProps: {
|
|
117
|
+
options: [
|
|
118
|
+
{
|
|
119
|
+
value: "第一",
|
|
120
|
+
key: 1,
|
|
121
|
+
},
|
|
121
122
|
],
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
label: "下拉",
|
|
128
|
+
name: "select",
|
|
129
|
+
type: "select",
|
|
130
|
+
rules: [
|
|
131
|
+
{
|
|
132
|
+
validator: () => {
|
|
133
|
+
return Promise.reject(new Error("错误"));
|
|
127
134
|
},
|
|
128
|
-
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
itemProps: {
|
|
138
|
+
addonBefore: "前面",
|
|
139
|
+
addonAfter: (
|
|
140
|
+
<div
|
|
141
|
+
onClick={() => {
|
|
142
|
+
console.log("fff");
|
|
143
|
+
}}
|
|
144
|
+
>
|
|
145
|
+
后面
|
|
146
|
+
</div>
|
|
147
|
+
),
|
|
148
|
+
},
|
|
149
|
+
},
|
|
129
150
|
];
|
|
130
151
|
};
|
|
131
152
|
function Ttta({ form }) {
|
|
@@ -145,7 +166,7 @@ const Test = (props) => {
|
|
|
145
166
|
};
|
|
146
167
|
export default () => {
|
|
147
168
|
const form = useHForm();
|
|
148
|
-
const [id,setId]=useState(1);
|
|
169
|
+
const [id, setId] = useState(1);
|
|
149
170
|
const [options, setOptions] = useState([{ label: "1", value: 1 }]);
|
|
150
171
|
const [aForm] = Form.useForm();
|
|
151
172
|
return (
|
|
@@ -166,46 +187,100 @@ export default () => {
|
|
|
166
187
|
value: "key",
|
|
167
188
|
}}
|
|
168
189
|
>
|
|
169
|
-
<div
|
|
170
|
-
|
|
171
|
-
|
|
190
|
+
<div
|
|
191
|
+
onClick={() => {
|
|
192
|
+
setId(2);
|
|
193
|
+
}}
|
|
194
|
+
>
|
|
172
195
|
点我
|
|
173
196
|
</div>
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
197
|
+
<div style={{ width: 1000 }}>
|
|
198
|
+
<HForm
|
|
199
|
+
configData={[{
|
|
200
|
+
label: '运营商账号',
|
|
201
|
+
name: 'mobile',
|
|
202
|
+
type: 'buttonInput',
|
|
203
|
+
itemProps: {
|
|
204
|
+
children: '修改手机号',
|
|
205
|
+
disabled: true,
|
|
206
|
+
buttonProps: {
|
|
207
|
+
type: 'primary',
|
|
208
|
+
ghost: true,
|
|
209
|
+
style: {
|
|
210
|
+
marginLeft: 8,
|
|
211
|
+
},
|
|
212
|
+
onClick:()=>{
|
|
188
213
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
}, {
|
|
218
|
+
label: '验证码',
|
|
219
|
+
name: 'newCode',
|
|
220
|
+
type: 'verificationCodeInput',
|
|
221
|
+
itemProps: {
|
|
222
|
+
request: async ({ newMobile }) => {
|
|
223
|
+
return Promise.resolve();
|
|
224
|
+
},
|
|
225
|
+
buttonProps: {
|
|
226
|
+
ghost: true,
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
},{
|
|
230
|
+
label:"你好",
|
|
231
|
+
noStyle:true,
|
|
232
|
+
render:()=>{
|
|
233
|
+
return <div style={{width:"100%",backgroundColor:'red',height:"100%"}}>
|
|
234
|
+
<div style={{height:200}}></div>
|
|
235
|
+
</div>
|
|
236
|
+
}
|
|
237
|
+
},{
|
|
238
|
+
label:"你好",
|
|
239
|
+
noStyle:true,
|
|
240
|
+
render:()=>{
|
|
241
|
+
return <div style={{width:"100%",backgroundColor:'black',height:"100%"}}></div>
|
|
242
|
+
}
|
|
243
|
+
},{
|
|
244
|
+
label:"文字",
|
|
245
|
+
type:"text",
|
|
246
|
+
name:"text",
|
|
247
|
+
itemProps:{
|
|
248
|
+
addonBefore:<div style={{height:100,backgroundColor:"red"}}>nihao</div>,
|
|
249
|
+
addonAfter:<div style={{height:200,backgroundColor:"red"}}>wohao</div>,
|
|
250
|
+
}
|
|
251
|
+
}]}
|
|
252
|
+
dismissOnPressEnter={false}
|
|
253
|
+
labelWidth={88}
|
|
254
|
+
form={form}
|
|
255
|
+
infoRequest={{
|
|
256
|
+
request: async () => {
|
|
257
|
+
if (id === 1) {
|
|
258
|
+
return {
|
|
259
|
+
name: "你好",
|
|
260
|
+
select: 1,
|
|
261
|
+
text:"hdj"
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
return {};
|
|
265
|
+
},
|
|
266
|
+
refreshDeps: [id],
|
|
267
|
+
}}
|
|
268
|
+
labelAlign={"left"}
|
|
269
|
+
onFinish={(value) => {
|
|
270
|
+
console.log(value, "onFinish");
|
|
271
|
+
}}
|
|
272
|
+
onValuesChange={(val) => {
|
|
273
|
+
console.log(val, "onValuesChange");
|
|
274
|
+
}}
|
|
275
|
+
request={(params) => {
|
|
276
|
+
return new Promise<any>((resolve) => {
|
|
277
|
+
setTimeout(() => {
|
|
278
|
+
resolve(params);
|
|
279
|
+
}, 3000);
|
|
280
|
+
});
|
|
281
|
+
}}
|
|
282
|
+
/>
|
|
283
|
+
</div>
|
|
209
284
|
</HFormConfigProvider>
|
|
210
285
|
<div
|
|
211
286
|
onClick={async () => {
|
|
@@ -160,8 +160,7 @@ export default () => {
|
|
|
160
160
|
<Button
|
|
161
161
|
onClick={() => {
|
|
162
162
|
num++;
|
|
163
|
-
modalForm.show({
|
|
164
|
-
});
|
|
163
|
+
modalForm.show({});
|
|
165
164
|
}}
|
|
166
165
|
>
|
|
167
166
|
打开
|
|
@@ -192,8 +191,8 @@ export default () => {
|
|
|
192
191
|
<HModalForm
|
|
193
192
|
configData={data}
|
|
194
193
|
labelWidth={88}
|
|
195
|
-
infoRequest={()=>{
|
|
196
|
-
|
|
194
|
+
infoRequest={() => {
|
|
195
|
+
console.log("infoRequest");
|
|
197
196
|
}}
|
|
198
197
|
labelAlign={"left"}
|
|
199
198
|
request={(values, params) => {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Space } from "antd";
|
|
2
2
|
import { HSwitch } from "../../components";
|
|
3
|
-
import {useState} from "react";
|
|
4
|
-
const req=()=>{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
const req = () => {
|
|
5
|
+
return new Promise((resolve, reject) => {
|
|
6
|
+
setTimeout(() => {
|
|
7
|
+
resolve({});
|
|
8
|
+
}, 2000);
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
11
|
export default () => {
|
|
12
|
-
const [val,setVal]=useState();
|
|
12
|
+
const [val, setVal] = useState();
|
|
13
13
|
return (
|
|
14
14
|
<Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
|
|
15
15
|
<HSwitch
|
|
@@ -17,8 +17,8 @@ export default () => {
|
|
|
17
17
|
beforeText="开关"
|
|
18
18
|
size="small"
|
|
19
19
|
valueMap={{ open: 1, close: 0 }}
|
|
20
|
-
onChange={(
|
|
21
|
-
console.log(
|
|
20
|
+
onChange={(v) => {
|
|
21
|
+
console.log(v);
|
|
22
22
|
}}
|
|
23
23
|
>
|
|
24
24
|
打开
|
|
@@ -21,7 +21,6 @@ export default () => {
|
|
|
21
21
|
onChange={setFiles}
|
|
22
22
|
multiple={true}
|
|
23
23
|
maxCount={3}
|
|
24
|
-
|
|
25
24
|
maxSize={Number.MAX_SAFE_INTEGER}
|
|
26
25
|
/>
|
|
27
26
|
<HUpload
|
|
@@ -33,7 +32,12 @@ export default () => {
|
|
|
33
32
|
}}
|
|
34
33
|
onChange={setFiles1}
|
|
35
34
|
/>
|
|
36
|
-
<HUrlUpload
|
|
35
|
+
<HUrlUpload
|
|
36
|
+
inputHelper="测试"
|
|
37
|
+
mediaType={MediaTypeEnum.video}
|
|
38
|
+
value={files}
|
|
39
|
+
onChange={setFiles}
|
|
40
|
+
/>
|
|
37
41
|
</Space>
|
|
38
42
|
);
|
|
39
43
|
};
|